-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Add periodic reboot/reboot on wifi disconnection option. #153
Comments
I also have problems with my ESP32 disconnecting and not coming online again. The reboot would be a welcome workaround but an actual solution would also be appreciated. |
Hey, Do either of you have any serial logs to share when the device becomes unresponsive? Thanks! |
Thanks for noticing this. I have only remote logging set up. The BLE device I am monitoring is very chatty. I use the default bin and see lots of Bluetooth message but nothing else. |
@shmuelzon perhaps you could provide a bin where less/no bluetooth messages are being logged. I would try to catch the ESP32 module's log output on a Raspberry Pi or an ESP8266. From what my research shows the ESP32 not reconnecting seems to be a more common issue. |
Hey, @giddyhup Please find attached binaries with some log messages removed. One's with the default INFO level debugs while the other is DEBUG. I've removed some of my debug messages but you'll probably still see some from the other modules. ble2mqtt.debug.bin.gz I'm interested in what you've found regarding the ESP32 not reconnecting. Anything concrete for the root cause or any workarounds? |
@shmuelzon thanks for the binaries. It may take some time for me to work with them but I will report back. Regarding re-connection issues. I noticed this comment in wifi.c:
|
I did first what could be done without much infrastructure change. I remote-flashed the DEBUG image and collected the log remotely. The flash procedure ended with a warm reboot. I used remote logging and after about a minute encountered a disconnect. In the past I experienced disconnects only about once in 12 hours so I was either 'lucky' or something was triggered (wild idea: could it be DHCP renewal?). The log showed no abnormalities. The last entry is the discovery of a BLE device that the module did not connect to (I only have one address whitelisted). After a forced manual reset via the module's reset button the messages appearing in the remote log still show no abnormalities. There is just some MQTT connection and subscribe chatter and listing of BLE devices. As I feared, I really have to find a solution for direct logging from a Raspberry Pi to get what is going on when the module disconnects. |
Unfortunately, you're right. Debugging WiFi issues can't be done over WiFi. |
Please find attached a redacted excerpt where I de-authed the module on purpose to see what happens. A panic happened, the module rebooted and reconnected. So here, the result at least was desirable. I had remote logging still enabled but disabled it now for the next tests. |
Thanks for that. It looks like we've run or of memory (?) |
Apparently serial logging fixes the reconnection issues. : ) The module is online since I started logging. I'll keep logging. |
How do I enable this accidental fix? |
I was joking, but if you want to try it yourself here's what I did: I flashed (OTA) ble2mqtt.debug.bin.gz and connected my ESP32 module via its USB port to a Raspberry Pi. On the Pi I use minicom to collect the module's serial output and write it to a file. |
BTW - Not sure if relevant to your setup, I once had an ESP32 connected to an RPI2 (I think) and it would often fail and get stuck in a boot loop but when I moved it to another machine (with USB3) it didn't happen again. I'm guessing it might be related to the amount of current the USB was able to provide. |
@shmuelzon, thanks for pointing that out. Initially, my ESP32 was connected to a USB charging brick that provides 5V/1A or more. Currently, it is connected to a Pi 4's USB 2 port. So I guess it is currently getting less juice while before (where it had issues reconnecting). Perhaps later will connect it to the charger again and see if failing reconnects reoccur. |
@shmuelzon I was offline for a few days and am now back to continue with this issue. I downgraded to the official version (16) and can confirm that the issue returns. In the log these entries keep repeating:
|
I am using the debug version again and a few minutes ago the BT connection to the (single whitelisted) device I am listening to got disconnected. Initially, when I checked the web interface the request appeared in the log but during handling the web request the module disconnected:
|
Is your feature request related to a problem? Please describe.
Device goes offline randomy after at least few hours. Disconnects from MQTT and can't load web interface too. Solution is to power cycle the device.
Describe the solution you'd like
Option to have device restarted at periodic intervals. And/or a device to reboot after it has disconnected from the network.
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: