Change the IP of Teensy 4.1 using UDP (again)

SimonWakley

Active member
Using an SPI with the teensy 3,2, I can change the IP relative easily from say 192.168.1.236 to .237 but when I do it with the 4.1, it does not respond to the new IP address.

This code works for me with Teensy3.2 Any suggestions?. It's not a deal breaker but would be nice to get it to work.

Thanks,

Simon

Udp.stop();
Ethernet.begin(mac, new_ip);
Udp.begin(localPort);

PS: Asked before but no one responded.
 
you are stopping udp but not ethernet, I don't know if you can actually change that live?
In my project I do reboot teensy after applying any change, so it restarts fresh with all the new settings saved in memory.
I don't know if that's a possible workaround for you. The command I use is CPU_RESTART;
 
Hi,
Thanks. I can actually write the ip to flash and re-start but I was hoping to be able to just change it without loosing other variables etc. It DOES work with the Teensy 3.2 and the WizIO over SPI so I was just wondering if anyone had an idea. It's not a deal breaker.

Obviously I am using the native ethernet headers. Also seems to hang when you check if the cable is plugged in (if it isn't) but the 3.2 didn't. Again not a deal breaker just would like it to work.

Maybe I should digging into the sources :)

Thanks
Simon
 
Hi,
Thanks. I can actually write the ip to flash and re-start but I was hoping to be able to just change it without loosing other variables etc. It DOES work with the Teensy 3.2 and the WizIO over SPI so I was just wondering if anyone had an idea. It's not a deal breaker.

Obviously I am using the native ethernet headers. Also seems to hang when you check if the cable is plugged in (if it isn't) but the 3.2 didn't. Again not a deal breaker just would like it to work.

Maybe I should digging into the sources :)

Thanks
Simon

yes, the cable requirement is also a bug of the native library, there is a workaround but you have to change the library:
https://github.com/vjmuzik/NativeEthernet/issues/12
 
This is worth a read.
Seems that IwIP was developed for use in embedded systems (sounds familiar).
@shawn how does IwIP compare with uIP?
 
I’ve never used uIP. Looks like it was made by the same author, though, so I’m imagining it’s similar in feel. According to that article, it also looks like it was written for 8- and 16-bit systems.
 
Last edited:
Back
Top