Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

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 ’.

3. To start testing the CanBUS, you have to install the can-utils package by running:

sudo apt-get install -y can-utils 
  • For more information, please follow the  CAN-Utils, which are available for Debain/Ubuntu etc.

4. To print all data received by CAN interface to “can_test” file (for ex):

candump can0 >> /tmp/can_test &

5. Send data to the bus by executing (for ex):

cansend can0 "123#1234"

6. Check received data by opening “can_test” file:

cat /tmp/can_test

Test RS-485 communication

An example for testing RS485 communication:

rs485conf -e 1 /dev/ttymxc1
touch /tmp/rs485_test
stty -F /dev/ttymxc1 raw -echo -echoe -echok
cat /dev/ttymxc1 > /tmp/rs485_test &
echo "rs485" > /dev/ttymxc1

  • No labels