summaryrefslogtreecommitdiffstats
path: root/agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md
diff options
context:
space:
mode:
Diffstat (limited to 'agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md')
-rw-r--r--agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md b/agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md
new file mode 100644
index 0000000..60a7ff6
--- /dev/null
+++ b/agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md
@@ -0,0 +1,35 @@
+# Bringing up a CAN device using socketcan backend
+
+* [Using a supported Linux CAN device](https://www.elinux.org/CAN_Bus):
+
+```bash
+# Find your interface name (e.g. can0)
+ip link
+# Configure bitrate
+sudo ip link set can0 type can bitrate 1000000
+# Bring the device up
+sudo ip link set can0 up
+# Optionally configure CAN termination
+sudo ip link set can0 type can termination 1
+```
+
+## Using slcand
+
+* Based on FTDI Serial driver
+* Requires slcand to "convert" serial device to SocketCAN.
+* Officially supported in Linux Kernel v2.6.38
+
+```bash
+# Create SocketCAN device from serial interface
+sudo slcand -o -c -s8 -S1000000 /dev/ttyUSB0 can0
+# Bring the device up
+sudo ip link set can0 up
+```
+
+## Using builtin Linux kernel virtual CAN module vcan
+
+```bash
+sudo modprobe vcan
+sudo ip link add dev can0 type vcan
+sudo ip link set can0 up
+```