esp-idf-template-master sample program not working

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: esp-idf-template-master sample program not working

Postby ESP_Sprite » Thu Jun 22, 2017 8:28 am

Ah, missed that, my bad.

bilkusg
Posts: 7
Joined: Tue Jun 13, 2017 9:13 am

Re: esp-idf-template-master sample program not working

Postby bilkusg » Thu Jun 22, 2017 9:23 am

Thanks for the comment about power. I tried connecting the rx0 and tx0 to a separate USB/3.3v serial board and then powering the ESP32 directly from a known high current USB power supply and it now works as expected. So there was nothing wrong with my software setup, and indeed, I can even get the arduino IDE software to work too now.

So it appears as though none of my computers is providing enough power through the usb connection to the esp32 board to reliably power it when wifi is turned on, although there is obviously enough to power it when flashing or doing other stuff.

Does anyone know how much current the ESP32 ought to draw when doing wifi stuff? And whether it's unreasonable to expect a standard USB 2 connector to provide enough ( with a half-decent cable )

Gary

f.h-f.s.
Posts: 215
Joined: Thu Dec 08, 2016 2:53 pm

Re: esp-idf-template-master sample program not working

Postby f.h-f.s. » Thu Jun 22, 2017 9:31 am

So you are using the esp-idf-template?
This template does not have any printlines or ESP_LOGx calls. There would not be any serial info printed if you did connect to a wifi AP

If you did not add any printlines try replacing the event_handler with this:

Code: Select all

#include "esp_log.h"
esp_err_t event_handler(void *ctx, system_event_t *event)
{
    ESP_LOGE("Event","Event Handler was called: #d", event->event_id);
    return ESP_OK;
}

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: esp-idf-template-master sample program not working

Postby ESP_Sprite » Thu Jun 22, 2017 9:55 am

ESP32s can generate spikes of up to 500mA or so when calibrating WiFi, which is the reason that with a bad power supply they usually crap out at that point (and people complain about WiFi crashes when they try to feed an ESP32 module from the 3.3V output of their USB-to-serial board). That being said, feeding a well-designed devboard over USB is usually 100% OK; I'd say 80% of our own engineers use a devboard that's only fed by the USB cable that connects them to their computer. (Note: This also means you're lucky I didn't saw your note about the type of devboard you use: I normally don't suspect power issues on an USB-connected devboard.)

That said, not sure why your board does have issues when connected to a PC... maybe WiFive is right and you just happen to have a board with an LDO that craps out the second the power supply gets slightly less than 5V or so, or maybe your PCs 5V rail sags a bit, who knows.

bilkusg
Posts: 7
Joined: Tue Jun 13, 2017 9:13 am

Re: esp-idf-template-master sample program not working - SOLVED

Postby bilkusg » Thu Jun 22, 2017 3:19 pm

Thanks all for your help and suggestions.

Now I know what's going on, I can investigate my usb, and in the meantime I have a way forward.

Hopefully this thread may save others some time if they experience a similar problem.

To summarize for the benefit of future readers who just want the answer:

If you have an ESP32 module which appears to work fine until you first initialize Wifi, and then either stops responding or behaves erratically, it is quite possible that the board has tried to take too much power from its power supply as WiFi intialization will cause a spike in power demand.

Even if the ESP32 is being driven from a USB port, and behaves perfectly well otherwise ( flashing, non Wifi programs &c), it may still draw more at this point than some USB ports are able to provide.

The easiest way to diagnose this is to run the module powered by a known good high current source, and use a separate 3.3v serial to USB converter to communicate with the PC. If that then works as expected, you know where the problem lies. If it doesn't then I'm afraid you have a different issue!

dorthonir
Posts: 1
Joined: Tue Jul 25, 2017 5:18 pm

Re: esp-idf-template-master sample program not working

Postby dorthonir » Tue Jul 25, 2017 5:22 pm

Thank you for starting this topic, I have struggled with almost exactly same problem with the very same DOIT module for past 2 days. In my case, BLE programs refuse to work powered with my laptop USB, they work perfectly with stronger supply.

pataga
Posts: 73
Joined: Sat Aug 12, 2017 5:53 am

Re: esp-idf-template-master sample program not working

Postby pataga » Fri Sep 08, 2017 4:28 am

Try soldering a large low ESR (low series resistance) capacitor e.g. 220uF tantalum 6.3V directly across the ESP32 3V3 and GND pins as close to the ESP32 as possible. This will act as a storage tank for current spikes so the voltage will not drop enough to cause a brownout, even when the regulator or power supply isn't properly spec'ed. If space is not a concern, a slightly larger 560uF 6.3V solid polymer cap works even better, you will barely see a blip on the supply line voltage on wifi transmissions.

Works for me, even with breakout boards that have a crappy AMS117 regulator supplying 3V3 from USB connection.

beg_dk
Posts: 34
Joined: Thu Apr 06, 2017 5:57 am

Re: esp-idf-template-master sample program not working

Postby beg_dk » Thu Sep 14, 2017 5:51 am

pataga wrote:Try soldering a large low ESR (low series resistance) capacitor e.g. 220uF tantalum 6.3V directly across the ESP32 3V3 and GND pins as close to the ESP32 as possible. This will act as a storage tank for current spikes so the voltage will not drop enough to cause a brownout, even when the regulator or power supply isn't properly spec'ed. If space is not a concern, a slightly larger 560uF 6.3V solid polymer cap works even better, you will barely see a blip on the supply line voltage on wifi transmissions.

Works for me, even with breakout boards that have a crappy AMS117 regulator supplying 3V3 from USB connection.
Just to confirm this is the case. Before mounting the capacitor I had to supply as much as 3.9 V from an adjustable power supply before the brownouts were gone. Adding a 470uF capacitor (did not have 560uF 6.3V solid polymer cap) gave me a barrier of 3.15 V before brownouts began to show up. This is especially a great thing if working with batteries.

Best regards

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: esp-idf-template-master sample program not working

Postby ESP_krzychb » Thu Sep 14, 2017 12:30 pm

beg_dk wrote: Before mounting the capacitor I had to supply as much as 3.9 V from an adjustable power supply before the brownouts were gone. Adding a 470uF capacitor (did not have 560uF 6.3V solid polymer cap) gave me a barrier of 3.15 V before brownouts began to show up. This is especially a great thing if working with batteries.
Hi beg_dk,

This is a simple and convincing case for using decoupling capacitors.

Thank you for sharing it!

Who is online

Users browsing this forum: No registered users and 70 guests