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); }
-
Thanks, will be added.
-
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.
-
Haha.. ok. I see. someone should probably take care of the bootloader code while @ToSa is busy..