-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIFI Issue - random reboot when STA is lost (investigation) #276
Comments
Test on my development rig:
ESP32 connected to WIFI hot spot on mobile phone (Android). On boot up, controller report (filtered for wifi events only, logging for MQTT increased to DEBUG level)
Data is successfully transmitted to MQTT server and web interface is working as expected. Upon terminating the WIFI hot spot on the Android phone:
Upon re-enabling the WIFI hot spot on the Android phone:
The code in the controller is designed for the following action when a loss of WIFI is detected (event
After 25 times, the message reported is Once the 25 attempts have failed, esp_wifi_connect() is called inside the main loop, approx. every 30 seconds, reported as As can be seen from the above logs, the development rig environment as described appears to work correctly and recovers from WIFI disconnection and errors successfully. |
Related to #220 |
Ok, managed to get a GURU if I repeat disable wifi hotspot and quickly re-enable it.
|
Possible fix firmware (experimental) |
Hello Stuart, I also noticed that the DIYBMS (Firmware 2023-11-28) was restarting. It seems to have restarted 3 times in a very short time. Unfortunately, I cannot yet say whether this is related to the WLAN. I will try to do tests with WLAN until the end of the week. I could see from the uptime of the controller that it has really restarted. |
It seems to trigger a reboot if the WIFI connection is lost and restored within a second or two, but it looks like a bug in the controller code (as expected!) so I'm hoping this version works as expected. |
the experimental firmware does not start on my esp, black screen. |
This isn't a complete flash image - if you re-flash the "release" version, then use the over the air upgrade feature to apply this experimental one. |
ok now it is running. disconnected wifi several times, no reboot. |
now it is running for two days no issues so far. if this is the trade off for a stable running controller i can live with it, maby not for all user? |
I've not made any changes to the wifi stack - so a hidden SSID shouldn't be a problem. I've a log file from another user who has tested this firmware and unfortunately it didn't solve his reboot. He uses a Fritzbox which does appear to be a common problem with ESP32 hardware.
which decodes as
|
Hi Stuart
Do you think an ESP32 with Ethernet port can solve the pb ?
Le ven. 9 févr. 2024 à 10:24, Stuart Pittaway ***@***.***> a
écrit :
… I've not made any changes to the wifi stack - so a hidden SSID shouldn't
be a problem.
I've a log file from another user who has tested this firmware and
unfortunately it didn't solve his reboot. He uses a Fritzbox which does
appear to be a common problem with ESP32 hardware.
CONTROLLER - ver:cbe2f3314cf6ac9e3db3e1cdb27aa386e6facbcc compiled 2024-02-06T12:40:00.542Z
ESP32 Chip model = 1, Rev 1, Cores=2, Features=50
I (245621) diybms: WIFI_EVENT_STA_DISCONNECTED
I (245621) diybms: ShutdownAllNetworkServices
I (245621) diybms-web: httpd_stop
I (245722) diybms: stop mdns
I (245734) diybms: WIFI connect quick retry 1
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x401b5f92 PS : 0x00060030 A0 : 0x801b6077 A1 : 0x3ffd8da0
A2 : 0x3ffb6328 A3 : 0xffffffff A4 : 0x00000000 A5 : 0xffffffff
A6 : 0x00000000 A7 : 0x3ffe2fc8 A8 : 0x3ffdad40 A9 : 0x3ffd8d10
A10 : 0x00000000 A11 : 0x00000001 A12 : 0x3ffe2438 A13 : 0x3ffe2438
A14 : 0x3ffe2f98 A15 : 0x3ffe2fd2 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4008c0e1 LEND : 0x4008c0f1 LCOUNT : 0xfffffffe
Backtrace: 0x401b5f8f:0x3ffd8da0 0x401b6074:0x3ffd8df0
—
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYDJ6M2NQHTGUZJ5ENNVAT3YSXTLFAVCNFSM6AAAAABC32IJ2GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVGU4DKNRSGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
No idea, I don't have one and it would also need significant code changes to make it work |
YES! LAN is the solution!!! ;-) |
have he tested this with other esp32? well i dont have a fritzbox, but i had also to replace my wifi router because some esp32 have not connected to my previous one... |
Sadly i have no logs, but also a Fritz!Box and the same issues. |
try to make a wifi hotspot on your phone and connect to that. if it will not reboot so the fritzbox is the issue |
Which other router you bought? |
The Hotspot on Iphone is not the right way for testing. Yesterday I switched off the Fritz!Box WiFi and tested a TP-Link Accesspoint(TL-WR841N). |
You can access the DIYBMS web interface directly from the phone web browser, when testing in this fashion. |
dlink dsr-250n it need some tricky fw updates 5 times to the new fw but this router is not longer supported and should not be for internet use. i use it offline my network for my inverters and this bms is offline. @stuartpittaway |
It's the same with me. diyBMS is the only device on my network without LAN :-( |
Security isn't really possible on these sort of devices (ESP32) - at least not without a full TLS encryption layer/certificates - otherwise any sort of password or PIN is pointless as they could be sniffed off the network. |
so 14 days now with experimental fw, no reboot no problems with the wifi. |
Hi @red0909 been 3 weeks now, whats the feedback? |
no problems as far i can see, but i am not using mqtt or homeasistant. |
Hello Stuart, I installed a DIYBMS a few days ago. I have installed the last 4 official releases on the controller and whenever the Fritzbox was rebooted or the wifi was turned off. The controller board is restarted. I then installed the beta "diybms_controller_firmware_experimental_bug276.zip" and the problem was gone. I must have restarted the Fritzbox 2-3 times without a problem. Today the power was probably off for about 1h during the installation. So the Fritzbox was off and the controller board restarted. The DIYBMS is connected to the router as follows (MESH is active): Unfortunately I have no access to the serial console of the controller Nobody wants to hear that here, sorry. |
@jetronic18s |
@red0909 |
Yes, that appears to be the common pattern of failure - using Fritzbox along with mesh/repeater wifi units. Very similar to this problem... arendst/Tasmota#14986 |
Hi Stuart, I think I experienced the same issue recently: I needed to update configuration on my WiFi router, so I rebooted it and just a few seconds later the whole house plunged into darkness, as diyBMS rebooted and relay controlling the inverter went off :) I managed to replicate the issue by stopping the wifi for ~5secs and then enabling it again. I have MikroTik cAP ac router, no TFT, MQTT enabled. The backtrace is pretty much the same as yours:
Apparently, the ESP is accessing a wrong address (EXCVADDR = null). My guess is that the ESP was trying to send an event to a component that was recently freed. I've made a slight change to the With the modified firmware I cannot make diyBMS to crash. I've tried several "wifi dropouts" from 1sec to 1hour and it's still running and reconnects once the WiFi is back. I can prepare PR if you want to look. |
I thought it was normal, I have the same problem... |
Yes @ruza87 a PR would be fabulous. I've chased this bug for months, the main problem is that I cannot reproduce the error with my router. |
Great work, with 2 installations it is no longer a problem if the WLAN fails. No reboot when the Fritzbox (with Mesh) restarts. It looks really good, I'll keep watching. Thank you very much |
I have changed another installation to the new firmware with Wifi Fix, again no reboot after Wifi failure. How are the other affected users doing? |
I am also on the FritzBox Mesh setup. No more issues :) Great work! |
This ticket is to investigate seemingly random reboots of the controller (often related to also losing WIFI STA) with latest firmware version Release-2023-12-27-12-02
May be related to #239
The text was updated successfully, but these errors were encountered: