mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-05-02 11:32:35 +02:00
BLE connections can enter a "zombie" state where notifications (reads) still arrive but writes silently fail. This went undetected until the user tried to send a message, at which point the connection was already dead. Additionally, after an abnormal BLE disconnect, BlueZ retains stale GATT notification handles, causing reconnection to fail with "[org.bluez.Error.NotPermitted] Notify acquired". Changes: - Add BLE keepalive loop (60s interval) that sends get_bat() to detect zombie connections proactively and trigger reconnection automatically - Add adapter power-cycle (hci0 off/on via D-Bus) during BLE reconnection to clear stale GATT notification state - Dedicated _ble_reconnect() with 5 attempts + adapter reset between each - Health endpoint returns 503 when BLE permanently fails, triggering Docker container restart via healthcheck - Guard against concurrent reconnection attempts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>