Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Timestamp when message is transmitted

Aperta
#2,029 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia tracciando il ciclo di vita di bus.send e Message.timestamp attraverso le implementazioni dei driver CAN. Confronta il momento in cui la trasmissione viene confermata con il timestamp attualmente esposto ai chiamanti. Il lavoro è completato quando i driver supportati forniscono il timestamp effettivo della trasmissione senza segnalarlo prima che il messaggio venga inviato fisicamente, e il comportamento è chiarito per i driver che non possono fornirne uno.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
Is your feature request related to a problem? Please describe.

I would like to measure the time it takes for a CAN node to respond to a given message.
Received messages have their timestamp correctly set, however there is no direct way to get the timestamp when a message is transmitted.

As a workaround, I'm using the timestamp when I call bus.send, however this is not necessarily the time when the message is actually transmitted on the bus (up to 30 ms difference).
The timings I'm measuring with this workaround do not match the timings I'm directly recording in the PCAN software.

Describe the solution you'd like

Ideally, the bus.send implementation would override the .timestamp property of the message object I called it with.
By default, the timestamp is 0.0 on newly constructed messages. Calling bus.sent does not immediately cause a transmission but only puts the message into the transmit buffer of the can device. For best results, the can driver implementation should set the correct timestamp once message was actually sent.

msg = can.Message(...)
print(msg.timestamp) # 0.0 - default
bus.send(msg)
print(msg.timestamp) # 0.0 - message given to can device but not physically sent yet
time.sleep(0.5)
print(msg.timestamp) # 1773217081.775475 - can driver sets timestamp property once message was actually transmitted
Describe alternatives you've considered

I have considered setting up a virtual can or configuring some loopback setup, such that i can use the receive timestamps for both received & transmitted messages. However this seems rather complicated for a seemingly simple task.

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hardbyte/python-can

Tutte le issue di hardbyte/python-can

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.