UDP Dropped/Missing Packets

I am prototyping a device controller using an Arudino Uno and an XBee S6B (latest firmware). My goal is to have a 110 byte UDP packet sent out every second. Part of the device interaction with the outside world is the duration of time that has past since the controller was turned on, so a packet every second is ideal.

I realize that occasionally packets may drop, so I actually send out a packet every 500ms, but what I see occasionally is that I have random times where out of nowhere the packets disappear for upwards of 10 seconds.

I ran a long test and while the delay varies from 2 seconds to 10 seconds, over the course of a half hour roughly 5 % of the packets I send get lost.

I’ve tried using different wifi networks, different send times, different baud rates, etc. I can’t seem to find any consistent improvement.

Is there something I could check for to solve this mystery?

I don’t mind losing an occasional packet but having the device not talking randomly for 5 to 10 seconds here and there is a big problem.

Have you tried using TCP instead of UDP? TCP has retries where as UDP is a broadcast.

Thanks for taking the time to reply… the reason I am using UDP is so that I can use UDP broadcast on the xbee and have the an app on a mobile device be able to easily discover the ip address of the hardware we are developing by simply listening on a given udp port for data being transmitted from the xbee

Is there any way to accomplish something similar using TCP?

You can still run broadcast packets in TCP but in either case, you have timeouts within the protocols that you have to contended with. Both of which can and will result in various times you will and can have data received.

How can I run broadcast packets in TCP? I thought this was not possible?

How can I broadcast packets in TCP? I thought this was not possible?

If I recall you send to the IP address 252.