javascript - espruino: wifi on connect event not fired -


i need notified when esp8266 connected wifi network. i'm listening connected event in wifi module. callback function never called.

the code:

var wifi = require("wifi");  wifi.on('connected', function(details) {    console.log('connected wifi', details); });  wifi.connect("*****", {password:"****"}, function(err){     console.log("connected? err=", err, "info=", wifi.getip()); }); 

the output:

> =undefined connected? err= null info= {   "ip": "192.168.1.105",   "netmask": "255.255.255.0",   "gw": "192.168.1.1",   "mac": "5c:**:7f:**:7a:**"  } 

the event not fired because esp8266 connected wifi network. when setup connection can save settings in order espruino reconnect wifi automatically @ boot time.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -