Simple Management Protocol (SMP) Client for remotely managing MCU firmware
Actively maintained. Last release 3 weeks ago, commits in 10 of the last 26 weeks. A safe choice.
pip install smpclientSimple Management Protocol (SMP) Client
smpclient implements the transport layer of the Simple Management Protocol. This library can be
used as a dependency in applications that use SMP over serial (UART or USB), Bluetooth (BLE),
or UDP connections. Some abstractions are provided for common routines like upgrading device
firmware.
If you don't need a library with the transport layer implemented, then you might prefer to use smp instead. The SMP specification can be found here.
If you'd like an SMP CLI application instead of a library, then you should try smpmgr.
Install
smpclient is distributed by PyPI and can be installed with uv, pip, and other dependency managers.
Build with all transports:
smpclient[all]
Or none (UDP transport only):
smpclient
Or build with only the transports you need:
smpclient[serial] # Serial (UART, USB, CAN)
smpclient[ble] # Bluetooth Low Energy
smpclient[serial,ble] # Serial + BLE
The UDP transport has no additional dependencies and is always available.
User Documentation
Documentation is in the source code so that it is available to your editor. An online version is generated and available here.
Server Buffers & SMP Serial Fragmentation
Choosing the right fragmentation for the serial transport (UART/USB/CAN/etc.) requires understanding the buffers in the firmware on the other end. The two SMP servers we target name the same concepts differently, and the docs/Kconfig on each side are easy to misread, so this section unifies the terminology. (BLE and UDP negotiate their MTU directly and need none of this.)
The SMP serial frame
A serial SMP transaction is one decoded frame: a 2-byte length and a 2-byte CRC16 wrap the SMP message — and that wrapped message is exactly what the BLE and UDP transports send bare.
flowchart LR
subgraph FRAME["decoded frame"]
direction LR
LEN["length<br/>(2 B)"]
MSG["decoded SMP message<br/>(SMP header + CBOR)"]
CRC["CRC16<br/>(2 B)"]
LEN --- MSG --- CRC
end