我正在與運行 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 模組設定有什麼問題?
乾杯