chenjuchuan 发表于 2024-4-5 20:55:32

Can发送报文,接收总是回环???

本帖最后由 chenjuchuan 于 2024-4-5 20:56 编辑

设置:
# ip link set can0 down
# ip link set can0 type can bitrate 250000 loopback off
# ip link set can0 up

接收
# candump can0
can000000001   01 03 00 00 00 02 00 00

发送
# cansend can0 00000001#0103000000020000

我购买了一个Can口温湿度变送器,使用Can口发送总是回环,使用CAN转USB连接到电脑上,采用windows下的上位机发送接收正常。按照道理我已经关闭loopback了呀。

相关信息参考如下:
# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
    link/can
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether b6:83:71:09:85:37 brd ff:ff:ff:ff:ff:ff
4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DORMANT mode DORMANT group default qlen 1000
    link/ether 10:bb:f3:a2:60:dc brd ff:ff:ff:ff:ff:ff
5: p2p0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 12:bb:f3:a2:60:dc brd ff:ff:ff:ff:ff:ff
6: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether b8:d2:0f:60:5b:bd brd ff:ff:ff:ff:ff:ff
7: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether ae:0c:29:a3:9b:6d brd ff:ff:ff:ff:ff:ff
8: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 100
    link/none


# ip -details link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
    link/canpromiscuity 0
    can state ERROR-ACTIVE restart-ms 0
          bitrate 250000 sample-point 0.875
          tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
          mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
          clock 4000000numtxqueues 1 numrxqueues 1


如何处理???

chenjuchuan 发表于 2024-4-9 09:38:27

有没有管理员能回复这个问题呀???

chenjuchuan 发表于 2024-4-18 09:21:16

结贴,问题找到了。
页: [1]
查看完整版本: Can发送报文,接收总是回环???