I have an ESP32 project up and running. If I power it via the microUSB on the Heltec ESP32 DEVKIT board that I'm using, all is well.
If, however, I run 5V to the VIN pin on the Heltec, it boots up and then goes into a loop of continuously rebooting every 3 seconds, almost like a watchdog.
Could the absence of a serial port matter? Does that block if there's no serial cable?
I have made sure each ground pin is grounded. I even tried feeding 3.3v to the 3V3 pin, but that didn't make a difference of course.
What could be the difference? I'm using a benchtop power suppy with more then enough power.
BTW, I dug a little further. It's rebooting in WiFi.begin(), and I'm guessing the watchdog but don't know for sure.
However, when powered by a little apple power brick it works fine. Only when powered via the board pins does it reboot in WiFi.begin() which is a little odd!
Thanks in advance for any advice! Here's the code - it doesn't make it to STEP3.
If I remove the USB cable -AFTER- it's connected to WiFi, it will CONTINUE to run from being powered by the VIN pin.
void ConnectToWiFi(const char * pszSSID, const char * pszPassword)
{
lcdTop.setCursor(0, 0); lcdTop.print("STEP1");
// attempt to connect to Wifi network:
unsigned long start = millis();
int status = WL_DISCONNECTED;
while (false == WiFi.isConnected())
{
lcdTop.setCursor(0, 0); lcdTop.print("STEP2");
Serial.print("Attempting to connect to SSID: ");
Serial.println(pszSSID);
// Connect to WPA/WPA2 network.
char * psz = const_cast<char *>(pszSSID);
status = WiFi.begin(psz, pszPassword);
for (int i = 0; i < 20; i++)
{
lcdTop.setCursor(0, 0); lcdTop.print("STEP3");
sprintf(szStatus, "%s: %s-%d", pszSSID, FriendlyTimeSpan(start, millis()).c_str(), status);
UpdateStatusText(szStatus);
//delay(250);
if (WiFi.isConnected())
break;
lcdTop.setCursor(0, 0); lcdTop.print("STEP4");
}
}
}
Hard to imagine the watchdog would only come into play when powered from the VIN pin.
What is the power supply you are using when powering via the VIN pin? I would suspect that first of all as being noisy or out of spec. At WiFi.Begin there is going to be a large power draw to fire up the Wi-Fi part. If you find any 5 volt supply on the VIN is causing a problem try adding say a 100uf cap solder on VIN and Gnd pins.
The ESP32s are (very) sensitive to the type of the incoming supply.
ESP32s seem stable when WiFi is turned on and you have;
Min 470uF in the regulator input.
Min 470uF on the regulator output.
A low drop out regulator capable of circa 500mA.
Even when you do this when supplied with say a Lithium battery thats not at full charge you will still get the brownout when the WiFi turns on.
The cause of the reset (watchdog) in this case is sent to the serial monitor on restart.
Its possible that in the future expressif might find a way of turning on the WiFi without generating such a large current pulse, 250mA or so, but for the moment I think they see it as a hardware issue caused by less than adequate power supplies and they do have a point I guess.
You can tell I'm just a user and not a moderator because I'm going to help you with knowledge rather than yelling at you for not posting source code.
I found most of these cases are power draw. Starting the WiFi puts a large brief load on the power demands, and if you are marginal (running LEDs off USB power and then start WiFi) it will brownout.
The chip will sometimes, but rarely, detect it and warn.
Could be anything of course but that's my guess! If your power is a big, ample, supply, it's likely not that.
Related to the original post, is this power supply sufficient to power an ESP-32 with a few peripherals? When hooking it up, do I use the 5v or 3.3v pins? From the other posts in this thread it appears that I should supply 5v to that pin and let the ESP-32 provide 3.3v to the rest of the circuit.
When I power the ESP32 with batteries (2X 188650 Li batteries wired in series), I supply the power to a small 5V regulator and apply the 5V to the ESP32 5V pin. I have a 10uF 50V electrolytic cap on both the input output of the regulator.
To avoid confusion an 'ESP32' would normally refer to an ESP32 bare module. An ESP32 bare module is a 3.3V device, it has no 5V pin.
I suspect that when some people say 'ESP32' they mean one of the various ESP32 breakout boards that have an ESP32 bare module and various other components such as a regulator, capacitors, switches etc. Most of these breakout boards accept a 5V input or can operate from a lithium battery.
The cause of this problem appears that some ESP32 boards the USB chip is not powered from the Vin (VDD5V) pin (19) but from the VDDUSB with a diode between. This is unlike the ESP8266 boards which are the opposite and is correct to enable the USB chip to be powered at 5v whether plugged into the USB or powered solely by the 5v input pin. It would then cause DTR and RTS to be in an indeterminate voltage affecting EN and IO0 throwing the ESP into a reboot when the higher current surge happens during WIFI communication pulls the rail down. IT happens on an older Makerfocus ESP32 but I will try another ESP32 board to see if occurs there. Maybe its been fixed in newer boards, nevertheless, I use 8266s powered from the Vin pin all the time with no problems.
fpovoski:
The cause of this problem appears that some ESP32 boards the USB chip is not powered from the Vin (VDD5V) pin (19) but from the VDDUSB with a diode between.
That maybe one cause, but you will get the problem on ESP32 boards without USB if the power supply is not good.
I have not had a problem with any boards for months, and the Heltec boards I've been using I power off 5V with impunity and they drive LEDs while connecting and no problem.
Once I had a similar problem and it was due to not petting the watchdog. ESP32 internals automatically does this, but you need to give time for it. So, basically you need to use a delay on any continuous looping task you have, which will allow ESP to pet the dog. 20ms should do it, but you may need to try other periods.
I just had the same problem when using some of the esp32 boards. All of them show the same behavior as in post #1 and after a while I found out that I can run them with 5V connected to the 5V pin only (without usb connected). BUT I have to use some capacitors of ~470µF (see also post #3). Where to put them depends a lot on the circuit and the way I connected the 0V cables (I still use a breadboard for my tests). My conclusion is that the esp32 boards are very sensitive to ground loops and to how you design the power supply especially if you use WiFi which can create some current peaks.
In having the same issue and it's driving me nuts Project works perfectly on USB, but connect a 5v/1A power supply to VIN and GND and I'm getting resets at WiFi initiation.
I would have thought providing the same power as what comes via USB would be a no brainer.. I'm really stuck as to what to do now.. I did try a 100uF cap across VIN and GND to no avail..
I also tried disabling brown out detection and while I could get past WiFi bootup, things got really unstable.
I should say I am pushing things a bit as I have a backlit 5V LCD, MFRC522, AND HX711 connected so there's a fair bit of draw.
My power setup is as follows.
5V bus connected to 5V supply POS
Devices connected: Esp32 VIN, LCD VCC, HX711 VCC
GND bus connected to 5V supply GND
Devices connected: Esp32 GND, LCD GND, HX711 GND,
MFRC522 GND.
3.3V bus connected to Esp32 3.3V
Devices connected: HX711 LogLvL pin, MFRC522 VCC.
Would it help to use higher voltage input like 9V and use a step down converter to 5V just before vin? Or alternatively use a higher Amp 5V supply? Larger caps to buffer significant draw?
Commercial power supplies?
Any advice would be warmly welcomed as I'd hate to have to switch to another microcontroller half way through boxing up the project.
Would supplying 5V to the USB port overcome all these problems?
mdwelch:
In having the same issue and it's driving me nuts Project works perfectly on USB, but connect a 5v/1A power supply to VIN and GND and I'm getting resets at WiFi initiation.
I strongly recommend the use of a "stronger" power supply. I would test it with at least 5V / 2A. The Wifi part of the esp32 requires a lot of power, but in short peaks. I have seen very similar results to those you have described. A capacitor of 470µF or better 1000µF can support you additionally.
I had a similar problem this afternoon. I have a board which uses the ESP32P-DEVKITC-32D-F, which my customer tells me is the only version of these ESP32 boards that can be used industrially in Japan. This one is directly sold by Espressif. However, I am not using the WiFi right now, so I assume I don't need the 470 to 1000uF. I only have 22uF on my 3.3V supply on my main board.
My main board with this ESP32 board mounted on it won't start with the my board main supply by itself. I have connect the USB cable and start the Arduino IDE and at least do a Serial Monitor.
Solved it just now by putting a 1uF cap to ground on the EN pin which on this module is pin 37, next to 3.3V at pin 38. My clue was I could touch the EN pin to ground momentarily and I would get start-up.
I do not supply any 5V to my ESP32 board at all, and supplying it did not help with the startup. Now it starts-up with just my board main supply.
I had a similar problem this afternoon. I have a board which uses the ESP32P-DEVKITC-32D-F, which my customer tells me is the only version of these ESP32 boards that can be used industrially in Japan. This one is directly sold by Espressif. However, I am not using the WiFi right now, so I assume I don't need the 470 to 1000uF. I only have 22uF on my 3.3V supply on my main board.
My main board with this ESP32 board mounted on it won't start with the my board main supply by itself. I have connect the USB cable and start the Arduino IDE and at least do a Serial Monitor.
Solved it just now by putting a 1uF cap to ground on the EN pin which on this module is pin 37, next to 3.3V at pin 38. My clue was I could touch the EN pin to ground momentarily and I would get start-up.
I do not supply any 5V to my ESP32 board at all, and supplying it did not help with the startup. Now it starts-up with just my board main supply.
Hello milika greetings from Mexico, what pins or how did you connect GND to the USB port? There are also some errors in the letters it seems to me, of some pins like instead of saying GND it should say CMD. When I put 5 to 7 V to vin, the led blinks, I have to put up to 9v for it to stabilize. This card is a generic Dev kit v4. I also have one with an IPX connector, which is more stable at 7v, but it fails when I input 5v. Connected both cards to the USB port they work fine. Thanks for your answers.