What is your power setup like? This sounds like the power supply for the ESP32 at times can go below the minimums as indicated in the datasheet, and if that's not handled correctly that can lead to the ESP32 going into an unpredictable state. That is a hardware thing, and you'd need an external voltage monitor to make sure the ESP32 resets properly when that happens.DanielPLongo wrote: ↑Wed May 10, 2023 1:48 pmI have been experiencing this exact same issue. My power source is dual battery and solar panel.
Mysterious freeze/stop in the field
-
- Posts: 9772
- Joined: Thu Nov 26, 2015 4:08 am
Re: Mysterious freeze/stop in the field
-
- Posts: 131
- Joined: Tue May 17, 2016 8:12 pm
Re: Mysterious freeze/stop in the field
Some suggestions:
- Power supply, as suggested by @ESP-Sprite, use a good one. Did have that problem at a point.
- I assume you are making your own PCB so decouple the LDO with the usual small 0.1 and 10uF and another big 100uF in the VOUT section.
- Review your power traces, should be thicker than signal traces and actually even thicker than a trace width calculator would suggest.
- Power freezing/spikes usually happens when using WiFi(as it seems here). In this forum it has been stated repeatedly this is an issue (brown-out also at boot time). Suggest to concentrate debugging/logging those sections of your code.
- A defective ESP32 could eventually be an issue, but do not disregard smd welding issues, even if done by a good factory, more if it's done by oneself.
- If you can power the other device directly from the USB PS would really help in eliminating power supply errors as a reason for a CPU freeze due to starvation from the LDO
- SW wise I suggest logging into flash on your suspected tasks (which should have a good stack size if using wifi functions like HTTP, bluetooth, printf, etc). Its impossible for a person to monitor for 1 hour straight not to mention 7 days. This could help giving you context as to whether it has a constant freeze/fail pattern.
Re: Mysterious freeze/stop in the field
we are also facing this issue, some of our products are freezing unpredictably and some are working smoothly. same code base and same system design are working as well. we have tried a few changes like power source, esp32 Arduino core version but nothing is solving the situation. we have noticed a phenomenon that mostly during power fluctuation esp32 becomes stop and it never starts until a complete power off. other MCUs restart themselves.
Re: Mysterious freeze/stop in the field
I have the same issue as well with esp32. I use them in cars for tracking. Some esp32 stop working or freezing without any known reason until a hard reset. Out of 10 devices one device will not work.
I searched and googled alot for the solution but couldn't find any reasonable answer.
At the end I finally came to conclusion that esp32 is not reliable.
Many customers are returning goods.
I searched and googled alot for the solution but couldn't find any reasonable answer.
At the end I finally came to conclusion that esp32 is not reliable.
Many customers are returning goods.
-
- Posts: 1
- Joined: Fri Dec 01, 2023 11:37 am
Re: Mysterious freeze/stop in the field
same problem here.
on a 1:1 model in the lab, it takes several months, but once in production, the esp32 freezes every 6 hours.
I use 3 inputs and one output to control a pump.
I supply directly on the 3.3v with a dc-dc converter 12v 3.3v 2A
once frozen, the esp 32 does strange things:
when it works we have :
input level at 0.01V
and HIGH output level at 3.28V
after a freeze :
input level 1.25V
HIGH output level: 2.28V
on other subjects, some people have added a 50ms tempo in loop(), I've added a 200ms tempo and lowered the esp32 frequency to 160mhz. This seems to hold, but strangely enough, the variables now reset after 3 or 4 hours, as if the esp32 were restarting by itself from time to time It's better than freezing, but my arduino uno didn't do that. I also have a doubt about the messages on the serial monitor, which are in the code and useless
void loop() {
...
unsigned long previousMillis = 0;
const long interval = 200; // 200 millisecond delay
// Checks if elapsed time exceeds specified interval
if (currentMillis - previousMillis >= interval) {
// Stores current time
Serial.println("wait 200ms");
previousMillis = currentMillis;
tempo100ms();
}
void tempo100ms() {
unsigned long startMillis = millis();
unsigned long currentMillis = startMillis;
while (currentMillis - startMillis < 200) {
// Wait
currentMillis = millis();
}
}
on a 1:1 model in the lab, it takes several months, but once in production, the esp32 freezes every 6 hours.
I use 3 inputs and one output to control a pump.
I supply directly on the 3.3v with a dc-dc converter 12v 3.3v 2A
once frozen, the esp 32 does strange things:
when it works we have :
input level at 0.01V
and HIGH output level at 3.28V
after a freeze :
input level 1.25V
HIGH output level: 2.28V
on other subjects, some people have added a 50ms tempo in loop(), I've added a 200ms tempo and lowered the esp32 frequency to 160mhz. This seems to hold, but strangely enough, the variables now reset after 3 or 4 hours, as if the esp32 were restarting by itself from time to time It's better than freezing, but my arduino uno didn't do that. I also have a doubt about the messages on the serial monitor, which are in the code and useless
void loop() {
...
unsigned long previousMillis = 0;
const long interval = 200; // 200 millisecond delay
// Checks if elapsed time exceeds specified interval
if (currentMillis - previousMillis >= interval) {
// Stores current time
Serial.println("wait 200ms");
previousMillis = currentMillis;
tempo100ms();
}
void tempo100ms() {
unsigned long startMillis = millis();
unsigned long currentMillis = startMillis;
while (currentMillis - startMillis < 200) {
// Wait
currentMillis = millis();
}
}
-
- Posts: 9772
- Joined: Thu Nov 26, 2015 4:08 am
Re: Mysterious freeze/stop in the field
Especially with a setup like that: do you know for sure you don't have spikes from the pump getting through to the 3.3V line?ScientiaCogitationis wrote: ↑Sat Dec 02, 2023 9:13 amon a 1:1 model in the lab, it takes several months, but once in production, the esp32 freezes every 6 hours.
I use 3 inputs and one output to control a pump.
I supply directly on the 3.3v with a dc-dc converter 12v 3.3v 2A
Who is online
Users browsing this forum: No registered users and 102 guests