PCAN message timestamps drift after macOS system sleep
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- embedded-iot
調査の方向性
PcanBus のタイムスタンプ計算から始め、PCAN アダプターを使用して、制御された macOS のスリープテストを再現します。受信した CAN メッセージのタイムスタンプが、復帰後もウォールクロック時刻と一致したままであることを、BLF writer または CSV converter の前段で確認し、アダプターを再接続しても結果に影響しないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
On macOS, CAN message timestamps from PcanBus drift behind the current wall-clock time after the computer sleeps.
PcanBus combines the Mac boot time with a PCAN elapsed-time counter. The counter pauses while macOS sleeps, so every sleep cycle increases the timestamp error.
The incorrect timestamp is produced before BLF or CSV logging. Both log formats preserve the timestamp received from python-can.
To Reproduce
- Connect a PCAN adapter on macOS.
- Start receiving CAN messages and record their timestamps.
- Put the Mac to sleep, then wake it.
- Receive another CAN message.
- Compare its timestamp with the current wall-clock time.
The CAN timestamp will be behind the wall clock by approximately the amount of time the Mac spent asleep.
Unplugging and reconnecting the PCAN adapter does not reset the drift.
Expected behavior
CAN message timestamps should match the current wall-clock time after the Mac wakes from sleep.
System sleep should not cause timestamps to drift backward.
Additional context
OS and version: macOS 26.5.1, build 25F80
Python version: 3.13.14
python-can version: 4.6.1
python-can interface/s: pcan via PCAN/MacCAN
The issue has been confirmed on macOS. Potential impact on Windows has not been tested.
Traceback and logs
No exception is raised. The problem appears in the timestamps assigned to received CAN messages.During a controlled sleep test:
Wall-clock elapsed time: 73.6 seconds
PCAN elapsed counter: 60.9 seconds
Difference: 12.7 seconds
Recorded macOS sleep: 12.7 seconds
The difference between the wall clock and PCAN counter matched the macOS sleep duration.
The incorrect timestamps were present before reaching the BLF writer and CSV converter, so those components were ruled out.
Disconnecting the PCAN adapter for 60 seconds did not reset the elapsed counter or correct the timestamp.
- 主要言語
- Python
- スター
- 1.6k
- フォーク
- 697
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hardbyte/python-can のほかの issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
hardbyte/python-can#2077 · コメント 1 件 · リアクション 1 件 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
hardbyte/python-can#1922 · リアクション 1 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
hardbyte/python-can#2102 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
hardbyte/python-can#2091 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
hardbyte/python-can#2083 ·
hardbyte/python-can の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
use-agent-os/agent-os#3314 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
BasedHardware/omi#15662 · コメント 1 件 ·
-
documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
AiursoftWeb/AnduinOS-2#19 ·