Skip to content

Cart

Your cart is empty

RAIBOX-ORNX CANBus Interfaces Tutorial

WHAT YOU WILL LEARN?

1- The pinout of CAN Bus connector
2- Examples of can-utils tools

ENVIRONMENT

Hardware: RAIBOX-ORNX


In this blog post, we will test the CANBus interfaces of RAIBOX-ORNX.

The Pinout of CAN Bus Connector

First, let's look over the 5 pin IO connector. On the connector, there are 4 CAN Bus and 1 ground pins.

Examples of can-utils Tools 

To test CAN Bus functionality, we used a DSBOX-TX2NX as a test equipment (It has 120Ω termination resistor included). (If you use a USB-CAN adapter, connect that adapter to the USB port of the host PC and install its driver software if necessary.) To the other side of the connector, connect your device’s CAN pins.


On host side, be sure that you are using same bitrate with your device. 

On next step, activate CAN drivers and activate 2 CAN interfaces on RAIBOX-ORNX with the following commands below:


sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 up type can bitrate 500000 sjw 127 dsjw 15
sudo ip link set can1 up type can bitrate 500000 dbitrate 2000000 berr-reporting on fd on

Now, you can use can-utils tools to communicate.


Use cangen to write random data from both CAN Bus interface:


cangen can0 -v
cangen can1 -v


Use cansend to write data from both CAN Bus interface:


cansend can0 123#1122334455667788
cansend can1 123#1122334455667788


Use candump to listen bus from both CAN Bus interface:


candump can0
candump can1



Thank you for reading our blog post.