silabs-ble-ota
Flash firmware to Silicon Labs EFR32 devices over BLE from Python, using the
Silicon Labs AppLoader OTA GATT service (a .gbl image). Transport-agnostic
— it uses bleak-retry-connector's
establish_connection, so the same code flashes over a direct Bluetooth
adapter or an ESPHome Bluetooth proxy.
Installation
pip install silabs-ble-ota
Library
The device must already be in the AppLoader (OTA bootloader) when you call
perform_silabs_ota. Triggering the bootloader and re-discovering the device is
vendor/device specific and is the caller's responsibility.
from silabs_ble_ota import SilabsOTAError, perform_silabs_ota
# `ble_device` is a bleak BLEDevice already in (or booting into) the AppLoader,
# at the same address as the application:
gbl = open("firmware.gbl", "rb").read()
try:
await perform_silabs_ota(
gbl,
ble_device,
on_progress=lambda pct: print(f"{pct:.0f}%"),
on_log=print,
)
except SilabsOTAError as exc:
print(f"OTA failed: {exc}")
perform_silabs_ota(gbl_bytes, ble_device, on_progress=None, on_log=None, *, fast=False)
| Argument | Description |
|---|---|
gbl_bytes |
Raw .gbl firmware bytes. |
ble_device |
A bleak BLEDevice already in (or booting into) the AppLoader, at the same address as the application. |
on_progress |
Optional callback, called with a float percentage 0–100. |
on_log |
Optional callback for human-readable status messages. |
fast |
True uses a larger write-without-response window for a ~2× faster transfer. Only safe on a direct connection — see below. Defaults to False. |
Raises SilabsOTAError if the connection or transfer fails, or the device is not
in OTA mode. No external sleep is needed before calling — it retries the
connect itself while the AppLoader boots.
Reliability over Bluetooth proxies
The Silicon Labs AppLoader has no packet-receipt flow control. Over an
ESPHome proxy (which forwards write-without-response with no backpressure), an
unacknowledged data write can be silently dropped when the device's buffer
is full — producing a complete-looking stream but an incomplete image that fails
the finalize step. By default this library therefore acknowledges every data
write (response=True), so no chunk is silently lost, and retries on a proxy
Congested signal. This is the safe default and is required through a proxy.
fast=True for direct connections
On a direct Bluetooth adapter (BlueZ, CoreBluetooth) the OS socket
backpressures write-without-response, so chunks are never silently dropped.
Passing fast=True then streams a window of write-without-response chunks
between acks for roughly 2× the throughput (measured ~58s vs ~125s for a
234 KB image on EFR32BG22). Do not use fast=True through an ESPHome proxy —
dropped chunks will corrupt the image.
It also:
- connects with
use_services_cache=False(fresh GATT discovery — the AppLoader has a different service table than the application at the same address); - treats the connection as one-shot (the AppLoader reboots to the application when the connection drops), retrying only the connect, never reconnecting mid-flash;
- identifies the OTA service by its characteristic UUIDs (the OTA service UUID varies between AppLoader builds).
License
Apache-2.0
Metadata
Release files for silabs-ble-ota 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| silabs_ble_ota-0.1.0.tar.gz | 69.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| silabs_ble_ota-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 81.3 kB
Release files / silabs_ble_ota-0.1.0.tar.gz
| Download URL | silabs_ble_ota-0.1.0.tar.gz |
|---|---|
| Size | 69.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4559504886d3cc7fd53b2ec200a86e6dadeda944ced727ce5786519817ba7e92
|
|
BLAKE2b-256 checksum How to use checksums |
40d393c3fd8d646ba4550d1d4a95d8c4014836c05bd6e67b4d8203f2a3186c5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.
Transparency logRelease files / silabs_ble_ota-0.1.0-py3-none-any.whl
| Download URL | silabs_ble_ota-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba1add7e96dda03ffb50c1737e49fad09db764c78c2a6f84738ea40d856c7c58
|
|
BLAKE2b-256 checksum How to use checksums |
e4b6a57bae5ec8772a7ea977507aef788b0e1c162728ec58dfd7f34ae2a8912f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 1, 2026.
Transparency log