SocketCAN is a Linux socket based implementation for Controller Area Network (CAN) protocol.
Questions tagged [socketcan]
155 questions
1
vote
1 answer
vcan0 interface linux communication
Linux is supporting virtual can interface. it was enabled by:
modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ifconfig vcan0 up
While using cam-utils such as camsniffer and cansend
cansend vcan0 321#1212
cansniffer vcan0
I could able to…

Gopi
- 340
- 4
- 12
1
vote
1 answer
SocketCAN stops read after RX overflow, is it normal?
I’m doing tests on embedded hardware with integrated CAN bus interface.
The driver provides Linux Socket API.
I try to see the limits:
I have one transmitter that writes CAN frames as fast as possible and a receiver that reads continuously.
After a…

Nelstaar
- 769
- 9
- 26
1
vote
0 answers
Enumerate CAN adapters
Is there a way to enumerate all CAN devices on Linux?
It's easy to get a list of the available adapter names plus their indices using if_nameindex but I can't see an obvious way to use that to then iterate though those to find out which are can or…

Gary Metalle
- 31
- 2
1
vote
1 answer
Do I need to 'select' to wait for write availability when writing a socket from multiple threads?
I have code that writes to the same socket with multiple threads, like this, on Linux, which seems to be working in my development tests (pseudo-ish code):
Mutex theSocketMutex = ...;
int theSocket = ...;
void Thread () {
while (...) {
…

Jason C
- 38,729
- 14
- 126
- 182
1
vote
1 answer
SocketCAN C# using mono
I am really new to mono and C# but I want to use sockets to open a communication via CAN. The problem is that a lot of protocol an adress families are implemented but CAN ist not supported by mono so far. The system kernel supports it but it is not…

user3485648
- 11
- 2
1
vote
1 answer
Faster alternatives to Popen for CAN bus access?
I'm currently using Popen to send instructions to a utility (canutils... the cansend function in particular) via the command line.
The entire function looks like this.
def _CANSend(self, register, value, readWrite = 'write'):
"""send a CAN…

Chris
- 9,603
- 15
- 46
- 67
0
votes
0 answers
Why does candump of can-utils flag sent frames as RX instead of TX?
raspberry pi sends messages:
On that device I have two terminals open:
to look at candump -x any expecting TX messages
to send messages cansend can0 110#C0FFEE
device B receives the messages sent by raspberry pi.
However, raspberry pi displays…

spaceKelan
- 67
- 7
0
votes
0 answers
How to use CANopenLinux with USBtin?
I use the USBtin via socketcan by plugging in the device and executing can-utils on CentOS
sudo slcan_attach -f -s3 -o /dev/ttyACM0
sudo slcand ttyACM0 can0
sudo ip link set up can0
Then I check ifconfig
can0: flags=193 mtu 16
…

spaceKelan
- 67
- 7
0
votes
0 answers
How to use SocketCAN via Unix Domain Sockets in Java?
I am trying to figure out how to use a SocketCAN connection in Java.
As stated in the SocketCAN doc, SocketCAN is designed very similar to TCP and UDP Sockets. It also provides a network interface for each connected CAN bus. These are also listed…

Crazy Doc
- 349
- 1
- 3
- 11
0
votes
1 answer
AttributeError: object has no attribute thrown even though an attribute is implicitly given
Not sure why the following code throws the error AttributeError: 'CANManager' object has no attribute bus:
class CANManager():
def __init__(self, name="can0", bitrate=500000, data_bitrate=2000000, fd=False):
self.bus_name = name
…

Nemesis
- 150
- 4
- 15
0
votes
0 answers
USB2CAN qdisc buffer full and no requeues
Hi I'm trying to connect my Linux VM to a physical CAN-Bus.
The USB Passthrough and setup of the CAN interface is working perfectly fine, but I have trouble sending messages from the VM.
First of all here is my VM version and…

Philipp
- 26
- 4
0
votes
0 answers
Is there any trial of CLI(Command line Interface) to Linux Shell via CAN(Controller Area Network)?
The CLI( Command Line Interface) to Linux Shell is usually on the Serial Communication.
So I think there is no need to change the Serial tty to CAN socket for it.
But is there any attempt of CLI of Linux Shell via CAN communication?
Thank you
Tried…

user16582941
- 9
- 1
0
votes
0 answers
modprobe: ERROR: could not insert 'can': Invalid argument (In 5.10.102.1 WSL2)
I'm setting up the socket can because I want to test it, but the same message comes out as the title.
modprobe: ERROR: could not insert 'can': Invalid argument
and dmesg display like blow.
[ 1297.682601] can: disagrees about version of symbol…

Leeharim__kr
- 1
- 1
0
votes
0 answers
Build and install libsocketcan for x86_64
I have downloaded the the libsocketcan project and built and installed it successfully (no errors) using:
./autogen.sh
./configure
make
make install
and the configure step outputs:
checking build system type... x86_64-pc-linux-gnu
By my program…

TSG
- 4,242
- 9
- 61
- 121
0
votes
0 answers
SocketCAN with C++ on Raspberry Pi: messages lost when read is delayed
In a C++ application running on a Raspberry Pi, I am using a loop in a thread to continuously wait for SocketCAN messages and process them. The messages come in at around 1kHz, as verified using candump.
After waiting for poll() to return and…

Fr4nky
- 11
- 4