I'm trying to connect to wifi after deep sleep wakeup on ESP32. The initial run work, but after wake from deep sleep the code wifi.connect is not executed. It does not fall into error or success branch.
I would like to ask how to do it in the right way:
Firmware version:
espruino_2v03_esp32
device is connected throught the USB cable
var WIFI_NAME = "";
var WIFI_OPTIONS = { password : "" };
var wifi = require("Wifi");
function connectToWifi(){
console.log("connectToWifi");
wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
if (err) {
console.log("Connection error: "+err);
return;
} else {
console.log("Connected!");
getPage();
}
console.log("End");
});
};
function getPage() {
require("http").get("http://www.pur3.co.uk/hello.txt", function(res) {
console.log("Response: ",res);
res.on('data', function(d) {
console.log("--->"+d);
});
});
}
setInterval(function() {
connectToWifi();
}, 10000);
setDeepSleep(1);
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,
I'm trying to connect to wifi after deep sleep wakeup on ESP32. The initial run work, but after wake from deep sleep the code wifi.connect is not executed. It does not fall into error or success branch.
I would like to ask how to do it in the right way:
Firmware version:
espruino_2v03_esp32
device is connected throught the USB cable