Using .dbc file to interpret data from PEAK CAN USB in Linux

This forum covers PCAN-Linux and Linux development issues concerning our products
Locked
ragkumar
Posts: 2
Joined: Tue 8. Oct 2019, 03:01

Using .dbc file to interpret data from PEAK CAN USB in Linux

Post by ragkumar » Tue 8. Oct 2019, 03:22

Hi,
I am relatively new to CAN and working on a project that requires me to read and filter some data off a CAN bus. I've come to understand that this would first require accessing the CAN data through the CAN bus (I am using the PEAK USB adapter) and then translating that data through the .dbc file associated with the CAN bus.

I think I have figured the first part out using manuals like -

h**s://www.star.bnl.gov/public/tof/electronics ... n_3.2x.pdf.

I can see CAN data coming over the USB like so -

Code: Select all

ragkumar@ragkumar-VirtualBox:~/Desktop/peak-linux-driver-8.9.0$ cat /dev/pcan32
x b 0x00000001  0    2832581847 779
m s 0x00000458  7  0x02 0x01 0x00 0x00 0x00 0x00 0x00   2832581847 088
m s 0x000003ed  1  0x00   2832581847 216
m s 0x00000113  3  0x01 0x97 0x01   2832581847 344
m s 0x000007ff  8  0x03 0x00 0x08 0x48 0x61 0x42 0x01 0x02   2832581847 600
m s 0x00000318  8  0x13 0x0a 0x17 0x00 0x08 0x15 0x0f 0x7b   2832581847 813
m s 0x00000458  7  0x02 0x01 0x00 0x00 0x00 0x00 0x00   2832581848 069
m s 0x00000405  8  0x12 0x46 0x33 0x38 0x38 0x37 0x34 0x37   2832581848 283
m s 0x00000113  3  0x01 0x97 0x01   2832581848 453
m s 0x000007ff  8  0x01 0x05 0x53 0x55 0x04 0x04 0x15 0x00   2832581848 709
m s 0x00000318  8  0x13 0x0a 0x17 0x00 0x08 0x15 0x11 0x7d   2832581848 923
and the cat proc/pcan command gives the following -

Code: Select all

ragkumar@ragkumar-VirtualBox:~/Desktop/peak-linux-driver-8.9.0$ cat /proc/pcan

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20190802_n (8.9.0) Oct  4 2019 12:46:34 --------------
*---------------------------- [mod] [par] [usb] -----------------------------
*--------------------- 1 interfaces @ major 240 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb   -NA- ffffffff 000 0x001c 0000000c 00000000 00000003 00000000 0x0000
So my question is, how can I translate this data into human readable form. I know you guys have PCAN-Explorer for Windows, is there anything of sorts for Linux?
Is there a barebones translation possible through python or on the terminal?
Finally, if nothing is possible, can I just track the CAN messages and manually decode?

Thanks!
Raghav

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Using .dbc file to interpret data from PEAK CAN USB in L

Post by PEAK-Support » Tue 8. Oct 2019, 11:47

The CAN Driver send and receive only RAW CAN Messages - it is up to your Application to "Decode" the Data using a CANdb (Automotive), NMEA200 (Marine), J1939 (Agriculture and Trucks) or any other common format.

You need to build your own application and/or use a libary to decode the Data Bytes to signal based Information.

Our Drivers do not include this feature.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

ragkumar
Posts: 2
Joined: Tue 8. Oct 2019, 03:01

Re: Using .dbc file to interpret data from PEAK CAN USB in L

Post by ragkumar » Tue 8. Oct 2019, 17:02

How
U.Wilhelm wrote:The CAN Driver send and receive only RAW CAN Messages - it is up to your Application to "Decode" the Data using a CANdb (Automotive), NMEA200 (Marine), J1939 (Agriculture and Trucks) or any other common format.

You need to build your own application and/or use a libary to decode the Data Bytes to signal based Information.

Our Drivers do not include this feature.
However, it seems like you do have an application for windows that can take a .dbc file and decode the raw CAN data right? Do you have something for Linux?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Using .dbc file to interpret data from PEAK CAN USB in L

Post by PEAK-Support » Tue 8. Oct 2019, 17:05

No, we offer this Tool only for Windows System.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Locked