Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to begin with a static IP after DHCP fails locks up the program #10

Open
robertinant opened this issue Aug 29, 2016 · 3 comments

Comments

@robertinant
Copy link
Member

From @jstamour802 on March 31, 2015 15:30

using the TM4C1294 connected launchpad..

My program stops working if DHCP fails and I try to begin with a static IP. If you try to call ethernet.begin(mac,IP) after DHCP fails, the program locks up.

The "DHCP chat server example" demonstrates this - if you have no DHCP it never begins with the static IP and moves beyond the setup loop

void setup() {
// open the serial port
Serial.begin(9600);
Serial.println("\n\nDhcpChatServer setup");
// start the Ethernet connection:
Serial.println("Trying to get an IP address using DHCP");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// initialize the ethernet device not using DHCP**************never gets past this point!!!************
Ethernet.begin(mac, ip, gateway, subnet);
}
// print your local IP address:
Serial.print("My IP address: ");
ip = Ethernet.localIP();
for (byte thisByte = 0; thisByte < 4; thisByte++) {
// print the value of each byte of the IP address:
Serial.print(ip[thisByte], DEC);
Serial.print(".");
}
Serial.println();
// start listening for clients
server.begin();

}

Copied from original issue: energia/Energia#594

@robertinant
Copy link
Member Author

From @rei-vilo on March 31, 2015 15:41

Which MCU?

@robertinant
Copy link
Member Author

From @rei-vilo on March 31, 2015 15:55

Thanks. So I guess you're using the CC3100 BoosterPack.

@robertinant
Copy link
Member Author

From @jstamour802 on March 31, 2015 19:30

@rei-vilo I am using the TM4C1294XL connected launchpad and have this problem -- I'm not sure why @a-bhat1 changed the topic to something else..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant