Questions tagged [canbus]
16 questions
1
vote
0 answers
How to verify CAN interfaces with Linux?
I want to verify the CAN interfaces on my embedded system. It has two can ports: can0 and can1.
I bring them both up with the following sequence:
# ip link set can0 type can bitrate 1000000 dbitrate 2000000 fd on
# ip link set can0 up
# ip link set…
mistyron
- 33
- 5
1
vote
1 answer
Getting a Waveshare CAN HAT working on a Banana Pi BPI-M2 Zero
Waveshare makes a great CAN HAT for the Raspberry Pi (see here), but the instructions only work for Raspberry Pi OS, not for Armbian. The Banana Pi BPI-M2 Zero has the same pin header layout as the Raspberry Pi, but runs Armbian. How do you setup…
johnnyb
- 71
- 7
1
vote
1 answer
Consistent / persistent network connection naming, like udev
I have multiple similar USB network devices, in this case CAN (can0 and can1) connections to different networks but I figure it is a similar problem with multiple other networks (eg WiFi, Ethernet etc). These currently show as can0 and can1 and I…
ShaunMc
- 13
- 3
1
vote
0 answers
systemd-networkd-wait-online failing with SocketCAN interface
I have configured a SocketCAN interface, can0 (confirmed working using can-utils). I have the below .network config file, so that systemd-networkd brings up the interface on…
Joshua Voskamp
- 143
- 1
- 6
1
vote
0 answers
Virtualbox Linux Adding SocketCAN Interface
Does anyone have experience using SocketCAN within Virtualbox? I'm using Xubuntu. I started by modprobing can, can_raw, can_dev and the relevant driver for the particular can module I'm using. In addition, I directed Virtualbox to pass through the…
Dan
- 11
- 1
1
vote
1 answer
Clear socket buffer of CAN adapter
I have a USB/CAN adapter, from lsusb:
OpenMoko, Inc. Geschwister Schneider CAN adapter
it provides a socket interface, from ip addr:
5: can0: mtu 16 qdisc pfifo_fast state UP group default qlen 10 link/can
On the bus…
Mark
- 677
- 1
- 10
- 24
1
vote
1 answer
Udev rule to connect USB to CAN Lawicell
I am using a Lawicel CAN adapter to connect to a sensor, and would like to setup a udev rule to avoid the manual can setup.
The manual can setup:
sudo slcand -o -c -f -s6 /dev/ttyUSB0 slcan0
sudo ifconfig slcan0 up
Running candump slcan0 shows, by…
Morten Nissov
- 130
- 7
0
votes
0 answers
Reading from socketCAN inside a driver
I am attempting to read a socketCAN device inside a driver.
I am setting up an skb and passing that along with pertinent information to the can_rx_register call to register a callback named sc_rcv.
// callback
static void sc_rcv(struct sk_buff…
Mark Clark
- 1
- 1
0
votes
0 answers
Specifiy which SPI interface to use for SocketCAN interface
I am using a Raspberry Pi 4b with Raspberry Pi OS (kernel 5.15) and a custom CAN HAT with 3xMCP2517FD CAN controllers connected to SPI0/1/4 of the Raspberry Pi to communicate to other CAN nodes on these 3 CAN buses.
To be able to use the 3 SPI…
0
votes
0 answers
QEMU CAN Bus Emulation; error on socket bind: No such device
The goal is to run following C program in the VM.
int main(int argc, char **argv) {
int s, i;
int nbytes;
struct sockaddr_can addr;
struct ifreq ifr;
struct can_frame frame;
if ((s = socket(PF_CAN, SOCK_RAW, CAN_RAW)) < 0)…
0
votes
1 answer
information regarding can, can-dev kernel modules on Debian GNU/Linux 10 (buster) Linux 4.19.94-ti-r42
I seem to be missing a couple of kernel modules. Specifically, can and can_dev.
The modules don't load when I run modprobe can or modprobe can-dev.
The reason for this I believe is because the modules are not in the…
HPVoxx
- 1
0
votes
0 answers
CANbus adapter stuff in 11-bit mode
I have a PEAK canbus adapter (USB) connected to my Linux box, access from Qt C++ program. While all works well, when I receive frames they are all SFF (11-bit) ID's. candumps are all 11-bit ID's. Even if I send EFF (29-bit) frames, it only shows…
TSG
- 1,580
- 6
- 26
- 42
0
votes
0 answers
Customizing PCAN Channel Names on Ubuntu
I have a testing system Ubuntu 22.04.1 LTS that uses more than one pcan device,
each pcan device is connected to one testing unit.
to connect to the pcan devices I use python python-can module.
my system was rebooted, and all the mapping was…
Rami Hassan
- 33
- 3
0
votes
1 answer
Unable to bring up the CANbus interface on a Beaglebone black
To automatically bring up the interface on boot, I edited the /etc/network/interfaces file as follows:
debian@beaglebone:~$ sudo nano /etc/network/interfaces
And added the following at the end of the file:
auto can1
iface can1 inet manual
pre-up…
Stéphane de Luca
- 163
- 7
0
votes
1 answer
On a system, can two CAN ports have the same CAN-ids?
If a device with two CAN ports have the same CAN-id, will this cause trouble?
The networks are separated for some reason, but the "master" should be the same for both networks.
Edit: Below the network topology.
("master") CAN-BUS 0 …
Bayou
- 155
- 7