In case it doesn't work it writes 'WiFi connect failed: FAIL'.
Actually, the line conn.on('close',function() {USB.setConsole();}) made the Wifi connect work reliably (!).
The line USB.setConsole() at the end causes Wifi connect to fail.
Regarding the LEDs, I'd expect the green one to go on once the Wifi connection is established. It doesn't, even when I can telnet to Espruino. Doing LED2.set() from the console works.
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.
In case it doesn't work it writes 'WiFi connect failed: FAIL'.
Actually, the line
conn.on('close',function() {USB.setConsole();})
made the Wifi connect work reliably (!).The line
USB.setConsole()
at the end causes Wifi connect to fail.Regarding the LEDs, I'd expect the green one to go on once the Wifi connection is established. It doesn't, even when I can telnet to Espruino. Doing LED2.set() from the console works.