WiFi power issues #4597
Replies: 1 comment
-
Posted at 2017-06-16 by @gfwilliams Hmm - You should be able to supply power straight to the 3.3v pin on the board - but perhaps you could stick a scope on it (and the VUSB line) first and see if it really does fluctuate? I guess you're powering the board itself straight over USB? Could you try a different USB cable? Sounds dumb, but the regulator should be able to handle 400mA peak, with the biggest issue being heat dissipation. I've never personally noticed any problems like this (and I've used the flow control before). Posted at 2017-06-16 by dave_irvine I've tried several different cables and I'm now running from an externally powered USB hub to make sure I've got enough juice going to the Espruino. I've hooked up a USB-TTL directly to the ESP8266 so I can try and sniff things without having the Espruino log them, and something is definitely up:
and then I can also see the resets happen as well. I tried looking through the schematics, but its not my strong suit. If I supply 3v3 to the board I'm guessing I have to unplug the usb beforehand otherwise I let out the magic smoke? Also do you have a capacitor between VCC and GND on the ESP8266? I can't see one on the schematic but I might just be missing it. Posted at 2017-06-16 by @gfwilliams When you use the external USB-TTL, do you ever see that Also, what if you disable the flow control you'd added? If you're not writing to the SD card you won't need it I guess, and I'd be interested to see if that is making it worse somehow. It'll be fine to power by USB and use an external 3.3v regulator - the one on there will still do its job, but if another regulator is on there too then it'll take up the slack if the volts on the 3.3v line drops. There's a 47uF capacitor (and a 0.1uF as well) on the 3.3v line next to the regulator in the circuit diagram - they're physically very close to the ESP8266 so should do pretty well. 47uF should do a pretty good job at soaking up any short-term power requirements. Also, the ESP8266 itself only needs 1.7v (less than the STM32 I think?) so if that's browning out then I'd be very surprised if the STM32 is still working fine. I guess it could be your board in particular has a bad connection to the ESP8266? Posted at 2017-06-16 by dave_irvine Yes I see the resets on the USB-TTL. I've gone back to using the pipe() we were discussing in the other thread that lead to memory issues. I thought the ESP was minimum 3v? http://www.electrodragon.com/w/ESP-12F_ESP8266_Wifi_Board I'm going to try hooking my components to an entirely seperate power supply, currently my voltage regulator is powered by the 5v output of the espruino (which I assume is just the 5v line from USB), so perhaps it is drawing too much from there and browning out the onboard vreg. I will note, that quite often I experience an issue where I can't flash to the Espruino once something has gone wrong with the WiFi. I usually have to disconnect power and reflash, I wonder if this is a symptom of the STM32 browning out? Posted at 2017-06-16 by @gfwilliams Ahh, I just googled and took the top hit, which was wrong :) Still, https://forum.makehackvoid.com/t/esp8266-operating-voltage-range-and-sleep-current/286 implies that they tested and 2.3v seems to work ok. Perhaps not under load, but there's a lot of leeway. On the Wifi that VUSB pin is connected straight to USB 5v - so it should be fine - however I guess it depends how it's connected.
It could well be, yes... Since the ESP8266 driver's all JS at the moment you should be able to Ctrl-C out of pretty much any execution regardless of what's happened. Do you have something like an oscilloscope that you could connect to the 5v and 3.3v lines? It might help to narrow this down quite a lot. Posted at 2017-06-16 by dave_irvine Unfortunately no oscilloscope here as far as I know, anything this low level is kind of our of our realm, it took me hours yesterday to realise I was getting SD card failures because that was browning out, I kept just thinking my code was wrong. Did you have any luck replicating at your end? Posted at 2017-06-16 by @gfwilliams No luck replicating power issues here. I'm using this code:
and uploading a big file. The voltage is rock solid at 3.32v Having said that, I could reproduce your out of memory issues at least - and hopefully I found something that'll fix them. It seemed to be related to what happens when we're trying to send data to a socket at the same time as ESP8266 is sending it out. If you upload now the out of memory issues should be gone (or at the very least, better). Posted at 2017-06-16 by dave_irvine While I imagine it probably won't make a difference, could you try it going the other way? Download rather than upload. Doesn't need to be a huge file, 40-50kb should do the trick... maybe just try and download https://www.espruino.com/press/logo_square_blur.png ? Posted at 2017-06-19 by @gfwilliams Just tried this, and it works fine here:
Even setting a few of them off at once. Using https still works, but I can't do more than one because of memory. Please can you try checking Perhaps you could do something like:
It'll then light the red LED if the voltage goes too far out of range. I've hooked it up to the oscilloscope with the WiFi router about as far away as I can sensibly get it, so it'll be using as much power as it can, and I do see some little troughs in the voltage - it goes down to 2.75v for about 250uS - which seems to be about what you'd expect based on the voltage regulator's response time (it's not overloaded, it just takes 200uS or so to respond), but that would appear to be fine. Do you have more than one Espruino WiFi device? Does it happen on all of them? Posted at 2017-06-19 by dave_irvine Oh now this is interesting. Here's what I get when I use your code with all the rest of my stuff deleted: 8 bytes (fairly consistent 69byte chunks). With my code:
(fairly consistent 300+ byte chunks). If I add some extra logging: 383 bytes (mine crashes around here) yours happily cruises along: 74 bytes So the question becomes, why does my code fetch larger chunks? I don't think I've configured anything to specifically ask for larger chunks... I've just added the flow control code to your example and I still get 69byte chunks, so its not the flow control. Posted at 2017-06-19 by dave_irvine Got it. I'll have another code sample for you in a few minutes. Posted at 2017-06-19 by dave_irvine So this whole debacle is at least mostly my fault. A while ago I had to reflash the ESP8266 firmware and ended up with 0.50 AT command set, which as we discussed here: http://forum.espruino.com/conversations/304736/?offset=25#13630588 has a longer boot preamble than the 0.40 command set, which seems to confuse the FIFO buffer and therefore the standard EspruinoWiFi module. To work around it I've been doing my own hack to reset the ESP8266 and then hand over control to the EspruinoWiFi module. What I didn't realise is that this causes two @gfwilliams as I am stuck with having to use my workaround to boot the 0.50 firmware, could you possibly provide a
Posted at 2017-06-19 by @gfwilliams Aha! Glad it's sorted! Really odd about the low power reset error though? You should be able to do About the packet sizes: the data comes into Espruino pretty much whenever, and Espruino handles it as and when it can. If the handling takes longer then the handler gets called less often - but with more data... So as you make more complex projects I'd expect the packet sizes you get to increase, or some to be larger than others (if a function took a long time to execute while data was being received). Posted at 2017-06-19 by dave_irvine That seems to fix it! Its worth noting that this drops the maximum baud rate that seems reliable. I used to get
in the received data, I guess the +IPD isn't complete so Espruino gets confused. I'll try and find a slower (but higher than 115200!) baud that is stable. Posted at 2017-06-19 by dave_irvine
Posted at 2017-06-19 by @gfwilliams Wow, that's still pretty impressive! That's with the flow control, or without? Just to say that I've just committed some changes that turn framing/parity errors off by default, with an option to turn them back on. If you get the latest builds now I imagine you may not need your hack around reset. Posted at 2017-06-19 by dave_irvine Thats with flow control on. Posted at 2018-01-31 by @gfwilliams Just to add to this, flow control is now on by default, and there's a new method for the Espruino WiFi called |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-06-16 by dave_irvine
After a fairly extensive debugging session, I've finally produced the following error message:
which I believe means the ESP8266 has browned out and reset itself due to lack of power.
Cut down version of the code:
This happens fairly regularly if the file I'm fetching is big enough. I've hooked my SD card power up to an external voltage regulator so the only thing being powered by the Espruino is itself.
Gordon can you give this a go at your end and see if you can replicate?
Hardware FC is enabled using
file is fetched over HTTP, about 46kb. SD card is at default baud rate. The problem occurs at different stages of the file transfer, but it happens almost every time for me.
Can you think of a board trace I could cut and supply voltage to the ESP8266 myself from another external voltage regulator? Problem with that is the ESP8266 needs a capacitor across VCC and GND otherwise you get these power issues...
Oh I've actually just tried it with the writing to the SD card commented out and I still get the issue.
Beta Was this translation helpful? Give feedback.
All reactions