After flashing new firmware to the ESP32, disabling Bluetooth, saving my wifi settings using the following:
var ssid = 'xxxx';
var pswd = 'xxxx';
var wifi = require('Wifi');
wifi.stopAP();
wifi.connect(ssid, {password: pswd},function(){
// console.log('Connected to Wifi. IP address is:', wifi.getIP().ip);
wifi.save(); // Next reboot will auto-connect
});
I get the following memory (after sending a ESP32.reboot):
And as long as my Wifi doesn't disconnect it seems to stay steady at 3981. Shortly after I shut off my WIFI, I get a few error messages and then my memory drops to 3963. It continues to drop each time it tries to reconnect. After a couple of minutes, I turned my WIFI back on. Just before I turned it on the free memory was down to 3895. After it finished reconnecting it dropped more, down to:
3859.
Then it stays steady ad 3859. If I wait a few more minutes and turn off my WIFI again it doesn't seem to catch the change in WIFI status. If I manually type in wifi.getStatus(), I get the following
For some reason my ssid is now deleted. Any idea why it does that? Maybe I'm shutting my WIFI off too quickly. If I turn my WIFI back on, it doesn't re-connect a second time. I'll set it to run overnight and see how much, if any memory loss I get if I don't manually shut off the WIFI.
On a S.W.AG. hunch, try console.log() the value of 'iwico' to see if the handle is changing. Wondering if the call to setInterval() is gobbling up those bytes?
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.
@Robin,
After flashing new firmware to the ESP32, disabling Bluetooth, saving my wifi settings using the following:
I get the following memory (after sending a ESP32.reboot):
I found that my board does run the event wifi.on('disconnected',function()), at least sometimes. So I am trying the following code:
After performing a ESP32.reboot, I get the following:
And as long as my Wifi doesn't disconnect it seems to stay steady at 3981. Shortly after I shut off my WIFI, I get a few error messages and then my memory drops to 3963. It continues to drop each time it tries to reconnect. After a couple of minutes, I turned my WIFI back on. Just before I turned it on the free memory was down to 3895. After it finished reconnecting it dropped more, down to:
3859.
Then it stays steady ad 3859. If I wait a few more minutes and turn off my WIFI again it doesn't seem to catch the change in WIFI status. If I manually type in wifi.getStatus(), I get the following
For some reason my ssid is now deleted. Any idea why it does that? Maybe I'm shutting my WIFI off too quickly. If I turn my WIFI back on, it doesn't re-connect a second time. I'll set it to run overnight and see how much, if any memory loss I get if I don't manually shut off the WIFI.