Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store current state of state machine in EEPROM and on next boot initalize state machine with that state #28

Open
jmozmoz opened this issue Jun 20, 2018 · 1 comment

Comments

@jmozmoz
Copy link

jmozmoz commented Jun 20, 2018

This is a question/feature request:
Store current state of state machine in EEPROM and on next boot initalize state machine with that state.

I guess these sub-issues had to be solved for this to work:

  • get the current state of the state machine (the pull request added ESP, removed unneeded file #24 implements this).
  • either serialize the current state object or create a unique identifier of it and store this in EEPROM/flash. Again pull request added ESP, removed unneeded file #24 adds names for states which could be used as identifiers; but currently these names are not guaranteed to be unique.
  • after reboot: create state objects in a way that one of the newly created ones can be identified as the stored one (or detect incompatible state).
  • if state from EEPROM is valid, initialize state machine with that state.

This would be useful if deep sleep is used to save battery/energy.

@LennartHennigs
Copy link
Collaborator

Hey @jmozmoz,
to catch up on your question (better late then never), I added unique IDs to the states in my branch:
https://github.com/LennartHennigs/arduino-fsm

This now allows to store the state in the EEPROM of the ESP32.
I'll take a look at this and add another commit.

Cheers.
l.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants