【发布时间】:2021-09-07 13:32:39
【问题描述】:
我正在尝试用覆盆子读取车辆上的 CAN-BUS(CAN 连接到覆盆子上的 DB9 连接器)。车辆也为覆盆子提供能量。
这是我的堆栈:
协议 CAN "ISO 15765 CAN" by Bosch
CAN总线板PiCAN3
机器:树莓派 4
司机/巴士类型:socketCAN
图书馆:CAN utils
我遵循了这些说明
#added this in /boot/config.txt and reboot
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
#create the can interface on divice can0 with a bitrate at 500 kbps
sudo /sbin/ip link set can0 up type can bitrate 500000
#connect the PiCAN to a CAN-BUS network, and listen to it:
candump can0
#a data stream is supposed to appear here, but nothing happens...
注意1:当我在终端中打开另一个选项卡并使用以下命令发送 can 消息时:
cansend can0 7DF#0201050000000000
2 行数据确实出现在听 can0 的选项卡中,就像它只显示我正在发送的内容而不是车辆发送的内容。
注2:这里是can0设备的ifconfig命令的结果
#ifconfig (only can0)
can0: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
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
有人知道我为什么从车辆中获得零数据吗?
这是我尝试过的教程,所有这些,问题都一样:
1:copperhilltech
2:Open Garage
3:Harrison's Box
【问题讨论】:
-
车辆码率是500000吗?
-
感谢您的评论,是的,我的工程师告诉了我。但以防万一我也尝试了most common bitrate(33,333 bps、50 Kbps、83,333 bps、100 Kbps、125 Kbps、250 Kbps、500 Kbps、800 Kbps 和 1,000 Kbps),遗憾的是,它也没有给出任何结果/错误我没有示波器..
标签: raspberry-pi can-bus ifconfig socketcan canutils