The error: A developer sets connection parameters for a BLE temperature sensor with interval = 100ms, latency = 4, and supervision timeout = 1 second, thinking “1 second is plenty of time to detect a lost connection.”
What happens:
The Bluetooth spec requires: supervision_timeout > (1 + latency) × interval × 2
Calculation: - (1 + 4) × 100ms × 2 = 1000ms = 1 second
The timeout is exactly at the minimum threshold. In practice, the supervisor timer starts AFTER the last successful packet exchange, and jitter in the connection event timing can cause the timeout to fire prematurely.
Real-world failure scenario (observed in production):
A warehouse temperature monitoring system with 200 BLE sensors experienced 15-20 “phantom disconnections” per hour – connections dropped despite both devices being in range and functional.
Root cause:
- Connection interval: 500ms
- Peripheral latency: 19 (wake every 20th interval = every 10 seconds)
- Supervision timeout: 20 seconds (exactly
(1+19) × 500ms × 2)
During peak warehouse activity, RF interference from forklifts caused occasional packet loss. When the peripheral skipped the maximum allowed intervals (19) and then lost the 20th packet due to interference, the supervisor timer expired before the next connection event.
The fix:
Add a safety margin of 2-3x the minimum:
Minimum: (1 + latency) × interval × 2
Recommended: (1 + latency) × interval × 2 × 3
For the sensor above:
(1 + 19) × 500ms × 2 × 3 = 60 seconds
Impact:
- Before fix: 15-20 disconnections/hour, 95% uptime
- After fix (60s timeout): 0-1 disconnection/hour, 99.9% uptime
Measured in industrial BLE deployments:
- Minimum timeout (2× formula): 5-10% spurious disconnection rate
- 3× timeout: 0.1% disconnection rate
- 5× timeout: <0.01% (but slower detection of genuine disconnections)
Rule of thumb: Use 3× minimum for consumer devices, 5× for industrial/medical where RF environments are harsh.