I am working on adding Ethernet capability to my project and have added routines for setting and changing the IP address, gateway address and netmask, but have run into a problem in when I run the sketch it neither sets the IP address, nor can I change it. I can’t ping anything.
I tried the example from here which works perfectly:
I added a delay of 5 seconds after Ethernet.begin() to give me time to ping the interface before and after the change and I can ping both the old address before and then the new IP address after the change as expected. Clearly then, the setLocalIP() and other methods do work, but for some reason they don’t in my code. The only difference perhaps is that the functions are placed in a supplementary rather cpp than the main ino program and I am therefore calling them indirectly, but ultimately I am simply invoking the exact same methods. I have attached my code files.
Test-Ethernet.ino (4.72 KB)
My_Ethernet.h (853 Bytes)
My_Ethernet.cpp (2.42 KB)
My_Config.h (1.14 KB)