Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Home Assistant
  4. Hassbian and MySensors Gateway on RPi not working

Hassbian and MySensors Gateway on RPi not working

Scheduled Pinned Locked Moved Home Assistant
10 Posts 3 Posters 3.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • pgvP Offline
    pgvP Offline
    pgv
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #2

      Try removing the my controller URL address in the configure

      1 Reply Last reply
      0
      • pgvP Offline
        pgvP Offline
        pgv
        wrote on last edited by
        #3

        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.

        martinhjelmareM 1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • pgvP pgv

            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.

            martinhjelmareM Offline
            martinhjelmareM Offline
            martinhjelmare
            Plugin Developer
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            0
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #6

              @martinhjelmare tnx, I am not much into Home Assistant :)

              1 Reply Last reply
              0
              • pgvP Offline
                pgvP Offline
                pgv
                wrote on last edited by pgv
                #7

                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.

                martinhjelmareM 1 Reply Last reply
                1
                • pgvP pgv

                  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.

                  martinhjelmareM Offline
                  martinhjelmareM Offline
                  martinhjelmare
                  Plugin Developer
                  wrote on last edited by
                  #8

                  @pgv

                  Your guess is correct.

                  1 Reply Last reply
                  0
                  • pgvP Offline
                    pgvP Offline
                    pgv
                    wrote on last edited by
                    #9

                    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:

                    1 Reply Last reply
                    0
                    • gohanG Offline
                      gohanG Offline
                      gohan
                      Mod
                      wrote on last edited by
                      #10

                      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 😀

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      20

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular