湖南网站建设kaodezhu广告关键词有哪些类型
我正在运行一个带有两个CAN通道的程序(使用TowerTech CAN Cape TT3201).
两个通道是can0(500k)和can1(125k). can0通道工作正常,但can1运行写入:没有缓冲区空间可用错误.
我正在使用ValueCAN3 / VehicleSpy来检查消息.
这是在我运行程序之前. can0和can1似乎都发送,但只有can0出现在VehicleSpy中.
[email protected]:~# cansend can0 100#00
[email protected]:~# cansend can1 100#20
这是在我尝试运行程序之后
[email protected]:~# cansend can1 100#20
write: No buffer space available
[email protected]:~# cansend can0 111#10
当我的程序运行时:我在can1上发送的所有消息都收到此错误
2016-11-02 15:36:03,052 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 12f83018 010 1 00
2016-11-02 15:36:03,131 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 0af81118 010 6 00 00 00 00 00 00
2016-11-02 15:36:03,148 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 12f81018 010 6 00 00 00 00 00 00
2016-11-02 15:36:03,174 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 0af87018 010 3 00 00 00
2016-11-02 15:36:03,220 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 12f89018 010 4 00 00 00 00
2016-11-02 15:36:03,352 - can.socketcan.native.tx - WARNING - Failed to send: 0.000000 12f83018 010 1 00
但有时整个程序运行正常(如果模块重启或某些随机实例).
我该如何解决?
[email protected]:~# uname -r
4.1.15-ti-rt-r43
做了一些挖掘后,我发现了这一点
[email protected]:-#ip -details link show can0
4:can0: mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 100
bitrate 500000 sample-point 0.875
tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
c_can: tseg1 2..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
clock 24000000
[email protected]:-#ip -details link show can1
5: can1: mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state STOPPED restart-ms 100
bitrate 125000 sample-point 0.875
tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
c_can: tseg1 2..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 8000000
事实证明,由于某种原因,can1已被停止
但是,当我尝试:
ip link set can1 type can restart
RNETLINK answers: Invalid argument
使用sudo ifconfig can0启用can0接口后,运行:
sudo ifconfig can0 txqueuelen 1000
这将增加排队规则的每个内核传输队列允许的帧数.更多信息here
… sometimes the whole program works perfectly (if the module is rebooted or some random instances).
它重新启动SocketCAN接口时的工作原理是,您可以清理足够的缓冲区空间以使其工作.