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. Modify Node ID?

Modify Node ID?

Scheduled Pinned Locked Moved Development
8 Posts 4 Posters 3.3k 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.
  • T Offline
    T Offline
    tcontrada
    wrote on last edited by
    #1

    Is there a way to modify the Node ID once a Node ID has been issues to a sensor node that was originally configured in AUTO Node ID mode?

    Thanks,
    Tony

    F 1 Reply Last reply
    0
    • T tcontrada

      Is there a way to modify the Node ID once a Node ID has been issues to a sensor node that was originally configured in AUTO Node ID mode?

      Thanks,
      Tony

      F Offline
      F Offline
      flopp
      wrote on last edited by
      #2

      @tcontrada
      I think only way is to clear eeprom and then use NODE number in gw.begin

      Eg. gw.begin(NULL, 12, true)

      1 Reply Last reply
      0
      • mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #3

        You can use this code to change the node ID without erasing the rest of the eeprom:

        #define MY_CORE_ONLY
        
        #include <MySensor.h>
        #define NEW_NODE_ID 42 // Change 42 to the new node ID you want
        
        void setup()
        {
          Serial.begin(MY_BAUD_RATE);
          Serial.print("Old node ID: ");
          Serial.println(hwReadConfig(EEPROM_NODE_ID_ADDRESS));
          Serial.println("Writing new ID");
          hwWriteConfig(EEPROM_NODE_ID_ADDRESS, NEW_NODE_ID);
          Serial.print("New node ID: ");
          Serial.println(hwReadConfig(EEPROM_NODE_ID_ADDRESS));
        }
        
        void loop()
        {
          // Nothing to do here...
        }
        

        The output will look like this:

        Old node ID: 69
        Writing new ID
        New node ID: 42
        

        I have tested this code with the MySensors development version only, but I think it should work on older versions as well.

        1 Reply Last reply
        1
        • T Offline
          T Offline
          tcontrada
          wrote on last edited by
          #4

          This looks good, thanks!

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jkandasa
            Plugin Developer
            wrote on last edited by
            #5

            @tcontrada and if you want to get new node id request, just write new node id as 255.

            1 Reply Last reply
            1
            • T Offline
              T Offline
              tcontrada
              wrote on last edited by
              #6

              I tried the short program above, but at compile time It got this error:
              'hwReadConfig' was not declared in this scope

              Any suggestions?

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jkandasa
                Plugin Developer
                wrote on last edited by
                #7

                @tcontrada I guess you are using 1.5 branch, If I am not wrong hwReadConfig and hwWriteConfig are not available in 1.5. Which is available in development branch(2.0 beta).

                My guess!! In 1.5 equivalent functions are hw_readConfig and hw_writeConfig

                1 Reply Last reply
                1
                • T Offline
                  T Offline
                  tcontrada
                  wrote on last edited by
                  #8

                  Yeah, I dug through the .h files and found the right spellings and got it to finally work...

                  Thanks...

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


                  13

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.0k

                  Posts


                  Copyright 2019 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