dschanoeh / socketcand

A deprecated fork of socketcand. Please got to linux-can for the latest version.
https://github.com/linux-can/socketcand
131 stars 40 forks source link

write: No buffer space available #14

Open kacetjan opened 7 years ago

kacetjan commented 7 years ago

Hi, I try to establish CAN communication between a java application (running in virtual machine Ubuntu 14.04) and a device using CAN/USB convertor (http://www.systec-electronic.com/en/products/industrial-communication/interfaces-and-gateways/can-usb-adapter-usb-canmodul1). The java application uses kayak-core to send CAN frames. When the driver is loaded and the bitrate is set properly, the java application is started and the communication works fine. However after a while the communication stops working. The CAN/USB convertor does not indicate any error, the java application runs without any warning, however the CAN bus is silent (no messages transmitted or received by the java application). When I try to send a single CAN message from linux terminal using "cansend can0 100#00" command it says "write: No buffer space available". It seems that it is problem of socketcan, does it not? Can you give me an advise how to fix this issue?

I use these commands 1) load driver and set bitrate sudo modprobe can_raw sudo modprobe can_dev sudo make firmware_install sudo insmod systec_can.ko sudo ip link set can0 up type can bitrate 125000 2) provide access for can0 socketcand -i can0

The details and statistics of can0 are:

17: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10 link/can 00:04:cb:18:00:00 brd 00:00:00:00:00:00 promiscuity 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 systec_can: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..255 brp-inc 1 clock 48000000 re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
766656 95832 0 0 0 0
TX: bytes packets errors dropped carrier collsns 354108 95831 0 0 0 0