我正在与运行 Ubuntu 18.04.1 的工业 PC 进行战斗
此电脑配备 Apacer CAN 模块 APEHC-D40,可接收外部传感器的数据。 95% 的情况下,模块运行良好,并且成功接收 CAN 总线数据,但在 5% 的情况下,模块会停止运行。由于 PC 位于远程,因此很难弄清楚导致“无数据”情况的确切情况集,但我相信这与 PC 连接到 CAN 总线运行时的情况有些相关,然后由于其他要求 CAN 网络断电时,CAN 网络断电时 PC 仍处于开启状态,然后当 CAN 网络启动时,有时 Apacer CAN 模块未检测到其已启动,需要重新启动。 CAN 模块作为虚拟网络接口由网络管理器进行管理。有趣的是,如果我检查接口状态,它总是显示为“未知”(不确定这是否是一个问题,但我预计会出现问题)。
rig@drillhub:~$ sudo ip -det link show can0
8: can0: <NOARP,UP,LOWER_UP> mtu 16 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
这是系统日志中唯一对我来说不正确的部分,尽管我不确定它是否相关。
Jun 2 06:16:42 drillhub slcand[824]: starting on TTY device /dev/ttyCAN0
Jun 2 06:16:42 drillhub slcand[825]: attached TTY /dev/ttyCAN0 to netdevice apacer_can0
Jun 2 06:16:42 drillhub kernel: [ 6.968400] tty_warn_deprecated_flags: 'slcand' is using deprecated serial flags (with no effect): 00008200
Jun 2 06:16:42 drillhub kernel: [ 6.969104] can0: renamed from apacer_can0
Jun 2 06:16:42 drillhub slcand[825]: netdevice apacer_can0 renamed to can0
Jun 2 06:16:42 drillhub systemd-networkd[498]: apacer_can0: Interface name change detected, apacer_can0 has been renamed to can0.
Jun 2 06:16:42 drillhub systemd-udevd[826]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Jun 2 06:16:42 drillhub NetworkManager[647]: <info> [1622614602.1822] manager: (can0): new Generic device (/org/freedesktop/NetworkManager/Devices/6)
Jun 2 06:16:42 drillhub systemd-udevd[826]: link_config: could not get ethtool features for apacer_can0
Jun 2 06:16:42 drillhub systemd-udevd[826]: Could not set offload features of apacer_can0: No such device
Jun 2 06:16:42 drillhub NetworkManager[647]: <info> [1622614602.1950] devices added (path: /sys/devices/virtual/net/apacer_can0, iface: apacer_can0)
Jun 2 06:16:42 drillhub NetworkManager[647]: <info> [1622614602.1950] device added (path: /sys/devices/virtual/net/apacer_can0, iface: apacer_can0): no ifupdown configuration found.
Jun 2 06:16:42 drillhub networkd-dispatcher[616]: WARNING:Unknown index 8 seen, reloading interface list
Jun 2 06:16:42 drillhub systemd-networkd[498]: can0: Link UP
Jun 2 06:16:42 drillhub systemd-networkd[498]: can0: Gained carrier
Jun 2 06:16:42 drillhub systemd[1]: Started Setup CAN buses using the Apacer CAN module..
有谁知道我可以检查什么来找出这个 CAN 模块设置有什么问题?
干杯