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. Development
  3. Gateway to hands out node ID's

Gateway to hands out node ID's

Scheduled Pinned Locked Moved Development
11 Posts 4 Posters 2.7k 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.
  • tbowmoT Offline
    tbowmoT Offline
    tbowmo
    Admin
    wrote on last edited by
    #2

    This is not implemented in the gateway code, as it's "always" been the job of the attached controller.

    M 1 Reply Last reply
    0
    • tbowmoT tbowmo

      This is not implemented in the gateway code, as it's "always" been the job of the attached controller.

      M Offline
      M Offline
      Mickey
      wrote on last edited by
      #3

      @tbowmo said:

      This is not implemented in the gateway code, as it's "always" been the job of the attached controller.

      I know it's "always" been the job of the attached controller but I have a scenario that the mqtt gateway will send directly to a cloud broker and an app that will receive it without any controller on the way. one problem I facing is the nodes id handing...so my question is if I would like to implement this in the GatewayESP8266MQTTClient.ino file is it possible?(check for incoming id request and 255 id number and saving current id handed in gateway eeprom etc...)

      sundberg84S 1 Reply Last reply
      0
      • M Mickey

        @tbowmo said:

        This is not implemented in the gateway code, as it's "always" been the job of the attached controller.

        I know it's "always" been the job of the attached controller but I have a scenario that the mqtt gateway will send directly to a cloud broker and an app that will receive it without any controller on the way. one problem I facing is the nodes id handing...so my question is if I would like to implement this in the GatewayESP8266MQTTClient.ino file is it possible?(check for incoming id request and 255 id number and saving current id handed in gateway eeprom etc...)

        sundberg84S Offline
        sundberg84S Offline
        sundberg84
        Hardware Contributor
        wrote on last edited by
        #4

        @Mickey - What happens if you fix a static node-id for each node?

        Controller: Proxmox VM - Home Assistant
        MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
        MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
        RFLink GW - Arduino Mega + RFLink Shield, 433mhz

        M 1 Reply Last reply
        0
        • sundberg84S sundberg84

          @Mickey - What happens if you fix a static node-id for each node?

          M Offline
          M Offline
          Mickey
          wrote on last edited by
          #5

          @sundberg84 it's need to be automatic. Fix id is easy to implement but because there will be an unknown number of nodes than I cannot use fix id's...

          1 Reply Last reply
          0
          • hekH Offline
            hekH Offline
            hek
            Admin
            wrote on last edited by
            #6

            Internal messages does not get exposed in the receive() function of the sketch.

            To archive this you would have to modify the core somewhere here:
            https://github.com/mysensors/MySensors/blob/development/core/MyTransport.cpp#L706

            M 1 Reply Last reply
            0
            • hekH hek

              Internal messages does not get exposed in the receive() function of the sketch.

              To archive this you would have to modify the core somewhere here:
              https://github.com/mysensors/MySensors/blob/development/core/MyTransport.cpp#L706

              M Offline
              M Offline
              Mickey
              wrote on last edited by
              #7

              @hek said:

              Internal messages does not get exposed in the receive() function of the sketch.

              To archive this you would have to modify the core somewhere here:
              https://github.com/mysensors/MySensors/blob/development/core/MyTransport.cpp#L706

              Thanks for answer.
              I tried to figure where I change the internal msg type to be exposed to GW in the MyTransport.cpp around line 706 but can't seems to find it...

              1 Reply Last reply
              0
              • hekH Offline
                hekH Offline
                hek
                Admin
                wrote on last edited by
                #8

                Why pass it to the sketch? You could implement the id-handout directly in core (I pointed out the area where internal messages directed to the node is processed).

                M 1 Reply Last reply
                0
                • hekH hek

                  Why pass it to the sketch? You could implement the id-handout directly in core (I pointed out the area where internal messages directed to the node is processed).

                  M Offline
                  M Offline
                  Mickey
                  wrote on last edited by
                  #9

                  @hek said:

                  Why pass it to the sketch? You could implement the id-handout directly in core (I pointed out the area where internal messages directed to the node is processed).

                  To mess with core as little as I could so it can be easy upgradable in future (I already altered the MyGatewayTransportMQTTClient.cpp to support using dynamic connection parameters instead hard coded , I don't want to alter a lot of core files but if it necessary I will...)

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    Mickey
                    wrote on last edited by Mickey
                    #10

                    So I went and change the MyTransport.cpp file and added a few lines around line 740:

                    		uint8_t currentID;
                    		#if defined(MY_GATEWAY_FEATURE)
                    			if (type == I_ID_REQUEST) {
                    				currentID = hwReadConfig(0X123); //Read first byte of free conf eeprom space
                    				if(currentID==0xFF)//check to see if it was never changed (255)...
                    				{currentID = 1;}
                    				_msg.set(currentID);
                    				if(transportSendWrite(0xFF,_msg))
                    				{
                    				hwWriteConfig(0X123,currentID+1)
                    				}
                    			}
                    			else
                    			// Hand over message to controller
                    

                    But the sensor still requesting an ID without getting it...

                    1 Reply Last reply
                    0
                    • hekH Offline
                      hekH Offline
                      hek
                      Admin
                      wrote on last edited by
                      #11

                      You can see at how incoming PING requests sends a message back to the requesting node.

                      So... something like this:

                      (void)transportRouteMessage(build(_msgTmp, sender, NODE_SENSOR_ID, C_INTERNAL,
                      					                                  I_ID_RESPONSE).set(currentID));
                      
                      1 Reply Last reply
                      1
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      21

                      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