RFXtrx intergation not loading on 2021.12.7 (recently upgraded from 2021.4)
Docker container with Rfxtrx mapped /dev/ttyUSB1
Any pointers how to resolve?
Relevant log extracts
2022-01-02 00:08:12 INFO (MainThread) [homeassistant.setup] Setting up rfxtrx
2022-01-02 00:08:12 INFO (MainThread) [homeassistant.setup] Setup of domain rfxtrx took 0.0 seconds
2022-01-02 00:08:13 INFO (MainThread) [homeassistant.components.zwave] Z-Wave USB path is /dev/ttyACM0
2022-01-02 00:08:13 DEBUG (Thread-3) [RFXtrx] Send: 0x0d 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
2022-01-02 00:08:13 ERROR (Thread-3) [root] Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/RFXtrx/__init__.py", line 876, in _connect
self.transport.reset()
File "/usr/local/lib/python3.9/site-packages/RFXtrx/__init__.py", line 723, in reset
self.send(b'\x0D\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
File "/usr/local/lib/python3.9/site-packages/RFXtrx/__init__.py", line 719, in send
self.serial.write(pkt)
AttributeError: 'NoneType' object has no attribute 'write'
2022-01-02 00:08:13 INFO (MainThread) [homeassistant.setup] Setup of domain apcupsd took 1.4 seconds
2022-01-02 00:08:43 ERROR (MainThread) [homeassistant.components.rfxtrx] Connection timeout: failed to receive response from RFXtrx device
lsusb
[admin@dockerhost opt]$ lsusb
Bus 001 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 18d1:9302 Google Inc.
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB
Bus 002 Device 003: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 002 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 002 Device 005: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 002 Device 002: ID 214b:7250 Huasheng Electronics
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
You have mail in /var/spool/mail/admin
[admin@dockerhost opt]$ ./USBid.sh
/dev/ttyUSB1 - RFXCOM_RFXtrx433_A1YKMXYW
/dev/ttyUSB0 - FTDI_FT230X_Basic_UART_DM01C7DN
/dev/ttyACM0 - 0658_0200
Same here , not in Docker though but on NUC (core-2012.12.08 and Supervisor 2021.12.2)
constant āConnection timeout: failed to receive response from RFXtrx deviceā messages on a RFXtrx433E device after updating
Upgraded firmware to no avail, removed integration and added makes no change, restarting Core does not help either.
Device is working on a Windows machine using RFXmngr.
Havenāt found a workaround yet, hope to find some directions here
Hi, I solved this but only by removing the integration, rebooting my full docker host and then readding the rfxtrx integration. Check that correct usb is being passed to container (sometimes not in my case).
Had to re-add all my devices but only have 6 so not too much of a pain.
I got it working by adding āādevice /dev/ttyUSB0:/dev/ttyUSB0ā to the docker run statement. That also allowed me to keep the already installed devices.
Please note that my docker for HA runs on āhostā and in 2021.11 it did not (!) need this mapping (as on āhostā)
Without this setting the connection works fine through using ip/port (using ser2net) but ser2net is not stable.
the way above in the ādocker runā¦ā of homeassistant container, slightly different you can also add this to a docker_compose but I have no example
You have the exact same error as the OP?
If so, even though I answered, never got a response to that so no clue exactly
EDIT: your HA instance can see this device?
Not sure, maybe only the symptom are the same, the integration not loading.
I donāt know if my HA can see the device. If I delete the integration and try to add it again, then it donāt see it. However both ttyUSB1 and usbRFXcom are created in:
$ docker exec -it TestHA bash
root@hallonpaj:/# ls /dev
fd full mqueue null ptmx pts random shm stderr stdin stdout tty ttyUSB1 urandom usbRFXcom zero
Other things I can rememer ( I wish Iād written them down) are to make the tty/USB0 read/write for all (chmod 777) and I made the container run āprevailedā which is a recommended setting btw.
In case you use /dev/serial/ttyUSB1:/dev/serial/RFX
then you are mapping usb 1, however what number that gets assigned to which port is random upon boot. Thatās is probably why it worked fine until you restarted because then the usb port you used got another number and the RFX device was no longer mapped. Therefore it is supposedly better to use /dev/serial/by-id, ie: /dev/serial/by-id/usb-RFXCOM_RFXtrx433XL_DO5OP3V5-if00-port0:/dev/serial/RFX
Because that long name is a unique ID that the actual device has and will be the same whichever usb port or computer is used.
Use
~ $ ls -l /dev/serial/by-id/
to get you identifier.
However in my case this donāt help, sometimes I get more luck with ttyUSB0, or if is just randomā¦
I have another usb device, a zwave stick which works flawlessly (with /dev/serial/by-id/.