Hi, I've notice this line of code
IPAddress broadcast_addr(remote_addr[0], remote_addr[1], remote_addr[2], 255);
So, it just happened that my netmask was 255.255.255.0 and it worked, but then I've changed it just to see if I will crash it. Indeed after the netmask change the app was not able to find my device.
I suggest changing that line with this:
IPAddress netmask(WiFi.subnetMask()); IPAddress broadcast_addr((unsigned char)(remote_addr[0] | ~netmask[0]), (unsigned char)(remote_addr[1] | ~netmask[1]), (unsigned char)(remote_addr[2] | ~netmask[2]), (unsigned char)(remote_addr[3] | ~netmask[3]));
Hi, I've notice this line of code
IPAddress broadcast_addr(remote_addr[0], remote_addr[1], remote_addr[2], 255);So, it just happened that my netmask was 255.255.255.0 and it worked, but then I've changed it just to see if I will crash it. Indeed after the netmask change the app was not able to find my device.
I suggest changing that line with this:
IPAddress netmask(WiFi.subnetMask()); IPAddress broadcast_addr((unsigned char)(remote_addr[0] | ~netmask[0]), (unsigned char)(remote_addr[1] | ~netmask[1]), (unsigned char)(remote_addr[2] | ~netmask[2]), (unsigned char)(remote_addr[3] | ~netmask[3]));