Just connecting to the AP, and then saving Wifi credentials with Wifi.save() was the best for me.
Wifi tries to reconnect if disconnected from the AP without any explicit code. Connect and reconnect sometimes completes quickly, sometimes it takes longer. And this can mess if you have timed reconnects.
The status can be for example connecting, if the function runs just after a random disconnect, while the ESP is still trying to connect. Calling Wifi.connect() while connecting caused all kinds of strange behaviour for me.
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.
Hi!
Just connecting to the AP, and then saving Wifi credentials with Wifi.save() was the best for me.
Wifi tries to reconnect if disconnected from the AP without any explicit code. Connect and reconnect sometimes completes quickly, sometimes it takes longer. And this can mess if you have timed reconnects.
Also, in the function
The status can be for example
connecting
, if the function runs just after a random disconnect, while the ESP is still trying to connect. CallingWifi.connect()
while connecting caused all kinds of strange behaviour for me.