Questions tagged [can-bus]
Controller Area Network (CAN) bus is a networking technology typically used in cars and other vehicles. It supports deterministic priority arbitration with multiple transmitting nodes.
1,111
questions
0
votes
1
answer
14
views
CANopen SYNC Message Detection with STM32L476
With an STM32L476 as CANopen node I have to detect (consume) the CANopen SYNC message on the CAN bus as fast as possible, probably in the ISR context. All other CANopen messages (beside the CANopen ...
-2
votes
0
answers
9
views
aurdino mega conneceted with 2 mcp2515 to send message and another aurdino mega connected with 2 mcp2515 to receive but i got no ouput [closed]
in Arduino mega I connected two mcp2515 and send two messages for each and also I connected another Arduino mega with 2 mcp2515 to receive message but I did not get output
0
votes
0
answers
20
views
Reading in CAN data into Python
I am trying to read in some data that was defined in the structure:
The structure is defined on the (16-bit) MSP430 as follows:
typedef union _group_64 {
float data_fp[2];
unsigned char ...
0
votes
0
answers
25
views
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;
...
-1
votes
0
answers
28
views
Calculation of CAN Signal CRC and payload in python
I am very new to calculate the CRC and Payload for a CAN signal, Basically I am trying to write a python script that shall trasnmit and receive certain CAN Messages extracted from a dbc file to (Linux ...
0
votes
1
answer
57
views
Signal based CAN bus frame manipulation in C
I'm trying to manipulate a CAN signal using C (with a PCAN Router interface).
What the program does is waits for a CAN specific frame like 0x1F0 and then modify some bits. The bits I want to modify is ...
0
votes
2
answers
52
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 ...
-1
votes
0
answers
18
views
How do I force load a python driver in windows and android?
I've got a Python 3.7 program. It works when I have the interface (a PEAK CAN adapter) connected to my windows laptop, or my raspberry pi. When it is NOT plugged in and I run the script I get a &...
0
votes
0
answers
29
views
Using a Raspberry Pi Pico, MCP 2515 and Micropython to transmit frames over CAN
I'm trying to use a Raspberry Pi Pico and MCP 2515 to transmit frames over CAN. For this I'm using CAN bus Module (B) for Raspberry Pi Pico (https://www.waveshare.com/wiki/Pico-CAN-B) and demo code ...
0
votes
0
answers
17
views
CAN-bus MCP_CAN CAN0(10); prevents execution in ESP32-Wroom-32
The ESP32-Wroom-32 (NODEMCU ESP32S) never enters execution when statement "MCP_CAN CAN0(10);" is part of the variable and constant definition section. The sketch works properly with an ...
1
vote
0
answers
43
views
CAN on ESP32 with Nodemcu
I have tried various Nodemcu builds based on the idf 4 (including the online builder) and cannot get the CAN bus to work on the built-in CAN controller. When I do make menuconfig, I don't see ...
0
votes
1
answer
106
views
CANoe signal manipulation and CRC calculation
I have a CANoe environment where I am simulating a series of nodes and their associated frames using a DBC file. Some of these frames have 8-bit CRC checksums for the payloads, which I am calculating ...
1
vote
1
answer
69
views
Reverse engineer CRC/checksum algorithm in CAN messages
I have a device that is exchanging messages on a CAN bus. I am trying to reverse engineer the protocol being used.
I can decode the protocol (or most of it), but I am struggling to reverse engineer ...
-2
votes
1
answer
55
views
Converting an integer into three hexadecimal variables
I have a problem when trying to convert a 6 digits number into three hexa decimal numbers
I'm using an Arduino Nano
I already did the following
Converting to string Hexa
Cutting string with substring ...
0
votes
0
answers
46
views
FIBEX XML to DBC: How can I convert a FIBEX XML to a DBC file
I need to use some of the signals from a FIBEX XML file in my C code. I have previously used cantools to generate C source code from .dbc files, but cantools do not support FIBEX XML format.
I have ...
0
votes
1
answer
25
views
Can STM32F1 (as part of MXChip) support CAN Bus
Background
I'm very new to electronics/IoT dev. I'm trying to create a solution to be able to read my wife's Car's CAN Bus signal (messages) and store it to an SD card. I hope to analyze the data and ...
0
votes
0
answers
35
views
Concatenate or merge .mdf files with different channels
When attempting to merge mdf files, I receive some version of the following error:
asammdf.blocks.utils.MdfException: internal structure of file 2 is
different; different channels
I understand the ...
0
votes
0
answers
27
views
J2534 library - How to import canbus into my python script using J2534 library
I have been trying to dump an output(live can bus data) from my can bus data logger into my python script.
My python code goes like -
import J2534
rx = J2534.PassThruMsgBuilder(protocol, tx_flag)
...
0
votes
0
answers
52
views
message output not working due to BitCount and Length being zero
I'm kind of new to CAPL. Today I am trying to use the output function for sending UDS messages on CAN, using a simple code below:
UdsReq.dir = 1;
UdsReq.byte(0) = 0x02;
UdsReq.byte(1)...
1
vote
0
answers
19
views
Can not get PN532 and mcp2515 to work together on arduino
I am trying to make the PN532 NFC reader module and mcp2515 to work together.
This is my code:
#include <SPI.h>
#include <mcp2515.h> //Library for using CAN Communication
#include <...
0
votes
0
answers
102
views
ESP32 (ESP-IDF) "driver/twai.h" CAN Data Transmission is working but Receive function is not working using CAN/TWAI
I saw a YouTube video with someone who used a similar code, and it was working perfectly for him (YouTube Video: link: https://youtu.be/bxzWuIqfn9Y). He used "driver/can.h" which has been ...
0
votes
0
answers
35
views
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 ...
0
votes
0
answers
44
views
Integrate TCAN4x5x into i.MX8 dts file
I've some trouble in enabling can device on my embedded platform based on iMX8 and YOCTO. To do that I would use the kernel driver already in the distro (TCAN4x5x). I've modified the *.dts file adding ...
-1
votes
1
answer
29
views
Is that posible to use two windows form in C# and both windows forms share the same serialPort?
I am using a C# "Windows Form App" to send CAN messages via RS232.
in "Form1" i am receiving and sending CAN- masseges by using timers. Since my "Form1" is quite full, I ...
0
votes
1
answer
68
views
Raspberry pi and arduino CAN bus communication not working
So I am working on a project to establish CAN bus communication between raspberry pi 4 and arduino. Unfortunately, I don't have great success. So I already established connection between multiples ...
0
votes
0
answers
54
views
Reading MDF4-Files containing Ethernet Signals
I am trying to read logger measurement files whicha are in the .mf4-format.
For this I am using asammdf as following:
self.mdf = MDF("file.MF4", version="4.10")
If the .mf4 file ...
0
votes
0
answers
40
views
How can I create a BLf file based on a measurement data?
I'm trying to make a certain BLF CAN data file.
After I created an arbitary measurements table, I try to encode messages and write on BLF format by folloing codes.
The BLF file was made, however, it ...
1
vote
1
answer
32
views
How much time does a node have to reply?
Is there a time limit for a node to respond to a message?
Is there a difference between PDO and SDO messages in terms of response time?
Or does this only depend on how the Master gets implemented?
Is ...
0
votes
0
answers
62
views
How to read DBC-file with canmatrix
Does anybody know, how to get a read from DBC-fille with canmatrix library working? I have not found any instructions or examples. THe DBC file has been created in Vector CANDB++ editor and works with ...
0
votes
1
answer
69
views
Corrupting CRC field of a CAN message in CAPL
I want to add some anomalies to corrupt the CRC field of the CAN message. Theoretically, the CRC is being calculated using the info from data field/ctrl field/ ARB field. How to add the CRC corruption ...
0
votes
0
answers
15
views
How do DEFSTRUCT and DEFTYPE work in CanOpen ODs and EDS?
I need to implement a device with custom DEFTYPE and DEFSTRUCT where using them is mandatory, but I cannot put my finger on how to implement them.
How do I create and use DEFSTRUCT and DEFTYPE in OD?
...
0
votes
0
answers
54
views
CAN Bus RX Errors
we are testing out integrating an AIO-3568j board. We have a CAN with a 500,000bps bus, but when we attempt to connect this board to our bus we are receiving packets but almost all of them are being ...
0
votes
0
answers
101
views
How to use Buffered Reader in python-can?
I have a python script that has 2 thread to perform CAN TX and CAN RX.
I'm more concerned about CAN RX. Right now I run
bus.recv(timeout=)
on my receiver thread. But I feel this is not the smartest ...
1
vote
0
answers
42
views
Should a CAN Bus-Off condition immediately reset the connection flags despite of Nodeguarding?
I am wondering whether a detected CAN Bus-Off condition should have a direct impact on the connection status flags in my CANopen Master. It is connected to CAN Nodes that handle analog and digital I/O....
0
votes
1
answer
88
views
Send and read the button state via CAN bus using Arduino
I'm intending to read the change of button input using 2 separate Arduino that connected via CAN bus (MP2515). The transmitter will connect to button with internal pulldown resistor, that pin will act ...
0
votes
0
answers
17
views
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 ...
2
votes
1
answer
76
views
How can the value of an argument in a function called from a signal handler be different from the value passed in?
Updated question - first version below
I have set up a custom signal handler to buffer frames being removed from a CAN interface. In the handler, I block the signal first, and unblock it last, using ...
1
vote
1
answer
113
views
Is there a way to read/write directly from/to the can-bus in android automotive?
Assume I have a vehicle containing a screen that is connected to the vehicles can-bus and that the screen is using the android automotive OS. Disregard Google play store. Is it possible to create a ...
0
votes
0
answers
30
views
Wireshark CAN : meaning of padding and reserved fields
I captured CAN frames with Wireshark, and when I observed the bit sequence, it turned not to follow the standard.
Precisely, in Wireshark, bits sequences labeled as "padding" and "...
0
votes
0
answers
158
views
Decoding logged CAN .blf file using a .dbc file
I am trying to decode a logged CAN file which is saved in CAN binary logging format (.blf)
I tried to use the following piece of code to decode my .blf file, but seem to get key error
import cantools
...
1
vote
0
answers
56
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 ...
0
votes
1
answer
155
views
How to add arduino libraries to espressif IDE?
We are working on a project which requires CAN communication in it. We have made some code in the Arduino IDE which we are trying to do in ESP IDE. However, there are some libraries which we are ...
0
votes
2
answers
146
views
Can you differentiate J1939 from UDS from an unknown message on CANbus
I'm working on a CAN sniffer/logger for and will connect to ECUs that may send out CANopen, J1939 or UDS. Most often two or even all of them in one session (For what I have understood this is not ...
0
votes
1
answer
51
views
Python canopen send a domain
I'm using the canopen python library, see https://canopen.readthedocs.io/en/latest/index.html.
I'm trying to send a domain to my CANopen node:
# nodeHeadPort.sdo['Config Data2'].phys = b'\x11\x22\x33\...
0
votes
1
answer
60
views
Issues with extended_id and socketcan_native
Good morning, I am using git hub examples as a base to make a can bus connection through the pican2 duo can, the python can configuration and the pican2 drivers were installed correctly the problem ...
0
votes
0
answers
68
views
buildroot raspberrypi3_defconfig how to enable SPI?
I'm trying to make a RPI3 buildroot image with CAN interface.
So far I don't see any device in /sys/bus/spi/devices
Please help
What I did are below
At the buildroot terminal "make ...
1
vote
0
answers
62
views
Trouble with Qt QCanBus filters
I'm trying to use the QCanBus filters (Qt version 6.4.0) like so:
if (QCanBus::instance()->plugins().contains(QStringLiteral("vectorcan"))) {
QString errorString = QString("...
0
votes
0
answers
59
views
How to make CanBus communication via Simulink for stm32 Nucleo H7 board via modules
I cannot communicate with Canbus using the Can read and Can write models on Simulink, I do not know how to use the modules.
How should I do the Canbus communication that will use these modules for the ...
0
votes
2
answers
86
views
Who wins arbitration between standard remote frame (11-bit identifier) and extended data frame(29-bit identifier)?
So in case of a CAN bus having both CAN 2.0A and CAN 2.0B nodes, who wins arbitration when CAN 2.0A node tries to send remote frame (RTR bit = 1, IDE = 0) and CAN 2.0B tries to send data frame (SRR = ...
0
votes
0
answers
81
views
FDCAN in production mode cannot send messages
I am using a STM32MP157C-DK2 board to communicate via CAN. To do this, I have created a program in STM32CubeIDE and set the FDCAN parameters:
FDCAN configuration
I have been testing in engineering ...