Skip to main content

MCUmgr Client for Zephyr

Crates.io PyPI - Version PyPI - Downloads License Build Status Docs Status

This library provides a Rust-based Python API for Zephyr's MCUmgr protocol.

It might be compatible with other MCUmgr/SMP-based systems, but it is developed with Zephyr in mind.

Its primary design goals are:

  • Completeness
    • cover all use cases of Zephyr's MCUmgr
    • for implementation progress, see this tracking issue
  • Performance
    • use static memory and large buffers to prioritize performance over memory footprint
    • see further down for more information regarding performance optimizations required on Zephyr side

Usage Example

Connect to a serial port:

from mcumgr_toolkit import MCUmgrClient

with MCUmgrClient.serial("/dev/ttyACM0") as client:
    client.use_auto_frame_size()

    print(client.os_echo("Hello world!"))
Hello world!

Or a USB-based serial port:

from mcumgr_toolkit import MCUmgrClient

with MCUmgrClient.usb_serial("2fe3:0004") as client:
    client.use_auto_frame_size()

    print(client.os_echo("Hello world!"))
Hello world!

For more information, take a look at the API reference.

Performance

Zephyr's default buffer sizes are quite small and reduce the read/write performance drastically.

The central most important setting is MCUMGR_TRANSPORT_NETBUF_SIZE. Its default of 384 bytes is very limiting, both for performance and as cutoff for large responses, like os_task_statistics() or some shell commands.

Be aware that changing this value also requires an increase of MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE to prevent overflow crashes.

In practice, I found that the following values work quite well (on i.MX RT1060) and give me 410 KB/s read and 120 KB/s write throughput, which is an order of magnitude faster than the default settings.

CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=4096
CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=8192

If the experience differs on other chips, please open an issue and let me know.

Contributions

Contributions are welcome!

I primarily wrote this crate for myself, so any ideas for improvements are greatly appreciated.

Metadata

Release files for mcumgr-toolkit 0.19.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for mcumgr-toolkit 0.19.2
File Actions
mcumgr_toolkit-0.19.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for mcumgr_toolkit-0.19.2-cp310-abi3-win_amd64.whl
mcumgr_toolkit-0.19.2-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details for mcumgr_toolkit-0.19.2-cp310-abi3-win32.whl
mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_x86_64.whl
mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_i686.whl CPython 3.10 abi3 Linux musl 1.2+ x86-32 Details for mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_i686.whl
mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_armv7l.whl CPython 3.10 abi3 Linux musl 1.2+ ARMv7l Details for mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_armv7l.whl
mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_aarch64.whl
mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.10 abi3 Linux glibc 2.17+ IBM System/390x Details for mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.10 abi3 Linux glibc 2.17+ PowerPC 64-le Details for mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl CPython 3.10 abi3 Linux glibc 2.17+ PowerPC 64-be Details for mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-32 Details for mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.10 abi3 Linux glibc 2.17+ ARMv7l Details for mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
mcumgr_toolkit-0.19.2-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details for mcumgr_toolkit-0.19.2-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Total release size: 29.4 MB

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-win_amd64.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-win_amd64.whl
Size 1.7 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
827d26846abc28db989c4e8c7e1b7297620966fcb3550de23f728fc3749f2a6e
BLAKE2b-256 checksum
How to use checksums
76904fc091268615dcf07509a1f5316b74828dd6e23e18619ee7b44f8fdb4a41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-win32.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-win32.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
2c6a50fdee4b4dbb739d3e83d8c7bd93635323eba8b34d374c50a2e7b9f0f11d
BLAKE2b-256 checksum
How to use checksums
7ff1d179ce8a4389ec6897e805b803651f2f1ae5ea92168f681d2fa4932b033e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_x86_64.whl
Size 2.3 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
15d8c01f5bafade7bb3b5ffd0e41f19522645f8ae19357864759c8b3a9732a06
BLAKE2b-256 checksum
How to use checksums
a9520e4986c7ad73635c71c86eaf4f69d70d7ca14eef300a87750ba7947c86c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_i686.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_i686.whl
Size 2.2 MB
Tags CPython 3.10 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
39e0a970aa3f7d46ffd5df2d35e5de3e3dfe1af0468914acc12b577d286446dd
BLAKE2b-256 checksum
How to use checksums
b9981205b390de6ac999b4c8ba5755add34f4ac5b9e70aea9d5a2d76ce33530b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_armv7l.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_armv7l.whl
Size 2.2 MB
Tags CPython 3.10 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
530b06b2b376ae7613f78b3e4304cb5c254e04f209a4dff63c475da2d1cda5c9
BLAKE2b-256 checksum
How to use checksums
c3b800788b5d88ceac4ea4437a262fb94076c8864957aa132aa27b5d903b0fdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-musllinux_1_2_aarch64.whl
Size 2.1 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
c09e36124d4be6393cf5d521890e2075075094115e43c8c6208d6be4f3ceecb9
BLAKE2b-256 checksum
How to use checksums
16ec10ee7d4bbca1e246eb40d67c34adcc30e847220cec4eec85da5af6d9901b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d23f09e678b94436250114953c0170f672a538459452aec3b51e198cc6e27c5c
BLAKE2b-256 checksum
How to use checksums
2d33d79211518969cdf92702e5dd134bc310c35ac8c42ae491b6d21cc50e23c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
d8aa36ef685b63d0beaa80799b1a704c67de5ed7f070bbf3cbf6c481e9c8c093
BLAKE2b-256 checksum
How to use checksums
62ef3aef352036484837d48e6c22fa41b16fa27f8ee163deb49777076a37aa3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
d3b01e8806eda4b410eedb25fa0f8f4f53cd34d528288e0df86f1e3b91f17f00
BLAKE2b-256 checksum
How to use checksums
df86e19aac83d51886429193b37999bddcdc3b02255cf4434963b064160c6961
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ PowerPC 64-be abi3
SHA-256 checksum
How to use checksums
059e8189d0df13d2605b2cadb2734d395a905e541977202969895a77ec3cb64c
BLAKE2b-256 checksum
How to use checksums
101e08ba565c027584998791d0539097dff5f0ee32467c1c0a703b70e58f5d72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Size 2.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
881e958d0ddb70a95e5ce951bd19e100ddcd388101d666f4374ae4d05bfeeed9
BLAKE2b-256 checksum
How to use checksums
79934d804bc4a48f1f0a93aead0aa7365932201c01f32cc4b64c7a8267870396
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 1.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
cba392eecde599c2e6ebdb3503daa97d2b197dc1773d4d9d7ef806241c414d2c
BLAKE2b-256 checksum
How to use checksums
295d14551ebe291510ef444201edb43a69981efed99a3f36828084d6939f41f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
fe0d0e7262f13f8c845588e4a02e9822db21202355430c36a1158c82a83f0e40
BLAKE2b-256 checksum
How to use checksums
a4b2e0018e23e2c9b267cc73313ec5312eb67231ab19bc251d14763f818c3ae6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / mcumgr_toolkit-0.19.2-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL mcumgr_toolkit-0.19.2-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 3.2 MB
Tags CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6c1b599bae2fbbfd6614830ac08893d0552e30b14d46a244ccf7b775901e0080
BLAKE2b-256 checksum
How to use checksums
242dbb6421fda93ea696158ce7a59225051d73009e5d85aa6f0a9af88765e9af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for mcumgr-toolkit 0.19.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page