Static IDs
-
A static ID is not saved in eeprom. As a consequence, OTA bootloader will request new ID for bootloading, until the sketch takes over with the static ID.
Resolution in MySensors.cpp / MySensor::begin procedure
if ( (_nodeId != AUTO) && (nc.nodeId != _nodeId) ) { // Set static id nc.nodeId = _nodeId; // Save static id in eeprom eeprom_write_byte((uint8_t*)EEPROM_NODE_ID_ADDRESS, _nodeId); } -
Same for static parent node id in MySensors.cpp / MySensor::begin procedure:
Resolution:
if ( (_parentNodeId != AUTO) && (nc.parentNodeId != _parentNodeId) ) { // Set static parent id nc.parentNodeId = _parentNodeId; // Save static parent id in eeprom eeprom_write_byte((uint8_t*)EEPROM_PARENT_NODE_ID_ADDRESS, _parentNodeId); autoFindParent = false; } else { autoFindParent = true; }A general thought: If the parent node is not static (there are a few cases where static parent nodes make sense), it would be better to re-discover the closest node/repeater during each startup. This concept makes also more sense for OTA bootloading - you do not want to have an assigned parent node that is eventually down...
-
Agree, but I think the bootloader code size must be kept to a bare minimum (I didn't write that part).
-
@hek the findParentNode() part is already part of the initial OTA bootloader and only takes a few lines.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login