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.


  • Hero Member

    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/EEPROMRead

    and if you really want to, write these values back....


  • Admin

    @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?


  • Admin

    @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


  • Admin

    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.


  • Hardware Contributor

    @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?


Log in to reply
 

Suggested Topics

49
Online

11.4k
Users

11.1k
Topics

112.6k
Posts