CAN发送接收示例
CAN发送数据命令1
cansend can0 123#11.22
cansend是命令,can0是参数,123是ID,#分隔符,11.22是发送数据。
CAN接收:接收需要另外开一个终端1
candump can0
candump 是命令,can0是参数,表示哪个设备,这个命令是阻塞型的,会一直等待接收。
CAN工具安装调试
1 | uname -r # 应该能看到自己起的CONFIG_LOCALVERSION |
1、配置can0,设置比特率1
sudo ip link set can0 type can bitrate 250000
2、打开can01
sudo ip link set can0 up
3、查看信息1
ip -details link show can0
4、ifconfig
关闭1
sudo ifconfig can1 down
参考资料
https://blog.csdn.net/qq_41661878/article/details/129038794
https://blog.csdn.net/weixin_43849483/article/details/130454760
https://blog.csdn.net/gjy_skyblue/article/details/131322358
https://zhuanlan.zhihu.com/p/611724997
https://blog.csdn.net/u010443710/article/details/106834961?spm=1001.2014.3001.5501
https://blog.csdn.net/u010443710/article/details/107476570?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-5-107476570-blog-106834961.235^v38^pc_relevant_anti_vip&spm=1001.2101.3001.4242.4&utm_relevant_index=8
https://cloud.tencent.com/developer/article/1902433?areaSource=102001.19&traceId=-2_c0P3YX14MQMjVQtfcf