OK, maybe I am unsure how to use UDP on these devices…
On my sending device, which does not listen, I am calling
udp.begin(5556); This sends a ~800 character packet every 10s with
udp.beginPacket( IPAddress(255,255,255,255), 5555);
The sender device works fine, I am receiving the packets both in Wireshark and with another windows program listening on 5555. Wireshark says it’s 5556 -> 5555.
I have now set up my listening device, which is meant to listen on that port:
But with that device on 5555, After a few minutes the cyan starts to fast blink and I cannot ping it. It’s disconnected. I have code in on there that checks WiFi.ready() and will udp.stop() and udp.begin() after a reconnect… but it’s not reconnecting.
So I think I have figured out that it does this when another device is listening to port 5555. Doesn’t matter if it’s the photon or the program on the Windows machine.
And once it gets into the REALLY fast cyan blink, it doesn’t come out. I set the LED to blink if WiFi.ready() goes false… and it doesn’t blink.
Whoah… the REALLY fast Cyan flash just went RED for one blink, then slowed down to a slighly less fast cyan blink.
A Reset and reboot makes it work, for a few minutes until this happens again.
WiFi.ready is TRUE, so I don’t know what to do here.