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. How to assign static node ID?

How to assign static node ID?

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

    Gday,

    I have the MQTT Client gateway running and the existing nodes are ok however a new motion sensor node I just built does not seem to be working.

    Could someone let me know how you set a static node ID.

    Regards,
    George

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

      gw.begin(NULL, 5) sets the node id to 5

      1 Reply Last reply
      1
      • G Offline
        G Offline
        George Whitehouse
        wrote on last edited by
        #3

        Ok thanks for that.

        Where should I put that code in the sketch?

        Cheers,

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

          Replace your current gw.begin

          1 Reply Last reply
          0
          • G Offline
            G Offline
            George Whitehouse
            wrote on last edited by
            #5

            I am looking at the development version of the MotionSensor sketch and can not seem to find a gw.begin

            Regards,
            George

            1 Reply Last reply
            0
            • sundberg84S Offline
              sundberg84S Offline
              sundberg84
              Hardware Contributor
              wrote on last edited by sundberg84
              #6

              Use #define MY_NODE_ID 10 (where 10 is your ID).
              Example: https://github.com/mysensors/Arduino/blob/7ee39509ebaf05900db0f4cf6af8eaad2b970d30/libraries/MySensors/examples/OregonSensorDecode/OregonSensorDecode.ino

              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

              G 1 Reply Last reply
              1
              • sundberg84S sundberg84

                Use #define MY_NODE_ID 10 (where 10 is your ID).
                Example: https://github.com/mysensors/Arduino/blob/7ee39509ebaf05900db0f4cf6af8eaad2b970d30/libraries/MySensors/examples/OregonSensorDecode/OregonSensorDecode.ino

                G Offline
                G Offline
                George Whitehouse
                wrote on last edited by
                #7

                @sundberg84 Fantastic thanks for that it worked perfectly.

                Cheers,
                George

                1 Reply Last reply
                0
                • GertSandersG Offline
                  GertSandersG Offline
                  GertSanders
                  Hardware Contributor
                  wrote on last edited by GertSanders
                  #8

                  Here are the defines I put in my sketches for the development library:

                  //#define MY_NODE_ID 1
                  //#define MY_PARENT_ID 0
                  
                  // Possible values for Arduino IDE: 9600, 19200, 38400, 57600, 74880, 115200, 230400, 250000
                  // The last three values are only possible if the mcu works at 16Mhz or more, not possible for 8MHz operation.
                  //#define MY_BAUD_RATE 57600
                  
                  //#define MY_RADIO_NRF24
                  //#define MY_RADIO_RFM69
                  
                  // Enable serial gateway
                  //#define MY_GATEWAY_SERIAL
                  
                  // Enabled repeater feature for this node
                  //#define MY_REPEATER_FEATURE
                  
                  // Flash leds on rx/tx/err
                  //#define MY_LEDS_BLINKING_FEATURE
                  // Set blinking period
                  //#define MY_DEFAULT_LED_BLINK_PERIOD 300
                  
                  // Enable inclusion mode
                  //#define MY_INCLUSION_MODE_FEATURE
                  // Enable Inclusion mode button on gateway
                  //#define MY_INCLUSION_BUTTON_FEATURE
                  // Set inclusion mode duration (in seconds)
                  //#define MY_INCLUSION_MODE_DURATION 60
                  // Digital pin used for inclusion mode button
                  //#define MY_INCLUSION_MODE_BUTTON_PIN  3
                  
                  //#define MY_DEFAULT_ERR_LED_PIN 5  // Error led pin
                  //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
                  //#define MY_DEFAULT_TX_LED_PIN  7  // the PCB, on board LED
                  
                  // possible values: RF24_PA_LOW (is default on gateway), RF24_PA_MED, RF24_PA_HIGH, RF24_PA_MAX (is default on nodes)
                  //#define MY_RF24_PA_LEVEL RF24_PA_HIGH
                  
                  // RF channel for the sensor net, 0-127. Channel 76 is the default in all library examples
                  //#define MY_RF24_CHANNEL     76
                  
                  //RF24_250KBPS for 250kbs (default), RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps
                  //#define MY_RF24_DATARATE      RF24_250KBPS
                  
                  
                  1 Reply Last reply
                  2
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  10

                  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