[Ovmsdev] Charging and Driving Logs
Mark Webb-Johnson
mark at webb-johnson.net
Sun Mar 10 21:42:25 HKT 2013
I have wanted to implement charging and driving logs, for some time now. The idea is the car will record 'drives' and 'charges' and report them back as historical records. This will be independent of the vehicle module, so should work for all supported vehicles.
For each drive, we need:
End time [4 bytes]
Duration (seconds) [2 bytes]
Drive mode [1 byte]
Start location [8 bytes]
End location [8 bytes]
Distance driven [2 bytes]
kWh used [2 bytes]
For each charge, we need:
End time [4 bytes]
Duration (seconds) [2 bytes]
Charge mode [1 byte]
Charge location [8 bytes]
Current available [1 byte]
Current used [1 byte]
Voltage [2 bytes]
Result (completed, stopped, failed) [1 byte]
kWh used [1 byte]
That is 27 bytes per drive, or 21 bytes per charge.
The problem is that GPRS connectivity may not be there at the end of the drive or charge, so we need to store these records. RAM would be good, but we only have 429 bytes left (and I think 256 bytes of that may be stack). EEPROM is also possible, but full of parameters at the moment.
I'm thinking of using the top 4 parameters (#20 through #23) - these appear to be free at the moment, and would give us 128 bytes of permanent storage. Easiest would be 32 bytes for each record.
This would be turned on with a FEATURE_CARBITS (suggestion: 0x80), so it would default off (for privacy).
Comments / suggestions?
Regards, Mark.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.teslaclub.hk/pipermail/ovmsdev/attachments/20130310/6604c157/attachment.html>
More information about the OvmsDev
mailing list