Help Web Ide can't find require(module)

Posted on
  • It was working but now it doesn't.
    Simple programs on the right side get sent to Espruino just fine.

    >
    >1+1
    =2
    >require("ESP8266WiFi_0v25");
    ERROR: Could not open file : NO_FILE
    WARNING: Module "ESP8266WiFi_0v25" not found
    =undefined
    > 
    > 
    

    Module URL
     http://www.espruino.com/modules
    Module Extensions
    .min.js|.js

    var serial=Serial4;
    serial.removeAllListeners();
    serial.setup(115200, { rx: C11, tx : C10 });
    
    var wifi = require("ESP8266WiFi_0v25").connect(seri­al, function(err) {
      if (err) throw err;
    
      wifi.reset(function(err) {
        if (err) throw err;
        console.log("Connecting to WiFi");
    
        wifi.connect(WiFi_Name,WPA2_Key, function(err) {
          if (err) throw err;
          console.log("Connected ");
          getpage();
        });
      });
    });
    
    function getpage(){
          require("http").get("http://www.pur3.co.­uk/hello.txt", function(res) {
            console.log("Response: ",res);
            res.on('data', function(d) {
              console.log("--->"+d);
            });
          });
    }//end get page
    
    
  • Same here! I've been troubleshooting for hours. Nothing happens when I try to send var dht = require("DHT22"); from the right-hand side.

  • http://www.espruino.com/modules/
    The modules can be seen using a browser.
    I'm wondering if the latest Windows update changed something that blocks Web IDE from fetching the modules when the send to Espruino button is clicked.

  • Temporary work around
    In the Web IDE click on the settings (gear icon) and go to project.
    Create a sandbox directory. Mine is called EP.
    Another button appears under the send to Espruino button.
    With Explorer copy your program into EP/Projects.
    Now for the modules. With a browser go to
    http://espruino.com/modules/
    Click on the module you need, and it will fill the screen.
    Select all and copy into Notepad and save with the same name in
    EP/modules.
    You might look to see if your module requires other modules. If so, copy and save them as well.

    In Web IDE load your program into the right side from EP/Projects/
    Now try the send to Espruino.
    With any luck your program will load.

    I used the following to test this method. The ESP8266 module requires the AT module as well.

    console.log("aaa"); require("ESP8266WiFi_0v25"); console.log("bbb");

  • Argh, sorry about this. I'l looking into it now

  • It's some recent contributed changes that were supposed to improve the 'sandbox' code, but it looks like they broke everything else.

    Really sorry about that - I'm trying to fix it ASAP.

  • Ok, fixed now... it'll take maybe an hour to update.

  • Great. Works fine now.

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

Help Web Ide can't find require(module)

Posted by Avatar for ClearMemory041063 @ClearMemory041063

Actions