Xbee device's serial port closed.

Hi there,

I am using Xbee S2C and I connected it to Rpi 3B, Rpi 3B+ with USB. I wrote a python application that establishes communication with the Xbee device. I am using digi-xbee library. I have several questions;

First: During the communication process, Xbee device sometimes returns “Xbee device’s serial port closed” exception without any reasonable problem, I mostly got this while sending and receiving messages but it is totally random. However, when it returns this exception I cannot control the device anymore. I tried to close the serial port and reconnect, but it fails too. The only solution I found was to unplug the USB connection and replug it, which is not efficient.

Second: During the communication process, the Xbee device sometimes returns “” exception when I tried to send data. There is nothing inside the exception. I basically say “except Exception as error:” then “logging.error(error)” or “print(error)”, but there is nothing inside the “error” response. After this exception, I can continue my process and I can use the device perfectly, however, my package lost. I don’t know the reason again. Also, this one works totally random too.

Thank you for your help.