hardbyte / hardbyte/python-can

USB2CAN gs_usb timestamp in received CAN messages incorrect

未关闭
#1,491 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
1.6k
派生
697
PR 合并指标
30 天内没有已合并 PR

描述

### Describe the bug

I have an application on Windows 10 that sends and receives CAN bus messages and I am using a USB2CAN module by Inno-maker having installed python-can[gs-usb]. The application runs successfully using can.Notifier except that the timestamps in the received CAN bus messages are not correct. The timestamps, which are floating point values, are low (e.g. 331, 42) rather than being the number of seconds since the epoch. Does anyone have any advice as to how to correct this? I can stamp the messages in my application when they are forwarded to my listener instances by my can.Notifier instance but this is not ideal. The received CAN bus message timestamps were correct when the application ran on a Raspberry PI using CAN bus type ‘socketcan_ctypes'. Are the timestamps normally set in hardware? I see that the implementation of the GsUsb start function https://github.com/jxltom/gs_usb/blob/master/gs_usb/gs_usb.py has the GS_CAN_MODE_HW_TIMESTAMP flag.

### To Reproduce

Use Inno-maker USB2CAN module and python-can[gs-usb]. Timestamp in received CAN bus messages incorrect (date same as epoch)

### Expected behavior

Timestamp should be seconds as float since epoch

### Additional context

OS and version:Windows 10
Python version:Latest
python-can version:4.1.0
python-can interface/s (if applicable):

Traceback and logs

```python
def func():
return "hello, world!"
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。