Unload/Load EEPROM
-
Hi,
Wouldn't it be useful to have a "Unload EEPROM" sketch to print the values in a readable manner and similar "Load EEPROM" where you can configure values to be written to EEPROM?
Sample scenario
If I have a Arduino sensor chip (let say a Nano) in use and I want to replace that with another (assume Pro Mini) but I don't want to have the device created again (in Vera).Another scenario could be if the node failed (e.g. stroke of lightning) but you have the EEPROM value to load.
-
Hi @jocke4u - Im assuming the only real data you need to retain is the allocated NodeID?? as the routing data will be rebuilt anyway.
If so did you know you can specify the NODE id to use when you upload the sketch?
Say you want to specify the NODE id as 69 - You can do this by
gw.begin(NULL, 69, true);
or gw.begin(incomingMessage, 69, true);by default it uses AUTO
http://www.mysensors.org/build/sensor_api#create-repeating-nodes
What im not sure of though is if you do specify in the sketch the NodeId - does MySensors then write that value to eeprom? ( and thus the sketch can be reverted back to AUTO for subsequent updates) ????
HTH.
You could of course dump out the values of the eeprom
http://arduino.cc/en/Tutorial/EEPROMReadand if you really want to, write these values back....
-
@gregl said:
What im not sure of though is if you do specify in the sketch the NodeId - does MySensors then write that value to eeprom? ( and thus the sketch can be reverted back to AUTO for subsequent updates) ?
No it does not write the static id to eeprom. You can safely revert to auto at a later stage.
-
Thanks for clarification. I will try it to see how it works.
-
@hek said:
No it does not write the static id to eeprom. You can safely revert to auto at a later stage.
I have now replaced two sensors (from Uno -> Pro Mini) and used the begin(NULL, MY_CHILD_ID) to set the same Node Id and works fine.
But I am not sure about what you wrote above.
So if this won't be written to the EEPROM and if I change back the sketch to AUTO, how can it know the Node Id?
-
@jocke4u said:
So if this won't be written to the EEPROM and if I change back the sketch to AUTO, how can it know the Node Id?
I doesn't. The node will try to fetch an id.
-
@hek said:
I doesn't. The node will try to fetch an id.
Ok, thanks so then "You can safely revert to auto at a later stage." won't work if you previously had a static Node ID
-
It won't work if you previously had AUTO enabled and have received an id. This id will be written to eeprom.
But If you always had a static id for a node this means no id has been written to eeprom and you can still go back to AUTO to fetch a new id.
For a node that HAS received an id and you want to receive a new id for some reason, you have to use the clear eeprom example which writes 0xFF to the id-position of eeprom again. This allows node to fetch a new fresh id from controller in AUTO mode.
-
@hek said:
It won't work if you previously had AUTO enabled and have received an id. This id will be written to eeprom.
But If you always had a static id for a node this means no id has been written to eeprom and you can still go back to AUTO to fetch a new id.
For a node that HAS received an id and you want to receive a new id for some reason, you have to use the clear eeprom example which writes 0xFF to the id-position of eeprom again. This allows node to fetch a new fresh id from controller in AUTO mode.
I always use nothing but static node-ids and I'm unable to re-include working nodes to my Vera without first erasing the eeprom. The sensors "new parent"-debug message isn't showed until after this either. Is this correct?
Suggested Topics
-
Arduino Celebrates 10 years (Malmö/Sweden)
Announcements • 29 Mar 2014, 17:08 • hek 29 Mar 2014, 17:08 -
Sending offset to node
Development • 31 Jan 2025, 00:59 • bsl88k 4 Feb 2025, 12:14 -
Saving last known good state, but not in EEPROM
Development • 30 Jan 2024, 18:46 • OldSurferDude 15 Jan 2025, 08:51 -
MYSController with MQTT Gateway (via Node Red)
Development • 11 Aug 2024, 22:35 • slt1 11 Aug 2024, 22:35 -
LAN8720A - will mysensors work with this module
Development • 13 Nov 2024, 17:06 • Marcin 15 Nov 2024, 10:59 -
MQTT-Help me understand about the MQTT Gateway.
Development • 14 days ago • dpcons 3 days ago