How to assign static node ID?
-
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
-
gw.begin(NULL, 5) sets the node id to 5
-
Ok thanks for that.
Where should I put that code in the sketch?
Cheers,
-
Replace your current gw.begin
-
I am looking at the development version of the MotionSensor sketch and can not seem to find a gw.begin
Regards,
George
-
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
-
@sundberg84 Fantastic thanks for that it worked perfectly.
Cheers,
George
-
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
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Sensebender Gateway (SAMD21)
Development • 25 Dec 2021, 23:02 • pikim 3 Jan 2024, 12:12 -
[mysensors] Not a valid message: invalid literal for int() with base 10: '\x00\x000'
Development • 18 Sept 2024, 20:34 • kiesel 20 Sept 2024, 08:28 -
Serial Gateway woes
Development • 3 Feb 2024, 20:31 • OldSurferDude 3 Feb 2024, 20:31 -
MQTT GW on ESP8266 supporting SSL/TLS?
Development • 4 Jun 2024, 10:21 • bgunnarb 27 Jun 2024, 13:53 -
MYSController with MQTT Gateway (via Node Red)
Development • 11 Aug 2024, 22:35 • slt1 11 Aug 2024, 22:35