feat(watchdog): Hardware USB bus reset for stuck LoRa devices

Implement a smart auto-detection and low-level fcntl ioctl reset mechanism for LoRa USB devices. This 'last resort' recovery is triggered if the meshcore-bridge container fails to recover after 3 restarts within an 8-minute window. Includes updates to the installer, systemd service, and newly added README.

Co-Authored-By: Gemini CLI <noreply@google.com>
This commit is contained in:
MarekWo
2026-02-22 20:15:27 +00:00
parent f1e5f39a4e
commit 2f82c589c7
5 changed files with 136 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ The Container Watchdog is a systemd service that monitors Docker containers and
- **Health monitoring** - Checks container status every 30 seconds
- **Automatic restart** - Restarts containers that become unhealthy
- **Auto-start stopped containers** - Starts containers that have stopped (configurable)
- **Hardware USB reset** - Performs a low-level USB bus reset if the LoRa device freezes (detected after 3 failed container restarts within 8 minutes)
- **Diagnostic logging** - Captures container logs before restart for troubleshooting
- **HTTP status endpoint** - Query container status via HTTP API
- **Restart history** - Tracks all automatic restarts with timestamps
@@ -82,6 +83,7 @@ If you need to customize the behavior, the service supports these environment va
| `LOG_FILE` | `/var/log/mc-webui-watchdog.log` | Path to log file |
| `HTTP_PORT` | `5051` | HTTP status port (0 to disable) |
| `AUTO_START` | `true` | Start stopped containers (set to `false` to disable) |
| `USB_DEVICE_PATH` | *(auto-detected)* | Path to the LoRa device (e.g., `/dev/bus/usb/001/002`) for hardware USB bus reset |
To modify defaults, create an override file:
```bash