"listening" is not implemented. Espruino code reduced to:
/* ESPRUINO WIFI */ var WIFI_NAME = "Paradise"; var WIFI_OPTIONS = { password : "XYZ" }; var PORT = 7077; var wifi = require("EspruinoWiFi"); var dgram = require('dgram'); wifi.connect(WIFI_NAME, WIFI_OPTIONS, function (err) { if (err) { console.log("Connection error: " + err); } wifi.getIP(function (f, ip) { console.log("Connected: " + ip.ip); // UDP Broadcast var client = dgram.createSocket("udp4"); client.on('message', function (message, rinfo) { console.log('UDP Msg: ' + rinfo.address + ':' + rinfo.port +' - ' + message); try { var u = JSON.parse(message); console.log('OK:'+u.cfg); } catch(err) { console.log('ERR: UPD packet not JSON, ignore'); } }); client.bind(PORT); }); });
@Sacha 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.
"listening" is not implemented. Espruino code reduced to: