我正在尝试使 SocketCAN 接口正常工作。我添加了 slcan0 适配器并尝试以candump slcan0
比特率运行,我确信 CAN 设备正在运行。当我确定 CAN 设备以 200Hz 发送数据时,我看不到任何数据正在终端中打印。
我正在使用 Lawicel CANUSB 设备并按照以下步骤操作:http: //pascal-walter.blogspot.com/2015/08/installing-lawicel-canusb-on-linux.html
当我绑定接口后打印系统日志时,我得到以下信息:
May 26 10:11:33 username gnome-software[3664]: Failed to load snap icon: local snap has no icon
May 26 10:11:34 username gnome-software[3664]: message repeated 4 times: [ Failed to load snap icon: local snap has no icon]
May 26 10:15:43 username systemd[1]: Started Session 3 of user aceinna.
May 26 10:15:57 username slcand[3923]: starting on TTY device /dev/ttyUSB0
May 26 10:15:57 username slcand[3923]: attached TTY /dev/ttyUSB0 to netdevice slcan0
May 26 10:15:57 username slcand[3923]: netdevice O#015 renamed to slcan0
May 26 10:15:57 username NetworkManager[1543]: <info> [1590513357.4839] manager: (slcan0): new Generic device (/org/freedesktop/NetworkManager/Devices/4)
May 26 10:15:57 username systemd-udevd[3925]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
May 26 10:15:57 username NetworkManager[1543]: <info> [1590513357.4957] devices added (path: /sys/devices/virtual/net/slcan0, iface: slcan0)
May 26 10:15:57 username NetworkManager[1543]: <info> [1590513357.4958] device added (path: /sys/devices/virtual/net/slcan0, iface: slcan0): no ifupdown configuration found.
May 26 10:16:23 username wpa_supplicant[1539]: wlp59s0: WPA: Group rekeying completed with bc:ee:7b:57:ed:fc [GTK=CCMP]
May 26 10:16:23 username wpa_supplicant[1539]: wlp59s0: WPA: Group rekeying completed with bc:ee:7b:57:ed:fc [GTK=CCMP]
May 26 10:17:01 username CRON[3944]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
问题是,“没有找到 ifupdown 配置”
如何为 CAN 接口配置 ifupdown 配置?
我尝试的一件事是将以下几行添加到 /etc/network/interfaces
auto can0
iface can0 inet manual
#pre-up ip link set $IFACE type can bitrate 125000 listen-only off
pre-up /sbin/ip link set $IFACE type can bitrate 250000 triple-sampling on
up /sbin/ifconfig $IFACE up
down /sbin/ifconfig $IFACE down
注意:当绑定接口以匹配 /etc/network/interfaces 中的接口名称时,我尝试使用 can0 作为适配器名称。
我还使用更新了 ifupdown 包
apt-get ifupdown
有人可以指出正确的方向,我应该看什么?
提前致谢。