smpclient

raw JSON →
7.0.0 verified Fri May 01 auth: no python

SMP (Simple Management Protocol) client for remotely managing MCU firmware, based on the MCUmgr protocol. Supports image management, OS management, shell, and file system operations over SMP. Current version: 7.0.0. Release cadence is irregular.

pip install smpclient
error RuntimeWarning: coroutine 'SMPClient.get_os_info' was never awaited
cause Calling an async method without await.
fix
Add await before the call: await client.get_os_info()
error OSError: [Errno 113] No route to host
cause Cannot connect to the target device; wrong IP or device not reachable.
fix
Verify the device IP and that the SMP server is running. Check firewall rules.
gotcha Default port is 1337, but many devices use different ports. Always verify the target's SMP port.
fix Explicitly pass port=1337 or the correct port when creating SMPClient.
gotcha The library uses asyncio; all operations must be awaited. Calling non-awaited coroutines will raise a RuntimeWarning or hang.
fix Always use await with SMPClient methods. Run in an async context.
deprecated SMPClient constructor argument 'hostname' is deprecated in favor of 'host'.
fix Use host='192.168.1.100' instead of hostname='...'.

Connects to an MCU running an SMP server and retrieves OS info.

import asyncio
from smpclient import SMPClient

async def main():
    async with SMPClient(host='192.168.1.100', port=1337) as client:
        resp = await client.get_os_info()
        print(resp)

asyncio.run(main())