-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupCAN.sh
executable file
·34 lines (34 loc) · 1.1 KB
/
setupCAN.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
sudo busybox devmem 0x0c303000 32 0x0000C400
sudo busybox devmem 0x0c303008 32 0x0000C458
sudo busybox devmem 0x0c303010 32 0x0000C400
sudo busybox devmem 0x0c303018 32 0x0000C458
sudo modprobe can
sudo modprobe can_raw
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 250000
sudo ip link set up can0
sudo ifconfig can0 up
sudo ifconfig can0 txqueuelen 1000
sudo ip link set can1 type can bitrate 250000
sudo ip link set up can1
sudo ifconfig can1 up
sudo ifconfig can1 txqueuelen 1000
echo "Done"
#ifconfig
# 3/7/2019
#
# This set up both the can0 and can1 interfaces. We have Waveshare CAN transcievers connected to the bus on both can0 and can1.
# We can ONLY see packets arriving on can0.
# We run:
# candump -t a can0
# And can see heartbeats print out from both motor controllers.
# We run:
# cansend can0 123#abcdabcd
# And we can see this sent message in our running candump.
#
# Multiple times we ran:
# sudo reboot
# Then logged back into the jetson over ssh, and ran:
# ./working_CAN_setup_3_7_19_v1.sh
# And tested candump and cansend immediately afterwards and they work.