I’m sometimes having 1 second latency with a XBee device. The XBee (XBee pro 868) is powered by the arduino mega 3.3V output and is wired to a 868MHz antenna.
For the software, I use the “serialEvent” to read each byte and since it is called after “loop()”, I made “loop()” not blocking for more than 5ms. I’m sending 10 bytes every 50ms.
10 bytes8 bits per byte20 times per second = 1600 which is under the 10% capabilities of the XBee (24kbps). I think it happends more frequently when it is hot in my room so it may come from the fact that the XBee puts itself in security mode and use this 10% duty cycle over 1 second. So does this device takes into account the transmission overhead ? I configured the XBee to create packets of 10 bytes in the transparent mode with :
The code is in many files and it may be hard to read it so I didn’t give anything but I can give parts or explenations if you think it comes from it.
Any idea ?