ESP8266 reboot report

arjen1
Posts: 16
Joined: Sun Aug 06, 2023 4:48 pm

ESP8266 reboot report

Postby arjen1 » Sun Sep 17, 2023 5:49 pm

Dear forum

Got an ESP8266 running measuring my Energy consumption and solar panels yield. Got it running for a few years already. Now and then, maybe twice a day, it reboots. This was not the case in the beginning it would run for days, even months. I'd like to investigate the cause of the error.

I cannot 'wait' for hours to watch this to occur and then read the serial output. Is there a way to store the reboot report so I can read that at my convenience?

An example of such a function is highly appreciated.

Thanks.

bobtidey
Posts: 43
Joined: Mon Jun 18, 2018 2:24 pm

Re: ESP8266 reboot report

Postby bobtidey » Tue Sep 19, 2023 6:01 pm

ESP.getResetReason().c_str() will return a string with reason for last reset

rst_info *resetInfo;
resetInfo = ESP.getResetInfoPtr();

will give you access to the rst_info structure which has more detail

Check out https://www.esp8266.com/viewtopic.php?p=26862

From either of those you could store the data in a file if you have the filing system set up.

arjen1
Posts: 16
Joined: Sun Aug 06, 2023 4:48 pm

Re: ESP8266 reboot report

Postby arjen1 » Wed Sep 20, 2023 10:07 am

Thanks. I'll try that.

Who is online

Users browsing this forum: No registered users and 7 guests