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?