Missing modules?

Posted on
  • Have been trying the code on this post: http://forum.espruino.com/conversations/­293809/
    But I have a problem, 2 missing modules:

    Is there a new repo that I'm not aware or something?

    I'm using an Espruino Pico and soldered a ESP8266 to it with the shim.

  • The code you are trying to load is for either an espruino board or Pico connected via serial port to an ESP8266. It doesn't currently work on an ESP8266 running Espruino. That would require modification to the Espruino source code and a recompile. As a consumer of Espruino I'm not currently setup to do such a task. Perhaps some of the ESP8266 folks on the Forum who are so equipped can comment further.

  • It sounds like @dh. does have a Pico?

    Maybe you could try just disconnecting and reconnecting the Web IDE? Sometimes if the Web IDE hasn't been able to communicate with the Espruino Board at startup it can't figure out which board is connected, so doesn't know which modules are installed (net and NetworkJS are built into Espruino boards).

    In fact, the Web IDE might be giving you warnings, but the code that is uploading might be working file?

  • This experiment used two Picos and two ESP8266. One Pico-ESP8266 (via serial) runs the server code and the other Pico-ESP8266 runs the client code.
    The ESP8266Wifi_0v25.js file was copied from the modules on the Espruino site, edited and saved us the UDP file. The UDP file was placed in the local modules directory of the WebIDE project on my PC. Upper right hand corner of WebIDE 'Gear' icon, and the Projects Tab, sets up the projects directory.
    The UDP modifications are based on ESP8266 firmware version 1.0 or later.

  • Did the disconnect/reconnect work?

    I guess the warnings you got were the orange popups in the bottom right? If you go into settings and immediately scroll down, do you see anything under Board Information, or just something saying it couldn't get anything.

  • I have no idea what's going on, after flashing with the newest version the board, it worked, but after trying again it's giving me those errors(yeah it's those little orange pop-ups on the right side of the screen)
    If I look on "About" on board information it's saying "Unable to get board information. Please connect to an Espruino board first."

    EDIT: Whenever I try to send any code to the board, even the basic led blink one, I get this message on the console: "ERROR: Prompt not detected - upload failed. Trying to recover..."

  • Ah Ha!

    The program creates a menu system for the left pane of the WebIDE by redirecting the USB port. If you enter a zero followed by a return in the left pane it will exit the menu mode and return to the Console mode.
    The other method is to exit WebIDE and cycle the power on the PICO-ESP8266 and reconnect.

  • Oh, so it was just "stuck" on this menu?
    I would never think of it. Thanks.

  • Ahh, that makes sense.

    So, just to be clear: The specific code that you uploaded re-uses the USB port for something else, so when you upload, it takes control away from the Web IDE.

    I get this message on the console: "ERROR: Prompt not detected

    That's because the Web IDE realised the board wasn't responding to the usual commands.

    To make matters worse, unless you plug & replug the board to reset it, the IDE won't be able to communicate with the board at all - to upload or even to figure out what kind of board it is.

  • If you upload and then enter 0 return in the left pane it exits the menu.
    Once the two Picos connect via the UTP exchange the menu shows up.
    The menu shows option zero '0' .
    If you upload and don't use the zero to exit a second upload will display all sorts of stuff on the left pane and the zero option no longer works.
    As for yellow warnings, I'm not seeing them in v1.86 or v1.88 of Espruino

    Please change the broadcast address so it doesn't UDP the entire Internet.
    //var BroadIP="255.255.255.255";
    var BroadIP="192.168.1.255";

  • It got a bit worse because I already set to keep the code even when powering off in the IDE, so I had no idea how to reset if not flashing the board. Is there another way to do that?

  • If you're powering the board externally often you can unplug and re-plug USB, and unless the console has been moved with .setConsole(1) the console will jump back to USB where you can then reset() the board and save().

    In the newest bootloaders you can just hold the button down for ~3 seconds while powering on and it starts up without loading saved code - but the Picos won't have that unless you upload the bootloader (which is a real pain and can't be done through the Web IDE).

  • In the code titled //UDP_TCPclient1.js //2 Oct 2016
    The following is the menu system.
    Entering a character zero 0 followed by a return should reset the USB.
    If you wrapped the code in an oninit() and saved it so it loads on boot,
    then power up the board, quickly connect with WebIDE and type 0 return in the left pane
    you should be able to reset the USB port.

    //Menus
    menu=function(){
     USB.print(" \n\r");
     USB.print("Select using digit and return key\n\r");
     USB.print("1 LED Off\n\r");
     USB.print("2 LED On\n\r");
     USB.print("0 Exit\n\r");
    };
    
    parsecmd=function(){
    USB.print("\n\r");
       switch(this.sst.charAt(0)){
        case "1"://LED off
         sst="";
         USB.print("LED Off\n\r");
         sendit("LED Off");
        break;
        case "2"://LED On
         USB.print("LED On\n\r");
         sst="";
         sendit("LED On");
        break;
        case"0"://Exit
         LoopbackA.print("USB.setConsole();\n\r")­;
         sst="";
         USB.print("Exit\n\r");
        break;
        default:
         menu();
        break;
      }//end switch sst
    };//end parsecmd
    
    //input cmd from terminal,send it to parsecmd()
    USB.on('data', function (data) {
     var i;
      sst+=data;
      USB.print(data);
      if(sst.length>0)
      if(sst.charAt(sst.length-1)==="\r")parse­cmd();
    });
    
    //Espruino replies here
    LoopbackA.on('data',function(data){
      USB.print(data); //sending data to terminal
    });
    
    /////////////////////////
    setTimeout(function () {
    var x;
    console.log("Start");
      LoopbackB.setConsole();
    x=test();
    if(x!==0)console.log("Try again");//error seen
    
    if(x===0) console.log("Exit Seen");
    }, 1000);
    

    The left screen

    >echo(0);
    =undefined
    Start
    -> LoopbackB
    <- USB
    Start connection process
    Try again
    Reset the ESP8266
    Connecting to WiFi
    OKxx1
    OKxx2
    >0 I entered a zero return
    Exit
    <- LoopbackB
    =undefined
    =undefined
    >USB.setConsole();
    -> USB
    1       I entered a 1 return
    =1
    > 
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Missing modules?

Posted by Avatar for dh. @dh.

Actions