[Solved] ESP8266 problem on Espruino pico #4785
Replies: 1 comment
-
Posted at 2015-05-28 by DrAzzy Put a 1uf+ ceramic cap onto those two pads on the shim, it seems to need a cap on the supply to work reliably (ie, the manufacturers of the board were too fucking cheap to add a 3 cent capacitor to make it work reliably). Posted at 2015-05-28 by @gfwilliams That's a strange one - do you get the same error each time? The error It feels unlikely, but could you just get a multimeter and check that A2 and A3 aren't shorted out? Posted at 2015-05-28 by Ingmar_Guillaume The error is consistent. Some commands work, some don't. I checked A2-A3 for short. Everything is OK. I ordered the caps DrAzzy recommended. I'll put them in this afternoon and report back. While at it, I noticed that the firmware/SDK is still at 0.9.2.4. And I also noted I shouldn't update the ESP8266 firmware. However, the newer firmware/SDK is already at V1.1.0 . Will there be a way to update the firmware when it's fix soldered to the Pico? And if, when will this happen? The new SDK solves so many issues since the 0.9.2.4 version. (And also allows for OTA updates) Posted at 2015-05-28 by @gfwilliams That's odd - can you try running It's a shame about the outdated firmware - I was told by the suppliers that the auto-update works, but after testing it turns out it just bricks the module in that version of the firmware :( I am planning on coming up with a way of updating it - I'm in the process of fixing some USB issues, and I think once that is done it should be possible turn the Espruino into a simple USB-TTL pass-through with a few lines of code, which would in turn mean you can use the existing firmware update tools to update the ESP8266. Even now it would be possible to write an updater in JavaScript that would run in the Web IDE, pushing data. It's just that me (or someone else) will have to do it. Posted at 2015-05-28 by Ingmar_Guillaume This is the debug output with the debug command immediately following the connect command (so within the delay for setTimeout). Cap is going in now, check back later.
Posted at 2015-05-28 by Ingmar_Guillaume The 1 uF capacitor did indeed correct the problem. It now says "Connected". Oops, cheered a bit too soon. It says "Connected" on the example I gave, but the webui still produces the same error. Posted at 2015-05-28 by Ingmar_Guillaume Even the example I gave now goes into error again. I'll solder another shim with another module and see what that gives. Maybe the module is just malfunctioning. Posted at 2015-05-28 by @gfwilliams Ok, something is odd here, are you sure it's the code you posted earlier:
Because Espruino seems to be trying to reset and connect twice in a row from the log you posted... Posted at 2015-05-28 by DrAzzy "but the webui still produces the same error" Which error? Posted at 2015-05-29 by Ingmar_Guillaume Gordon, DrAzzy,
Posted at 2015-05-29 by @gfwilliams There's definitely something wrong here - It looks like the code is somehow being executed twice - I don't see how you can be getting the same So you're sure that you're putting that exact code into the right hand side of the Web IDE (nothing else), clicking the send button once, and getting that exact output? Posted at 2015-05-29 by Ingmar_Guillaume Indeed. You can see that it is actually the serial garbage (which is a known problem in 0.9.2.4), that is the cause of the (initial) error. That's why I originally added the setTimeout. Anyway, I took that setTimeout away for now. After uploading and executing that code (which failed), I entered the following in the command window
That resulted in:
To display the full error, I entered this:
which then resulted in:
which in turn is again the same error as in all previous tests. I'll put together another pico/esp8266 to see what that gives. ====================================================
Posted at 2015-05-29 by @gfwilliams Ok, thanks for checking all that! So the ESP8266 module is one of the ones that came with the KickStarter, not a different one? From the garbage, and third from last post, it looks like the ESP8266 could be resetting itself after Unless it's something crazy like a dodgy USB port/cable that doesn't supply enough power? If you could put another together Pico that'd be great, hopefully it'll work. If it turns out to be the ESP8266 I'll send you another (although granted unsoldering the old one will be a pain. Posted at 2015-05-29 by Ingmar_Guillaume I also verified that. yes, it's one that came with the Pico. The other ones have been updated. This one is still at the original firmware level.. The USB is a powered USB 3.0 hub. But I also inserted the pico in the PC directly. It doesn't matter. (I also added a 1uF cap as suggested by DrAzzy.) Posted at 2015-05-29 by DrAzzy Before you give up, try a bigger cap. Another guy said 1 worked so I used that number, but the working esp's I have all have at least a few uf on them. I don't claim that this is definitely the problem, but it's easy to try, and if it is, it's something people are going to keep dealing with Posted at 2015-05-29 by Ingmar_Guillaume Just made another one. Exactly the same problem. Get APs works, but connecting fails with the CWmode error. I'll add another cap in parallel. (I need a better magnifying glass, these little buggers are SMALL, for me anyway) Posted at 2015-05-29 by Ingmar_Guillaume Added another 1uF. Didn't change anything. Same error. I can try to add another uF, but then that's it. With these small things, it's nearly impossible to do this right. Posted at 2015-05-29 by Ingmar_Guillaume Added another 1 uF. That makes 3uF. Still same error. Get APs works, connect doesn't. Posted at 2015-05-29 by DrAzzy Hum. Wonder what's wrong... Posted at 2015-05-29 by Ingmar_Guillaume I'm kinda lost here. Let me give some examples with output:
produces
Now,
produces
OK, so that works. Now, inserting connect
That gives me BS (due to the serial garbage on initialisation)
So, I re-introduce the SetTimeout
and then I get
In effect, as I said, connecting (or trying to in any way) produces the error, both on this and on the other module. With or without caps on Vcc-GND. Posted at 2015-05-29 by @gfwilliams Thanks - I'm pretty sure:
Is actually because the board has reset while trying to connect, so I'd be pretty sure this was a power issue (especially as it's affecting both boards). I've never seen it so bad though - maybe it's having to use more power to transmit to your WiFi network than it is to the network I've tried. Come to think of it, have you tried connecting to a different network? Maybe put your phone into mobile hotspot mode and try that? Do you have an oscilloscope that you could look at the 3.3v line with so you can see if it's fluctuating. 1 or 2 uF might not cut it. Any chance you have a 47uF or 100uF capacitor kicking around, just to make sure? You can solder through-hole parts into the 2 (of 3) holes nearest where the capacitor goes (one nearest the ESP8266 is GND). Posted at 2015-05-29 by Ingmar_Guillaume I have had the same issue with all other esp8266 boards (espruino related or not). It's in the firmware. The newer firmware clears the serial buffer before releasing it ready. (I think starting from the V0.9.5 versions. That's actually why I was enquiring about updating the firmware) Posted at 2015-05-29 by Ingmar_Guillaume Can someone instruct me on using the wifi.at command? I tried a wifi.at("AT+GMR"), but that produces an error. What function should I call using this?
Posted at 2015-05-29 by @gfwilliams If it is a firmware problem, it seems to work for other people - me included - so I'm not sure why it's different in your case. Did you try a different wifi ap? Try:
Posted at 2015-05-30 by Ingmar_Guillaume I meant that the garbled output at the start is a firmware issue. Just tried with another AP. Same error. Tomorrow I'll put on a scope and logic analyzer and try to see what's happening. =======================================
gives me the same error (on both modules)
Posted at 2015-06-01 by @gfwilliams Ahh - yes, I think it might be outputting at the wrong baud rate right after it starts? Odd that you still get problems though. You'd need to do: I made a mistake when I initially posted, and then corrected it 30 secs later - maybe you copied the code from the notification e-mail you got, which wouldn't have updated? Posted at 2015-06-01 by Ingmar_Guillaume Thx Gordon, I hadn't noticed. I picked up your initial post seconds after you wrote it. However, I suppose that
is not supposed to give me
but rather the version of the firmware running? Posted at 2015-06-01 by @gfwilliams Yes, however you can turn echo off first (it should have been turned off initially, but it looks like the module restarted itself) using:
Posted at 2015-06-01 by Ingmar_Guillaume Hmmm,
gives me
So, in effect, it just echoes. Posted at 2015-06-02 by @gfwilliams That really is strange. Maybe try
Posted at 2015-06-04 by Ingmar_Guillaume I'm going to try to find some larger capacitors. I currently have 3 uF on them, but in both cases it doesn't seem to be enough. On the ESP12 board I have, there's a 100uF. All in all it's weird, because the getAPs command runs without problem (even without the caps), but anything else gives me troubles. Posted at 2015-06-05 by @gfwilliams Yes, that might help. Interesting the ESP12 board has got such a big cap on though! I suppose Posted at 2015-06-05 by Ingmar_Guillaume Exactly. The moment the radio TX is turned on, things go wrong. My power supply is however a powered USB 3 hub. So it shouldn't be a problem. Posted at 2015-06-16 by Ingmar_Guillaume New tantalum caps arrived. 10UF each. Same problem, on both modules. This may be a stupid question, but putting a cap on the pads does mean on the 2 squarish pads on the shim, right? (If someone says no to this, I'll eat my hat) Posted at 2015-06-16 by @gfwilliams
Yes, that's right... While your powered hub shouldn't have problems, have you tried connecting the Pico to anything else (like straight to your computer) just in case there is some issue with it? Also, are you plugging the Pico straight into the hub, or using an extension cable? Posted at 2015-06-16 by Ingmar_Guillaume Yup, did that. Straight into a PC USB port. Same issue (on all three pico's) Posted at 2015-06-16 by Ingmar_Guillaume Found something:
gives me
Now,
results in:
Commenting out the version command makes the script run as it should. The version command on itself however, does run as in the following:
which results in:
So, combining the version command with the connect command results in an error. Posted at 2015-06-17 by DrAzzy My guess is that it's getting confused because you're starting the connection to it before it's given it's response to the getVersion() (look at the order the messages show up with them combined) - waiting a short time to ensure that it's done might fix it. Posted at 2015-06-17 by Ingmar_Guillaume That was my guess also. However, as JS doesn't have a delay apparently, I seems I would have to use nested settimeouts for every wifi command. Or is there another way to wait? Posted at 2015-06-17 by @gfwilliams You'd have to use setTimeout - or execute the connection in the handler for
Is it repeatable? The error you were getting ( I guess the library should deal with that eventuality, but the example code resets the WiFi before connecting so it's not generally an issue. Posted at 2015-06-17 by Ingmar_Guillaume I only submitted a portion of the code. It does contain the reset. It's totally repeatable. But due to this "discovery" I think I (finally) understand what is happening. As you/DrAzzy/I mentioned, I have to nest the calls within one another if I call commands sequentially. As a non-JS programmer I am not used to the asynchronous execution of code. The problem probably lies in there. Posted at 2015-06-17 by @gfwilliams Ahh -that's quite likely - in fact if you called reset but didn't nest what came next then that would explain almost everything. I had assumed that the totally unmodified example code didn't work for you... Or did it? You probably know this anyway now, but Espruino isn't multi-tasking, so it relies on scheduling execution of small functions one after the other (which includes all the code that handles the ESP8266). It's probably most apparent in the ESP8266 library - if you call It's really powerful, but it's quite easy to trip up. For instance:
Looks absolutely fine, but if you tap the button twice in quick succession (or the button bounces) it'll break, because the ESP8266 was already in the middle of resetting, but it'll be told to reset again. Posted at 2015-06-20 by Ingmar_Guillaume Solution:
Posted at 2015-06-22 by @gfwilliams Great, glad it's sorted! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-05-27 by Ingmar_Guillaume
I hope someone here can help me out on this.
I'm a total newbie on Javascript, but an experienced programmer in several other languages.
I got the Espruino Pico with the free ESP8266 modules. I succesfully soldered the shim and the module. The module responds on certain commands, but produces an error on others (actually, the software does).
Originally, I thought it was the spurious characters that flow out of the ESP8266 when reset, so I put in a delay (through setTimeout()), but apparently that is not the problem.
The firmware version of the ESP8266 corresponds to the requirements.
I put the code and output of two small programs below. One gets the accesspoints (and that one works), the other one tries to connect, and doesn't work.
Can someone help me out here?
================================
This code works, producing the list of available APs
But the code below produces an error
Beta Was this translation helpful? Give feedback.
All reactions