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

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

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

Download URL mcumgr_toolkit-0.20.0-cp310-abi3-win32.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
2bb8898cae4f687454c99aebd1f24c8ac25cfdd4becfc63f48cfd3c458101336
BLAKE2b-256 checksum
How to use checksums
ccdaacc0634c35807dc772948c903f13cabd8aeca31cda659ed2bcaf621cd8c8
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.20.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL mcumgr_toolkit-0.20.0-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
d63f5282c9df1d2f7f818119a6c2cff52f501498bb6040bab7990d414065a815
BLAKE2b-256 checksum
How to use checksums
f40ef1a969f144431393040a19d8d561f9200b7cb92e13dd9b73963774ce584d
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.20.0-cp310-abi3-musllinux_1_2_i686.whl

Download URL mcumgr_toolkit-0.20.0-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
08d9379497417f191647ec770e4b559c396b85bdd7d2da55c7e36f414aecd5e0
BLAKE2b-256 checksum
How to use checksums
9a9d4ad68df2edcfac81aa95f7902d91778fe08f4df7e8635142163b8bbb5f50
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.20.0-cp310-abi3-musllinux_1_2_armv7l.whl

Download URL mcumgr_toolkit-0.20.0-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
8f69d658a42b014b65e799da5752ec18c5f2b60dec7db813f723ed1fadc866fb
BLAKE2b-256 checksum
How to use checksums
5849ddaac148bb0be31dee3a550e703bbc854634e117bdb597759ffc000ba92c
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.20.0-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL mcumgr_toolkit-0.20.0-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
dd5239e3f4521c6667db65c7292939f109cf09353d7d7370bcd2e19ebf7a7487
BLAKE2b-256 checksum
How to use checksums
2bb539a4d73b5811a36c207c6d2dae09dc08c5b42957f8f5333bbde9ff3780e4
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.20.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mcumgr_toolkit-0.20.0-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
9b6871d4985404e2f3382fb2754f3ad30db3a0b7dd2a3ee9ce6e3781a98fb5af
BLAKE2b-256 checksum
How to use checksums
7aa983026f5d3115416dc6a1c73bcef68da90a460dd30c132c3fe08d6b3f19d1
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.20.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL mcumgr_toolkit-0.20.0-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
d1441151ac871d187cd661edc12c933ec0beccef34f2d818cb7161e9b6db9854
BLAKE2b-256 checksum
How to use checksums
bff2b68e5e72e4c8e4dd29be588b6ebfb80c4db48fc9aeb562e1300ca959dd9b
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.20.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL mcumgr_toolkit-0.20.0-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
038e9471c9597dddc888c044173aa884a3a7bc63a6787f81c3720484f67e0b9c
BLAKE2b-256 checksum
How to use checksums
9e88baa2978af1560925c67f15869fe1e3ea7f3058f49140cb65f5ea1270543a
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.20.0-cp310-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl

Download URL mcumgr_toolkit-0.20.0-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
2b73c749f58c1aa4a38e7f713f419c8cc559aafb03fe203da196cbfd1bd3dd99
BLAKE2b-256 checksum
How to use checksums
ac3814434bc7e5a950bcf4de86b23c87a714eb1fbe388b08908cd97b4122eafb
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.20.0-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL mcumgr_toolkit-0.20.0-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
e9097687843e0bc2863645bc412e86f32fcce8ce120b1b3f0b3dd62e7ce77f59
BLAKE2b-256 checksum
How to use checksums
3ad23f795dae55d2c41f56c4326b1347cf112982f51bb4a6388622289cd11005
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.20.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL mcumgr_toolkit-0.20.0-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
64701bd489c5e52e96596f016a4afd1b87a7ba7d0559d283b652a1bee0b77c57
BLAKE2b-256 checksum
How to use checksums
2092ff82dfec04ac5dc9e482756b667558a991c2c27bd1bbdb1bc6a959efd80b
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.20.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL mcumgr_toolkit-0.20.0-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
cb713304d571b9d019b5e9040f44ef4df8ecfd12e3963efc29ced4a58b648d51
BLAKE2b-256 checksum
How to use checksums
cfab23d2da2458a576d84724eaf107cb3576c78f3a5d06d95adb5399d343a80f
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.20.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL mcumgr_toolkit-0.20.0-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
c189fc36ee7ca966816dc986a2cfa9360c7ed3dc91bf53fb4ae0597e2f52ad25
BLAKE2b-256 checksum
How to use checksums
b9573e3c29af672f772f27fd5a8e26a420d3914ab4e21d9df7a121b61094854e
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.20.0

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