I'm not sure what is so secret about your code that you don't want to post it?
You can * out the passwords.
You have code that is using wifi.connect - however you are using wifi.save as well....
The wifi.save saves the current connection and on next restart -automatically connects. This is useful for telnet to the device..
So you don't need wifi.save in your main code.
The way it it working at the moment is
restart device
it auto connects to the wifi
then you connect to wifi when the connection is already done.
Perhaps this is why the wifi.disconnect case works.
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.
I'm not sure what is so secret about your code that you don't want to post it?
You can * out the passwords.
You have code that is using wifi.connect - however you are using wifi.save as well....
The wifi.save saves the current connection and on next restart -automatically connects. This is useful for telnet to the device..
So you don't need wifi.save in your main code.
The way it it working at the moment is
Perhaps this is why the wifi.disconnect case works.