From 6c43a30f879c0bcbf6b26081300a89be7c0cf3b5 Mon Sep 17 00:00:00 2001 From: Ruixiang Du Date: Fri, 14 Aug 2020 13:26:13 +0800 Subject: [PATCH] added scripts to setup/bringup can --- scripts/bringup_can2usb_1m.bash | 4 ++++ scripts/bringup_can2usb_500k.bash | 4 ++++ scripts/setup_can2usb.bash | 10 ++++++++++ 3 files changed, 18 insertions(+) create mode 100755 scripts/bringup_can2usb_1m.bash create mode 100755 scripts/bringup_can2usb_500k.bash create mode 100755 scripts/setup_can2usb.bash diff --git a/scripts/bringup_can2usb_1m.bash b/scripts/bringup_can2usb_1m.bash new file mode 100755 index 0000000..f7e3b6e --- /dev/null +++ b/scripts/bringup_can2usb_1m.bash @@ -0,0 +1,4 @@ +#!/bin/bash + +# bring up can interface +sudo ip link set can0 up type can bitrate 1000000 \ No newline at end of file diff --git a/scripts/bringup_can2usb_500k.bash b/scripts/bringup_can2usb_500k.bash new file mode 100755 index 0000000..e638f6a --- /dev/null +++ b/scripts/bringup_can2usb_500k.bash @@ -0,0 +1,4 @@ +#!/bin/bash + +# bring up can interface +sudo ip link set can0 up type can bitrate 500000 \ No newline at end of file diff --git a/scripts/setup_can2usb.bash b/scripts/setup_can2usb.bash new file mode 100755 index 0000000..6a8d891 --- /dev/null +++ b/scripts/setup_can2usb.bash @@ -0,0 +1,10 @@ +#!/bin/bash + +# enable kernel module: gs_usb +sudo modprobe gs_usb + +# bring up can interface +sudo ip link set can0 up type can bitrate 500000 + +# install can utils +sudo apt install -y can-utils \ No newline at end of file