{"id":23637,"library":"dronecan","title":"DroneCAN Python Library","description":"Python implementation of the DroneCAN protocol stack (v1.0.27). Provides DSDL parsing, CAN bus communication, node management, and MAVLink bridging. Release cadence is irregular with occasional patches.","status":"active","version":"1.0.27","language":"python","source_language":"en","source_url":"https://github.com/DroneCAN/pydronecan","tags":["dronecan","uavcan","can-bus","drones","protocol"],"install":[{"cmd":"pip install dronecan","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"CAN bus backend interface","package":"python-can","optional":false}],"imports":[{"note":"Standard import.","wrong":"","symbol":"dronecan","correct":"import dronecan"}],"quickstart":{"code":"import dronecan\n\n# Initialize a node\nnode = dronecan.make_node('slcan0', node_id=100, bitrate=1000000)\n\n# Start node\nnode.start()\n\n# Subscribe to node status messages\ndef on_node_status(msg):\n    print(msg)\nnode.add_handler(dronecan.uavcan.protocol.NodeStatus, on_node_status)\n\n# Spin forever\nimport time\nwhile True:\n    try:\n        node.spin(timeout=1)\n        time.sleep(1)\n    except KeyboardInterrupt:\n        break\nnode.close()","lang":"python","description":"Initialize a DroneCAN node on a SLCAN interface, subscribe to NodeStatus, and spin."},"warnings":[{"fix":"Use `from dronecan.uavcan.protocol import NodeStatus` after compiling DSDL.","message":"The import path for DSDL types changed. Use `dronecan.uavcan.protocol.NodeStatus` instead of `dronecan.node.NodeStatus` after DSDL compilation.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade to dronecan >=1.0.18 and ensure python-can is up-to-date.","message":"In Python 3.11+, the slcan driver may have issues. A fix was applied in v1.0.18, but ensure you are using a supported python-can version.","severity":"breaking","affected_versions":"<=1.0.17"},{"fix":"Use `dronecan.driver.slcan.Serial` instead of `dronecan.driver.slcan`.","message":"The old `dronecan.driver.slcan` driver is deprecated in favor of `dronecan.driver.slcan.Serial`.","severity":"deprecated","affected_versions":">=1.0.20"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `dronecan_dsdlc <path-to-dsdl-dir>` to compile DroneCAN DSDL definitions first.","cause":"Missing DSDL compilation or using wrong import path.","error":"ModuleNotFoundError: No module named 'dronecan.uavcan'"},{"fix":"Upgrade dronecan to >=1.0.0 with `pip install --upgrade dronecan`.","cause":"Using an older version of dronecan that does not have `make_node`.","error":"AttributeError: module 'dronecan' has no attribute 'make_node'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}