In review · not yet published
6 min readLaunchapp
BLE in production: the failure modes we design for
Six ways a Bluetooth Low Energy app fails after the demo, and what we build in from the first week so the field does not find them for us.
A Bluetooth Low Energy demo is easy. Pair on the bench, write a characteristic, watch the light change. The work that decides whether a connected product survives contact with customers starts after that, in the gap between a phone on a desk and a phone in a pocket, three operating system releases later, talking to firmware that shipped last year.
We have built that gap more than once: an app that lets drivers reach their vehicles over the internet and BLE at Sibros, residential apps that control home systems, and factory tooling that configures, tests and updates connected products on a production floor. The products differ. The ways they fail do not. These are the six we design for from the first week.
1. iOS will not keep you alive in the background
Teams promise "always connected" and then discover that iOS decides when a backgrounded app runs. Background scanning only works with explicit service UUIDs, discovery is coalesced, and an app the system has terminated is only relaunched for Bluetooth events if it opted in to state preservation and restoration. Apple documents these limits plainly in its Core Bluetooth background processing guide.
So we design reconnection around state restoration, and we do not promise behaviour the operating system will not allow. In practice that means three decisions made early:
- The central manager is created with a restore identifier, and the app can rebuild its session from the peripherals the system hands back.
- Every feature is classified as "works in the background" or "needs the app open", in writing, before screens are designed.
- The product copy says what the app really does. "Reconnects when you open the app" is a promise we can keep.
The honest version of "always connected" is "recovers quickly, and tells you the truth about the last time it heard from the device".
2. Android is not one platform
BLE stacks and permission models vary by OS version and by manufacturer. Android 12 moved scanning and connecting to their own runtime permissions, BLUETOOTH_SCAN and BLUETOOTH_CONNECT, where earlier versions tied scanning to location access; the Android Bluetooth permissions guide lists the differences. Underneath the permissions, connection behaviour differs between chipsets and vendor builds in ways no emulator reproduces.
We test on a real-device matrix, not just emulators. The matrix is chosen from the customer's actual install base, and it is small on purpose: a handful of phones that cover the OS versions and vendors that matter, each one running the same scripted pair, write, kill and reconnect sequence on every release.
3. An OS release breaks connectivity
This is the failure that reaches the news. A new OS version changes Bluetooth behaviour, and apps that worked on Friday strand their users on Monday.
Our engineering lead ran this exact situation at Carrier: the response to major outages caused by the iOS 18 rollout, shipping replacement apps fast to reconnect users to their systems. Two habits came out of it, and we now apply both by default.
First, every iOS and Android beta is tested against the real devices as soon as it is available. The cost is a few hours per beta. The cost of skipping it is discovering the break at the same time as your customers.
Second, a fast release path exists before it is needed. If shipping takes a quarter, an OS break is a crisis. On the same residential app team, releases moved from quarterly to every two weeks, which turns "we found a problem" into a routine release instead of an emergency.
4. The firmware handshake drifts
The phone and the device are two programs written by two teams on two schedules. If the protocol between them lives in someone's memory, they drift.
We agree a versioned protocol with the firmware side: GATT services, characteristics, pairing and bonding behaviour, and the error cases, written down and reviewed by both teams. Then we handle the case everyone forgets, mismatched firmware in the field. Devices that left the factory a year ago are still out there. The app has to recognise an older protocol version and degrade gracefully: offer the features that version supports, explain what an update unlocks, and never assume the newest firmware.
On the factory side of this, product configuration lives in data with an editor for it, so that a new product variant can ship without an app release. The app reads what a device is and what it supports, instead of hard-coding a list.
5. Long sessions and big transfers
Short writes hide every throughput problem. Firmware updates, log pulls and bulk configuration expose them. A default BLE connection carries about 20 bytes of application payload per packet, so anything large is a sequence of chunks, and the sequence has to survive interruption.
Three things make long sessions dependable:
- Chunked transfers with integrity checks. Each chunk is acknowledged and verified, so a failure costs one chunk and not the whole transfer.
- Connection-parameter tuning. Negotiating a larger MTU and a shorter connection interval where both sides support them, and falling back cleanly where they do not.
- Timeouts that recover. Every await has a deadline, and expiry leads to a retry or a clear error. A spinner that never ends is the classic BLE bug.
Firmware updates over the air deserve their own care. We use Nordic's DFU for this on Nordic-based hardware; the Android and iOS libraries are open source. The device restarts into a bootloader, receives a signed init packet and then the firmware in checked pieces, and restarts into the new image. The app's job is everything around that: refusing to start below a battery threshold, keeping the screen and the connection alive, resuming after a dropped link, and telling the user what is happening in words they understand. An update that fails halfway must leave a device that can be updated again.
6. You cannot test it without a lab, so nobody does
Hardware-in-the-loop testing is expensive, so most teams test BLE by hand, late. We split the problem in two.
Simulated peripherals run in CI. They speak the agreed protocol, including the unpleasant parts: slow responses, dropped connections, an older firmware version, a transfer that fails at 60 percent. That covers the app's logic on every commit.
Scripted real-hardware runs cover what simulation cannot, on the device matrix, before each release. The homeowner app team our engineering lead established at Carrier reached 100% end-to-end test coverage, with a QA process behind it, and reported bugs fell by more than half.
The field then needs to be observable. At Sibros, real-time analytics on the connected-vehicle app cut client engineers' debugging time from weeks to hours. Connection attempts, failure codes, firmware versions and time-to-reconnect, collected per release, turn "it doesn't connect sometimes" into a chart with a cause.
How we start
The first week of a BLE engagement is a spike on real hardware: pair, read, write, and reconnect after the app is killed, on your devices, before any screens are designed. If that works, the rest is engineering. If it does not, you have found out in a week instead of a quarter.
Then the protocol is agreed in writing, the release train is built so that shipping every two weeks is routine, and the app ships with crash and connection analytics, so field problems show up before support tickets do.
What we built
The work behind this post: the Sibros connected-vehicle app and its analytics, the Carrier homeowner app turnaround, and the design system and app portfolio that carried the iOS 18 outage response. The cards below link to each.
Proof
The work behind this post
Led
Sibros connected-vehicle app and analytics
Led a five-engineer team on an app that lets drivers reach their vehicles over the internet and BLE, plus real-time analytics for client engineers.
- engineers led
- 5
- engineers led
- client debugging time
- Weeks → hours
- client debugging time
Led
Carrier homeowner app turnaround
Stabilized Carrier's flagship homeowner app, built the team and QA process behind it, and moved releases from quarterly to every two weeks.
- fewer reported bugs
- 50%+
- fewer reported bugs
- end-to-end test coverage
- 100%
- end-to-end test coverage
- release cadence, from quarterly
- 2 wks
- release cadence, from quarterly
Led
Carrier design system and app portfolio
A branded design system that enabled 12 apps in one year for 1M+ users, delivered by teams of 21–50 engineers.
- apps launched in a year
- 12
- apps launched in a year
- users
- 1M+
- users
- engineers led
- 21–50
- engineers led
Founder-led
Building something like this? A founder will reply personally.
Scope a project