core: 0.117 - RFXtrx serial error

The problem

RFXtrx stopped working since upgrading to HA 0.117.
Error message from the log

2020-10-31 17:48:08 ERROR (Thread-8) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/share/hass/lib/python3.8/site-packages/serial/serialposix.py", line 500, in read
    raise SerialException(
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/share/hass/lib/python3.8/site-packages/RFXtrx/__init__.py", line 862, in _connect
    self._status = self.send_get_status()
  File "/usr/local/share/hass/lib/python3.8/site-packages/RFXtrx/__init__.py", line 928, in send_get_status
    return self.transport.receive_blocking()
  File "/usr/local/share/hass/lib/python3.8/site-packages/RFXtrx/__init__.py", line 684, in receive_blocking
    data = self.serial.read(pkt[0])
  File "/usr/local/share/hass/lib/python3.8/site-packages/serial/serialposix.py", line 509, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

Downgrading to 0.116.x fixes the issue

Environment

  • Home Assistant Core release with the issue: 0.117.1
  • Last working Home Assistant Core release (if known): 0.116.4
  • Operating environment (OS/Container/Supervised/Core): FreeBSD 12.2-RELEASE
  • Integration causing this issue: RFXtrx
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/rfxtrx/

Problem-relevant configuration.yaml

Note this is the entry as it was for 0.116.4. I’ve also tried to remove it for 0.117.1, did not fix the issue

rfxtrx:
  device: /dev/rfx
  devices:
    0a520d52fd0100d8430189: # Outside Alecto sensor
    115a02018bf2010000092e00000000000089: # Electricity sensor
    0b11003b020A100801010f60: # Lighting Terrace Garland
    0b11003b020A100901010f60: # Lighting Entrance Side
    0b11003b020A100701010f60: # Lighting Entrance Main door
    0b11003b020A101001010f60: # Lighting Terrace Lamps    
    0b11003b0101023202010f60: # Extractor Bathroom
    0b11003b0104091116010f60: # Lighting Sleigh
    0b11003b000C050005010f60: # Lighting Entrance Parking

Traceback/Error logs

See above. Also captured IO to RFXtrx device below. /dev/rfx is a symlink to /dev/cuaU0

openat(AT_FDCWD,"/dev/rfx",O_RDWR|O_NONBLOCK|O_NOCTTY|O_CLOEXEC,00) = 41 (0x29)
ioctl(41,TIOCGETA,0x7fffdf7f9c40)                = 0 (0x0)
ioctl(41,TIOCGETA,0x7fffdf7f9c40)                = 0 (0x0)
ioctl(41,TIOCSETA,0x7fffdf7f9c40)                = 0 (0x0)
ioctl(41,TIOCMBIS,0x7fffdf7f9a30)                = 0 (0x0)
ioctl(41,TIOCMBIS,0x7fffdf7f9a30)                = 0 (0x0)
ioctl(41,TIOCFLUSH,0x7fffdf7f9dcc)               = 0 (0x0)
write(41,"\r\0\0\0\0\0\0\0\0\0\0\0\0\0",14)      = 14 (0xe)
ioctl(41,TIOCFLUSH,0x7fffd8fe0e9c)               = 0 (0x0)
write(41,"\r\0\0\^A\^B\0\0\0\0\0\0\0\0\0",14)    = 14 (0xe)
read(41,0x80643e3b0,1)                           = 0 (0x0)

Additional information

Downgrading to 0.116.4 fixes the issue. Device permissions are correct. May be related to pyRFXtrx version change (0.116 uses pyRFXtrx==0.25, 0.117 uses pyRFXtrx==0.26) Tested pyRFXtrx with the included test program pyRFXtrx/examples/receive.py , both versions 0.25 and 0.26 work fine, able to see rfx device and messages from sensors. Also tried to remove and add again the RFXtrx integration, no improvement.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

Happy to report that async_timeout.timeout(30) fixes the issue. Keeping the issue open based on comments about need to fix the underlying lib for retry. Thanks a lot for your help!