-
Notifications
You must be signed in to change notification settings - Fork 587
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
max of 320 messages on RX. Dropping packets #657
Comments
No, unfortunately this isn't currently exposed via the As such, the size of this buffer should take on your system's defaults. If you need this functionality, as a temporary workaround you can try increasing # Read current values
cat /proc/sys/net/core/rmem_max
cat /proc/sys/net/core/rmem_default
# Temporarily set new values. To permanently set, do it via sysctl.conf
echo $NEW_VALUE | sudo tee /proc/sys/net/core/rmem_max
echo $NEW_VALUE | sudo tee /proc/sys/net/core/rmem_default You can try and see if that works. If we were to implement support for this, we can probably set Note: Also, if we have the |
We should consider adding this to the documentation. |
Hi there! Have you ever tested on raspberry pi? Any clues for message dropping? Thank you. |
It tested on a Raspi 4B with socketcan (from Ubuntu 20.04) via USB and everything works there. |
I have always used it with Raspbian. I will give a try with Ubuntu. My can adapter is communicating via SPI, I guess it may affect too. |
I am having a lot of problems just to install the drivers for the hat using Ubuntu. |
I have a Raspian with a Linux 5.10 kernel which works out-of-the-box WITHOUT compiling any drivers/scripts from Seeedstudio. The Seeedstudio install procedure might have worked for older kernels but the best SPI drivers are in Mainline Linux now and compiling and installing the stuff from Seeedstudio made it worse and finally sabotaged the working setup (in my case). |
It sounds great! I actually have installed this linux Kernel version. |
Yes, similar here: This was the only thing I changed on my RasPi (no compiling and installing of out-of-tree CAN drivers that came with the seeed package). |
I see. I am using v2 due to the RealTimeClock in the HAT. |
There was a former installation process where a driver was compiled and installed (not only the dtoverlay): As you can see here https://github.com/Seeed-Studio/seeed-linux-dtoverlays/blob/master/modules/CAN-HAT/Makefile#L47 the |
All right! I've seen how to uninstall it. |
Hi, I could improve quite a lot by uninstalling the old driver and setting correctly the can interfaces (thanks hartkopp) and setting big buffers (thanks karlding). If I run in the terminal:dmesg | grep spi I guess that if the buffer is full is because I am not taking the messages out fast enough, right? Is there any way to check the buffer status? And to clear it? Thanks a lot |
If you get a
that means that the kernel failed to get the messages fast enough out of the hardware. This is independent of any user space buffers or size, and/or applications receiving CAN frames. However, if the system is loaded, the processor has less time to download incoming CAN frames from the hardware and finally the buffer will overrun. |
I did some test again checking the CPU load. It was slightly over 50%. In al cases, even with the low CPU load I am receiving FIFO overflow. Is that what you mean? |
I noticed that I can only fit a max of 320 (extened id, dlc=8) messages on the receiver. If I don't pull them off the socket fast enough the last ones get dropped. Is there any way to increase the queue size on can.interfaces.socketcan.socketcan?
The text was updated successfully, but these errors were encountered: