[Ovmsdev] Polling not working as expected
Michael Balzer
dexter at expeedo.de
Wed Aug 12 23:36:00 HKT 2020
Soko,
by history of it's origin in the V2 module, the poller currently is only
called by the ticker, so runs once per second, and is limited to
processing one request at a time. A response may consist of multiple
frames (automatically requested by the receiver). The poller doesn't
know when/if a request is completed / cancelled.
It should be pretty simple to allow PollerSend() to be called anytime,
e.g. by the IncomingPollReply() handler as soon as it detects a
completed response.
From a quick glance, the only change necessary for this should be adding
a control argument to PollerSend() that inhibits the m_poll_ticker
increment & cycling.
You would e.g. call PollerSend(false) in IncomingPollReply() to check
for any more polls to be done in the current poller second
(m_poll_ticker value). If none is found, the poller exits and leaves the
next call to the ticker again. The default (ticker) PollerSend()
behaviour remains the same as now.
Do you want to try implementing that change? You can test it on your
polls directly. If you submit the change, please keep it in a separate
commit / pull request, don't mix it with some UpMiiGo changes.
Regards,
Michael
Am 12.08.20 um 15:47 schrieb Soko:
> Hey guys,
>
> I'm wondering how the poller ticker works as it seems it doesn't poll
> as frequently as expected. Here are my (simplified) polls:
>
> const OvmsVehicle::poll_pid_t vwup_polls[] = {
> {VWUP_CHARGER_TX, VWUP_CHARGER_RX,
> VEHICLE_POLL_TYPE_OBDIIEXTENDED, VWUP_CHARGER_AC_U, {0, 0, 5}},
> {VWUP_CHARGER_TX, VWUP_CHARGER_RX,
> VEHICLE_POLL_TYPE_OBDIIEXTENDED, VWUP_CHARGER_AC_I, {0, 0, 5}},
> {VWUP_BAT_MGMT_TX, VWUP_BAT_MGMT_RX,
> VEHICLE_POLL_TYPE_OBDIIEXTENDED, VWUP_BAT_MGMT_U, {0, 1, 5}},
> {VWUP_BAT_MGMT_TX, VWUP_BAT_MGMT_RX,
> VEHICLE_POLL_TYPE_OBDIIEXTENDED, VWUP_BAT_MGMT_I, {0, 1, 5}},
> {VWUP_BAT_MGMT_TX, VWUP_BAT_MGMT_RX,
> VEHICLE_POLL_TYPE_OBDIIEXTENDED, VWUP_BAT_MGMT_SOC, {0, 20, 20}},
> {0, 0, 0, 0, {0, 0, 0}}};
>
> I was expecting to get both voltages and currents every 5 seconds and
> just milliseconds apart from each other. And (of course) every 20
> seconds the SoC.
>
> But I get one of the first four every seconds (taking 4 seconds in
> total until a I have all) and SoC only ~40 seconds.
>
> Is there some way to change the poller to the expected behavior?
>
> I would like the first 4 very close to each other so I can calculate
> AC power, DC power and therefore the efficiency of the charging process.
>
> thx
>
> Soko
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
More information about the OvmsDev
mailing list