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. General Discussion
  3. how to have 2 gateways?

how to have 2 gateways?

Scheduled Pinned Locked Moved General Discussion
13 Posts 4 Posters 118 Views 4 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.
  • S Offline
    S Offline
    SylvainMartin
    wrote on last edited by
    #1

    I have a nrf24 gateway running on a raspberry pi zero for a couple of years and I was playing around with creating a esp8266/nrf24 one as a replacement but I was playing around and debugging a new node when after a day or 2 noticed all my existing nodes connected to the new gateway. So now all my data got dumped into a different mqtt topic and influx DB. Is there a way to have a live "production" gateway and a "dev" one at the same time without that happening? both gateways seem to use node_id 0 and setting it differently doesn't seem to work

    mfalkviddM 1 Reply Last reply
    0
    • S SylvainMartin

      I have a nrf24 gateway running on a raspberry pi zero for a couple of years and I was playing around with creating a esp8266/nrf24 one as a replacement but I was playing around and debugging a new node when after a day or 2 noticed all my existing nodes connected to the new gateway. So now all my data got dumped into a different mqtt topic and influx DB. Is there a way to have a live "production" gateway and a "dev" one at the same time without that happening? both gateways seem to use node_id 0 and setting it differently doesn't seem to work

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

      @SylvainMartin use a different radio channel for the two networks. Define MY_RF24_CHANNEL.

      Documentation: https://www.mysensors.org/apidocs/group__RF24SettingGrpPub.html#gafb356a7718f74a37f2081fb636dfacd2

      S 1 Reply Last reply
      2
      • mfalkviddM mfalkvidd

        @SylvainMartin use a different radio channel for the two networks. Define MY_RF24_CHANNEL.

        Documentation: https://www.mysensors.org/apidocs/group__RF24SettingGrpPub.html#gafb356a7718f74a37f2081fb636dfacd2

        S Offline
        S Offline
        SylvainMartin
        wrote on last edited by
        #3

        @mfalkvidd Thanks for the tip! Worked perfectly

        mfalkviddM skywatchS 2 Replies Last reply
        1
        • S SylvainMartin

          @mfalkvidd Thanks for the tip! Worked perfectly

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

          Nice work @SylvainMartin, thanks for reporting back.

          1 Reply Last reply
          0
          • S SylvainMartin

            @mfalkvidd Thanks for the tip! Worked perfectly

            skywatchS Offline
            skywatchS Offline
            skywatch
            wrote on last edited by skywatch
            #5

            @SylvainMartin I have been doing this recently, splitting security sensors on one channel and other sensors/actuators on a different one.

            It worked OK to start with but then I had issues. It may be to do with the way each individual controller handles things, but I am currently testing with adding

            #define MY_NODE_ID xxx   //where xxx is a node id not in use by any other nodes on any gateway/channel.
            

            on the second gateway, just to eliminate issues. So far the problems have gone away and I have not had a single reboot fail either. It might be worth trying if you run into problems.

            Also worth pointing out to those who might try this is that you can't have the same node id on different gateways. If gateway 1 has a node 12 registered to it then you can't have another node 12 on gateway 2 as this also seems to mess things up!

            mfalkviddM 1 Reply Last reply
            0
            • skywatchS skywatch

              @SylvainMartin I have been doing this recently, splitting security sensors on one channel and other sensors/actuators on a different one.

              It worked OK to start with but then I had issues. It may be to do with the way each individual controller handles things, but I am currently testing with adding

              #define MY_NODE_ID xxx   //where xxx is a node id not in use by any other nodes on any gateway/channel.
              

              on the second gateway, just to eliminate issues. So far the problems have gone away and I have not had a single reboot fail either. It might be worth trying if you run into problems.

              Also worth pointing out to those who might try this is that you can't have the same node id on different gateways. If gateway 1 has a node 12 registered to it then you can't have another node 12 on gateway 2 as this also seems to mess things up!

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

              @skywatch a MySensors gateway will always have node id 0. That cannot be changed.

              It is definitely possible to reuse the same node id on different MySensors networks. It could be that your controller has problems, but I know Domoticz supports multiple networks without problems.

              skywatchS 1 Reply Last reply
              1
              • mfalkviddM mfalkvidd

                @skywatch a MySensors gateway will always have node id 0. That cannot be changed.

                It is definitely possible to reuse the same node id on different MySensors networks. It could be that your controller has problems, but I know Domoticz supports multiple networks without problems.

                skywatchS Offline
                skywatchS Offline
                skywatch
                wrote on last edited by
                #7

                @mfalkvidd said in how to have 2 gateways?:

                @skywatch a MySensors gateway will always have node id 0. That cannot be changed.

                So how does the controller differentiate between which gateway, or does it not need to? This bit has been bugging me for a while now and might explain one last oddity (but not one that causes any issues). In mycontroller I see a 'node 0' in the nodes list and this is the first gateway in the list, but the second one doesn't show due to it also being node 0 and there can only be one node with a given EUI in the listing it seems.

                Still learning after all these years!

                It is definitely possible to reuse the same node id on different MySensors networks. It could be that your controller has problems, but I know Domoticz supports multiple networks without problems.

                OK, so I will try again with this one day and see if it was just me having a bad day (not that uncommon sadly).

                mfalkviddM 1 Reply Last reply
                0
                • skywatchS skywatch

                  @mfalkvidd said in how to have 2 gateways?:

                  @skywatch a MySensors gateway will always have node id 0. That cannot be changed.

                  So how does the controller differentiate between which gateway, or does it not need to? This bit has been bugging me for a while now and might explain one last oddity (but not one that causes any issues). In mycontroller I see a 'node 0' in the nodes list and this is the first gateway in the list, but the second one doesn't show due to it also being node 0 and there can only be one node with a given EUI in the listing it seems.

                  Still learning after all these years!

                  It is definitely possible to reuse the same node id on different MySensors networks. It could be that your controller has problems, but I know Domoticz supports multiple networks without problems.

                  OK, so I will try again with this one day and see if it was just me having a bad day (not that uncommon sadly).

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

                  @skywatch I don't have any experience with MyController unfortunately. In Domoticz, each gateway is added as a separate entity, with a separate name, and all nodes on that network are associated with their gateway entity.

                  Each gateway has a different USB port, ip address, tcp port, mqtt topic prefix or something else that will uniquely identify it to the controller.

                  skywatchS 1 Reply Last reply
                  1
                  • mfalkviddM mfalkvidd

                    @skywatch I don't have any experience with MyController unfortunately. In Domoticz, each gateway is added as a separate entity, with a separate name, and all nodes on that network are associated with their gateway entity.

                    Each gateway has a different USB port, ip address, tcp port, mqtt topic prefix or something else that will uniquely identify it to the controller.

                    skywatchS Offline
                    skywatchS Offline
                    skywatch
                    wrote on last edited by
                    #9

                    @mfalkvidd Thank you - I will ask on the mycontroller forum about this as it is something I can't find info on and it puzzles me a bit!

                    When I add #define MY_NODE_ID to a gateway sketch what happens? Does it get ignored by the compiler or is it overruled by the MS library?

                    mfalkviddM BearWithBeardB 2 Replies Last reply
                    0
                    • skywatchS skywatch

                      @mfalkvidd Thank you - I will ask on the mycontroller forum about this as it is something I can't find info on and it puzzles me a bit!

                      When I add #define MY_NODE_ID to a gateway sketch what happens? Does it get ignored by the compiler or is it overruled by the MS library?

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

                      @skywatch quickest way to find out is to try. I think there will be an error printed on debug when the gateway starts up.

                      skywatchS 1 Reply Last reply
                      0
                      • mfalkviddM mfalkvidd

                        @skywatch quickest way to find out is to try. I think there will be an error printed on debug when the gateway starts up.

                        skywatchS Offline
                        skywatchS Offline
                        skywatch
                        wrote on last edited by skywatch
                        #11

                        @mfalkvidd said in how to have 2 gateways?:

                        @skywatch quickest way to find out is to try. I think there will be an error printed on debug when the gateway starts up.

                        I have been trying it for days now. The gateway compiles and works in as far as it connects to the controller. It is not passing traffic from nodes, but then all nodes are looking for parent id 0 and not parent is 200 (which is what I used).

                        Maybe today I will reflash a node for parent 200 and see if it works, so far I think it will! ;)

                        1 Reply Last reply
                        0
                        • skywatchS skywatch

                          @mfalkvidd Thank you - I will ask on the mycontroller forum about this as it is something I can't find info on and it puzzles me a bit!

                          When I add #define MY_NODE_ID to a gateway sketch what happens? Does it get ignored by the compiler or is it overruled by the MS library?

                          BearWithBeardB Offline
                          BearWithBeardB Offline
                          BearWithBeard
                          wrote on last edited by
                          #12

                          @skywatch

                          When I add #define MY_NODE_ID to a gateway sketch what happens? Does it get ignored by the compiler or is it overruled by the MS library?

                          I assigned 99 to a GW and it seems to ignore it.

                          Serial output:

                          73 TSM:INIT:TSP OK
                          75 TSM:INIT:GW MODE
                          77 TSM:READY:ID=0,PAR=0,DIS=0
                          

                          MQTT:

                          mytest-out/0/255/0/0/18-2.4.0-alpha
                          mytest-out/0/255/3/0/11-ESP dualRF Gateway
                          mytest-out/0/255/3/0/12-1.0
                          

                          Also, I have currently 3 separate MQTT gateways configured in HA. All my nodes use static IDs and some IDs are used in multiple networks. As far as I can tell, messages in both directions are always directed to the right GW. At least I didn't notice anything go wrong so far.

                          skywatchS 1 Reply Last reply
                          2
                          • BearWithBeardB BearWithBeard

                            @skywatch

                            When I add #define MY_NODE_ID to a gateway sketch what happens? Does it get ignored by the compiler or is it overruled by the MS library?

                            I assigned 99 to a GW and it seems to ignore it.

                            Serial output:

                            73 TSM:INIT:TSP OK
                            75 TSM:INIT:GW MODE
                            77 TSM:READY:ID=0,PAR=0,DIS=0
                            

                            MQTT:

                            mytest-out/0/255/0/0/18-2.4.0-alpha
                            mytest-out/0/255/3/0/11-ESP dualRF Gateway
                            mytest-out/0/255/3/0/12-1.0
                            

                            Also, I have currently 3 separate MQTT gateways configured in HA. All my nodes use static IDs and some IDs are used in multiple networks. As far as I can tell, messages in both directions are always directed to the right GW. At least I didn't notice anything go wrong so far.

                            skywatchS Offline
                            skywatchS Offline
                            skywatch
                            wrote on last edited by
                            #13

                            @BearWithBeard thanks - that is useful to know. I will try again with this soon, but today is another project! ;)

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


                            18

                            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