emsesp / EMS-ESP32

ESP32 firmware to read and control EMS and Heatronic compatible equipment such as boilers, thermostats, solar modules, and heat pumps
https://emsesp.github.io/docs
GNU Lesser General Public License v3.0
589 stars 100 forks source link

EMS-ESP32 restarting #244

Closed maciejka104 closed 2 years ago

maciejka104 commented 2 years ago

My device running v3.3.1b0 firmware is restarting/rebooting by itself. EMS connected to Junkers cerapur. Approximately every 4-6 hours is restarting. Max uptime is 10 hrs. Anything I could check in the settings? I did reset to factory settings and configured minimum – basically MQTT (connected to HA) and EMS Bus (HT3). What could be a problem?

proddy commented 2 years ago

wow, that could be anything. Did you build the circuit yourself? Does it crash if you disable the MQTT? Try and pinpoint which service is crashing. Use the syslog to capture the logs which may hint to something weird happening. Also let us know what your config is

maciejka104 commented 2 years ago

It is bbqkees circuit. Will check MQTT - thanks for pointing me somewhere …. ;)

bbqkees commented 2 years ago

@maciejka104 had a Premium II which we upgraded with an ESP32. Both the old and the new board have the same rebooting issue, even when powered via USB without EMS connected so I basically ruled out a hardware issue at this point. Perhaps a fringe case with his setup that freaks out EMS-ESP.

proddy commented 2 years ago

Thanks. I think it is software related, most likely a null pointer/buffer overflow problem. The arduino core is very sensitive to those.

proddy commented 2 years ago

any update @maciejka104 ?

maciejka104 commented 2 years ago

I have disabled MQTT for a couple of days. Basically still the same, up time - up to 20 h Tested on v3.3.0 and v3.3.1b1

proddy commented 2 years ago

These are the worst type of bug. It's like looking for a needle in a haystack. All I can recommend at this point is 1) check the System Log for the restart reason (it'll be the first line) and 2) setup a Syslog server and capture the logs just before it crashes.

glitter-ball commented 2 years ago

Do you have a Dallas sensor connected? If so, is the data coming back from this always OK? I found weird Dallas values and restarts went together on my system. That was down to power issues in my case but it might help narrow things down for you too.

maciejka104 commented 2 years ago

No Dallas sensor. Just junkers boiler.

proddy commented 2 years ago

then my only recommendation is https://emsesp.github.io/docs/#/Troubleshooting?id=ems-esp-sometimes-crashes-and-restarts

maciejka104 commented 2 years ago

I have checked syslog server today and it was empty (qnap). Checked EMS-ESP configuration and then I noticed that I have set up EMS-ESP IP as syslog server IP :/ Silly me 😊 Corrected it and let’s wait for the result.

proddy commented 2 years ago

fingers crossed!

maciejka104 commented 2 years ago

So … correcting syslog's IP didn't help :/ Few min ago it has restarted Here is part of the logs https://pastebin.com/DrBGUFw1 Take a look at 2021-12-30T10:47:16 and on Last log was: ems-esp telegram - - - telegram- 000+05:14:01.597 D 55449: Sending read Tx [#124], telegram: 8B 90 FF 00 20 00 65 Any ideas? If you need I have a logs for a few days. For the records Below uptime taken from HA

obraz

proddy commented 2 years ago

so restarts every 3 hrs with MQTT enabled, and with MQTT disabled it crashes after 20hrs? Wifi has a strong signal and the ESP32 is powered by a steady 5V supply?

maciejka104 commented 2 years ago

Power: 5V power supply - yes, I have tested few PS. WIFI: based on HA info: WIFI strength 50-70%, WIFI RSSI: 71 dBm. In general I have good wifi coverage (cisco). MQTT: looks like you said - disabling mqtt extends the time between reboots but it still reboots.

proddy commented 2 years ago

and if you disconnect from the EMS bus and run it standalone (with MQTT) does it still reboot every few hours?

maciejka104 commented 2 years ago

I think problem is solved.

  1. I have uploaded firmware to v3.3.0 (same as old one)
  2. Reboot/Restart
  3. Factory reset
  4. Configured Boiler settings, MQTT, syslog
  5. Reboot/Restart

Device is up for 3 days now :)

proddy commented 2 years ago

great! but still weird what it was failing before

maciejka104 commented 2 years ago

I really think key action was factory reset and / or re flash same firmware. Before doing that I have tested connection to boiler, checked power supply and it did not help.

proddy commented 2 years ago

ok, I'll make a note of this in the doc and close this issue. thanks for getting back to us.