Page 1 of 2
timestamp issue
Posted: Wed 2. Dec 2020, 12:55
by JGarza
Hello,
Im using PeakCan proFD usb device and also PCI express card from Peak. When I read CANFD messages I get messages with the same timestamp although they come one after the other.
Im using socketCAN and also QT can bus interface. The parameters I use to initialize my hardware are;
#!/bin/sh
sudo ip link set can0 down
sudo ip link set can1 down
sudo ip link set can0 txqueuelen 5000
sudo ip link set can1 txqueuelen 5000
sudo ip link set can0 type can bitrate 1000000 sample-point 0.75 dbitrate 5000000 dsample-point 0.75 fd on
sudo ip link set can1 type can bitrate 1000000 sample-point 0.75 dbitrate 5000000 dsample-point 0.75 fd on
sudo ip link set can0 up
sudo ip link set can1 up
And an example of how I get the time stamps is :
0.0273 CANFD 0 Rx 403 0 0 b 01 2C C6 D7 B5 59 14 EA 80 00 C8 00 00 00 00 1E 04 9C 01 06
0.0273 CANFD 0 Rx 404 0 0 b 01 4F 00 07 99 19 24 D4 80 00 D8 00 00 00 00 22 07 16 01 06
0.0273 CANFD 0 Rx 405 0 0 b 01 B5 00 08 C7 D9 44 CE 80 01 18 00 00 00 00 3D 01 10 01 06
0.0313 CANFD 0 Rx 406 0 0 b 02 03 00 08 18 59 4C 51 80 01 48 00 00 00 00 1C 02 2B 01 06
0.0313 CANFD 0 Rx 407 0 0 b 02 35 00 08 06 99 54 B5 80 01 68 00 00 00 00 1B 02 14 01 06
0.0313 CANFD 0 Rx 408 0 0 b 02 61 00 08 0C 59 5C 6B 80 01 88 00 00 00 00 1C 06 9B 01 07
Does anybody know how can I solve this. I use Ubunto 20.04.1 LTS. Thanks.
Jorge
Re: timestamp issue
Posted: Wed 2. Dec 2020, 13:00
by JGarza
Here is what I get when I use candump with the PCI CAN card:
2020-09-10 12:54:39.528426) can2 102 [20] 01 C7 00 08 EA D7 3C 9F 80 00 60 00 00 00 00 56 02 20 01 06
(2020-09-10 12:54:39.528441) can2 020 [08] C7 00 00 00 00 00 00 00
(2020-09-10 12:54:39.528441) can2 103 [20] 02 57 00 08 1D D7 A4 BF 80 00 80 00 00 00 00 1C 01 89 01 06
(2020-09-10 12:54:39.528441) can2 030 [08] C7 00 00 00 00 00 00 00
(2020-09-10 12:54:39.528441) can2 104 [20] 02 CF 00 07 B5 17 D4 D8 80 00 98 00 00 00 00 1F 01 5C 01 06
(2020-09-10 12:54:39.528441) can2 105 [20] 03 5C FF F8 BE 17 FC 43 80 00 B8 00 00 00 00 36 12 1A 01 07
(2020-09-10 12:54:39.528442) can2 106 [20] 03 D1 00 07 E3 58 0C 38 80 00 D0 00 00 00 00 1C 01 8B 01 03
(2020-09-10 12:54:39.528442) can2 107 [20] 04 5B 00 08 79 58 1C 26 80 00 F0 00 00 00 00 25 02 7F 01 07
(2020-09-10 12:54:39.528442) can2 1FF [08] 10 00 00 18 A0 71 00 00
the timestamps are not correct.
Re: timestamp issue
Posted: Wed 2. Dec 2020, 13:25
by M.Heidemann
hello,
Do you use the proprietary PCAN-Linux driver package and if so, which version do you use?
can you also give us the output for
uname -a
Please understand i will handle this support request in this forum, the same people in our support-team also
see email requests. So posting it here and additionally writing an email will not speed things in any way.
Please report back to us regarding this.
Best Regards
Marvin
Re: timestamp issue
Posted: Wed 2. Dec 2020, 14:51
by JGarza
Hello Marvin,
I am not using Peak drivers, only Socketcan and QT CAN bus. This is what you requested:
Linux radar-Precision-7510 5.4.0-54-generic #60-Ubuntu SMP Fri Nov 6 10:37:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
OK,I will only reply here.
Regards,
Jorge Garza
Re: timestamp issue
Posted: Wed 2. Dec 2020, 15:53
by M.Heidemann
Hello,
Can you post your command history so we might see which parameters you use when calling candump?
Best Regards
Marvin
Re: timestamp issue
Posted: Thu 3. Dec 2020, 08:53
by JGarza
Hi,
This is how I call candump:
candump can0 -tA
This is what I get:
(2020-12-03 08:51:25.837411) can0 401 [20] 01 E4 FF B8 B8 16 CB FB 80 00 68 02 00 00 00 37 01 11 01 57
(2020-12-03 08:51:25.837412) can0 010 [08] EA 00 00 00 00 00 00 00
(2020-12-03 08:51:25.837412) can0 402 [20] 01 F7 0C 68 05 96 CC 1E 80 00 68 96 00 00 00 1C 01 46 01 0A
(2020-12-03 08:51:25.837413) can0 403 [20] 02 E1 00 88 AE 97 4B E9 80 00 A0 FC 00 00 00 37 01 4C 02 CA
(2020-12-03 08:51:25.838382) can0 404 [20] 03 33 00 18 B5 17 5C 0F 80 00 B0 00 00 00 00 35 00 F9 02 2B
(2020-12-03 08:51:25.838383) can0 405 [20] 03 47 02 D8 92 D7 5C 11 80 00 B0 E8 00 00 00 2A 01 8A 01 7D
(2020-12-03 08:51:25.838383) can0 406 [20] 03 35 00 B8 AB D7 5B FE 80 00 B0 FA 00 00 00 33 00 FD 04 E9
Re: timestamp issue
Posted: Thu 3. Dec 2020, 12:43
by M.Heidemann
Hello,
You are currently getting system-timestamps aka. software-timestamps (This kind of timestamp has no interaction with our driver) , which are not as accurate
as hardware-timestamps, which you can get by using the -H parameter in candump, example:
However with the mainline-kernel-driver these timestamps will be represented in raw, not reflecting the current date, if used.
You should consider using the PCAN-Linux driver package and build the NetDev-driver:
http://www.peak-system.com/fileadmin/me ... 0.2.tar.gz
and follow the installation instruction given in the PCAN-Linux documentation:
make sure you install the necessary software listed in 2.2 System Requirements before compilation/instalation
http://www.peak-system.com/fileadmin/me ... an_eng.pdf
How to build the NetDev driver version is described in 3.1 Build Binaries.
make sure to load the driver
after installation.
The Netdev driver after loading works exactly the same as the maniline driver but has additional features
and gets the hardwaretime-stamps based on the host-machine time.
Please report back to us, if this has solved your issue.
Best Regards
Marvin
Re: timestamp issue
Posted: Fri 4. Dec 2020, 14:55
by JGarza
Hi,
So I followed the procedure you mentioned and runned:
make –C driver NET=NETDEV_SUPPORT
Then I did:
sudo modprobe pcan
but now when I do ip link I dont see any can device anymore.
Re: timestamp issue
Posted: Fri 4. Dec 2020, 15:06
by M.Heidemann
Hello,
did you install the driver using:
from the PCAN-Linux driver directory?
did
show any errors?
Best Regards
Marvin
Re: timestamp issue
Posted: Fri 4. Dec 2020, 15:32
by JGarza
I uninstall and install again with:
sudo make netdev
and now it worked.