Hi all,
having trouble with getting the the DHCP working with the Arduino Portenta H7.
We have a custom daughter board but have same issues if I’m using the Portenta Breakout Board.
Packages I’m using are:
and
I’ve just used the code from some provided Arduino examples but even if I use the Ethernet library from Mbed OS, it returns a DHCP failed error.
https:// os.mbed .com/docs/mbed-os/v6.16/apis/ethernet.html
(sorry for formatting, apparently I can only have 2 links as a new user)
Statically assigning an IP works completely fine. I can open a UDP socket, send and receive packets just fine.
// initialize the ethernet device
Ethernet.begin(mac);
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet was not found. Sorry, can't run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.hardwareStatus() == EthernetMbed) {
Serial.println("Ethernet found. :)");
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
if (Ethernet.linkStatus() == LinkON) {
Serial.println("Ethernet cable IS connected.");
}
Hardware set-up is Arduino connected to a custom daughter board, which connects to an embedded switch. RJ45 connection into a USB-C hub (bloody work laptop doesn’t have a NIC with RJ45).
I might be missing something obvious, I haven’t written firmware for over a decade and I’ve never done any OOP so C++ is fairly new to me.
Any help would be greatly appreciated.