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 #594

Closed
jstamour802 opened this issue Mar 31, 2015 · 4 comments
Closed

Comments

@jstamour802
Copy link

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();

}

@rei-vilo
Copy link
Member

Which MCU?

@rei-vilo
Copy link
Member

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

@jstamour802
Copy link
Author

@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..

@robertinant
Copy link
Member

This issue was moved to energia/tivac-core#10

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

3 participants