CAN Setup¶
This guide covers setting up the CAN interface for use with DaMiao motors.
Prerequisites¶
- Linux operating system
- CAN interface hardware (USB-CAN adapter, CAN-capable board, etc.)
- SocketCAN drivers
Basic CAN Setup¶
1. Check CAN Interface¶
List available network interfaces:
Look for can0, can1, or similar interfaces.
2. Bring Up CAN Interface¶
This sets up can0 with a 1 Mbps bitrate.
3. Verify Interface¶
You should see the interface is UP.
Testing CAN Interface¶
Using candump¶
This will show all CAN messages on the bus.
Using damiao scan¶
Troubleshooting¶
Interface Not Found¶
- Check hardware connection
- Verify drivers are loaded:
lsmod | grep can - Check dmesg for errors:
dmesg | grep can
Permission Errors¶
You may need to run with sudo or add your user to a group with CAN access:
Then log out and back in.
Bitrate Mismatch¶
Ensure the CAN bitrate matches your motor configuration. Check motor firmware settings.
Multiple CAN Interfaces¶
If you have multiple CAN interfaces:
Then specify the channel in your code: