You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Polestar trips: end a drive on fresh readings, and read more often #152
Read the odometer and position again until they are newer than the drive's end. When a drive ends, the settled endpoints are read once. Polestar's backend can still return values dated before the end. The trip then ends at the wrong place and odometer, and the rest of the drive becomes a "reconstructed" trip with 0 kWh. The first part's consumption is wrong too: 19 km at 45 kWh/100 km, then 20 km in 3 min. Expected: read them again, within a time limit, until their timestamp is later than the end of the drive.
Measure how often the car updates while driving (car timestamps, metaReceivedAt).
Shorten the paces within the 10,000 calls/day. Today it's 10 min parked, so a drive's start is known within 10 min, and 1 min driving.
runsten d399789, PR #159: after a trip, the odometer and the position are read again every minute, for 10 minutes at most, until the car sends ones newer than its last reading driving. Remains: measure the car's upload rate while driving, then the paces (the other two items).
PR #159 does the first item only (the end readings read again); it no longer closes this issue, which stays open for the measure of the car's uploads and the paces.
Done in runsten 2b97d94 (PR #159): after a trip, the odometer and the position are read again every minute, for 10 minutes at most, until the car sends ones newer than its last reading driving. Remains open: measure the car's uploads while driving, then the paces.
How the Data Portal's car uploads, read from the collector's vehicle upload logs (sent_at, age, since_previous):
Driving or charging, about every minute. Read every minute, nearly every read finds a new upload, sent less than a minute before, received a few seconds after it was sent. Reading faster would read the same upload again: the driving pace stays at 1 minute.
Parked, only while the car is awake. A sleeping car uploads nothing.
What we miss is the start of a drive. Only the availability (usageMode) tells a drive, and it is read every parked interval (10 minutes): a trip's start is known only within that interval, and a drive shorter than it is missed, its trip only reconstructed from the odometer. The battery, though, is read every minute parked while the budget is ample, and its new upload is the car waking up.
Change: parked, a new upload of the battery brings the availability forward to the same pass. A drive is seen within a minute or two of the car waking up, for a call per new upload of a parked car, far fewer than reading the availability every minute (about 1,300 calls a day per car). When the budget runs short, the battery falls back to the parked pace, and the availability with it.
runsten f500fe7, PR #380: parked, a new battery upload (the car waking up) reads the availability in the same pass (EndpointSpec.Wakes), so a drive's start is seen within a minute or two. The driving pace stays at 1 minute, which matches the car's uploads. Remains: the merge.
Activity
vcanuel commentedon Oct 27, 2026
runsten d399789, PR #159: after a trip, the odometer and the position are read again every minute, for 10 minutes at most, until the car sends ones newer than its last reading driving. Remains: measure the car's upload rate while driving, then the paces (the other two items).
vcanuel commentedon Oct 27, 2026
PR #159 does the first item only (the end readings read again); it no longer closes this issue, which stays open for the measure of the car's uploads and the paces.
vcanuel commentedon Oct 27, 2026
Done in runsten 2b97d94 (PR #159): after a trip, the odometer and the position are read again every minute, for 10 minutes at most, until the car sends ones newer than its last reading driving. Remains open: measure the car's uploads while driving, then the paces.
vcanuel commentedon Nov 12, 2026
How the Data Portal's car uploads, read from the collector's
vehicle uploadlogs (sent_at,age,since_previous):What we miss is the start of a drive. Only the availability (
usageMode) tells a drive, and it is read every parked interval (10 minutes): a trip's start is known only within that interval, and a drive shorter than it is missed, its trip only reconstructed from the odometer. The battery, though, is read every minute parked while the budget is ample, and its new upload is the car waking up.Change: parked, a new upload of the battery brings the availability forward to the same pass. A drive is seen within a minute or two of the car waking up, for a call per new upload of a parked car, far fewer than reading the availability every minute (about 1,300 calls a day per car). When the budget runs short, the battery falls back to the parked pace, and the availability with it.
vcanuel commentedon Nov 12, 2026
runsten f500fe7, PR #380: parked, a new battery upload (the car waking up) reads the availability in the same pass (
EndpointSpec.Wakes), so a drive's start is seen within a minute or two. The driving pace stays at 1 minute, which matches the car's uploads. Remains: the merge.