3 title: Bringing up a CAN device using socketcan backend
5 https://raw.githubusercontent.com/automotive-grade-linux/docs-sources/master/agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/candevstudio-developer-guides-api-services-book.yml -->
10 # Bringing up a CAN device using socketcan backend
12 * [Using a supported Linux CAN device](https://www.elinux.org/CAN_Bus):
15 # Find your interface name (e.g. can0)
18 sudo ip link set can0 type can bitrate 1000000
20 sudo ip link set can0 up
21 # Optionally configure CAN termination
22 sudo ip link set can0 type can termination 1
27 * Based on FTDI Serial driver
28 * Requires slcand to "convert" serial device to SocketCAN.
29 * Officially supported in Linux Kernel v2.6.38
32 # Create SocketCAN device from serial interface
33 sudo slcand -o -c -s8 -S1000000 /dev/ttyUSB0 can0
35 sudo ip link set can0 up
38 ## Using builtin Linux kernel virtual CAN module vcan
42 sudo ip link add dev can0 type vcan
43 sudo ip link set can0 up