Using the code below my program halt at the Ethernet.begin(mac) line, what could cause this?
byte mac[] = { 0xDE, 0xFF, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress ip(172, 16, 0, 100);
IPAddress myDns(192, 168, 0, 1);
Ethernet.init(10);
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
} else {
Serial.print(" DHCP assigned IP ");
Serial.println(Ethernet.localIP());
}
// If DHCP fails or if DHCP was successful but you want to use a static IP, configure using the static IP
if (Ethernet.hardwareStatus() != EthernetNoHardware) {
Ethernet.begin(mac, ip, myDns);
}