Can Ports; How To Enable The Can Bus 5V; How To Setup A Can Port; How To Send/Receive A Message Via A Can Port - Eurotech DynaGate 10-12 Series User Manual

Automobile iot edge gateway ti am335x, lte cat 1
Table of Contents

Advertisement

11 How to access interfaces under Linux
11.8

CAN ports

The DynaGATE 10-12 exposes the CAN ports as follows:
CAN 0 port:
l
CAN 1 port:
l
CAN ports are added through the SocketCAN kernel extension.
For further information on SocketCAN refer to the Linux kernel documentation:
www.kernel.org/doc/Documentation/networking/can.txt
11.8.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
11.8.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
11.8.3

How to send/receive a message via a CAN port

Example: Sending/receiving a message via a CAN port (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
68 / 94
can0
can1
DynaGATE 10-12 User manual Rev. 0-14

Advertisement

Table of Contents
loading

Table of Contents