Hello there,
I have written a piece of code that fetches base64 encoded images from the web and displays on a 128x64 OLED (Web2OLED)
And following is the piece of code:
I upload this to the board and save it (using save()).
Now I am under the assumption that the code inside onInit is only executed once (and not looped).
The weird thing that's happening is that when I turn off/on my WiFi router(after the NodeMCU is connected to the WiFi), it automatically tries to reconnect to the WiFi.
But you can see above that nowhere there is a loop that checks for WiFi disconnect event. The setTimeout will only work as long as it is switched on for the first time and is not able to connect to the WiFi.
After it has connected to the WiFi the control should not go to the if block where setTimeout is called.
Please help me understand this (I am a newbie to Espruino, please let me know if I have missed out something very trivial 😊)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hello there,
I have written a piece of code that fetches base64 encoded images from the web and displays on a 128x64 OLED (Web2OLED)
And following is the piece of code:
I upload this to the board and save it (using save()).
Now I am under the assumption that the code inside onInit is only executed once (and not looped).
The weird thing that's happening is that when I turn off/on my WiFi router(after the NodeMCU is connected to the WiFi), it automatically tries to reconnect to the WiFi.
But you can see above that nowhere there is a loop that checks for WiFi disconnect event. The setTimeout will only work as long as it is switched on for the first time and is not able to connect to the WiFi.
After it has connected to the WiFi the control should not go to the if block where setTimeout is called.
Please help me understand this (I am a newbie to Espruino, please let me know if I have missed out something very trivial 😊)
Thanks