NodeMCU Wifi Module not found

Posted on
  • I know this has been asked before, but they all used a different method of flashing the nodeMCU. I followed this tutorial ( to flash Espruino onto the device.

    I am not getting any output from any of the Wifi functions, tried getIp, getStatus, etc... All thats returned is undefined.

    i've also tried variations of "... require("Wifi")"

    basic functionality works and console output works fine. it's just wifi that isn't working.

    code currently on the board

    var interval = 1000
    // Initilize the LED to be off
    var wifi = require("Wifi");
    setInterval(function() {
    }, interval)

    attached file is the terminal output from that code

    Is there an easy method of installing all the required modules that doesn't use crazy to understand terminal stuffs :p

    thanks for any help!

    1 Attachment

    • terminalOutput.png
  • Dont you have to use the EspruinoWiFi Module with an ESP board?


    var wifi = require('EspruinoWiFi');

    and see if this helps.

  • thanks! it did something, but now it's saying NetworkJS not found.

  • @user74461

    require("Wifi") is correct if you have flashed Espruino to the nodeMCU itself.

    When using a using a terminal app to send code, you won't have modules autoloaded by default, but that shouldn't be your issue with the Wifi module as that is built in.

    Are you saying that you get undefined returned from this?

    var wifi = require("Wifi");
  • yes.
    attached a pic of the code next to the terminal output when run

    1 Attachment

    • Screen Shot 2017-03-08 at 8.13.51 pm.png
  • Where is that function call to main() coming from? Do you have code saved that is loaded at boot?

    You should get this, or similar, this is the output of a connection with screen:

    |   __|___ ___ ___ _ _|_|___ ___ 
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
     1v91.122 Copyright 2016 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    Flash map 4MB:512/512, manuf 0xef chip 0x4016
    >var wifi=require("Wifi")
    =function () { [native code] }
      "mode": "sta", 
      "station": "connected", 
      "ap": "disabled", 
      "phy": "11n", 
      "powersave": "ps-poll", 
      "savedMode": "off"

    In the terminal try issue a reset() first, this will clear saved code, then issue a save() then try again.

  • Instead of using the nodejs - your are better off using the web ide. Install that in chrome and set the board rate to 115200 and use that to programme.

  • I've tried reflashing the board, no result.
    as well as reset()/save() terminal commands
    and tried using web ide.
    the output is still the same as my screenshot above.

  • This is most odd. We should use the Web IDE though - we have a good starting point for debugging and a common understanding of the interface.

    Please can you post the output/screen grabs of these actions.

    1) Immediately after you connect via the Web IDE.
    2) After you type reset() in console on left hand side of IDE, and hit return
    3) After you type save() in the console, and have hit return
    4) After you key the var wifi= require("Wifi") and hit return
    5) After you key the wifi.getStatus() and hit return

  • Sure

    5 Attachments

    • Screen Shot 2017-03-10 at 7.58.16 pm.png
    • Screen Shot 2017-03-10 at 7.54.02 pm.png
    • Screen Shot 2017-03-10 at 7.54.26 pm.png
    • Screen Shot 2017-03-10 at 7.54.45 pm.png
    • Screen Shot 2017-03-10 at 7.54.57 pm.png
  • Thanks for that. I thought it was a big ask.

    It's not exactly as I had hoped, but the good news is your board looks fine. Next step is to get yourself on a network.

    Something like this, but checkout the documentation for all the detail

    wifi.connect(ssid, {password:pw}, function(err){
     if (!err) {console.log("Connected");}
  • Re the output after save(). I'd be inclined to ensure the board is wiped totally. For this you may need something like "", I don't know what flasher.js does with respect to wiping board before flashing

  • Ok, I reflashed the board to the 1v91 espruino using
    run the commands you said. here's the output.

  • Ok. I reflashed using to 1v91 espruino.
    Then ran the commands you said above, heres the output.

    3 Attachments

    • Screen Shot 2017-03-10 at 9.18.53 pm.png
    • Screen Shot 2017-03-10 at 9.19.08 pm.png
    • Screen Shot 2017-03-10 at 9.19.18 pm.png
  • Looks good. So what do you want to do next?
    You have the whole internet available to your tiny ESP8266...

  • YES! Thanks man much appreciated!!!

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

NodeMCU Wifi Module not found

Posted by Avatar for user74461 @user74461