sample_canbus_logger cannot read can0

I connected CAN bus to AGX’s CAN1&2 and tried candump can0, it worked.

$ candump can0
  can0  247   [5]  06 00 FF 00 00
  can0  230   [7]  00 00 00 01 00 00 3A
  can0  1C4   [8]  00 00 00 00 00 00 00 CD
  can0  127   [8]  00 10 00 08 00 0E BA 10
  can0  025   [8]  00 07 00 01 00 00 00 35
  can0  0AA   [8]  1A 6F 1A 6F 1A 6F 1A 6F
  can0  024   [8]  01 FF 02 04 41 FB 80 EE
  can0  331   [8]  00 00 00 00 00 00 00 00
  can0  0B4   [8]  00 00 00 00 00 00 00 BC
  can0  4A1   [8]  00 01 80 80 80 00 06 02
  can0  245   [5]  00 00 00 00 4C
  can0  283   [7]  00 00 00 00 00 00 8C

However when I tried sample_canbus_logger, it showed the message below and didn’t work.

$ ./sample_canbus_logger --driver=can.socket --params=file=/home/nvidia/samplecan111.can
Program Arguments:
--driver=can.socket
--filter=000:000
--offscreen=0
--params=file=/home/nvidia/samplecan111.can
--profiling=1
--send_i_understand_implications=0
--send_id=6FF

[19-12-2019 07:54:46] Platform: Detected DDPX - Tegra A
[19-12-2019 07:54:46] Initialize DriveWorks SDK v2.0.2081
[19-12-2019 07:54:46] Release build with GNU 4.9.4 from heads/buildbrain-branch-0-g36b127f against Drive PDK v5.1.0.2
[19-12-2019 07:54:46] TimeSource: monotonic epoch time offset is 1576741965682646
[19-12-2019 07:54:46] PTP Time is available from NVPPS Driver
[19-12-2019 07:54:48] Platform: number of GPU devices detected 1
[19-12-2019 07:54:48] Platform: currently selected GPU device integrated ID 0
[19-12-2019 07:54:48] SDK: Resources mounted from /usr/local/driveworks-2.0/data/
[19-12-2019 07:54:48] SDK: Create NvMediaDevice
[19-12-2019 07:54:48] egl::Display: found 1 EGL devices
[19-12-2019 07:54:48] egl::Display: use drm device: drm-nvdc
[19-12-2019 07:54:48] SensorFactory::createSensor() -> can.socket, file=/home/nvidia/samplecan111.can
[19-12-2019 07:54:48] SensorCANSocket: expected device=can0 to be set to a valid can bus
[19-12-2019 07:54:48] Driveworks exception thrown: DW_INVALID_ARGUMENT: device params

Cannot create sensor can.socket with file=/home/nvidia/samplecan111.can
[19-12-2019 07:54:48] SDK: Release NvMediaDevice
[19-12-2019 07:54:48] Driveworks SDK released
[19-12-2019 07:54:48] SDK: Release NvMedia2D
*** Error in `./sample_canbus_logger': corrupted double-linked list: 0x00000000006e9000 ***
Aborted (core dumped)

I’m concerned with the message

[19-12-2019 07:14:06] SensorCANSocket: expected device=can0 to be set to a valid can bus

as candump can0 works.

Dear Hirofumi.Tamori,
Can you check running ./sample_canbus_logger --params=file=/home/nvidia/samplecan111.can

Dear Siva,

First of all, no samplecan111.can is created in this procedure I wrote in the previous post.

Let me clarify, do you mean that you ask me to capture can.virtual results on the file samplecan111.can?

Dear Hirofumi.Tamoroi,
If you want to replay the data from samplecan111.can, you need to use can.virtual protocol which is default setting in the sample

Dear Hirofumi.Tamori,

Could you please help to check if the socket can port is working properly with below command?
./sample_canbus_logger --driver=can.socket --params=device=can0

To generate samplecan111.can, you should use DW recording tool.
Please see Recording SocketCAN Data section in https://docs.nvidia.com/driveworks/dwx_recording_devguide_basic_recording.html

Thanks Steve,

I forgot to pass --params=device=can0 and believed it’s default value when --driver=can.socket is specified.