Test CAN bus communication
1. Enable device can0 (for ex):
ip link set can0 up type can bitrate xxxxxx
(ex: 125000)
2. Bring the CAN interface up:
ifconfig can0 up
To discover your CAN bus interface name, please run ‘ ip link show ’.
The easiest way to test the CanBUS is to use the CAN-Utils, which are available for Debain/Ubuntu etc.
Example commands:
Sending:
cansend can0
Receiving:
candump can0
3. To print all data received by CAN interface to “can_test” file (for ex):
candump can0 >> /tmp/can_test &
4. Send data on the CAN bus:
cansend can0 "123#1234"
5. Check received data by opening “can_test” file:
cat /tmp/can_test
#### RS485