{"id":24598,"library":"smp","title":"smp: Simple Management Protocol","description":"smp is a Python implementation of the Simple Management Protocol (SMP) for remotely managing MCU firmware, commonly used with Zephyr and MCUboot. Version 4.0.2 is current, supporting Python >=3.9. The library provides client and server functionality for MCU management including image upload, shell, file system, and task statistics. Releases occur every few months.","status":"active","version":"4.0.2","language":"python","source_language":"en","source_url":"https://github.com/JPHutchins/smp","tags":["smp","mcumgr","zephyr","iot","firmware","management"],"install":[{"cmd":"pip install smp","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"CBOR serialization/deserialization for SMP frames","package":"cbor2","optional":false},{"reason":"optional for persistent session storage","package":"lmdb","optional":true}],"imports":[{"note":"SMPClient is exported directly from smp package since v4","wrong":"from smp.client import SMPClient","symbol":"SMPClient","correct":"from smp import SMPClient"},{"note":"Group moved to top-level in v4","wrong":"from smp.group import Group","symbol":"Group","correct":"from smp import Group"}],"quickstart":{"code":"import asyncio\nfrom smp import SMPClient, Group\n\nasync def main():\n    client = SMPClient(\"tcp://localhost:6500\")\n    await client.connect()\n    # Get echo response\n    echo = await client.echo(data=b\"hello\")\n    print(\"Echo:\", echo)\n    # List groups\n    groups = await client.get_group_list()\n    print(\"Groups:\", groups)\n    await client.disconnect()\n\nasyncio.run(main())","lang":"python","description":"Connect to a remote MCU over TCP, send an echo request, and list management groups."},"warnings":[{"fix":"Ensure Python 3.9+ is installed.","message":"v4.0.0 dropped Python 3.8 support. Upgrade to Python >=3.9.","severity":"breaking","affected_versions":"<4.0"},{"fix":"Use `SMPClient.encode(data, fragment_size=8192)` if 8192 bytes is required.","message":"v4.0.0 changed default line length from 8192 to 127 bytes for encode(). Override if using larger frames.","severity":"breaking","affected_versions":">=4.0.0 <4.0.0"},{"fix":"Use 'from smp import SMPClient' instead.","message":"Top-level imports changed in v4; 'from smp.client import SMPClient' no longer works.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Migrate to SMPClient (import from smp).","message":"The 'session' module is deprecated in favor of the new client interface.","severity":"deprecated","affected_versions":">=3.0 <4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from smp import SMPClient' instead.","cause":"Import path changed in v4.0.0.","error":"ModuleNotFoundError: No module named 'smp.client'"},{"fix":"Set fragment_size to a value <= 127 or use the default.","cause":"Default fragment size reduced to 127 in v4.0.0. An explicit large value is rejected.","error":"ValueError: Fragment size 8192 exceeds maximum 127"},{"fix":"Ensure you call 'await client.connect()' before other operations.","cause":"Trying to await a synchronous method or missing client.connect() call.","error":"TypeError: object NoneType can't be used in 'await' expression"},{"fix":"Verify the MCU is running and the port is correct; check network connectivity.","cause":"MCU not reachable or wrong transport address.","error":"smp.exceptions.SMPError: No response received"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}