Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
65 views

UDP Multicast Windows

I have developed a C# application that needs to listen for UDP multicast messages. The UDP multicast is being sent from a Linux virtual machine (VM) with the following network details: inet: 192.168.6....
Giovanni van de Sluis's user avatar
0 votes
0 answers
151 views

Unable to send a message CAN from a PC with Linux (Ubuntu) to a module CANable (usb to can) with C++ code

I am using a C++ library with the following code: #include <linux/can.h> #include <linux/can/raw.h> #include <sys/socket.h> #include <unistd.h> #include <cstring> #...
Miguel Oliveira da Rocha's user avatar
-1 votes
1 answer
165 views

CAN dump utility Filter and mask id

Can anyone help me out with the difference between can_id and can_mask with an example i am trying to understand by going through the man pages still i am unable to get it. Kindly help me
Suma's user avatar
  • 1
0 votes
0 answers
543 views

CAN bus with single node will spam errors until it breaks

Situation: we have a pc with a USB2CAN adapter we have a single node (us) because the other node is a vehicle cable which may get disconnected if we write on the can without another node it will fail ...
The Mark's user avatar
2 votes
0 answers
318 views

Can read CANBUS socket, but not write to it

I'm converting a Windows program to Linux and I have some problem writing to the CAN bus. Trying write or send returns -1 with errno as "No such device or address" Some simplified C code: ...
dargaud's user avatar
  • 2,551
0 votes
2 answers
914 views

How to set CAN Filters on Linux? Do they work on virtual CANs?

I just programming a ROS node where I'm trying to set up filters on a CAN Socket. I would like to get the messages with CAN_Id 0x6A0 to 0x6A4 as well as the CAN_Id 0x0CF02980. I'm using the socket can ...
Boris's user avatar
  • 1
1 vote
0 answers
184 views

Multiple cycle times for can frames on a bcm SocketCan possible?

I would like to send and reveive CAN frames via a BCM SocketCAN in Linux with C/C++. Some frames may be 11bit others are 29bit. Each frame can have an individual cycle time and the data will change ...
Andy Höfler's user avatar
-2 votes
1 answer
741 views

slcand error : Inappropriate ioctl for device [closed]

I want to use can interface with slcand, but I have a problem. To link can device(canable) with slcand, I make symbolic link with udev-rule SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device&...
LeeJaeBong's user avatar
1 vote
1 answer
203 views

How do I install a signal handler for a custom I/O signal?

I am trying to set up a signal and signal handler to rebuffer CAN frames as they arrive. Below is my code. I can send a frame from the computer running this code, but when I send a frame back the ...
Walkingbeard's user avatar
2 votes
1 answer
2k views

Equivalent tool of Kvaser Database Editor on Linux

What's a Equivalent tool of Kvaser Database Editor on Linux? The only GUI tool I found is SavvyCAN and Wireshark CAN plugin. But both tools are for viewing logged data. enter image description here ...
newnavi's user avatar
  • 23
1 vote
0 answers
1k views

CAN bus doesnt recover after reset

I'm running my script on Nvidia Xavier #!/bin/bash sudo /sbin/ip link set can0 down sudo busybox devmem 0x0c303000 32 0x0000C400 sudo busybox devmem 0x0c303008 32 0x0000C458 sudo busybox devmem ...
Taio pepe's user avatar
1 vote
0 answers
564 views

SocketCAN recovery from buffer overflow CAN_ERR_CRTL_RX_OVERFLOW

I write an application in C/C++ which uses SocketCAN. Under some conditions I can generate an buffer overflow error CAN_ERR_CRTL_RX_OVERFLOW on my system. An ip command shows growing number of ...
dr.chleb's user avatar
0 votes
2 answers
525 views

Can you attach a custom CAN interrupt handler to SocketCAN?

I have an application running baremetal which controls a peripheral via CAN. In its original form, my application hands messages to the CAN "driver", which is actually a buffering layer. ...
Walkingbeard's user avatar
0 votes
1 answer
529 views

Debian: Module can-dev loaded with load-modules.conf does not work until I reload it manually [closed]

I have a slight problem with using can bus on a raspberry pi with Debian 64 bit running on it. My /etc/modules-load.d/modules.conf looks like this: # /etc/modules: kernel modules to load at boot time. ...
Fux's user avatar
  • 1
0 votes
1 answer
168 views

BBB CAN TX only works at loop-situation

I'm working on BeagleBone Black board to confirm the CAN communication between the BBB and another device. sudo modprobe can sudo modprobe can-dev sudo modprobe can-raw sudo ip link set can1 down ...
Seth's user avatar
  • 21
5 votes
3 answers
626 views

Getting CAN interface packet statistics using getifaddrs

I'm using the getifaddrs Linux function to get information about network interfaces on a Linux machine running Debian Jessie kernel 3.16.0. Among the info I want to know is network statistics (packets ...
hoz's user avatar
  • 316
1 vote
1 answer
834 views

SocketCAN CAN bus Arbit-lost error increments once program started

