From ff537c85644aedab9551dd598992732cb2b8f676 Mon Sep 17 00:00:00 2001 From: Sven Date: Fri, 9 Feb 2024 00:07:57 +0100 Subject: [PATCH] first commit --- installSocketCAN.sh | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 installSocketCAN.sh diff --git a/installSocketCAN.sh b/installSocketCAN.sh new file mode 100755 index 0000000..d14cc4a --- /dev/null +++ b/installSocketCAN.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +cd $HOME + +sudo apt install -y linux-headers-generic build-essential gcc git dkms cmake libusb-1.0-0-dev libpcap-dev can-utils + +rm -rf intrepid-socketcan-kernel-module +git clone https://github.com/intrepidcs/intrepid-socketcan-kernel-module.git +cd intrepid-socketcan-kernel-module +make +sudo make install +grep -F -q 'can' /etc/modules | echo 'can' | sudo tee -a /etc/modules +grep -F -q 'can-raw' /etc/modules | echo 'can-raw' | sudo tee -a /etc/modules +grep -F -q 'can-dev' /etc/modules | echo 'can-dev' | sudo tee -a /etc/modules +sudo modprobe can +sudo modprobe can-raw +sudo modprobe can-dev +sudo insmod intrepid.ko + + +cd .. +rm -rf icsscand +git clone --recursive https://github.com/intrepidcs/icsscand.git +cd icsscand +mkdir -p build && cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +make + +sudo echo << EOF > /etc/systemd/system/icsscand.service +[Unit] +Description=Intrepid Device Scanner + +[Service] +ExecStart=/home/sven/icsscand/build/libicsneo-socketcan-daemon + +[Install] +WantedBy=multi-user.target +EOF + +sudo systemctl enable icsscand.service +sudo systemctl start icsscand.service + +sleep 10 + +cd ../.. +sudo ip link set can0 up +sudo ip link set can1 up +sudo ip link set can2 up +sudo ip link set can3 up + +rm -rf libicsneo +git clone https://github.com/intrepidcs/libicsneo +cd libicsneo +cmake -S . -B build +cmake --build build +sudo cp build/*.so /usr/lib/ +sudo cp 99-intrepidcs.rules /etc/udev/rules.d/ +sudo cp -r include/* /usr/include +sudo udevadm control --reload +sudo udevadm trigger + +cd .. +