Перейти к содержанию

Навигация

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

Новая страница: «For more information see the «AmadeuS» wiki article «[http://www.armadeus.com/wiki/index.php?title=CAN_bus_Linux_driver CAN bus Linux driver]».»
(Новая страница: «==== Using standard linux tools (manually) ====»)
(Новая страница: «For more information see the «AmadeuS» wiki article «[http://www.armadeus.com/wiki/index.php?title=CAN_bus_Linux_driver CAN bus Linux driver]».»)
Метки: правка с мобильного устройства правка из мобильной версии
 
(не показаны 3 промежуточные версии этого же участника)
Строка 34: Строка 34:
</syntaxhighlight>
</syntaxhighlight>


== Работа с CAN ==
== Working with CAN ==


Утилиты <code>cansend</code> и <code>candump</code> есть в стандартном наборе ПО контроллера. Если по каким-то причинам их нет, можно поставить пакет <code>can-utils</code>:
The <code>cansend</code> and <code>candump</code> utilities are included in the controller's standard software package. If for some reason they are not there, you can install the <code>can-utils</code> package:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
apt update && apt install can-utils
apt update && apt install can-utils
</syntaxhighlight>
</syntaxhighlight>


Примеры команд:
Command examples:
* Отправка четырех байт c адресом 123:
* Sending four bytes with address 123:
*:<syntaxhighlight lang="bash">
*:<syntaxhighlight lang="bash">
cansend can0 123#DEADBEEF
cansend can0 123#DEADBEEF
</syntaxhighlight>
</syntaxhighlight>


* Показывать входящие пакеты:
* Show incoming packets:
*:<syntaxhighlight lang="bash">
*:<syntaxhighlight lang="bash">
candump can0
candump can0
</syntaxhighlight>
</syntaxhighlight>


* Показать статистику:
* Show statistics:
*:<syntaxhighlight lang="bash">
*:<syntaxhighlight lang="bash">
cat /proc/net/can/stats
cat /proc/net/can/stats
Строка 58: Строка 58:




Обратите внимание, что в случае проблем на шине (нет терминатора, нет принимающего устройства, короткое замыкание), контроллер может прекратить работу.
Please note that in case of problems on the bus (no terminator, no receiving device, short circuit), the controller may stop working.
Для того чтобы начать работу вновь, выполните:  
To start working again, run:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
ifconfig can0 down && ip link set can0 up type can bitrate 125000
ifconfig can0 down && ip link set can0 up type can bitrate 125000
</syntaxhighlight>
</syntaxhighlight>


Больше информации смотрите в вики проекта «AmadeuS», статья «[http://www.armadeus.com/wiki/index.php?title=CAN_bus_Linux_driver CAN bus Linux driver]».
For more information see the «AmadeuS» wiki article «[http://www.armadeus.com/wiki/index.php?title=CAN_bus_Linux_driver CAN bus Linux driver]».
translator, wb_editors
4285

правок