-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot clear TX Buffer of CAN. #514
Comments
In both of your outputs (
Are you actually using CAN-FD with a data bitrate of 8 Mbit/s? The TX errors will not "disappear" as they are cumulative counters. Completely removing the device driver or a reboot will. You have enabled bit error reporting, use If your devices goes into |
I modified the
Running Trying Was a For setting the bitrate to 8 MBit/s I followed what was indicated on their setting up page. This is my These are the codes I use to communicate with the CAN:
The CAN_IDs I use for the motors are
|
No, don't know why this doesn't for for you.
You should look at the datasheet of your drive, if they use CAN or CAN-FD and configure you raspi accordingly. Can you send me a There's CAN-ID |
I see CAN-ID |
That is simply the way this motor is setup... I will see if I can change it but not sure. |
This may not be related, but I had a similar experience; tx buffer being full. This case was reproduceable when the target devices are left disconnected for a while where the socket can device periodically tries to check the devices via sending a packet. |
Hello, In our case, we have "Transmit buffer full" error with USB->CAN adaptators using gs_usb driver (Innomaker and UCCB). Note that we didn't have this issue on 5.15 kernel with any cable only with 6.6. Regards, |
@nefethael If you still have this issue and want help to resolve it, please open a new issue. The OP's problem is unrelated to a kernel update. |
@grvstick If you try to send to a CAN bus without a 2nd device, the sender will continuously retry to send. Eventually all TX buffers are full. It's a known limitation of the CAN implementation in Linux and the candlelight firmware that you cannot abort a single CAN message "stuck" in the TX queue. |
Hello,
I am using a 2-Channel Isolated CAN Expansion HAT to control two DC Motors via a Raspberry Pi 4B. I am using python-can 4.3.1.
When starting the python script, I receive the "Transmit Buffer Full" Error from
can/interfaces/socketcan/socketcan.py
.However, if successfully running
cangen can0
andcandump can0
in the terminal before running the python script, the CAN works perfectly. It sometimes happens that runningcangen can0
andcandump can0
yieldswrite: no buffer space available
, in which case the CAN doesn't work. Attempting to change the CAN interface settings with functions such assudo ifconfig can0 txqueuelen 1000
results in these errorsRNETLINK answers: Invalid argument
. The can0 is initialised withtxqueuelen = 65536
, so I don't know why I get these errors, which seem to be very random.I checked the following threads, without any success:
I asked the manufacturer for advice, who recommended to add
bus.flush_tx_buffer()
. This didn't change anything.Continuing to troubleshoot the issue, I observe that when I turn the Raspberry Pi on, running
ifconfig
indicates no issues. However runningcangen can0
, which results in the "write: No buffer space available" error message, I observe a significant amount of TX errors, as depicted below:I have tried changing the bitrate, turning the can0 interface down then up, still doesn't resolve the issue. The only solution which works after multiple attempts is to reboot the Raspberry Pi, for which the TX errors seem to halve after every reboot (until there are non left and I can run the python script)
Below is a screenshot when running
ip -det link show can0
This is the code to put the CAN Bus up at boot:
sudo nano /etc/network/interfaces
Any help is fully appreciated!
The text was updated successfully, but these errors were encountered: