|
OVMS doc -
Scripting for OBDII ECU
|
|
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!),
|
|