Raspberry gateway cant communicate with Home assistant.



  • Hi,
    I am running homeassistant in raspberry (manuall installataion on rasbian) and i had a serial usb gateway with arduino working fine with my first test node. I saw i could make gateway directly on raspberry so i decided to do it for more compact design. I built the raspberry gateway following these instructions https://www.mysensors.org/build/raspberry
    with configuration of serial port
    --my-gateway=serial --my-serial-is-pty --my-serial-port=/dev/ttyUSB020
    All tests passed and communication from node to gateway established and working fine (i saw from debugging that node was sending values and gateway reaceiving the values. The problem is that Homeassistant cant open port ttyUSB020 with error:
    ''Unable to connect to /dev/ttyUSB020
    util/async_.py (ERROR)''
    How can i make the homeassistant to open port ,so get the data and show me the sensor on the UI?
    Thank you.


  • Mod

    Welcome to the forum @badisensors

    Which user and group is homeassistant running as? Maybe its group needs access by adding --my-serial-groupname=<GROUP>



  • Thank you very much. I followed the instructions here:
    https://www.home-assistant.io/docs/installation/raspberry-pi/
    to manually install the homeassistant so if i understood well the user is homeassistant and groups ''dialout'' and ''gpio'' added with command :
    $ sudo useradd -rm homeassistant -G dialout,gpio

    So do i need to build again the gateway adding --my-serial-groupname=<gpio> ?


  • Mod

    @badisensors that sounds reasonable. Yes, start over from the ./configure step. Make sure you add all arguments to configure on one line.

    Edit: so the full configure command will be

    ./configure --my-gateway=serial --my-serial-is-pty --my-serial-port=/dev/ttyUSB020 --my-serial-groupname=gpio
    


  • I did it and i made a reboot, but nothing changed. Again i see the error about port unable to connect in USB020 in homeassistant. Any other idea?

    PS: when i run the test gateway command i see:
    Dec 04 12:22:01 INFO Starting gateway...
    Dec 04 12:22:01 INFO Protocol version - 2.3.0
    Dec 04 12:22:01 DEBUG Serial port /dev/ttyUSB020 (115200 baud) created
    Dec 04 12:22:01 DEBUG MCO:BGN:INIT GW,CP=RNNGL-Q-,VER=2.3.0
    Dec 04 12:22:01 DEBUG TSF:LRT:OK
    Dec 04 12:22:01 DEBUG TSM:INIT
    Dec 04 12:22:01 DEBUG TSF:WUR:MS=0
    Dec 04 12:22:01 DEBUG TSM:INIT:TSP OK
    Dec 04 12:22:01 DEBUG TSM:INIT:GW MODE
    Dec 04 12:22:01 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
    Dec 04 12:22:01 DEBUG MCO:REG:NOT NEEDED
    Dec 04 12:22:01 DEBUG MCO:BGN:STP
    Dec 04 12:22:01 DEBUG MCO:BGN:INIT OK,TSP=1
    Dec 04 12:22:20 DEBUG TSF:MSG:READ,1-1-0,s=0,c=1,t=23,pt=2,l=2,sg=0:68
    Dec 04 12:22:55 NOTICE RF24: Recovered from a bad interrupt trigger.



  • I have something new. Homeassistant write now that node 1 is unknown in the info section and i still dont see the sensor in UI

    So the gateway not connected to USB020 port :
    2018-12-04 12:37:29 INFO (MainThread) [mysensors] Connected to Serial<id=0xb0c1cf30, open=True>(port='/dev/ttyUSB020', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=0, xonxoff=False, rtscts=False, dsrdtr=False)

    and then:

    2018-12-04 12:37:44 WARNING (MainThread) [homeassistant.components.mysensors.gateway] Gateway /dev/ttyUSB020 not ready after 15.0 secs so continuing with setup

    and later:

    18-12-04 12:39:45 WARNING (MainThread) [mysensors] Node 1 is unknown



  • OK SOLVED!
    I reinstalled the last version of mysensors library and i uploaded again the sketch to arduino node and now i can see my light sensor!

    Thank you very much for your help.
    Best Regards


 

380
Online

8.0k
Users

8.8k
Topics

94.3k
Posts