Pico and ESP8266

Posted on
Page
of 4
/ 4
Last Next
  • Hi guys,

    I got my Pico earlier this week and I've been trying to get it to work with some ESP8266s I bought a couple of months ago. I flashed the pico because 1v75 doesn't include NetworkJS, but to no avail. I tried with the two flash versions available, WIZNet and CC3000 (btw, why isn't there an ESP8266 build for 1v78?), but I get the following error after a few seconds:

    Uncaught No 'ready' after AT+RST
     at line 3 col 18
      if (err) throw err;
                      ^
    in function "a" called from line 1 col 100
    ...a("No 'ready' after AT+RST");else return c}
                                   ^
    in function "d" called from line 1 col 16
    {e=void 0;d&&d()}
                    ^
    in function called from system
    

    Any hints? Am I doing anything obviously wrong? The ESP8266 lights up the red led when the Pico is connected, but that's about it (not sure if it is supposed to blink at some point thou).

    Thanks!
    gonzalo

  • ESP8266 is supported in all builds since I think 75? It's done via networkjs instead of a custom build that has the driver written in C.

    What is all the code you're using? Does it always fail like that? Sometimes I get that, but the next try, it'll work.

  • I think since 76, at least the build that it shipped with (iirc was 75) was complaining about missing networkjs. Now I've 1v78. Test code is basically the same from the tutorial + some logging:

    Serial2.setup(9600, { rx: A3, tx: A2 });
    var esp8266 = require("ESP8266WiFi");
    console.log("Testing ESP8266...");
    var wifi = esp8266.connect(Serial2, function(err) {
      console.log("Connected, reseting...");
      if (err) throw err;
      wifi.reset(function(err) {
        if (err) throw err;
        console.log("Connecting to WiFi");
        wifi.connect("ssid","pass", function(err) {
          if (err) throw err;
          console.log("Connected");
          // Now you can do something, like an HTTP request
          require("http").get("http://www.pur3.co.­uk/hello.txt", function(res) {
            console.log("Response: ",res);
            res.on('data', function(d) {
              console.log("--->"+d);
            });
          });
        });
      });
    }); 
    

    I get this consistently, never works. I tried 3 different ESP8266 modules I have, and it's all the same. I tried 9600 and 115200 setup. In fact, I even tried disconnecting everything and I get the same error, so, something must be really wrong on my side I guess.

  • Did you put the cap across the supply?

    The available ESP8266 breakout boards don't have enough caps to work without adding caps.

    On the shim, I put a 47 uf 1210 cap on mine, and it works beautifully, didn't even connect without it.

  • No capacitor, I'll get some tomorrow to try that.
    I don't have the shim, I just wired it up on a breadboard. My wiring is very primitive (and so is my electronics knowledge). And, sorry if this is an extremely obvious question, but, where exactly should I add the capacitor? Does it go between VCC on the ESP8266 and 3.3 on the Pico?

    Thanks

  • Between Gnd and Vcc.

    Also - not sure what value capacitor you'll need. I'll try to play around with that later today and see if I can figure out how large a cap you need on it.

    I have a 0.1uf and a 1uf ceramic cap on an ESP8266 breakout board, and it seems to work fine. I guess I was being overly pessimistic when I went with a 47uf one on the shim. I would definitely use a ceramic cap, though.

  • Thanks @DrAzzy! I'll play with it this week.

  • Hi,

    Uncaught No 'ready' after AT+RST is almost certainly because the module isn't responding to any commands that get sent. In fact you should usually be able to see if it's responding to anything because the blue LED will start flickering.

    I guess one question is: Have you connected TX to RX and TX to RX? If you connect RX to RX and vice versa then it won't work.

  • Sometimes the ESP8266 responds to AT+RST with "ERROR"

    In that case, sending an AT+RST again seems to sort it out.

  • Sometimes the ESP8266 responds to AT+RST with "ERROR"

    That usually happens if Espruino has been reset/restarted and there happened to be half a line of text already in the ESP8266's input buffer. Potentially it'd be fixed just by sending \r\nAT+RST\r\n instead of AT+RST\r\n in the driver.

  • Still no luck.
    I am sure TX and RX are connected properly, if I invert them, Espruino complains with ERROR: Pin A2 is not capable of USART RX Suitable pins are: A3.

    I added different capacitors, sometimes I see that when I plug it, the blue led turns on and stays, but as soon as I upload the sample js code which does esp8266.connect, it goes off and doesn't blink anymore.

    One dumb question: I have the esp8266 in a breadboard, and it is wired to the Pico with jumperwires, no soldering anywhere. Could that be the cause?

    At some point I think I've read something about the proximity of capacitors affecting this, so I wonder if the fact that it's wired instead of soldiered in close proximity a problem. Keep in mind that I am absolute zero when it comes to electronics, so, try not to laugh too hard if this question is non-sense :)

  • The cap should be as close as possible to the ESP8266. Where and when did you get them? (wondering if they have the right firmware version - there are multiple mutually incompatible firmwares for the ESP8266)

    What we meant is whether you had the wires reversed, not the pin numbers in the code. I can't tell you how many times I've been certain I had TX/RX or SCL/SDA right, then reversed the connector, and found that I had them backwards.

    Usually what I see is the red light coming on, with no activity from the blue light until I start communicating with the ESP8266.

  • I got them in February 8th from aliexpress (http://www.aliexpress.com/snapshot/64823­84681.html).

    But, it does not matter: I think i just fried my Pico :( I was trying to re-write the thing for the 100th time, and I missed by one pin: wired vbat instead of 3.3, then the smell of burnt electronic followed and now can't detect the Pico anymore.... bad luck, I guess I'll just wait in line to buy new ones from the next batch! :P

  • Btw, thanks for your help, guys!!

  • Shorting vbat to ground should only be able to destroy the fet or the diode (if running off BAT_IN or usb, respectively). The diode seems to be the first thing to go - luckily also probably the easiest part on the board to fix.

    I think Gordon said he was able to squeeze in a polyfuse in the next run of the pico, which will be great.

    Do be aware that USB ports get unhappy if too much current is drawn from them, and some won't work until the system is powercycled (I've also managed to kill one port on a hub apparently for good)

  • Argh, that's a shame.

    Just to add that your Pico might not be totally dead. If you have a breadboard power supply or similar, try connecting it between the 'Bat' and 'GND' pins. The Pico may still be usable like that.

  • The No 'ready' after AT+RST error also appears when CH_PD has not been set to 3.3. It happened to me too because I don't use the shim.

    So to summarize:

    • The serial connection needs to be cross wired. ESP8266 URXD => Pico TX and ESP8266 UTXD => Pico RX
    • ESP8266 CH_PD needs to be connected to the Pico 3.3.

    What I saw until now is that the wifi module seems a bit unstable. I get random errors when connecting. For example:

    • SD card must be setup with E.connectSDCard first on module init.
    • No change when trying to connect to a wifi network.
    • CIPSTART failed after connection to wifi has been established

    Usually a reboot solved the issues and it works fine for some time. I will try to keep an eye on the issues. I think it may be related to the AT commands. Maybe the prior command is still in the command buffer of the ESP8266 after I restart the Pico.

  • SD card must be setup... is an uploading problem, where your code is trying to use a js module that hasn't been loaded (these get autoloaded when you reference them from the left side of the IDE and send to espruino.

    no change I think just indicates that it was already connected to that network.

    Make sure you are using latest version. Also, don't try to do multiple connections at a time - this is broken currently.

    Also, put a ceramic capacitor between power and ground right next to the ESP8266. 0.1uf wasn't enough, but 1 uf seemed to work.

  • I didn't try the capacitor yet but I think most of the problems I wrote occurred because I loaded new code onto the Pico while a prior request was still running. Because once I stopped that the issues mostly disappeared.

  • I am also trying to make my pico work with the esp8266 right now. I get the errors above and after looking at the tutorial again I discovered CH_PD was not connected. I s this really not required for the pico ? The table cell is empty when using the pico, so many here would try not connecting CH_PD to 3.3V. Does it need to be connected?

    BTW it does not fix it. ... Still cannot make the code example work.

  • When CH_PD is connected, I strangely cannot make anythign work (pico). So I disconnected 3.3V from CH_PD again. Now I get this error, as described before (v1.78):

    Uncaught no 'ready' after at+rst..

    how do I copy code from teh web ide???

  • Does it need to be connected?

    No, I'm pretty sure there's a pullup/down resistor internally.

    Uncaught no 'ready' after at+rst..

    Your code would have uploaded fine, this is the general error message you get if there is no communication with the ESP8266.

    Are you using an ESP8266 that came with the Espruino Pico KickStarter, or another one? ESP8266s all come with different firmwares which have different baud rates and subtly different AT command sets.

    • You could also try soldering a capacitor across the power lines on the ESP8266. It seems that when using jumper wires the resistance/bad contacts mean that ESP8266 can be a bit flakey.
    • Is the red light on the ESP8266 lit up? Does the blue light light up at all?
    • Also, are you sure that RX goes to TX and vice versa?

    If you're getting other errors, please can you post up the exact ones? People have posted up a bunch of different errors here.

    how do I copy code from teh web ide???

    Copy it from the Web IDE? Just click and drag on the left-hand side. It'll automatically copy it to the clipboard.

  • I've the same problem.
    after:

    var wifi = require("ESP8266WiFi").connect(Serial2, function(err)
    

    there is an Error:

    No 'ready' after AT+RST
    

    I can't see any red or blue LED on the esp8266 board.
    btw. I wonder that 5V is connected to the shim, but not connected to the esp8266 board. where does the power for the wifi module comes from ?

  • It takes the 3.3v supply from the pico - it's one of those 3 little pins on the side of the shim - make sure you soldered those.

    You need to put a ~1 uf+ cap between power and ground (there are pads for an SMD one on the shim), it seems like (at least in most cases) to get reliable operation. I've also found that sometimes it takes two tries to get AT+RST to work, if the ESP8266 isn't power cycled between attempts to use it.

  • @DrAzzy that could be the right hint. Thx.
    Looking on the video I saw only a power connection between Pico an esp8266 via two wires ( Gnd and 5V ). The middle connector (labeled: VDD) leaves unconnected.

    Do I have to connect that middle pin to the esp8266 too ?

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

Pico and ESP8266

Posted by Avatar for gnz @gnz

Actions