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

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

Download URL mcumgr_toolkit-0.19.1-cp310-abi3-win_amd64.whl
Size 1.7 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
46778ad754c8ed42be4dd69d88caa346525075d8bfd53bf7813347a774625353
BLAKE2b-256 checksum
How to use checksums
4cb5a2c54993bf98efa9494394e00a89a738247528af9715ef671adad8df8b4d
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.1-cp310-abi3-win32.whl

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

Download URL mcumgr_toolkit-0.19.1-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
5832827907f09c3ca14e8b1d2b40d896e9952fac8a0729f848df9c5cc046e820
BLAKE2b-256 checksum
How to use checksums
54f96361aec204ce808d484999d71a2e79e214b21b8097581f87af6035d4e3e6
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.1-cp310-abi3-musllinux_1_2_i686.whl

Download URL mcumgr_toolkit-0.19.1-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
e463d9608fc6de58daf7029952dbcc6f52d1c43339c9b723d4af1de75f298651
BLAKE2b-256 checksum
How to use checksums
890590c5a101e3d030a3667e85b20f25a94b4fc51ef6388398f801918400c775
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.1-cp310-abi3-musllinux_1_2_armv7l.whl

Download URL mcumgr_toolkit-0.19.1-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
619bcc44d36c4dc9d71595a8a98b2b622e57e83dd54cf3099a90a6832d71cc05
BLAKE2b-256 checksum
How to use checksums
e6ca2d93d3e42b47c118a3521aefbf3459701f8b9a91262162fc5e762e52245a
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.1-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL mcumgr_toolkit-0.19.1-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
41d6c9931d84bc3618796c2fc5a4945141018686d39417a8ffe999d7af0817d6
BLAKE2b-256 checksum
How to use checksums
0a220a9a58eec6bd3e88f193590d94c65f1002c0892b77cf13dede6ecd7427b0
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.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mcumgr_toolkit-0.19.1-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
313866d376f32db48846cefeef1f47265003eff2a7600a363732daf015923373
BLAKE2b-256 checksum
How to use checksums
b52d3a465ea59e0573ef3206f18a7de14895003d187292cb64bab3adbed05dfc
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.1-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL mcumgr_toolkit-0.19.1-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
8c922f360f435b97a3c1c165137d5c3345cbed3ad8ecdbba7246330a7645b993
BLAKE2b-256 checksum
How to use checksums
59cfbed65082bba4913b7d2cca542d5927e4c8e7bd6dabf09c8e6213a922e105
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.1-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL mcumgr_toolkit-0.19.1-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
11599e36adc256c7d08622421c3844f94fd9e0606789856a10205b0f98043f13
BLAKE2b-256 checksum
How to use checksums
4d23295f9908ef277aa0553d1efc8b95ed05f86b5145a3cf27ccdcfa36486b23
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.1-cp310-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl

Download URL mcumgr_toolkit-0.19.1-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
9214573d8daefd73ff7c621f612922a0ce6ccf1b1ad6d70a0ef9f9571c1bdc20
BLAKE2b-256 checksum
How to use checksums
84bf095298a136ea63082b17aa07e521392292fd2bfe56b229f855526e13a8e3
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.1-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL mcumgr_toolkit-0.19.1-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
4ce5bbf9cb61b1722c51699fa8781312b6d477083fef678ad18d7a055a98d9ae
BLAKE2b-256 checksum
How to use checksums
729306e36cd1c169a19d18125616e894541f65240414808a3695010acd4191c4
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.1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL mcumgr_toolkit-0.19.1-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
aa6259b61601f7854bbc6b7bd8abe777b5996494f64151071c5da2d234f8af7f
BLAKE2b-256 checksum
How to use checksums
18fa8dcde88993ae2e2c9bb46dd34f67c9809e5857b0603cbd1a95263605e46a
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.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL mcumgr_toolkit-0.19.1-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
0bf9923455c2c8b5a262ce9fd363e0b45983fbdd6f27da90603dc3193fec7392
BLAKE2b-256 checksum
How to use checksums
0a6301d65bc05c29a3befe08310950b9534c453b3804c604d18d62861a345745
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.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL mcumgr_toolkit-0.19.1-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
2e40979425e8a3006f87b0bf617f99549d2e977b806d46279ebe97e5c271cf0a
BLAKE2b-256 checksum
How to use checksums
0cd4d53547006284933d87f27d7d811eb0906b1a989626b163aca44d6e5f1700
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.1

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