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. Troubleshooting
  3. RPI Gateway: Connect to Controller and MQTT broker with different IP addresses

RPI Gateway: Connect to Controller and MQTT broker with different IP addresses

Scheduled Pinned Locked Moved Troubleshooting
6 Posts 2 Posters 1.5k Views 2 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.
  • R Offline
    R Offline
    rjgmba
    wrote on last edited by
    #1

    Hi all,
    I am trying to use a RPI as mysensors' gateway for both MQTT as well as RFM69 and connected to network using ethernet. As controller I am using HomeAssistant. Is it possible to run a MQTT broker like mosquito on this gateway / or on a device other than the controller?
    0_1552297840169_247bed7d-c2b0-410f-94cc-fe2a85735e94-image.png

    It looks like the assumption is that the MQTT broker is on the same device as the Controller:
    https://www.mysensors.org/apidocs/group__RaspberryPiGateway.html:
    MySensors options:

    --my-controller-url-address=<URL>
                                Controller or MQTT broker url.
    --my-controller-ip-address=<IP>
                                Controller or MQTT broker ip.
    

    But maybe I misunderstand.

    I was trying to use the following:

    ./configure --my-gateway=ethernet --my-controller-ip-address=<HomeAssistant IP>  --my-transport=rfm69 --my-rfm69-frequency=433 --my-is-rfm69hw --my-gateway=mqtt --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1
    

    Where <HomeAssistant IP> is 192.168.XX.AA in my picture

    But that doesn't allow me to specify the MQTT broker on a different device than the Controller/Home Assistant...

    Perhaps I got this all wrong?

    mfalkviddM 1 Reply Last reply
    0
    • R rjgmba

      Hi all,
      I am trying to use a RPI as mysensors' gateway for both MQTT as well as RFM69 and connected to network using ethernet. As controller I am using HomeAssistant. Is it possible to run a MQTT broker like mosquito on this gateway / or on a device other than the controller?
      0_1552297840169_247bed7d-c2b0-410f-94cc-fe2a85735e94-image.png

      It looks like the assumption is that the MQTT broker is on the same device as the Controller:
      https://www.mysensors.org/apidocs/group__RaspberryPiGateway.html:
      MySensors options:

      --my-controller-url-address=<URL>
                                  Controller or MQTT broker url.
      --my-controller-ip-address=<IP>
                                  Controller or MQTT broker ip.
      

      But maybe I misunderstand.

      I was trying to use the following:

      ./configure --my-gateway=ethernet --my-controller-ip-address=<HomeAssistant IP>  --my-transport=rfm69 --my-rfm69-frequency=433 --my-is-rfm69hw --my-gateway=mqtt --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1
      

      Where <HomeAssistant IP> is 192.168.XX.AA in my picture

      But that doesn't allow me to specify the MQTT broker on a different device than the Controller/Home Assistant...

      Perhaps I got this all wrong?

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      --my-gateway=ethernet means a TCP connection between the gateway and the controller. Only one my-gateway option should be specified. If you want to use mqtt, use only --my-gateway=mqtt

      Set --my-controller-ip-address to the ip if the mqtt broker.

      See the MQTT section on https://www.mysensors.org/build/raspberry#configure for more information.

      R 1 Reply Last reply
      0
      • mfalkviddM mfalkvidd

        --my-gateway=ethernet means a TCP connection between the gateway and the controller. Only one my-gateway option should be specified. If you want to use mqtt, use only --my-gateway=mqtt

        Set --my-controller-ip-address to the ip if the mqtt broker.

        See the MQTT section on https://www.mysensors.org/build/raspberry#configure for more information.

        R Offline
        R Offline
        rjgmba
        wrote on last edited by
        #3

        @mfalkvidd Many thanks for your quick and helpful reply! Could I ask you two more clarifying questions:

        • So if define the rpi as a mqtt gateway, can I see this mqtt GW still as my GW for my RFM69 sensors?
        • Or do I need to split out the ethernet GW for my RFM69 sensors from the mqtt GW?

        0_1552302707752_becf5f20-43d0-4233-98fa-3734b2357dfc-image.png

        mfalkviddM 1 Reply Last reply
        0
        • R rjgmba

          @mfalkvidd Many thanks for your quick and helpful reply! Could I ask you two more clarifying questions:

          • So if define the rpi as a mqtt gateway, can I see this mqtt GW still as my GW for my RFM69 sensors?
          • Or do I need to split out the ethernet GW for my RFM69 sensors from the mqtt GW?

          0_1552302707752_becf5f20-43d0-4233-98fa-3734b2357dfc-image.png

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @rjgmba yes it will still be gw for your rfm69 sensors, the picture to the left is correct.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rjgmba
            wrote on last edited by
            #5

            Thanks for clarifying, @mfalkvidd, so that means that I won't use the Ethernet GW, but only the MQTT GW configuration, changing it to

            ./configure --my-gateway=mqtt --my-controller-ip-address=192.168.X.BB --my-transport=rfm69 --my-rfm69-frequency=433 --my-is-rfm69hw --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mymqttgateway1
            

            Where <MQTT / MySensors GW IP address> is the MySensors RPI IP address.

            But that also means that in Home-Assistant I will need to change the configuration yaml file and take out the Ethernet GW reference:

            So from

            mysensors:
              gateways:
                - device: '192.168.X.BB'
                  persistence_file: 'mysensors3.json'
                  tcp_port: 5003
                - device: mqtt
                  persistence_file: 'mysensors1.json'
                  topic_in_prefix: 'mysensors-out'
                  topic_out_prefix: 'mysensors-in'
              optimistic: false
              persistence: true
              retain: true
              version: '2.0'
            

            to

            mysensors:
              gateways:
                - device: mqtt
                  persistence_file: 'mysensors1.json'
                  topic_in_prefix: 'mysensors-out'
                  topic_out_prefix: 'mysensors-in'
              optimistic: false
              persistence: true
              retain: true
              version: '2.0'
            

            But how will Home-Assistant now know what the IP address is for the MySensors RPI gateway?

            Apologies if I completely missing something obvious....

            mfalkviddM 1 Reply Last reply
            0
            • R rjgmba

              Thanks for clarifying, @mfalkvidd, so that means that I won't use the Ethernet GW, but only the MQTT GW configuration, changing it to

              ./configure --my-gateway=mqtt --my-controller-ip-address=192.168.X.BB --my-transport=rfm69 --my-rfm69-frequency=433 --my-is-rfm69hw --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mymqttgateway1
              

              Where <MQTT / MySensors GW IP address> is the MySensors RPI IP address.

              But that also means that in Home-Assistant I will need to change the configuration yaml file and take out the Ethernet GW reference:

              So from

              mysensors:
                gateways:
                  - device: '192.168.X.BB'
                    persistence_file: 'mysensors3.json'
                    tcp_port: 5003
                  - device: mqtt
                    persistence_file: 'mysensors1.json'
                    topic_in_prefix: 'mysensors-out'
                    topic_out_prefix: 'mysensors-in'
                optimistic: false
                persistence: true
                retain: true
                version: '2.0'
              

              to

              mysensors:
                gateways:
                  - device: mqtt
                    persistence_file: 'mysensors1.json'
                    topic_in_prefix: 'mysensors-out'
                    topic_out_prefix: 'mysensors-in'
                optimistic: false
                persistence: true
                retain: true
                version: '2.0'
              

              But how will Home-Assistant now know what the IP address is for the MySensors RPI gateway?

              Apologies if I completely missing something obvious....

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #6

              @rjgmba Home Assistant should connect to the mosquitto broker

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


              32

              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