[Ovmsdev] OVMS Poller module/singleton

Chris Box chris8086 at ee.eclipse1.net
Tue Feb 4 06:47:26 HKT 2025


On 2025-02-03 07:34, Michael Balzer wrote:

> This is the moment the vehicle state change was detected:
> 
>> 2025-02-02 21:08:14.372 GMT D (338493292) events: 
>> Signal(vehicle.charge.stop)
> 
> The event is emitted automatically by the vehicle framework when metric 
> "v.c.charging" (ms_v_charge_inprogress) changes from true to false.
> 
> I don't know the Leaf code, but I think that should directly lead to a 
> poller state change, but doesn't.

In vehicle_nissanleaf.cpp [1] there are four places where we have 
"StandardMetrics.ms_v_charge_inprogress->SetValue(false);"
They're all in the same switch statement block.

Two of them also say "PollSetState(POLLSTATE_OFF);"
These are CHARGER_STATUS_INTERRUPTED and CHARGER_STATUS_FINISHED.

The two that don't set poll state are CHARGER_STATUS_IDLE and 
CHARGER_STATUS_PLUGGED_IN_TIMER_WAIT.

For anyone that knows the Leaf code, does it seem reasonable to add 
PollSetState(POLLSTATE_OFF) to both of those? I note there's a 
mysterious comment "Separate from vehicle_nissanleaf_poll1() to make it 
clearer what is going on." but I can find no record of such a function 
in the current repo.

Chris

Links:
------
[1] 
https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_nissanleaf/src/vehicle_nissanleaf.cpp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20250203/1e3a32d8/attachment-0001.htm>


More information about the OvmsDev mailing list