PCAN message timestamps drift after macOS system sleep
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- embedded-iot
Direzione di ricerca
Inizia dal calcolo dei timestamp di PcanBus e riproduci il test controllato di sospensione di macOS con un adattatore PCAN. Verifica che i timestamp dei messaggi CAN ricevuti rimangano allineati con l'ora dell'orologio a parete dopo il risveglio, prima del writer BLF o del convertitore CSV, e che la riconnessione dell'adattatore non influisca sul risultato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 1.6k
- Fork
- 697
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hardbyte/python-can
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
hardbyte/python-can#2077 · 1 commento · 1 reazione ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
hardbyte/python-can#1922 · 1 reazione ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
hardbyte/python-can#2102 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
hardbyte/python-can#2091 ·
-
`BitTiming.from_sample_point` rejects valid timing solutions due to hardcoded register limits Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
hardbyte/python-can#2083 ·
Tutte le issue di hardbyte/python-can
Issue simili
-
triage/confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
apache/cloudstack#14222 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100