hardbyte / hardbyte/python-can

python-can doesn't appear to be using hardware timestamps with socketcan

Đang mở
#1,881 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
1.6k
Fork
697
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Describe the bug

### To Reproduce

Run two captures at the same time, one using candump with hardware timestamps :

`candump -ta -H can1
`

The other utilising python-can e.g. logger :

`python -m can.logger -c can1
`

If you then dump the output into a spreadsheet and compare frames, the output is quite different. For example, on a cyclic message on our hardware, I can see the cycle with `candump -H` is stable +/- 5 microseconds. With the timestamps from python-can the variance seems to be +/- 900 microseconds.

### Expected behavior

The python can docs say :

> The timestamp field in a CAN message is a floating point number representing when the message was received since the epoch in seconds. Where possible this will be timestamped in hardware.

So I'd have expected the hardware timestamps to have been enabled as with `candump -H`.

### Additional context

OS and version: Debian 12 (6.1.112-1)
Python version: 3.11
python-can version: 4.4.2
python-can interface/s (if applicable): Peak PCAN-USB X6

We're using the standard kernel drivers not peak's custom drivers.

Traceback and logs

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.