Dump CAN traffic while using Linux driver

This forum covers PCAN-Linux and Linux development issues concerning our products
Locked
godorizzi
Posts: 3
Joined: Wed 15. Sep 2021, 18:17

Dump CAN traffic while using Linux driver

Post by godorizzi » Wed 15. Sep 2021, 18:20

Hello,

I am using the Linux driver in a C++ application. I would like to dump all CAN traffic (generated by the application and received from CAN nodes).
How can I achieve this?

Thank you in advance

M.Heidemann
Sales & Support
Sales & Support
Posts: 673
Joined: Fri 20. Sep 2019, 13:31

Re: Dump CAN traffic while using Linux driver

Post by M.Heidemann » Thu 16. Sep 2021, 07:35

Hello,

Can you please tell us more about your request?

- Which driver variant do you use (CharDev /NetDev)
- Which API do you use (PCAN-BASIC, CAN 2.0 API, CAN FD API?, SocketCAN)?
- Can you give us an output for:

Code: Select all

uname -a
Bets Regards

Marvin

godorizzi
Posts: 3
Joined: Wed 15. Sep 2021, 18:17

Re: Dump CAN traffic while using Linux driver

Post by godorizzi » Thu 16. Sep 2021, 09:29

Hello,
sure:

- I am using CharDev
- Not sure about this one, but I am using functions from libpcan.h (LINUX_CAN_Open, LINUX_CAN_Read, CAN_Write etc.)
- And here is the output of uname -a:

Code: Select all

Linux g-VirtualBox 5.8.0-63-generic #71-Ubuntu SMP Tue Jul 13 15:59:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Thank tou

M.Heidemann
Sales & Support
Sales & Support
Posts: 673
Joined: Fri 20. Sep 2019, 13:31

Re: Dump CAN traffic while using Linux driver

Post by M.Heidemann » Thu 16. Sep 2021, 14:01

Hello,

This will not be feasible with the Chardev driver.

if you want to have a full dump of everything going on on the bus with exact timestamps,
you'll need to use a) SocketCAN and B) use a 2nd Channel to capture the bus-traffic.

In this case using candump will be sufficent.

Best Regards

Marvin

godorizzi
Posts: 3
Joined: Wed 15. Sep 2021, 18:17

Re: Dump CAN traffic while using Linux driver

Post by godorizzi » Fri 17. Sep 2021, 08:38

Okay thanks for the support.

Locked