You are reading a single comment by @parasquid and its replies.
Click here to read the full conversation.
-
Ah, I see 🙂. I used the access point feature only, so never really had to call
connect
, I updated the example, still getting the same error I'm afraid 🤔.// ************************************************************ // *** IMPORTS / CONSTANTS // ************************************************************ const ssid = "<ACCESS_POINT_SSID>"; const password = "<PASSWORD>"; const wifi = require("Wifi"); let Wifi; wifi.enableMDNS = function (hostname, serviceType, port, callback) { // <-- Also tried fat-arrow syntax let mdns = "AT+MDNS=1," + JSON.stringify(hostname) + "," + JSON.stringify(serviceType) + "," + JSON.stringify(port) + "\r\n"; Wifi.at.cmd(mdns, 500, function (d) { callback(d); }); }; // ************************************************************ // *** MAIN // ************************************************************ /* * Called on boot */ function onInit() { const w = wifi.connect(ssid, { password: password }, function () { console.log("Connected"); Wifi = w; wifi.enableMDNS("abcd", "iot", 80, function (result) { console.log("enableMDNS result: " + result); }); }); }
Sure, here it is 😊:
That was my guess as well, but replacing
this
withwifi
gives me exactly the same error 🤔.```
2v06 (c) 2019 G.Williams
Espruino is Open Source. Our work is supported
only by sales of official boards and donations:
http://espruino.com/Donate