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.21.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.21.0
File Actions
mcumgr_toolkit-0.21.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for mcumgr_toolkit-0.21.0-cp310-abi3-win_amd64.whl
mcumgr_toolkit-0.21.0-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details for mcumgr_toolkit-0.21.0-cp310-abi3-win32.whl
mcumgr_toolkit-0.21.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for mcumgr_toolkit-0.21.0-cp310-abi3-musllinux_1_2_x86_64.whl
mcumgr_toolkit-0.21.0-cp310-abi3-musllinux_1_2_i686.whl CPython 3.10 abi3 Linux musl 1.2+ x86-32 Details for mcumgr_toolkit-0.21.0-cp310-abi3-musllinux_1_2_i686.whl
mcumgr_toolkit-0.21.0-cp310-abi3-musllinux_1_2_armv7l.whl CPython 3.10 abi3 Linux musl 1.2+ ARMv7l Details for mcumgr_toolkit-0.21.0-cp310-abi3-musllinux_1_2_armv7l.whl
mcumgr_toolkit-0.21.0-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for mcumgr_toolkit-0.21.0-cp310-abi3-musllinux_1_2_aarch64.whl
mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_s390x.manylinux_2_17_s390x.whl CPython 3.10 abi3 Linux glibc 2.17+ IBM System/390x Details for mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_s390x.manylinux_2_17_s390x.whl
mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl CPython 3.10 abi3 Linux glibc 2.17+ PowerPC 64-le Details for mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl
mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_ppc64.manylinux_2_17_ppc64.whl CPython 3.10 abi3 Linux glibc 2.17+ PowerPC 64-be Details for mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_ppc64.manylinux_2_17_ppc64.whl
mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-32 Details for mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl
mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl CPython 3.10 abi3 Linux glibc 2.17+ ARMv7l Details for mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
mcumgr_toolkit-0.21.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.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.21.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Total release size: 29.7 MB

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

Download URL mcumgr_toolkit-0.21.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
3efb82a7bc580be382f97b7ebfb31cde26b9ba130113e92ed1b0cf34544a67cc
BLAKE2b-256 checksum
How to use checksums
9827540a51acc2f3b048a4f92747138af95fb7c016276cc6d735013c8bc0182d
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.21.0-cp310-abi3-win32.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-win32.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
b6bce2f7eef478250e1299f108fac8b6853379f97f6835e014ebbbdd0974fc90
BLAKE2b-256 checksum
How to use checksums
24e630fefc1033ffaac91852d9a2942f092d634b1c985a36863189c28230ba2e
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.21.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL mcumgr_toolkit-0.21.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
265e867615952401e59a6cca1823be3288a64bc5e53e73f72fefa94139281fc4
BLAKE2b-256 checksum
How to use checksums
d25d67ad3406e67cace50951c5bfac40866a037e92e737b92e84fd74115646b1
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.21.0-cp310-abi3-musllinux_1_2_i686.whl

Download URL mcumgr_toolkit-0.21.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
8e4ebcdcdaef0ebf8e9aec65683c15513af2202e3974bcbceaba30db77d65b43
BLAKE2b-256 checksum
How to use checksums
33a8e4b404c885a1c89bf345f3a82d43a7fd80d876bbc677b434bad10322dce0
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.21.0-cp310-abi3-musllinux_1_2_armv7l.whl

Download URL mcumgr_toolkit-0.21.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
4135856caa7657f59eb0813613981c4e4c1bdf51b74eedfc81264f8d6b5bc462
BLAKE2b-256 checksum
How to use checksums
723b3620fb7d02d31ddb28ea736f35f095c5f23f9b6fe600383d516eb7b064c9
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.21.0-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL mcumgr_toolkit-0.21.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
334c579d8cecaf120c5a70bdc1223f6b31368f484a24fffaffd4e79bbc80070c
BLAKE2b-256 checksum
How to use checksums
5e6d0d479de145dbc394da2b9eb7f3e46ff305c9ff2ecf1e5b53d8a29c136bdb
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.21.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
447be8fba33c6fb4cec1aaf007b4b4d65e96522ab1d3b3320f4801f63aa59753
BLAKE2b-256 checksum
How to use checksums
fa556f0f661f9eedf2f3deb3350296e9def9c848cc320255d23119afa81bcfa8
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.21.0-cp310-abi3-manylinux2014_s390x.manylinux_2_17_s390x.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_s390x.manylinux_2_17_s390x.whl
Size 2.2 MB
Tags CPython 3.10 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
e05ec80f79bfd5bc6506dbebfba8a3001cf9a5040ddb4c263be635047a8ae9cf
BLAKE2b-256 checksum
How to use checksums
e75d892340076b8c308194d85f6e09f070056fdb0641cf0af366e0bb1e7bf4d1
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.21.0-cp310-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_ppc64le.manylinux_2_17_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
bb704ac72546b4f4464ad0da473456bc32f3f62228ef1019d6e3b5c670692d95
BLAKE2b-256 checksum
How to use checksums
c591b774baffe1533fa4697b9be2475724c1fee4e3d6af30f43f2af5594d980d
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.21.0-cp310-abi3-manylinux2014_ppc64.manylinux_2_17_ppc64.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_ppc64.manylinux_2_17_ppc64.whl
Size 2.2 MB
Tags CPython 3.10 Linux glibc 2.17+ PowerPC 64-be abi3
SHA-256 checksum
How to use checksums
1c1e86da2875da92fa75b8da801597d6469668fbd32ae61af53ccdc733e2e409
BLAKE2b-256 checksum
How to use checksums
acecaee77ca178bc7c50fa459e4c31f5b3a228ba3e3184bc4146d4b36937454c
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.21.0-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_i686.manylinux_2_17_i686.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
964d3f7d07486b620c6d28a6945b531dbe691ff7dd6e127c3ada7830a2b01b92
BLAKE2b-256 checksum
How to use checksums
f3f114e860bbaa8b45a3933ef6fa27ecdcddee73250edba0f82239a979441d29
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.21.0-cp310-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.whl
Size 1.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
2b8b012739f5a22f96858d8e446e7c2a4d22c4a39248c01769190535817d4dc8
BLAKE2b-256 checksum
How to use checksums
0594e2ac748c47119c2cb9937cc2e30513d6010f5fb1059ca25458ba038aa2ec
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.21.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
f544f94456396da799019272d29f01abd25305e3e74b3cf856e22544da1d4ab6
BLAKE2b-256 checksum
How to use checksums
b4b0a48fb2a023b5ebbada0629f2a1df8affa0ce1de88c915e404418160cfd60
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.21.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Download URL mcumgr_toolkit-0.21.0-cp310-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
Size 3.3 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
779fe38aaa469e2c9f807519ddea6a41bce467423802449954a90209449d19ca
BLAKE2b-256 checksum
How to use checksums
741b983a4f061d6cca5ca6d54545d41ebac2648e12fd2fb7a6fef1a940dd78b5
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.21.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