Hassbian and MySensors Gateway on RPi not working



  • Hi

    I have an RPi with IP 192.168.1.16 I've installed Home Assistant using Hassbian which appears to work OK. I've now installed a MySensors gateway on the same RPi using the NRF24 module connected to GPiO pins as the transport.

    It appears the transport is working fine but there is something about the connection to HA which isn't right:

    pi@hassbian:~/MySensors $ sudo ./bin/mysgw -d
    mysgw: Starting gateway...
    mysgw: Protocol version - 2.2.0-beta
    mysgw: MCO:BGN:INIT GW,CP=RNNG----,VER=2.2.0-beta
    mysgw: TSF:LRT:OK
    mysgw: TSM:INIT
    mysgw: TSF:WUR:MS=0
    mysgw: TSM:INIT:TSP OK
    mysgw: TSM:INIT:GW MODE
    mysgw: TSM:READY:ID=0,PAR=0,DIS=0
    mysgw: MCO:REG:NOT NEEDED
    mysgw: connect: Connection refused
    mysgw: failed to connect
    mysgw: Eth: connect
    
    

    My configuration commands to set up the MySensors gateway: (I have also tried this with 127.0.0.1 seeing as it is the same device but I get the same result)

    pi@hassbian:~/MySensors $ ./configure --my-transport=nrf24
    
    pi@hassbian:~/MySensors $ ./configure --my-gateway=ethernet --my-port=5003
    
    pi@hassbian:~/MySensors $ ./configure --my-gateway=ethernet --my-controller-url-address=192.168.1.16
    
    

    The important part of my configuration.yaml file is shown here:

      gateways:
        - device: '192.168.1.16'
          persistence_file: '/home/homeassistant/.homeassistant/mysensors3.json'
          tcp_port: 5003
      debug: true
      optimistic: false
      persistence: false
      retain: true
      version: 2.2
    
    

    Any help would be most welcome. Thanks


  • Mod

    Try removing the my controller URL address in the configure



  • Hi

    Thank you. That has fixed it.

    What is the best way to get the help page updated? It is not 100% clear not to include that config line if the controller and gateway share the same ip address. It would just be a few more words there.

    Thanks again. Appreciated.


  • Mod

    For your case I think you have to use 127.0.0.1 instead of the Lan ip address


  • Plugin Developer

    @pgv

    It's not that you shouldn't include that part when sharing ip address. Including that part will configure the gateway to act as a client instead of a server. Home assistant expects to connect as a client and that the gateway should be the server. That's why you got an error about connection refused.


  • Mod

    @martinhjelmare tnx, I am not much into Home Assistant 🙂



  • Thanks Martin and Gohan

    I do appreciate your help.

    My installation definitely working OK now without the client configure statement.

    Martin, just for clarity, what if my HA was on another IP address?

    Would I have used the client configure statement and which one would I have used?

    My guess is NO neither is required as MySensors is acting as a server so you just need to make sure HA knows where to find the MySensors server.

    Thanks again.


  • Plugin Developer

    @pgv

    Your guess is correct.



  • thank you.

    As a suggestion could the documentation be changed from:

    By default, the gateway is built for ethernet and it listens on port 5003:

    to:

    By default, the gateway is built for ethernet as a server and it listens on port 5003 for controller connections:


  • Mod

    A service listening on a port it is implicit that is a server waiting for a connection, otherwise is would not need to be listening for anyone calling 😀


Log in to reply
 

Suggested Topics

  • 1
  • 3
  • 5
  • 17
  • 2
  • 1

58
Online

11.4k
Users

11.1k
Topics

112.6k
Posts