Unintentional ESP32 Resets Reboots - hoylabs/OpenDTU-OnBattery GitHub Wiki
There are "intentional restarts," which are triggered by a user-directed process, such as installing new software, and "unintended reboots," which occur unexpectedly. If "unintended reboots" occur frequently, they can significantly disrupt the system's operation.
However, before we can address the restart problem, we first need to find the reason for the restart. And that's not too difficult, because the ESP32 is equipped with reset cause logging, which tells you what caused the reboot, and that's already implemented.
This is not possible on every ESP32 board, not with every power supply, and certainly not if there is also a serial connection.
Therefore, I would recommend proceeding as follows:
-
Disconnect the ESP32 board from the power supply, wait a few seconds, and then reconnect it. However... Do not use a serial connection under any circumstances. For example, do not connect it to a PC's USB port.
-
After reconnecting, check the reset reason for both CPUs under Info->System. It must display "Vbat power on reset" for both. Otherwise, it will not be possible to determine the cause of the reboot.

-
Then, trigger a reboot via the web UI settings -> Restart and check the reset reason again via Info -> System. This time, "Software reset CPU" should be displayed for both.

-
And now it's best to note the time and check from time to time whether a reboot/reset has taken place and what the cause was.
If you see messages like "Vbat power on reset" or "Reset when the vdd voltage is not stable," then you have a problem with the power supply. This is currently the most common cause, and ESP32 demo boards are particularly affected.
For all other causes, I recommend opening an issue.
If you want to know more about the 16 reboot causes, check this: ESP32 Reset Reason