Multiple can channels work together

It didn’t show any error. Just no CAN messages received or sent.

Did you mean running “single” sample_canbus_logger with bport other than 50000 is also not working?

right.

As below mentioned in https://docs.nvidia.com/driveworks/dwx_canbus_logger_sample.html , by default bport is set as 60395 in the code so at least without bport setting or setting as 60395 should be working. Please give it a try.

The connection to AurixCAN happens using UDP sockets. Additional arguments for the remote (aport) and local (bport) UDP port can be specified if AurixCAN is working in a non-default configuration. By default, on DRIVE AGX, AurixCAN is reachable over aport=50000 and communicates with the Xavier over bport=60395.

Tried again. no luck.

Please provide your sample_canbus_logger command and following messages here. Thanks~

here is the can setup:

params.protocol = “can.aurix”;
params.parameters = “ip=10.42.0.146,bport=50000,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf”;

The rest code basically is the same as the example. Below I attached the main piece.

gRun = dwSensor_start (canSensor) == DW_SUCCESS;

int messages_Counter = 0;

while (gRun)
{
dwCANMessage msg{};
dwCANMessage recMsg;
dwTime_t tNow;
dwContext_getCurrentTime (&tNow, sdk);
//td::cout << "receiving Msg " << std::endl;
//read all messages until internal queue is empty
while(dwSensorCAN_readMessage(&msg, 1, canSensor) == DW_SUCCESS)
{
recMsg.id = msg.id;
std::cout << "messages id: " << recMsg.id << std::endl;
recMsg.size = msg.size;
recMsg.data[0]= msg.data[0];
std::cout << "messages data = " <<recMsg.data[0]<< std::endl;

   }
////send message 
 dwCANMessage senMsg;
  for (int32_t j = 0; j < 8; j++)
    {
      senMsg.data[j] = j;
    }
  senMsg.id = 0x6ff;
  senMsg.size =8;//SENSORS_CAN_MAX_MESSAGE_LEN;
  senMsg.timestamp_us = 0;
  dwSensorCAN_sendMessage (&senMsg, 10000, canSensor);

Could you try with sample_canbus_logger with bport=60395? If still not working, share the command and its log here?

I did as follow, I also tried with bport= 60359 and 50000 as well, but the come out was the same. Looks like it was an unsuccessful run.

nvidia@tegra-ubuntu:/usr/local/driveworks-2.2/bin$ ./sample_canbus_logger --driver=can.aurix --params=ip=10.42.0.146,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf

Program Arguments:
–driver=can.aurix
–filter=000:000
–hwtime=1
–offscreen=0
–params=ip=10.42.0.146,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf
–profiling=1
–send_i_understand_implications=0
–send_id=6FF
–send_size=8

[07-02-2020 20:32:03] Platform: Detected DDPX - Tegra A
[07-02-2020 20:32:03] TimeSource: monotonic epoch time offset is 1581120643940078
[07-02-2020 20:32:03] PTP Time is available from NVPPS Driver
[07-02-2020 20:32:05] Platform: number of GPU devices detected 1
[07-02-2020 20:32:05] Platform: currently selected GPU device integrated ID 0
[07-02-2020 20:32:05] SDK: Resources mounted from /usr/local/driveworks-2.2/data/
[07-02-2020 20:32:05] SDK: Create NvMediaDevice
[07-02-2020 20:32:05] egl::Display: found 1 EGL devices
[07-02-2020 20:32:05] egl::Display: use drm device: drm-nvdc
[07-02-2020 20:32:05] TimeSource: monotonic epoch time offset is 1581120643940078
[07-02-2020 20:32:05] PTP Time is available from NVPPS Driver
[07-02-2020 20:32:05] Initialize DriveWorks SDK v2.2.3136
[07-02-2020 20:32:05] Release build with GNU 7.3.1 from heads/buildbrain-branch-0-gca7b4b26e65 against Drive PDK v5.1.6.1
[07-02-2020 20:32:05] SensorFactory::createSensor() → can.aurix, ip=10.42.0.146,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf
Cannot setup CAN message filters: DW_NOT_SUPPORTED
[07-02-2020 20:32:05] EndpointUDP: started 10.42.0.146:50000
^C[07-02-2020 20:34:52] EndpointUDP: stopped 10.42.0.146:50000
[07-02-2020 20:34:52] Releasing Driveworks SDK Context
[07-02-2020 20:34:52] SDK: Release NvMediaDevice
[07-02-2020 20:34:52] SDK: Release NvMedia2D

However, if I ran in this sequence:
driver=can.aurix
params=ip=10.42.0.146,bport=60395/…/50000,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf

It works. at the end of the can data stream,
Sensor statistics for: can.virtual, file=…/./data/samples/sfm/triangulation/canbus.can
Events:0
Erros:0
MinDelta:…
maxdelta:…
meanDelta:…
Standard deviation: …
Releasing Driveworks SDK Context
SDK: Release NvMediaDevice
SDK: Release NvMedia2D

So this is working?
$ ./sample_canbus_logger --driver=can.aurix --params=ip=10.42.0.146,bport=60395,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf

this is not working?
$ ./sample_canbus_logger --driver=can.aurix --params=ip=10.42.0.146,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf

no.

Works for this command sequence,
$ driver=can.aurix
$ params=ip=10.42.0.146,bport=60395/…/50000,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf
$ ./sample_canbus_logger

Does not work for
$ ./sample_canbus_logger --driver=can.aurix --params=ip=10.42.0.146,bport=60395,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf
I also tried without bport or bport=50000. Looks like it is caused by sth. as shown below

[07-02-2020 20:32:03] Platform: Detected DDPX - Tegra A
[07-02-2020 20:32:03] TimeSource: monotonic epoch time offset is 1581120643940078
[07-02-2020 20:32:03] PTP Time is available from NVPPS Driver
[07-02-2020 20:32:05] Platform: number of GPU devices detected 1
[07-02-2020 20:32:05] Platform: currently selected GPU device integrated ID 0
[07-02-2020 20:32:05] SDK: Resources mounted from /usr/local/driveworks-2.2/data/
[07-02-2020 20:32:05] SDK: Create NvMediaDevice
[07-02-2020 20:32:05] egl::Display: found 1 EGL devices
[07-02-2020 20:32:05] egl::Display: use drm device: drm-nvdc
[07-02-2020 20:32:05] TimeSource: monotonic epoch time offset is 1581120643940078
[07-02-2020 20:32:05] PTP Time is available from NVPPS Driver
[07-02-2020 20:32:05] Initialize DriveWorks SDK v2.2.3136
[07-02-2020 20:32:05] Release build with GNU 7.3.1 from heads/buildbrain-branch-0-gca7b4b26e65 against Drive PDK v5.1.6.1
[07-02-2020 20:32:05] SensorFactory::createSensor() → can.aurix, ip=10.42.0.146,bus=a,config-file=/usr/local/driveworks/data/samples/sensors/can/EasyCanConfigFile.conf
Cannot setup CAN message filters: DW_NOT_SUPPORTED
[07-02-2020 20:32:05] EndpointUDP: started 10.42.0.146:50000
(it stopped here)

Hi VickNV,

After I synchronized the aurix and the Tegras, 60395 became the only working value can be assigned to 60395, 50000 no longer works. I need at least one more aurix can channel for my work. What else maybe I’ve been missing?

some new found.

I just realized that I need to send a can message to can channel a. Then, if I run sudo ./sample_canbus_logger --driver=can.aurix --params=ip=10.42.0.146,bus=a,bport=60395
then, the info becomes

Program Arguments:
–driver=can.aurix
–filter=000:000
–hwtime=1
–offscreen=0
–params=ip=10.42.0.146,bus=a,bport=60395
–profiling=1
–send_i_understand_implications=0
–send_id=6FF
–send_size=8

[10-02-2020 03:00:33] Platform: Detected DDPX - Tegra A
[10-02-2020 03:00:33] TimeSource: monotonic epoch time offset is 1581297148272735
[10-02-2020 03:00:33] PTP Time is available from NVPPS Driver
[10-02-2020 03:00:34] Platform: number of GPU devices detected 1
[10-02-2020 03:00:34] Platform: currently selected GPU device integrated ID 0
[10-02-2020 03:00:34] SDK: Resources mounted from /usr/local/driveworks-2.2/data/
[10-02-2020 03:00:34] SDK: Create NvMediaDevice
[10-02-2020 03:00:34] egl::Display: found 1 EGL devices
[10-02-2020 03:00:34] egl::Display: use drm device: drm-nvdc
[10-02-2020 03:00:34] TimeSource: monotonic epoch time offset is 1581297148272735
[10-02-2020 03:00:34] PTP Time is available from NVPPS Driver
[10-02-2020 03:00:34] Initialize DriveWorks SDK v2.2.3136
[10-02-2020 03:00:34] Release build with GNU 7.3.1 from heads/buildbrain-branch-0-gca7b4b26e65 against Drive PDK v5.1.6.1
[10-02-2020 03:00:34] SensorFactory::createSensor() → can.aurix, ip=10.42.0.146,bus=a,bport=60395
Cannot setup CAN message filters: DW_NOT_SUPPORTED
[10-02-2020 03:00:34] EndpointUDP: started 10.42.0.146:50000
[10-02-2020 03:00:38] Received from 10.42.0.146:50000 - 46 bytes, src=4, dst=1, app=202, time=6491217, id=259, length=38
[10-02-2020 03:00:38] Received at most 1 CAN messages within 22 bytes
[10-02-2020 03:00:38] CAN messages [956] for 0 at 2148417473879056
[10-02-2020 03:00:38] Parsed 1 CAN messages, found 1 messages on selected EasyCAN bus.
2148417473879056 → 3BC [8] F5 3A EA A6 39 0D 4D 44
[10-02-2020 03:00:39] Received from 10.42.0.146:50000 - 46 bytes, src=4, dst=1, app=202, time=6492147, id=259, length=38
[10-02-2020 03:00:39] Received at most 1 CAN messages within 22 bytes
[10-02-2020 03:00:39] CAN messages [956] for 0 at 4026536468026536
[10-02-2020 03:00:39] Parsed 1 CAN messages, found 1 messages on selected EasyCAN bus.
4026536468026536 (dt=1878118994147480) → 3BC [8] F5 3A EA A6 39 0D 4D 44
[10-02-2020 03:00:39] Received from 10.42.0.146:50000 - 46 bytes, src=4, dst=1, app=202, time=6492807, id=259, length=38
[10-02-2020 03:00:39] Received at most 1 CAN messages within 22 bytes
[10-02-2020 03:00:39] CAN messages [956] for 0 at 4026536468026536
[10-02-2020 03:00:39] Parsed 1 CAN messages, found 1 messages on selected EasyCAN bus.
4026536468026536 (dt=0) → 3BC [8] F5 3A EA A6 39 0D 4D 44
[10-02-2020 03:00:41] Received from 10.42.0.146:50000 - 46 bytes, src=4, dst=1, app=202, time=6494077, id=259, length=38
[10-02-2020 03:00:41] Received at most 1 CAN messages within 22 bytes
[10-02-2020 03:00:41] CAN messages [956] for 0 at 2148346628486589
[10-02-2020 03:00:41] Parsed 1 CAN messages, found 1 messages on selected EasyCAN bus.
2148346628486589 (dt=-1878189839539947) ERROR msg out of order - → 3BC [8] F5 3A EA A6 39 0D 4D 44
[10-02-2020 03:00:42] Received from 10.42.0.146:50000 - 46 bytes, src=4, dst=1, app=202, time=6495737, id=259, length=38
[10-02-2020 03:00:42] Received at most 1 CAN messages within 22 bytes
[10-02-2020 03:00:42] CAN messages [956] for 0 at 2148417473879056
[10-02-2020 03:00:42] Parsed 1 CAN messages, found 1 messages on selected EasyCAN bus.
2148417473879056 (dt=70845392467) → 3BC [8] F5 3A EA A6 39 0D 4D 44

  1. Sometimes, it gives a dt error. I synced the aurix and tegra again by following the procedure to make sure the difference is within +/- 3. Any thoughts?
  2. I tried several bport values, 60395,60396,60397,50000. Only 60395 worked. So, how to get multi aurix can working at the same time?

Thank you again VickNV!

What did you mean synchronizing aurix and tegra? How to do it? How to check if the difference is within +/-3?

So currently there are two issues for you on sample_canbus_logger; One is even single Aurix CAN access on 60395 sometimes hitting “ERROR msg out of order”. The other is not able to run on another port. Am I right?

Hi VickNV!

  1. Regarding the sync, I followed the below post synced the hardware,
    https://devtalk.nvidia.com/default/topic/1031778/faq/nvidia_drive_px2_time_sync_guide/.
    The difference I referred was the last number after “+/-” in the following message. Below message was what I saw at the very beginning. After I switched the ethernet port, this value reduced to 0~3.
    ptp4l[3510.797]: rms 770596 max 1326362 freq -7417675 +/- 908180 delay 7075 +/- 1407

  2. Yes, looks like there are two issues. If two issues are not affected by each other, could you help me address the 2nd one first? 2nd one has higher priority to me.

Thank you again, VickNV!

Hi Vick,

I saw a lot people asked the same question, “how to turn on multiple aurix can at a time?” Looks like all questions went nowhere. Wonder if there is a solution or it is not doable at all?

Yes, DRIVE Software isn’t supporting aurix can from multiple applications. At least it has never been tested on our side.

To whom might be trying to use multiple aurix can channels, please stop wasting time on it! As an alternative solution, you can use Kvaser on Xavier. It definitely works.