From 34d327f9b1fb69660ed016bca5e2b6e72aa70a0a Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 3 Jul 2023 09:34:05 +0200 Subject: [PATCH] Fix: add a very minimal README on how to use can-utils to send and receive CAN frames with Arduino boards via SocketCAN. Target audience: developers. --- libraries/Arduino_CAN/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 libraries/Arduino_CAN/README.md diff --git a/libraries/Arduino_CAN/README.md b/libraries/Arduino_CAN/README.md new file mode 100644 index 000000000..0969cbc00 --- /dev/null +++ b/libraries/Arduino_CAN/README.md @@ -0,0 +1,20 @@ +`Arduino_CAN` +============= +### How-to-`SocketCAN` +* Connect your [SocketCAN](https://en.wikipedia.org/wiki/SocketCAN) capable CAN/USB dongle to the PC and configure it. +```bash +sudo ip link set can0 type can bitrate 250000 +sudo ip link set up can0 +``` +* Install can-utils for cansend/candump: +```bash +sudo apt-get install can-utils +``` +* Transmit CAN frames via [`cansend`](https://manpages.ubuntu.com/manpages/lunar/man1/cansend.1.html): +```bash +cansend can0 1F334455#1122334455667788 +``` +* Display received CAN frames via [`candump`](https://manpages.ubuntu.com/manpages/lunar/man1/candump.1.html): +```bash +candump can0 +```