The Wifi module builtin since 1.96 (many thanks, Gordon) connects as expected.
However, it seems to do an extra callback when it connects.
The code below is supposed to pulse the green LED on success and the red one on wifi timeout.
On connect both LEDs go on, at the same time.
var addr=null;
function cbwi(err) {
if (err) {
digitalPulse(LED1, 1, 1000);
cowi();
} else {
digitalPulse(LED2, 1, 1000);
wifi.getIP(function(a) {addr=a;});
net.createServer((conn) => {
conn.on('close', USB.setConsole);
conn.pipe(LoopbackA);
LoopbackA.pipe(conn);
LoopbackB.setConsole();
}).listen(23);
}
}
function cowi() {
wifi.connect('HXNET1',{password:'xxx'}, function(err) {cbwi(err)});
}
cowi();
While the connection definitely succeeds (ping replies are sent), the value of the variable addr is 'Timeout'. And the telnet server doesn't get startet.
What's going on here?
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.
The Wifi module builtin since 1.96 (many thanks, Gordon) connects as expected.
However, it seems to do an extra callback when it connects.
The code below is supposed to pulse the green LED on success and the red one on wifi timeout.
On connect both LEDs go on, at the same time.
While the connection definitely succeeds (ping replies are sent), the value of the variable addr is 'Timeout'. And the telnet server doesn't get startet.
What's going on here?