User's Manual

12 How to manage interfaces in Linux ReliaGATE 10-12 User manual Rev. 2-1
12.7 How to manage the CAN ports
The ReliaGATE 10-12 exposes the CAN ports as follows:
l CAN 0 port:
can0
l CAN 1 port:
can1
CAN ports are added through the SocketCAN kernel extension.
For more information on SocketCAN refer to the Linux kernel documentation:
www.kernel.org/doc/Documentation/networking/can.txt
12.7.1 How to enable the CAN Bus 5V
To enable can0 5V, enter the following command:
gpio_utility gpio8 1
To enable can1 5V, enter the following command:
gpio_utility gpio9 1
12.7.2 How to setup a CAN port
To setup a CANport, enter the following commands:
#Set CAN0 to work at 125 kbps
ip link set can0 type can bitrate 125000
#Open the connection
ip link set up can0
12.7.3 How to send/receive a message via a CAN port
Example: Sending / receiving a message via a CANport (once the CAN port has been setup)
#Send a byte via CAN0
cansend can0 255
#Example of received message on can0
root@productname...:~# candump can0
interface = can0, family = 29, type = 3, proto = 1
<0x001> [1] 01
<0x001> [1] 02
<0x001> [1] 05
<0x001> [1] 00
<0x001> [1] ff
12.8 How the TTL Serial Console is exposed
The ReliaGATE 10-12 exposes the Console as follows:
l Console /dev/ttyS0 (available in the Service Panel)
76 / 118