Through the script, start Thor’s 4-channel CAN:
#!/bin/bash
sudo modprobe can
sleep 0.2
sudo modprobe can_raw
sleep 0.2
sudo modprobe mttcan sudo mod探测mttcan
sleep 0.2
sudo ip link set can0 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
sleep 0.2
sudo ip link set can1 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
sleep 0.2
sudo ip link set can2 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
sleep 0.2
sudo ip link set can3 up type can bitrate 500000 dbitrate 1000000 berr-reporting on fd on
sleep 0.2
candump -x any &
Then communicate with the 4-channel CAN via CAN tools. CAN0 and CAN1 can receive data normally, while CAN2 and CAN3 can receive data, but all displayed data are erroneous.
The message printed by the system is as follows:
dkythor@dkythor:~$ ifconfig
can0: flags=193<UP,RUNNING,NOARP> mtu 72
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 26 bytes 208 (208.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 61
can1: flags=193<UP,RUNNING,NOARP> mtu 72
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 13 bytes 104 (104.0 B)
RX errors 1 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 71
can2: flags=193<UP,RUNNING,NOARP> mtu 72
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 4042 bytes 32336 (32.3 KB)
RX errors 4040 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 74
can3: flags=193<UP,RUNNING,NOARP> mtu 72
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 1566 bytes 12528 (12.5 KB)
RX errors 1564 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 75
enP2p1s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 8e:7e:b0:d9:d7:c2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 23
l4tbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.55.1 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::1 prefixlen 64 scopeid 0x20
ether a2:e6:3c:c8:1d:d8 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 771 bytes 69904 (69.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 771 bytes 69904 (69.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
mgbe0_0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1466
ether 3c:6d:66:76:dc:72 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
mgbe1_0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1466
ether 3c:6d:66:76:dc:73 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
mgbe2_0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1466
ether 3c:6d:66:76:dc:74 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
mgbe3_0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1466
ether 3c:6d:66:76:dc:75 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
usb0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether c6:00:cf:42:06:69 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
usb1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether c6:00:cf:42:06:6b txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlP1p1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.110.134 netmask 255.255.255.0 broadcast 192.168.110.255
inet6 fe80::f0fa:e01:50f3:c72a prefixlen 64 scopeid 0x20
ether f8:3d:c6:91:b9:0e txqueuelen 1000 (Ethernet)
RX packets 85563 bytes 60813481 (60.8 MB)
RX errors 0 dropped 64461 overruns 0 frame 0
TX packets 16974 bytes 1296069 (1.2 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 140