CAN/en: различия между версиями

Материал из Wiren Board
(Новая страница: «show statistics:»)
(Новая страница: «Note that in case of problems on the bus (no terminator, no receiving device, short circuit), the controller may stop working. To get started again, run»)
Строка 35: Строка 35:




Обратите внимание, что в случае проблем на шине (нет терминатора, нет принимающего устройства, короткое замыкание), контроллер может прекратить работу.
Note that in case of problems on the bus (no terminator, no receiving device, short circuit), the controller may stop working. To get started again, run
Для того, чтобы начать работу вновь, выполните


<pre>
<pre>

Версия 19:48, 29 мая 2019

Другие языки:

Can ports are available in the system as can0 or can1 network interfaces, depending on the controller model.

The work takes place through the standard Linux SocketCAN subsystem.

For easy work with CAN, you need to install the package 'apt-get install can-utils'

Switch the RS-485/CAN port to CAN mode: On the Hardware Modules Configuration tab, select 'RS485-2/CAN interface config' settings, select 'Module type' CAN interface, and click 'Save'. 400px|right||Module type CAN interface

Configuring the interface

ip link set can0 up type can bitrate 125000


sending 4 bytes with address 123:

cansend can0 123#DEADBEEF

show incoming packages:

candump can0

show statistics:

cat /proc/net/can/stats


Note that in case of problems on the bus (no terminator, no receiving device, short circuit), the controller may stop working. To get started again, run

ifconfig can0 down && ip link set can0 up type can bitrate 125000


Больше информации смотрите в статье.