[Ovmsdev] Fwd: Peter.h started a conversation with you: "OVMS doc - Scripting for OBDII ECU"
Mark Webb-Johnson
mark at webb-johnson.net
Thu Sep 17 10:22:03 HKT 2020
I got this feedback today from one of our users, and thought it worthwhile to share. Good to see this facility getting some use.
Regards, Mark.
P.S. I have made the documentation change he pointed out.
> OVMS doc - Scripting for OBDII ECU <http://email.teslamotorsclub.com/c/eJxtTkFuxCAQe01yIwISyHLgsJf-YxgmDW1gVkC23y-9V7Is2bItR48qOPOYkwdtLAVLWsk1BtLmALevdOxgHQBZK8FIGXHaZKd2QebOteF1hwU5z6ffFVpFmwtSGWPsakdVITo80CBomC9_9v5q0_qc9MfAPzN_bsbByOVNtUFPXNrQ_M5NREbRsKZXT-VTHFwFh5iSILwXvSm9P0byLpUgztVnqN_j7A-FIL74LI3LUqj_AobJT-E>
>
>
> I finally got around to playing a bit with the OBDII ECU scripting facility - it's a great tool.
>
> I came across a minor error in the doc that had me tripped up for a while and I hope you could channel this to the right person to get it updated.
>
> I am referring to the Google doc "OVMS v3 Advanced User Guide"
>
> In the "Metrics scripts" section is the following example:
> ret1=OvmsMetricFloat("v.p.speed");
> ret2=OvmsMetricFloat("v.b.power");
> out=0.0;
> if (ret1 > 0) { out=ret2/ret1; }
> out;
> This fails since OvmsMetricFloat is undefined - it should say "OvmsMetrics.AsFloat" in the first two rows.
>
> I managed to get my Pioneer NEX radio to show a speedometer on the home screen at last - it turns out it can only show a subset of gauges on the home screen, and the speedometer is not one of them (it offers a tach and MAF). the MAF can be tweaked to show the correct range: by setting it to metric (g/s) the range can be adjusted to 0-120. Somehow I need to multiply v.p.speed by 1.6 to get the correct mph output (which doesn't make sense to me) and then divide it by 2.56 since the OBDII ECU only sends the hibyte of the MAF response, and this is parsed as (256 * A + B)/100.
>
> Thank you again for all the help (and the great work on OVMS!),
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20200917/ae97cdf7/attachment.html>
More information about the OvmsDev
mailing list