esp-protocomm
A Python client for protocomm, Espressif's transport for ESP-IDF unified provisioning: the security1 handshake, the BLE transport, and Wi-Fi provisioning. It talks to any ESP32 device running protocomm, over Bluetooth Low Energy, from a laptop or a server.
Unofficial. Not affiliated with, endorsed by, or supported by Espressif Systems. Portions are adapted from ESP-IDF under the Apache License 2.0; see NOTICE for per-file attribution and a list of the changes made.
Install
pip install esp-protocomm # the session: handshake, Wi-Fi provisioning
pip install "esp-protocomm[ble]" # adds the radio (bleak)
The base install needs no Bluetooth stack, so the handshake and the protobuf schemas can be exercised in CI. Only BleTransport requires the extra.
Use
import asyncio
from esp_protocomm import Security1, establish_session, provision_wifi
from esp_protocomm.ble import BleTransport
async def main():
async with BleTransport("XX:XX:XX:XX:XX:XX") as transport:
security = await establish_session(transport, Security1(pop="abcd1234"))
status = await provision_wifi(transport, security, ssid="my-network", passphrase="...")
print(status)
asyncio.run(main())
The endpoint name-to-UUID map is read from the device's 0x2901 descriptors rather than hardcoded, so a product that registers its own endpoint alongside the standard ones works without changes here.
Scope
What this is: the protocomm session and the standard prov-session / prov-config endpoints.
What it is not: a device's own application commands. Those ride over the session this library establishes, on their own endpoint, and belong in that product's code. Keeping that boundary is why this is a separate library.
Security scheme support is security1 (X25519 key exchange, AES-CTR, proof-of-possession). The protobuf definitions for security0 and security2 are present because they ship together upstream, but only security1 has a client here.
Development
pip install -e ".[dev]"
pytest tests/ -v
ruff check . && ruff format --check .
Tests run against an in-process fake device that implements the device side of the handshake with the same primitives as the client, so they exercise the real key exchange, the real AES-CTR keystream, and the real framing. No radio, no hardware.
Releasing
Publishing uses PyPI Trusted Publishing (OIDC), so there is no API token in this repository and there should not be one. Tag a version and the Release workflow builds, checks that the wheel carries LICENSE and NOTICE, and publishes.
Before the first release, PyPI needs to be told which workflow is allowed to publish. Because the project does not exist there yet, this is a pending publisher at pypi.org/manage/account/publishing:
| Field | Value |
|---|---|
| PyPI Project Name | esp-protocomm |
| Owner | electrification-bus |
| Repository name | esp-protocomm |
| Workflow name | release.yml |
| Environment name | pypi |
Workflow name is the filename, not the name: inside it, and the environment must match the job's environment: key. The pending publisher converts to a normal one on the first successful publish.
git tag v0.1.0 && git push origin v0.1.0
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file esp_protocomm-0.1.0.tar.gz.
File metadata
- Download URL: esp_protocomm-0.1.0.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92b36f9f970a93f7f432bb971c00cf5ee0e682e57ee8e4f440097f6dfe00c213
|
|
| MD5 |
1da1f69eb879ce416ccd2b4b04a0e681
|
|
| BLAKE2b-256 |
3ac9d065fcbd7c25a3d7e294a02c32e5b60a89e004166e73da1fe3e1b2d782ed
|
Provenance
The following attestation bundles were made for esp_protocomm-0.1.0.tar.gz:
Publisher:
release.yml on electrification-bus/esp-protocomm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esp_protocomm-0.1.0.tar.gz -
Subject digest:
92b36f9f970a93f7f432bb971c00cf5ee0e682e57ee8e4f440097f6dfe00c213 - Sigstore transparency entry: 2468030393
- Sigstore integration time:
-
Permalink:
electrification-bus/esp-protocomm@bf14e1c1135a65b9b6ef4ecf028b2b1a4ec532e9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/electrification-bus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bf14e1c1135a65b9b6ef4ecf028b2b1a4ec532e9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file esp_protocomm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: esp_protocomm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69c2800d904134aff6e36c33cfb746c686c5ca17683804718f572aea727711b2
|
|
| MD5 |
216f396dfe78982b931ac6b035a1e176
|
|
| BLAKE2b-256 |
3bf70db4202ec44e131765894f33bd05b43270b0ef6274b44589e8ee3f0f7c70
|
Provenance
The following attestation bundles were made for esp_protocomm-0.1.0-py3-none-any.whl:
Publisher:
release.yml on electrification-bus/esp-protocomm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esp_protocomm-0.1.0-py3-none-any.whl -
Subject digest:
69c2800d904134aff6e36c33cfb746c686c5ca17683804718f572aea727711b2 - Sigstore transparency entry: 2468030433
- Sigstore integration time:
-
Permalink:
electrification-bus/esp-protocomm@bf14e1c1135a65b9b6ef4ecf028b2b1a4ec532e9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/electrification-bus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bf14e1c1135a65b9b6ef4ecf028b2b1a4ec532e9 -
Trigger Event:
push
-
Statement type: