Registry / communication / dronecan

dronecan

JSON →
library1.0.27pypypi✓ verified 85d ago

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.

pip install dronecan
INSTALL
IMPORT
SIG · DRONECAN
D
dronecan
communicationpythonv1.0.27
Install
1.6s avg
Import
1091ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.27 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.132s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 1.050s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dronecan
import dronecan
Standard import.

Initialize a DroneCAN node on a SLCAN interface, subscribe to NodeStatus, and spin.

import dronecan # Initialize a node node = dronecan.make_node('slcan0', node_id=100, bitrate=1000000) # Start node node.start() # Subscribe to node status messages def on_node_status(msg): print(msg) node.add_handler(dronecan.uavcan.protocol.NodeStatus, on_node_status) # Spin forever import time while True: try: node.spin(timeout=1) time.sleep(1) except KeyboardInterrupt: break node.close()
Debug
Known issues
gotchaThe import path for DSDL types changed. Use `dronecan.uavcan.protocol.NodeStatus` instead of `dronecan.node.NodeStatus` after DSDL compilation.
fix
Use `from dronecan.uavcan.protocol import NodeStatus` after compiling DSDL.
affects: >=1.0.0
breakingIn 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.
fix
Upgrade to dronecan >=1.0.18 and ensure python-can is up-to-date.
affects: <=1.0.17
deprecatedThe old `dronecan.driver.slcan` driver is deprecated in favor of `dronecan.driver.slcan.Serial`.
fix
Use `dronecan.driver.slcan.Serial` instead of `dronecan.driver.slcan`.
affects: >=1.0.20
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dronecan.uavcan'
Missing DSDL compilation or using wrong import path.
fix
Run `dronecan_dsdlc <path-to-dsdl-dir>` to compile DroneCAN DSDL definitions first.
AttributeError: module 'dronecan' has no attribute 'make_node'
Using an older version of dronecan that does not have `make_node`.
fix
Upgrade dronecan to >=1.0.0 with `pip install --upgrade dronecan`.
Upgrade
Version history
1.0.27latest on PyPI · released Oct 29, 2025
Audit
Dependencies
python-canrequiredCAN bus backend interface
Agent activity
52 hits · last 30 days
node
46
Amazon
1
OpenAI (training)
1
Resources
dronecan — pip install dronecan · libregistry