Please, could anyone help to solve implementation problem?!
I'm making a thing which I want to take sometimes to another place. As a result, I have two different wifi's(one at home, one at an office), and want to check which is present and connect to one of them. Wifi.scan doesn't work on my ESP8266 (NodeMCU Amica), so I tried 'if' statement. But can't write it correctly.
How is better to solve such task, maybe some of you have faced with it already.
Thanks!!!
var ssid2 = "WIFI2";
var password2 = { password : "PASS2"};
var ssid = "WIFI1";
var password = { password : "PASS1"};
var wifi;
wifi = require("Wifi");
wifi.connect(ssid, password, function(err) {
if (err){
console.log("Connection error: " + err);
wifi.connect(ssid2, password2, function(err)){
if (err){
console.log("Connection error: " + err);
return;
}
console.log("Connected! WIFI2");
}
console.log("Connected! WIFI1");
});
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,
Please, could anyone help to solve implementation problem?!
I'm making a thing which I want to take sometimes to another place. As a result, I have two different wifi's(one at home, one at an office), and want to check which is present and connect to one of them. Wifi.scan doesn't work on my ESP8266 (NodeMCU Amica), so I tried 'if' statement. But can't write it correctly.
How is better to solve such task, maybe some of you have faced with it already.
Thanks!!!