-
Fri 2020.01.17
'if power if removed long enough, it will start without errors on the next boot'
'Why should the device act differently immediately after a 'save()''Has reading over the following answered your concern?
http://www.espruino.com/Saving
Quick Start Best Practices - Proper way to call init() on start up
Short answer, the onInit() function does not execute when just uploading.re: 'it will start without errors on the next boot'
This would be expected, as after executing save(), the same onInit() function will execute on power up.
I've got an Espruino Wifi updated to 2v04.
I am having trouble when trying to start an AP, AND connect to mqtt AND creating an http server.
The error:
Here's my onInit():
And this is apparently the offending chunk of code:
But, to make things even more interesting, this DOES NOT happen immediately following a 'save()' command. Sometimes if power if removed long enough, it will start without errors on the next boot, but even this has no rhyme or reason. Why should the device act differently immediately after a 'save()' and why does this behavior seem so non-deterministic? Thoughts?