Wifi module not found

Posted on
  • Just loaded up espruino on a nodemcu and trying the sample code...

    var wifi = require("Wifi");
    wifi.connect("my-ssid", {password:"my-pwd"}, function(err){
    console.log("connected? err=", err, "info=", wifi.getIP());
    });
    wifi.stopAP();

    I keep getting Warning: "Wifi" module not found.

    What am I doing wrong?

  • IIRC, there is a post that the module name has to be written in lowercase:
    var wifi = require("wifi");

  • Uppercase "Wifi" in later builds. Are you connected - do you get a return from wifi.getIP()? It was case that warnings could be ignored. I don't recall seeing in more recent builds.

  • The warning will go away once the web site is updated with v1.85... Please ignore the warning for now.

  • It does not connect. Since the module is not found each line produces an error. Am I missing a step?

    Looking at the espruino\modules site there is no Wifi module there.

  • it would help if you posted what you see, starting with reset()... what does it output (shows which version you're running) and then what do you input, etc...

  • Straight forwards normally. You've missed nothing in your JS code as far as I can see. What build have you flashed?

    But also, note the build post in this forum (http://forum.espruino.com/conversations/­279176/) has the latest build at the end of the thread. If you are using an early build you could well be seeing wacky stuff as well as using a deprecated API. Could this be it?

  • You were correct. I had loaded an old version by mistake. Works now.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Wifi module not found

Posted by Avatar for cwilt @cwilt

Actions