Best Practices: Troubleshooting
CAN Communication Errors
”socketcan write failed: No buffer space available (os error 105)”
Cause: CAN TX buffer overflow - sending too many messages too fast. Solutions:-
Increase control period:
-
Increase TX queue length:
-
Stop other CAN senders:
-
Reduce feedback request frequency:
“CAN interface not found”
Cause: CAN interface not configured or not up. Solutions:“Permission denied on /dev/ttyACM0”
Cause: User doesn’t have permission to access serial port. Solutions:Motor Response Issues
”state = None”
Cause: No feedback frame received yet. Solutions:- Motor powered on
- CAN wiring correct (CAN_H, CAN_L)
- Correct motor_id and feedback_id
- Bitrate matches motor configuration
”Mode switch timeout”
Cause: Motor not responding to mode change command. Solutions:-
Verify motor ID:
-
Check motor status:
-
Clear errors first:
-
Increase timeout:
“Motor not moving”
Cause: Motor disabled, wrong mode, or command not being sent. Checklist:Error Code Reference
Damiao Status Codes
| Code | Meaning | Action |
|---|---|---|
| 0 | Normal | None |
| 1 | Over-voltage | Check power supply |
| 2 | Under-voltage | Check power supply |
| 3 | Over-current | Reduce load |
| 4 | MOSFET over-temp | Cool down, reduce load |
| 5 | Rotor over-temp | Cool down, reduce load |
| 6 | Communication timeout | Check wiring |
Handling Errors
Import Errors
”ImportError: cannot import name ‘Controller’”
Cause: Package not installed or ABI library missing. Solutions:“AbiLoadError: Failed to load libmotor_abi”
Cause: ABI shared library not found or incompatible. Solutions:Performance Issues
High CPU Usage
Causes & Solutions:-
Tight loop without sleep:
-
Excessive polling:
Inconsistent Timing
Solutions:Debugging Tips
Enable Verbose Logging
Check CAN Traffic
Test with CLI
Isolate Problem
Getting Help
If issues persist:- Check documentation:
-
Gather information:
-
Report issue with:
- Full error message
- Code snippet
- System information
- CAN configuration
Next Steps
- Control Loop Patterns - Reliable patterns
- CLI Reference - Debugging tools
- Tutorial 01 - Verify setup