Can't get RFXtrx to work on Hass.io!

Hi!

I try to get my RFXtrx433E to work with Hass.io running on a RPi3.

I have previously used the RFXtrx433E with a Vera Edge and imported the devices to HASS using the Vera component. I now want the RFXtrx433E directly plugged in the RPi.

I have unplugged everything else from the RPi. I get two USB ports when I run “hassio ho hardware” using putty: /dev/ttyUSB0 and /dev/ttyAMA0.

I have used both these ports in configuration.yaml:

rfxtrx:
  device: /dev/ttyUSB0
  debug: True
  dummy: False

and

rfxtrx:
  device: /dev/ttyAMA0
  debug: True
  dummy: False

Neither of these settings works. I do not get any devices auto detected. I know the RFXtrx433E have the right protocols enabled because my devices show when the RFXtrx433E is connected to my Vera.

I have added “automatic_add: True” to sensors, switches, lights and binary_sensors.

I read somewhere you could use the putty command “dmesg” but I don’t know what I’m looking at?

What am I doing wrong?

This is the output from “dmesg”:

https://pastebin.com/RU5QCfRs

Have a look at the instructions: https://www.home-assistant.io/components/rfxtrx/

device (Required): The path to your device, e.g., /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1Y0NJGR-if00-port0

That works for me.

I had to run the grep tty command in this thread to get it to work

I tried path /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1Y0NJGR-if00-port0 but that didn’t work either.

if you connect to your Pi and just type “ls /dev” is should give you a big list of all the devices the pi currently sees, you should be able to see if its TTYUSB0 or TTYUSB1, mine is…

rfxtrx:
  device: '/dev/ttyUSB0'

Hope this helps.
Lee

Yes! By running “dmesg | grep tty” and rebooting the system my sensors started to show up!

I don’t know why (I thought the “grep” command in linux just listed things?) or if I need to do this every time I reboot, but I’m just happy it works! :slight_smile:

The command “ls /dev” just printed:

core-ssh:~# ls /dev
char     init     null     random   stdin    urandom
fd       kmsg     ptmx     shm      stdout   zero
full     mqueue   pts      stderr   tty

EDIT: No, I was premature in my joy… Rebooted the RPi3 and the sensors are gone and don’t get autodetected again. Tried running “dmesg | grep tty” again:

core-ssh:~# dmesg | grep tty
[    1.159050] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[    4.491000] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
[    4.492567] cdc_acm 1-1.3:1.0: ttyACM1: USB ACM device
[    5.874399] usb 1-1.5: FTDI USB Serial Device converter now attached to ttyUSB0

and SOMETIMES the sensors start show up again. This is not very stable.

Could someone who use a RFXtrx433E for Hass.io on a RPi3 (preferable together with other USB devices like Z-Wave USB stick) please share if they need to use the “dmesg | grep tty” every time after reboot?

I tried the command “dmesg” without the " | grep tty"-part and got this output: https://pastebin.com/Wt4aWpBV

I assume this part:

[    1.614323] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.614335] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.614789] hub 1-1:1.0: USB hub found
[    1.614849] hub 1-1:1.0: 5 ports detected
[    1.894042] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    1.994392] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    1.994415] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.997365] smsc95xx v1.0.4
[    2.057897] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:61:e0:ff
[    2.294038] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
[    2.371857] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.397360] usb 1-1.2: New USB device found, idVendor=0658, idProduct=0200
[    2.397384] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.415099] EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
[    2.494064] usb 1-1.3: new full-speed USB device number 5 using dwc_otg
[    2.619978] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001
[    2.619999] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.620012] usb 1-1.3: Product: RFXtrx433
[    2.620023] usb 1-1.3: Manufacturer: RFXCOM
[    2.620035] usb 1-1.3: SerialNumber: A1XQFOUU
[    2.704014] usb 1-1.5: new full-speed USB device number 6 using dwc_ot`

have something to say about what port the RFXtrx is connected to. Could someone interpret the output for me?

I get the following, which raspberry pi and image are you using?? hass.io hassbian ??

pi@hassbian:~ $ ls /dev
autofs           loop6               ram5     tty2   tty45      uhid
block            loop7               ram6     tty20  tty46      uinput
btrfs-control    loop-control        ram7     tty21  tty47      urandom
bus              mapper              ram8     tty22  tty48      vchiq
cachefiles       mem                 ram9     tty23  tty49      vcio
char             memory_bandwidth    random   tty24  tty5       vc-mem
console          mmcblk0             raw      tty25  tty50      vcs
cpu_dma_latency  mmcblk0p1           rfkill   tty26  tty51      vcs1
cuse             mmcblk0p2           serial   tty27  tty52      vcs2
disk             mqueue              serial1  tty28  tty53      vcs3
fb0              net                 shm      tty29  tty54      vcs4
fd               network_latency     snd      tty3   tty55      vcs5
full             network_throughput  stderr   tty30  tty56      vcs6
fuse             null                stdin    tty31  tty57      vcsa
gpiochip0        ppp                 stdout   tty32  tty58      vcsa1
gpiochip1        ptmx                tty      tty33  tty59      vcsa2
gpiomem          pts                 tty0     tty34  tty6       vcsa3
hwrng            ram0                tty1     tty35  tty60      vcsa4
initctl          ram1                tty10    tty36  tty61      vcsa5
input            ram10               tty11    tty37  tty62      vcsa6
kmsg             ram11               tty12    tty38  tty63      vcsm
log              ram12               tty13    tty39  tty7       vhci
loop0            ram13               tty14    tty4   tty8       watchdog
loop1            ram14               tty15    tty40  tty9       watchdog0
loop2            ram15               tty16    tty41  ttyAMA0    zero
loop3            ram2                tty17    tty42  ttyprintk
loop4            ram3                tty18    tty43  ttyUSB0
loop5            ram4                tty19    tty44  ttyUSB1

Lee

Based on your dmesg, I believe it would be /dev/serial/by-id/usb-RFXCOM_RFXrec433_A1XQFOUU-if00-port0 on your system.

If that doesn’t work, you’ll need to follow the steps at https://www.home-assistant.io/developers/hassio/debugging/ to enable SSH to the resinos host. Once done, you can ssh to the resinos host and check at /dev/serial/by-id/ for the right device id.

I finally got it to work and post here for others who are struggling (and for myself in the future when I have forgotten how I did it… ;))!

First you need to get SSH root access which you need to follow the instructions @NotoriousBDG link to ( https://www.home-assistant.io/developers/hassio/debugging). Copy the public key to a file called “authorized_keys” (no file ending) and put it in the root of the /resin-boot partition of the SD card (you need to remove the Sd card from the RPi to do this).

Then, connect as root to Hass.io using the generated private key and using port 22222. Use the “ls -al /dev/serial/by-id” command to list the long, real paths to all USB devices connected to the RPi:

root@hassio:~# ls -al /dev/serial/by-id
total 0
drwxr-xr-x 2 root root 100 Apr  6 17:05 .
drwxr-xr-x 4 root root  80 Sep 17  2017 ..
lrwxrwxrwx 1 root root  13 Apr  6 17:09 usb-0658_0200-if00 -> ../../ttyACM0
lrwxrwxrwx 1 root root  13 Apr  6 17:09 usb-Arduino__www.arduino.cc__0043_55330343731351705081-if00 -> ../../ttyACM1
lrwxrwxrwx 1 root root  13 Apr  6 17:09 usb-RFXCOM_RFXtrx433_A1XQFOUU-if00-port0 -> ../../ttyUSB0

Then, use the long path for each device instead of the shortcuts used in the examples.

For example, in my configuration.yaml I need to put in

rfxtrx:
  device: '/dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1XQFOUU-if00-port0'
  debug: True
  dummy: False

to enable the RFXtrx and

mysensors:
  gateways:
    - device: '/dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_55330343731351705081-if00'
      persistence_file: 'mysensors.json'
      baud_rate: 115200
  optimistic: false
  persistence: true
  retain: true
  version: '2.2'

to enable the MySensors gateway.

The path seems to be persistent between reboots and I can finally have several USB devices connected to my Rpi.

2 Likes

Have been trying to enter debugging mode by following @NotoriousBDG instructions but when I try to connect via Putty I got the following message:

Is there any way I can check if the public key is imported from the USB memory?

The private key should be used in Putty under “Connection - Auth - Private key file”, or am I wrong?

I also tried this but even logging in using 22222 doesn’t work.
Can someone please help me or give some guidelines?
Thanks

Finally got it all working after a huge amount of trying and adjusting.
I’m a bit anxious to ever reboot my pi, as I think everything might change. So let’s not reboot is the thing now :wink:

rfxtrx:
 device: /dev/ttyUSB0
 debug: true
switch:
 - platform: rfxtrx
   automatic_add: false
   devices:
     "0710010241010150":
       name: Bureau
     "0710010141020060":
       name: Keukenkast
     "0710010541030060":
       name: TV Raam

So this is what my config looks like right now.
Because my listed rfxtrx device only had a number I found out that it is necessary to " " accolade them out.

Hello,

Neither TTY were working for me but thanks to all tips described in this topic, I’ve been able to “easily” guess the by-id path ::

  • First run dmesg in CLI and find the following lines
    [ 2.216443] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6001
    [ 2.217725] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 2.218961] usb 1-1.3: Product: RFXtrx433
    [ 2.220177] usb 1-1.3: Manufacturer: RFXCOM
    [ 2.221389] usb 1-1.3: SerialNumber: A1R17KD

  • Then just replace the here with the one from the last line
    /dev/serial/by-id/usb-RFXCOM_RFXtrx433_-if00-port0

  • That’s it