No 'ready' after AT+RST error on wifi connection

Posted on
  • I was running some code on the Espruino Wifi without any issues, but suddenly after reconnecting my Espruino to the WebIDE I get this error.

    I tried resetting and flashing my Espruino, removing all local code, clearing the cache, uploading something else but nothing changes. It's like the Wifi module is in some kind of locked state.
    I have no idea how to fix it. I hope anyone else could help me?

    This is the code I use to connect to my Wifi

    const WIFI_NAME = "******";
    const WIFI_OPTIONS = { password : "*******" };
    
    function onConnected(err) {
        if (err) {
            console.log(err); // This returns the No 'ready' after AT+RST
            setTimeout(connect, 5000);
        } else {
            wifi.getIP(function(e,ip) {
                connected = true;
                console.log(ip);
                setInterval(getWeather, 1800000); // once every 30 minutes
                getWeather();
            });
        }
    }
    
    function connect() {
        wifi = require("Wifi");
        wifi.on('connected',function() {
            console.log("Connected to WiFi");
        });
        wifi.on('disconnected',function() {
            console.log("Disconnected from WiFi");
        });
    
        wifi.connect(WIFI_NAME, WIFI_OPTIONS, onConnected);
    }
    
    E.on('init', function() {
        connect();
    });
    
    
  • How are you powering the Espruino WiFi? Please could you run E.getAnalogVRef() and check what value it returns?

    It's possible that there's some issue with the voltage on the device which is causing the Wifi module not to boot?

    It also seems that maybe there's some other code in there that you're uploading (eg you're calling getWeather). Please could you try:

    • Run require("Storage").eraseAll() on the left hand side of the IDE
    • Upload this most basic code from https://www.espruino.com/WiFi#connecting¬≠-to-an-ap and see if you still have the issue:

      var WIFI_NAME = "";
      var WIFI_OPTIONS = { password : "" };
      
      var wifi = require("Wifi");
      wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
      if (err) {
      console.log("Connection error: "+err);
      return;
      }
      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);
      });
      });
      }
      
  • The value is between 3.31 and 3.04.

    I have a LED strip soldered to the + - and B15
    When LEDs are active around 3.0
    After removing the wires again the values are a little higher, between 3.312 and 3.315

    When I remove all unrelated code in my program I get the same error.
    Same when I uploaded your snippet.
    I erased all storage and used reset to clear the RAM but nothing helps.

    The LED strip is still working as expected.

    Could I have damaged the ESP8266 in some way?

    I always had my espruino connected to my laptop, I'm not 100% sure but after I plugged the USB into a standard android phone USB power plug it stopped working.

    Typically it was the moment that I finalised my project and wanted to show it the first time to someone else it died. So frustrating :)

    BTW any idea when the Espruino WIFI will be back in stock?


    1 Attachment

    • IMG_20210323_214022696.jpg
  • Thanks for checking - that's very interesting then!

    The LEDs are connected to the 5v wire which is connected direct to USB power. When they are active and you're seeing 3v on E.getAnalogVRef(), that'll be because the actual USB power line's voltage has dropped from the normal 5v to something like 3.2v or so - so it's really going to be stressing whatever you've connected it to (your PC?).

    But without it, the 3.3v rail seems ok.

    Please could you try this and see if anything at all gets printed?

    var WIFI_BOOT = A13;
    var WIFI_CHPD = A14;
    digitalWrite(WIFI_CHPD, 0); // turn off wifi
    var pins = { rx: A3, tx : A2 };
    Serial2.on('data', function(d) { console.log("wifi:",JSON.stringify(d)); });
    Serial2.setup(115200, { rx: A3, tx : A2 });
    setTimeout(function() {
      digitalWrite(WIFI_BOOT, 1); // out of boot mode
      digitalWrite(WIFI_CHPD, 1); // turn on wifi
    }, 500);
    

    It's hard to believe a different USB supply would have caused an issue for you - the voltage regulator is rated for about 16v so even if it was seriously out of range it's unlikely to cause problems.

    I'm hoping to have some more Espruino WiFis eithin the month - I've got pretty much all the parts needed here for assembling a new batch, but I've just had a bit too much on to get them made recently.

  • Nope, nothing is printed.

    so it's really going to be stressing whatever you've connected it to

    Is it a bad idea to attach the LED strip directly to those pins?
    It's always a max of 10 neopixels that will be toggled on and off.
    I'm making some kind of weather station that gets the data from an API so eventually I want to plug my device into a socket with a USB supply and keep it running for days.

  • Ok, thanks for trying. That's bad news then. Honestly, I'm not sure what to suggest - you could check that the states of the BOOT/CHPD pins on the ESP8266 go up and down as you'd expect - but if they do then the ESP8266 seems to be toast (somehow!).

    What's E.getAnalogVRef() after running the code in the last post?

    Is it a bad idea to attach the LED strip directly to those pins?

    Not especially - those pins are connected straight to USB's 5V. It's just that if the voltage is dropping that low, the PC is struggling to supply enough power (but that seems unlikely if it's 10 neopixels - give the voltage drop I thought you might have 50 to 100!).

    Stupid question: Have you tried a different Micro USB cable? It could just be a dead cable that's unable to supply enough power even for the WiFi on the Espruino WiFi to boot.

  • OMG, I was about to try to desolder the ESP8266 and replace it with another one I had when I thought to give it one more go. And yeah guess what, it worked :D

    I have no idea what did the trick. Very frustrating that I have no idea what the issue was :)

    But it works! That's the most important thing. Thank you very much for looking into it!
    I'll try to write down all steps with all source files in an instructable and share the link.

    And then buy more espruinos and have more fun with them ;)


    1 Attachment

    • IMG_20210325_231545846.png
  • Glad you sorted it - and that looks amazing! So it's side-lit, encraved acrylic panels? I can't wait to see the instructable!

    My money is on a dodgy Micro USB lead now - so if you have troubles again maybe try that as a first port of call. I've lost count of the number of times dodgy USB leads have been the cause of problems (although usually it's broken data lines rather than power!).

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

No 'ready' after AT+RST error on wifi connection

Posted by Avatar for marzsman @marzsman

Actions