sureshakthi / python-xbee

Automatically exported from code.google.com/p/python-xbee
0 stars 0 forks source link

SerialException when waiting for frame #48

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am currently using the library with multiple xbee devices configured as 
DigiMesh.  I use an asynchronous callback function for reading data and I 
asynchronously call the write function through the use of other callback 
inputs.  Each xbee device may be tasked with sending and receiving copious 
amounts of data between computers.  I occasionally receive the following error:

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/xbee/base.py", line 95, in run
    self._callback(self.wait_read_frame())
  File "/usr/local/lib/python2.7/dist-packages/xbee/base.py", line 399, in wait_read_frame
    frame = self._wait_for_frame()
  File "/usr/local/lib/python2.7/dist-packages/xbee/base.py", line 131, in _wait_for_frame
    byte = self.serial.read()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 456, in read
    raise SerialException('device reports readiness to read but returned no data (device disconnected?)')
SerialException: device reports readiness to read but returned no data (device 
disconnected?)

Sometimes the error happens immediately, while sometimes it takes time before 
it occurs.  I can also say that it is not due to a bad connection as I have 
confirmed the connection as well as on various different vehicles.  I am 
curious as if it is due to multiple writes and reads possibly colliding as I 
did not see any protection against this.

I appreciate any help someone could give.

Original issue reported on code.google.com by EpsilonO...@gmail.com on 20 Mar 2014 at 12:12

GoogleCodeExporter commented 8 years ago
It happens the same to me!

Any hint how to fix it?

Thanks!

Original comment by Javier.B...@gmail.com on 1 Jul 2015 at 3:07