[Ovmsdev] timestamps on push notifications and logs

Mark Webb-Johnson mark at webb-johnson.net
Mon Jun 16 08:11:51 HKT 2014


unsigned long car_time

Time (in seconds), as measured by the car. The 0 value of this can be whatever the car module desires.
It is acceptable to merely initialize this to zero and increment it by 1 for every ticker1() received.
Alternatively, a more accurate method is to read the real time clock from the vehicle CAN bus (if available) and update from there. 

I think the Tesla Roadster is the only vehicle actually updating it from the CAN bus. There was some (fairly recent) discussion about getting this from the GPS, and Tom did the foundation work (utils.{h,c} JDEpoch, JdToYMD, JdFromYMD, and datestring_to_timestamp  in net.c), but we haven't completed the changes to the core net.c (+CCLK handler) to do this yet. I attach the mailing list eMail showing how this will be done.

Regards, Mark.

On 15 Jun, 2014, at 9:35 pm, Nikolay Shishkov <nshishkov at yahoo.com> wrote:

> Hi, 
> I am getting strange time on my push notifications and on the logs. 
> Looking at the code it seem a variable called car_time is used to produce string indicating time. 
> Also looking at the code I can not seem to find where this car_time variable is set. The only place I could find is the vehicle_teslaroadster.c .
> If I am not missing something wouldn't it be beneficial to get the time from the GPS or the GSM network instead?
> I am attaching a screenshot of my app where the timestamp of the push notification is visible together with the time displayed on my phone.
> Nikolay
> <Screenshot_2014-06-15-07-26-47.png>_______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20140616/b4a82201/attachment.htm>
-------------- next part --------------
An embedded message was scrubbed...
From: Mark Webb-Johnson <mark at webb-johnson.net>
Subject: Re: [Ovmsdev] Inaccurate car_parktime / car_time
Date: Tue, 12 Nov 2013 10:56:15 +0800
Size: 33024
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20140616/b4a82201/attachment-0002.eml>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20140616/b4a82201/attachment-0001.htm>

More information about the OvmsDev mailing list