I'm doing a project that will connect multiple subsystems (sensors, controller, etc) via CAN bus. I'm using SocketCAN and have settings as below: root@ngtianxun-desktop:~# ip -details -statistic link ...
T08's user avatar
  • 163
1 vote
1 answer
1k views

Socket reading error on CAN BUS Linux Socketcan?

I implemented a CAN bus communication for writing and read operations with linux. I am using socketCan library. Write function works correctly. I have problems with my reading function: int ...
kevin94's user avatar
  • 37
2 votes
1 answer
2k views

Communication through CAN-bus interface not working

I have python code running on a linux based device which has the following OS specifications: NAME=Buildroot VERSION=2020.11.1 This device is connected to a PLC using a three wire interface (CAN_H,...
Kian's user avatar
  • 21
0 votes
0 answers
1k views

Send CAN Messages to Multiple Specified Device IDs in Socketcan / Python-can similar to MCP_CAN Arduino library?

Is there an equivalent in Python Socketcan / python-can that allows CAN messages to be sent to a specific destination device ID like how it's done on Arduino devices? The Arduino CAN bus boards use a ...
Stigma's user avatar
  • 361
0 votes
0 answers
309 views

Missing PDO in a CAN bus of SocketCAN on a linux CPU board

It is being observed that multiple PDO go missing when a CPU has high usage and also when there is a high traffic via SSH connection. The arrangement is such that SocketCAN api of the linux system is ...
curosity's user avatar
0 votes
1 answer
731 views

Linux MCP2551 CAN Bus: Stop working after one frame

I got a problem for days now, my Can Bus stop working after sending the first message. I use as a client the IOT-Gate-RPI which have the raspberry pi 3 compute module and a integrated hat with the ...
danakil's user avatar
2 votes
0 answers
800 views

Sending CAN-bus J1939 messages with no Data in linux

I need to send a CAN-bus J1939 message with no data using socketcan. The reason why the message needs to be sent with no data is to follow the spec J1939-73 DM11 (PGN=0x00FED3). The C code below works ...
rickthehope's user avatar
0 votes
0 answers
486 views

CAN Bus - handle multiple CAN Bus sockets

I am attempting to read/write to multiple CAN Bus sockets on a device out of the same thread. However, I am only getting RX messages when I write to the boards that are supposed to be on can1 when I ...
CapnCook's user avatar
1 vote
2 answers
2k views

Linux can-bus excessive retransmit

I'm working on a project involving a linux embedded device with CAN bus-support. I've noticed that if I try to send a CAN-packet without having anything attached to the CAN-bus, the transmit is ...
avl_sweden's user avatar
0 votes
0 answers
196 views

SocketCAN: No telegrams received

I want to receive messages periodically using socketCAN. But the program didnt receive any telegrams. I think one problem may be the telegram ID inside the BCM. Can somebody help me with a hint? Thank ...
Or25's user avatar
  • 1
0 votes
1 answer
839 views

linux CAN protocol maximum rate

I am writing a program that has to handle 20000 CAN messages per second. When writing the code with python under linux using socketcan, it seems that I start to lose messages when msg_per_second is ...
rickthehope's user avatar
-1 votes
2 answers
438 views

Command "ip link show" saving the results to a variable in C language

I am using the command ip -details -statistics link show can0 My result : re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 15 13 0 ...
Domi Nik's user avatar
1 vote
0 answers
1k views

socketcan alternative / add can0 to /dev/

I am currently working with CAN-BUS Systems. I make the CAN Interface available using sudo modprobe can sudo modprobe can-raw sudo modprobe mttcan sudo ip link set can0 type can bitrate 250000 sudo ip ...
Markus's user avatar
  • 175
0 votes
1 answer
3k views

How to detect open CAN bus using CAN socket in C

I will try to keep it short. I have a C application which opens can socket port using the following approach ... struct sockaddr_can lCanAddr; struct ifreq lIfr; if ((*aCanSocket = socket(PF_CAN, ...
curosity's user avatar
0 votes
1 answer
500 views

Why isn't j1939.h include in the Ubuntu 18.04 Linux Kernel?

I am trying to use CAN J1939 standard on an embedded Linux system running Ubuntu 18.04, kernel 5.4.0-52-generic. This elinux page indicates that j1939.h "got in the mainline kernel since v5.4&...
Cameron's user avatar
1 vote
1 answer
666 views

SocketCAN read from socket only returns 11cobid

I am trying to read from a socketCAN and the msg is always filtered for the 11bit identifier. This should be a problem fixable with setting the rpoper flags for the 29bit identifier but I can`t find ...
homer69's user avatar
  • 73
2 votes
1 answer
1k views

How and what do need to do to use CAN on android? [closed]

I need to know what software or programs and hardware I need to effectively communicate with CANbus and my usb2can through android phone. Everything I read or try doesn't seem to be legit or doesnt ...
Iknowaguy's user avatar
4 votes
1 answer
6k views

SocketCAN: How to query buffer usage

I am trying to determine the buffer usage for my CAN interface on linux. At the level of the interface, I know of two ways to get statistics: From /proc/net/can/stats ip -details -statistics link ...
Naju's user avatar
  • 315
0 votes
1 answer
1k views

Simple consumer producer example for sending and receiving CAN messages does not receive messages

I was just trying to use a virtual can device vcan0 under linux and the python-can module to get acquainted with programming and debugging over the CAN bus. I devised a simple looking program with two ...
Aleph0's user avatar
  • 6,064
1 vote
1 answer
1k views

Candump - candumpanalyzer : command not found

Operating System: Rasbian I am trying to follow this https://www.npmjs.com/package/@canboat/canboatjsto to use the following command : candump can0 | candumpanalyzer. However, after trying all these ...
colla's user avatar
  • 807
-1 votes
1 answer
295 views

More efficient way for reading CAN data in while loop

I have 3 devices which send 8 bytes of data over CAN interface. To read the buffer from CAN I am using a while loop which looks something like this: void CanServer::ReadFromCAN() { ...
aikhs's user avatar
  • 979
1 vote
1 answer
1k views

Sending CAN frame via UDP in Python

I made UDP socket connection between two Linux machines and can send for example b"Hello, World!" easily. But now I need to send the below CAN frame from can import Message send_msg = ...
Farhan Kabir's user avatar
2 votes
1 answer
2k views

How to send and receive CAN messages between 2 Linux machines without any CAN hardware?

I have been trying to establish CAN communication between my laptop (Ubuntu 20 Virtualbox) and Raspberry Pi (Ubuntu 20) without any CAN hardware, because that will not get the CAN message in the ...
Farhan Kabir's user avatar
9 votes
3 answers
6k views

Sharing virtual network with docker container

I am working on a project that requires me to create a virtual CAN network on my host machine $ sudo modprobe vcan $ sudo ip link add dev vcan0 type vcan $ sudo ip link set up vcan0 My ifconfig : My ...
Ansh David's user avatar
0 votes
1 answer
1k views

BeagleBone AI - How to setup CAN bus

I couldn't find any resources on the internet for setting up CAN bus on the Beagle Bone AI, and I had a lot of trouble getting it up and going but zmatt on the http://beagleboard.org/chat basically ...
user2654735's user avatar
2 votes
0 answers
799 views

CAN socketCAN - how reliable is for file transfer

I want to send files (mp3 about 4MB each) to devices connected via CAN. I'm testing with Linux machine and ESP32. The problem is that not all data arrives to destination. I'm sending from Linux ...
user2018761's user avatar
0 votes
1 answer
1k views

linux c socketcan wait for transmit buffer empty

Is there a way to check for an empty transmit buffer with raw socketcan? EDIT: Or is there a way to make socketcan blocking until the current frame is sent which would serve the same purpose ... (...
Scheintod's user avatar
  • 8,105
0 votes
0 answers
202 views

Unix CAN socket does not wait for message

I have a unix CAN socket created as below: #include <linux/can.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <net/if.h> #include <string.h> #include <...
Shadasviar's user avatar
2 votes
1 answer
2k views

What's the difference between RAW CAN sockets and Broadcast Manager CAN sockets and how to use them?

I am new to the CAN protocol and I am trying to utilise it through the Linux's SocketCAN. However, I am confused by the 2 different CAN sockets available, RAW and Broadcast Manager (BCM). ...
Alex Anderson's user avatar
2 votes
1 answer
1k views

CAN socket read with frames late

I am using CAN linux socket created as below: ... sockaddr_can addr; struct ifreq ifr; _sock_fd = socket(PF_CAN, SOCK_RAW, CAN_RAW); if (_sock_fd < 0) { throw(std::...
Shadasviar's user avatar
2 votes
1 answer
4k views

Reading CAN bus in C displays incorrect CAN ID for 29-bit CAN ID

I wrote some code in C to read CAN bus data. Everything works correctly when I read 11-bit CAN IDs. As soon as I try to read 29-bit IDs it displays the ID incorrectly. Example: Receiving message with ...
Markus's user avatar
  • 319
4 votes
0 answers
1k views

How to remove a CAN message filter from a CAN_RAW socket?

SocketCAN's description says about adding some filters to a socket: struct can_filter rfilter[2]; rfilter[0].can_id = 0x123; rfilter[0].can_mask = CAN_SFF_MASK; rfilter[1].can_id = 0x200; ...
Greenberet's user avatar
0 votes
1 answer
596 views

How to get CANbus working on beaglebone green

I am having trouble getting CAN working on my beaglebone green using can-utils. I have a bitscope hooked up to the CAN pins but I'm not seeing any output.. Beaglebone version: $ uname -a Linux ...
ishorion's user avatar
0 votes
0 answers
357 views

Systemd service interrupting CAN bus process

I've made a program that communicates with hardware over CAN bus. When I start my program via CLI, everything seems to run fine, but starting the process via a Systemd service leads to paused traffic ...
abdomo's user avatar
  • 11