This is what I use
function wifiConnect() { wifi = require('Wifi'); wifi.connect(wifi_options.ssid, { password: wifi_options.password }, (e)=> { if (e) { print("WIFI: " + e); } }); wifi.on('connected', ()=> { print('WIFI:', wifi.getIP()); }); wifi.on('disconnected', ()=> { print("WIFI: Reconectando..."); wifi.connect(wifi_options.ssid, {password: wifi_options.password}); }); }
@barbiani started
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.
This is what I use