Assign sensor ID so it never changes



  • Hi all

    At the moment, whenever I test a sensor I add it to my controller (Vera) and if it doesn't work correctly I delete all the sensors, clear my sensor using the wipe sketch and then upload the corrected sketch again. Turn obviously my controller is populated with the new sensors.

    Is there a way so I don't have to delete the sensors in my controller and for the newly uploaded sketch be associated with the previous sensors in my controller? Should I not bother wiping the Arduino and would that mean that the new sketch would be applied to the existing sensors in my controller? Or is there a better way?

    Thanks in advance!



  • If you want to force the ID for the Sensor node you can add

    #define MY_NODE_ID 200
    

    before

    #include <MySensors.h>
    

    This will overwrite the Node ID in the Arduino EEPROM. If the Unit is powered up and connected to the Gateway you can remove the define. The ID should now be stored in the EEPROM.



  • @hermann-kaiser

    Thank you


 

240
Online

8.7k
Users

9.5k
Topics

99.9k
Posts