-
-
Notifications
You must be signed in to change notification settings - Fork 24
BLE adapter silently hangs after hours of operation on Raspberry Pi Zero W (not a proxy bug) #155
Description
Background
This is not a bug in TeslaBleHttpProxy — the proxy itself works great. I'm opening this to share findings and see if other users (especially Pi Zero W users) have encountered this or found a workaround.
Hardware
- Device: Raspberry Pi Zero W Rev 1.1
- Bluetooth: Built-in Broadcom BCM43438, HCI 4.1, Bus: UART
- Kernel: 6.12.62+rpt-rpi-v6 (Raspbian Bookworm, latest as of 2026-03)
- BlueZ: 5.66
- Setup: Systemd service (not Docker), charging_manager role
- Integration: EVCC polling vehicle_data?endpoints=charge_state every ~2.5 minutes
Distance to car: 1 meter.
Problem
After approximately 5 hours of operation, the BLE adapter silently locks up. The proxy continues to receive HTTP requests, but BLE operations never execute. No errors or warnings are logged — requests just
silently hang.
Log pattern when working:
Received HTTP request (VehicleData)
VehicleData endpoint cache expired
Connecting to Vehicle ...
Scanning for vehicle ...
Beacon found
Creating vehicle object ...
Starting VCSEC session ...
Starting Infotainment session ...
Connection to vehicle established
Executing command (vehicle_data)
Successfully executed
Log pattern when hung:
Received HTTP request (VehicleData)
VehicleData endpoint cache expired
(nothing else — no scanning, no connecting, no errors)
The proxy accepts HTTP connections but times out without responding. Attempting sudo hciconfig hci0 reset returns:
Can't down device hci0: Device or resource busy (16)
The only fix is restarting the service first (sudo systemctl restart tesla), then resetting the adapter (sudo hciconfig hci0 reset).
What I've tried
- Kernel + firmware upgrade to latest Raspbian Bookworm packages (new kernel 6.12.62, new BT firmware) — did not fix the issue
- Added CAP_SYS_ADMIN ambient capability to the systemd service (in addition to CAP_NET_ADMIN) — did not fix the issue
- The issue appears related to the known go-ble/ble library problems discussed in Infinite loop in NewConnection teslamotors/vehicle-command#346 and TeslaBleHttpProxy gets into a bad state, eats memory and cpu #76
Current workaround
Restarting the systemd service + resetting the HCI adapter recovers the connection immediately.
Questions for other users
- Has anyone run this reliably on a Pi Zero W for extended periods (days/weeks)?
- Are there any BlueZ or kernel parameters that improve long-running BLE stability?