I have 2 xbee pros, relatively close to each other however I still often get dupe messages from one end or the other.
[ 2018-01-16 17:51:48 ] From Xbee (length: 100) [RAW]:
My setup is the following: Arduoino + Xbee < > Xbee + Raspberry pi 2
The rpi 2 sending commands and the arduino on the other end executes them and responds. In this example the only line I should’ve gotten back was:
The rest is garbage which either stuck in on the SENDER side Xbee or on the RECEIVER side. I hope that this is the rest because the SENDER side circuit is built in and difficult to disassemble.
So my question is, is it possible from C to send a flush command to the RECEIVER Xbee to flush it’s buffer after each successful command reception?
int serialport_flush(int fd)
return tcflush(fd, TCIOFLUSH);
Does this have any effect?
So before sending out messages to the Arduino side my code always does:
At receiving messages it cannot really know if there is a junk in the receiver buffer before it writes that out to the serial.