-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes cpu is going hight and there are serial.serialutil.SerialException on rfxcom module #1
Comments
Hi Bruno, Had the same issue. An easy way to get this error is to simply unplug the rfxcom module. This comes from pyserial not correctly handling the error in python 3. select.error is a subclass of OSError, which causes to enter in the first catch instead of second. Not finding a fixed version on pyserial website, I justed hacked directly the file serialposix.py around line 480 from this: except select.error, e:
# ignore EAGAIN errors. all other errors are shown
# see also http://www.python.org/dev/peps/pep-3151/#select
if e[0] != errno.EAGAIN:
raise SerialException('read failed: %s' % (e,))
except OSError, e:
# ignore EAGAIN errors. all other errors are shown
if e.errno != errno.EAGAIN:
raise SerialException('read failed: %s' % (e,)) to this (found somewhere, I believe in ToT of dev branch): except OSError as e:
# this is for Python 3.x where select.error is a subclass of OSError
# ignore EAGAIN errors. all other errors are shown
if e.errno != errno.EAGAIN:
raise SerialException('read failed: %s' % (e,))
except select.error as e:
# this is for Python 2.x
# ignore EAGAIN errors. all other errors are shown
# see also http://www.python.org/dev/peps/pep-3151/#select
if e[0] != errno.EAGAIN:
raise SerialException('read failed: %s' % (e,)) It would be great to insist in getting a new release of pyserial with recent fixes at some point! Cheers |
Oh, and the CPU goes high because (in my case), the exception not being handled correctly, asyncio was repeatedly trying to read from a dead fd! |
Thank you for the analysis. I wonder why there is a select.error thrown. I thought I had found the root cause with the raspberry pi, when I had not disabled the serial port as console port. After having disabled it, this error became much less frequent. But it still occurs. Is the serial file descriptor dead ? |
In my case, yes: i unplug the rfxcom! It results in a infinite look on the same error. |
So far so good, the system is in production for 10 days with a little raspberry pi 2. I have not had this bug. But it's too early to be sure. |
The rfxcom module is broken with this kind of stacks :
The text was updated successfully, but these errors were encountered: