mark at webb-johnson.net
Fri Nov 24 16:31:22 HKT 2017
I think in general things like this should be handled in the common vehicle code, rather than all vehicle modules. In this case, the vehicle module control v.e.on and park time can be maintained centrally (irrespective of the vehicle type).
Given the v3 server code, it makes more sense for park time in v3 to mean number of seconds since vehicle was parked (like in the protocol for v2).
I’ve added that logic into vehicle.cpp, and updated the other vehicle modules not to change it at all. I’ve also fixed ovms_server_v2 to handle it correctly.
> On 24 Nov 2017, at 5:55 AM, Geir Øyvind Vælidalo <geir at validalo.net> wrote:
> «Quick» question:
> StdMetrics.ms_v_env_parktime, is it seconds since the car was parked, which means we should update it in Ticker1? Or is it the time when the car was parked?
> Looking at V2 and the OVMS-V2conversion in V3, it looks to me like the first, but looking at the Twizy-module it looks like the latter.
> I guess setting the start time should be enough. When sending packets to V2-server, we could easily calculate the seconds: time(NULL)-ms_v_env_parktime. Unless ms_v_env_parktime is 0, then we’re not parked.
> The same could then be done for ms_v_charge_minutes too.
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OvmsDev