I have a XBee SB6 in API mode successfully sending TCP packets to a Qt5 App running on a Raspberry Pi. The Pi is acting as a Wireless Hotspot and so the XBee associates with the Pi and sends TCP data to it. This all works great.
What I am noticing is that if I kill the Qt5 Process ( which is running a QTCPServer ) that is accepting the TCP data on the Raspberry Pi from the XBee, then the XBee gets ‘jammed up’ and does not send anymore data ( because there is no listening socket to connect to on the Pi ), but also the app that controls the UART for the XBee on the Sending machine becomes unresponsive. Furthermore, restarting the kill receiving TCP Server app on the receiving Pi does not allow the XBee to re-establish connections. The XBee has to be restart and reconfigured to restart successful communication. My questions are below:
How can I detect that the remote TCP Server on the Listening Pi from the XBee perspective is down ( so I can stop sending API frames at that point )?
The status ATAI is still 0 because the XBee is associated but no sent TCP packet is being ACK’d so I believe that is why it is getting jammed up. How can I gracefully recover the XBee from this state?