I'm having trouble removing the previous instance of the Wifi connection when I call the save() function. (see attached image)
I have a function setConfig(options) where I set variables like the Wifi SSID, password, device name, etc, and I'd like to be able to save these variables to the flash memory on the fly. This function has a save() function at the end which calls onInit() again. I noticed that the previous Wifi connection reconnects on top of the new Wifi connection. I tried explicitly disconnecting it and setting the wifi variable to null, but it still does the same thing.
Is there anything I can do to remove the previous instance? Or is this normal and I shouldn't be worried about it?
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,
I'm having trouble removing the previous instance of the Wifi connection when I call the
save()
function. (see attached image)I have a function
setConfig(options)
where I set variables like the Wifi SSID, password, device name, etc, and I'd like to be able to save these variables to the flash memory on the fly. This function has asave()
function at the end which callsonInit()
again. I noticed that the previous Wifi connection reconnects on top of the new Wifi connection. I tried explicitly disconnecting it and setting thewifi
variable to null, but it still does the same thing.Is there anything I can do to remove the previous instance? Or is this normal and I shouldn't be worried about it?
1 Attachment