Hard-coding Node IDs vs. Using Controller-Assigned



  • Long story short: I'm setting up about 9+ PID sensors, 5+ temperature sensors, and 8+ door/window sensors, plus other stuff. I'm using the ethernet gateway and Domoticz.

    It seems that when a sensor goes offline, Domoticz will re-use that node ID. That's fine, until I change the battery or bring a new node online and get the old ID, etc. Do most people hard-code the node ID in the EPROM, or have the gateway assign the node ID?

    Also, MYSController seems pretty good from a troubleshooting standpoint. Any issue running that on the 'production' system, with MYSController bootloader, etc?


  • Hardware Contributor

    Hi @David-Noren

    I use ethernet gw and Domoticz but with hardcoded IDs. It works great.
    I have not tried letting domoticz assigns IDs so i dont know how that works...

    Good luck with your project!



  • Good to know. Do you just write the ID to the EPROM using a sketch that allows that and then write the node sketch to the Arduino, or do you assign the ID in the actual node sketch, or do you use MSYController?

    Just trying to figure out the best/easiest way. 🙂

    Thanks for the input!


  • Hardware Contributor

    I declare it in the scetch.
    This example has hard coded to 5 and act as a repeater node.

    #define NodeID 5
    
    gw.begin(NULL, NodeID, true);
    
    //incomingMessageCallback - Callback function for incoming messages from other nodes or controller and request responses. Default is NULL.
    //nodeId - The unique id (1-254) for this sensor. Default is AUTO(255) which means sensor tries to fetch an id from controller.
    //repeaterMode - Activate repeater mode. This node will forward messages to other nodes in the radio network. Make sure to call process() regularly. Default in false
    
    

    and that is all you need to do.
    an



  • @sundberg84 I'm looking to hard coded as well. To much problems with automatic created nodes. Especially when testing with the same Arduino Nano. Full of fail when reconnect an node with other sketch and eeprom_clear does not solve that problem. 'Still using after all these years'? Thanks anyway for the hint!!


  • Hardware Contributor

    @hj_sk - yes, I always set ID in each node.


Log in to reply
 

Suggested Topics

  • 2
  • 48
  • 6
  • 75
  • 5
  • 17

10
Online

11.2k
Users

11.1k
Topics

112.5k
Posts