EEPROM values behaving strangely in RelayActuator example



  • My opinion is to clear the EEPROM before calling gw.loadstate(). in the example. while testing if there is a value previously written in some address it gives inconsistent output. Clearing the value in setup should be done before saving any state.



  • I Have made the necessary changes in the code and have send a pull request. If that helps the admin can merge else this topic and pull request can be closed


  • Admin

    You have the ClearEepromConfig in examples folder for this. I pretty sure you wouldn't want to have this in RelayActuator-example.



  • I am testing that example as of now, so added that there. Ideally the EEPROM should be cleared before writing new code to the board to prevent it from reading redundant state which was saved in the microcontroller earlier for some other code. we can move this to the main code so that it is included globally. I added it there so that someone else using that example doesn't get strange values and spend hours trying to decode the library.


  • Contest Winner

    But what will happen with the NodeID and the signing preferences then? If EEPROM is cleared if you update your gateway you have to restart all nodes using signing so the gateway gets updated then.
    If you do it in a node, the gateway will assign it a new nodeId and that in turn messes up for the controller. I do not think wiping all EEPROM config on reprogramming is a good ide. The purpose of the EEPROM config is exactly to preserve certain parameters on power cycle/reprogramming.


Log in to reply
 

Suggested Topics

  • 33
  • 17
  • 2
  • 5
  • 5
  • 2

5
Online

11.4k
Users

11.1k
Topics

112.7k
Posts