Probably another of my edge cases, but if I have an Interval set in my code of about 100ms or so, and then try to upload new code to my Espruino WiFi I can quite often get the Espruino and the IDE stuck, the upload progress bar is about 1/16th in, the Espruino is otherwise unresponsive and I have to unplug and replug.
However if I connect, run reset() and then upload new code, everything works.
Could the code upload function run reset() by itself? Or otherwise interrupt the running program before it tries to upload?
Huh, just found this but its already ticked.
That's strange - and you running with Save on send turned on, or off (the default)?
Save on send
The IDE actually does run a reset() before upload - unless it's been turned off? Try checking settings -> communications -> reset before send. If that's off it could cause all kinds of problems!
settings -> communications -> reset before send
I guess perhaps the code you've uploaded has functions that take a long time to execute... Espruino usually gives it ~250ms to reset, but if your function runs for a full second before leaving then it's possible the Wifi board won't have reset by the time code starts getting uploaded.
The IDE also tries to send Ctrl-C if it's not getting a response, which should help to break out of whatever is running... You could try doing that manually and seeing if it helps after the board has become unresponsive
Beat me to it! You can check in the 'console' menu item as well, and you should hopefully see it mentions reset() being sent.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem