Teensy 4.1 NativeEthernet IP change

Status
Not open for further replies.

SimonWakley

Active member
I can change the IP address of my Teensy 3.2 using the following code.

IPAddress ip(192,168,1,234);

void ipchange(ipaddr newval)
{

IPAddress new_ip(newval.addr0, newval.addr1, newval.addr2, newval.addr3);

sprintf(szText, "Ip was %u.%u.%u.%u, now %u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3], newval.addr0, newval.addr1, newval.addr2, newval.addr3);
Debug.println(szText);

ip = new_ip;

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

}

Doesn't seem to work with Teensy 4.1. Anyone have a suggestion? I am using the NativeEthernet header files and it seems to be working fine and even says the localIP is the new one, but it only responds to the old address.
 
Status
Not open for further replies.
Back
Top