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

NVS: boot/splash resets upon crash #227

Open
sebastius opened this issue Aug 17, 2017 · 1 comment
Open

NVS: boot/splash resets upon crash #227

sebastius opened this issue Aug 17, 2017 · 1 comment

Comments

@sebastius
Copy link
Member

sebastius commented Aug 17, 2017

I want to autoload an app (wiki_infotag) so i set:

badge.nvs_set_str('boot', 'splash', 'wiki_infotag')

Whenever the app crashes the NVS apparently clears too. That is part of the boot.py behavior:

if splash == badge.nvs_get_str('boot', 'splash', 'splash') and splash != 'splash': badge.nvs_erase_key('boot', 'splash')

Any advice on how to cope with this? Do we still need this auto-reset function since we have safe-mode?

An ugly work-around would be to add in a service to the app that adds this NVS string and reboots the system. I'd really like to avoid such hackery ;)

@sebastius
Copy link
Member Author

sebastius commented Aug 17, 2017

I did the ugly work-around which i'd have liked to avoid:

Service.py
`
def setup():

import machine, badge, easydraw

easydraw.msg("Hacking myself")

badge.nvs_set_str('boot', 'splash', 'wiki_infotag')

easydraw.msg("Hacking done!")

machine.deepsleep(1)`

and

Service.json
{"apiVersion":2, "wifi": {"setup":false, "loop":false}, "rtc": false, "loop": false, "draw": false}

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

1 participant