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.3

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.3
File Actions
mcumgr_toolkit-0.19.3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for mcumgr_toolkit-0.19.3-cp310-abi3-win_amd64.whl
mcumgr_toolkit-0.19.3-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details for mcumgr_toolkit-0.19.3-cp310-abi3-win32.whl
mcumgr_toolkit-0.19.3-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for mcumgr_toolkit-0.19.3-cp310-abi3-musllinux_1_2_x86_64.whl
mcumgr_toolkit-0.19.3-cp310-abi3-musllinux_1_2_i686.whl CPython 3.10 abi3 Linux musl 1.2+ x86-32 Details for mcumgr_toolkit-0.19.3-cp310-abi3-musllinux_1_2_i686.whl
mcumgr_toolkit-0.19.3-cp310-abi3-musllinux_1_2_armv7l.whl CPython 3.10 abi3 Linux musl 1.2+ ARMv7l Details for mcumgr_toolkit-0.19.3-cp310-abi3-musllinux_1_2_armv7l.whl
mcumgr_toolkit-0.19.3-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for mcumgr_toolkit-0.19.3-cp310-abi3-musllinux_1_2_aarch64.whl
mcumgr_toolkit-0.19.3-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.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mcumgr_toolkit-0.19.3-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.3-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
mcumgr_toolkit-0.19.3-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.3-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
mcumgr_toolkit-0.19.3-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.3-cp310-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
mcumgr_toolkit-0.19.3-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.3-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
mcumgr_toolkit-0.19.3-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.10 abi3 Linux glibc 2.17+ ARMv7l Details for mcumgr_toolkit-0.19.3-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
mcumgr_toolkit-0.19.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for mcumgr_toolkit-0.19.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
mcumgr_toolkit-0.19.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.10 abi3 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details for mcumgr_toolkit-0.19.3-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.3-cp310-abi3-win_amd64.whl

Download URL mcumgr_toolkit-0.19.3-cp310-abi3-win_amd64.whl
Size 1.7 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7ad9de858e22f53748ba10ccb1e180dfa272b9dc9d24ba4db028c9e91fc795f6
BLAKE2b-256 checksum
How to use checksums
17d8f08e6459a8d4eb3c7b606e4af13406d65102069bda97d8c6ed92be4eef82
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.3-cp310-abi3-win32.whl

Download URL mcumgr_toolkit-0.19.3-cp310-abi3-win32.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
e78c706202e6bf46abe5574b8ed668caa839ee3dc7b010c092b43d454c614f0b
BLAKE2b-256 checksum
How to use checksums
5dd9f007612bf56f970b6558f2188ad3726d351d842e19f862a056f5ca580a68
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.3-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL mcumgr_toolkit-0.19.3-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
8c3045024703ad679c5f1c973e0a4f505f3e794f3f1aef8c77dacd2d2be9621b
BLAKE2b-256 checksum
How to use checksums
a91a7283c267198a8c8debd79ee92e51240430a508f936343459ad3ccceebc31
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.3-cp310-abi3-musllinux_1_2_i686.whl

Download URL mcumgr_toolkit-0.19.3-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
f5610baecdf2adc09a7ebefbe8a8010c2ca25c1239508eab4f790aac80cc00c4
BLAKE2b-256 checksum
How to use checksums
fd3370daa4832f4c11c7d2bd721dc1baf8a2aaf995b06a646d38e50d9a5cd65a
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.3-cp310-abi3-musllinux_1_2_armv7l.whl

Download URL mcumgr_toolkit-0.19.3-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
9cdbe7286e0d9d000f9aced492262076f64d98bbca4aa01ab380d1ff9ad123df
BLAKE2b-256 checksum
How to use checksums
0e0361ba3af0c3d44c8c3a9efffc6caf150925ff2d77cb5a2da2281d88fcc9e2
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.3-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL mcumgr_toolkit-0.19.3-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
e5d8e963fae15fbf2341902d42e9d3ec804de02c8839a39e812b4708c94374e3
BLAKE2b-256 checksum
How to use checksums
bfc7229f9a3d94555bc97458084cd0009b616db946d86fb8697b1b08f266fb4f
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.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mcumgr_toolkit-0.19.3-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
000f73933dd25404390e38fed08bd9c6c397c07db91ded6ba44c30df8a5e0c69
BLAKE2b-256 checksum
How to use checksums
fe4dd130505117be9d426a86ee8f77d12c17c8910b643665fb4c4fd01be10cb5
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.3-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL mcumgr_toolkit-0.19.3-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
2b53864507e112b35e90a43d0276696e0693f9245bbd4405c9c822bdd44feb59
BLAKE2b-256 checksum
How to use checksums
cdd5d9d39f4234c8e577db87d41eb5ed9f2b0cb9cef19fa3d93526f95b9e6c05
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.3-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL mcumgr_toolkit-0.19.3-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
d721d9a7a85fc6dbfe7a79e83cab8e7d408e320c0adc4bca9f5c33f08f910cd3
BLAKE2b-256 checksum
How to use checksums
86cd36750970ae0c456d0461fa99134b9a0287ac01e85f3fcb51491b21296d0f
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.3-cp310-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl

Download URL mcumgr_toolkit-0.19.3-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
3bc12bac7e3eaec6270a4b30914f2789efcb2cf7e3c84d056269b726ecab90d4
BLAKE2b-256 checksum
How to use checksums
5291655246f844f046f61cac399809d0276602ac263181df1a254dcd0cee7ac7
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.3-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL mcumgr_toolkit-0.19.3-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
cf1464e8d714c91cda39fdc359eb153cf6ac9104892b2f2f7a31e32c15ade298
BLAKE2b-256 checksum
How to use checksums
5436415defa7170b497f9e6dffc338a8ed806275c0371332ef3642873358b86e
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.3-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL mcumgr_toolkit-0.19.3-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
7cbcc8b12e351b735a7a68fd6f8ea329fc7f63024ac5554aa9b49d19dbd64b2d
BLAKE2b-256 checksum
How to use checksums
45fb9ad4cedd8f0139d7beec6d692ce80376ce9d52f27288d9a7d7874e71843f
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.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL mcumgr_toolkit-0.19.3-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
bab2f70f6996ea778c5745b3796cc462267174887613fe61371a770d5b09f344
BLAKE2b-256 checksum
How to use checksums
e59d75984c04373da8de50bcbfe57b912111cb16b697c4bcfc1ee42182a60c62
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.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL mcumgr_toolkit-0.19.3-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
9c53b1ae0a0e4cf8467c616048af1b7da917a470bb0ff670c8c8d047c9e0d587
BLAKE2b-256 checksum
How to use checksums
7cc748a45360c03f9f85e11585776a6bf8bfd49d22e9acd7e42a5d2b3056f316
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.3

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