Teltonika io number for fuel use in liters seems incorrect

Synergy Dave4 years ago

Hello,
I'm receiving those attributes for my FMB140 tracker:

{"priority":0,"sat":14,"event":0,"ignition":false,"motion":false,"rssi":5,"io200":0,"gpsStatus":1,"obdSpeed":0,"throttle":0,"fuel":0,"io114":0,"oilLevel":0,"pdop":0.5,"hdop":0.30000000000000004,"power":12.845,"battery":3.948,"io68":0,"io84":450,"rpm":0,"door":0,"fuelConsumption":0.0,"coolantTemp":83.0,"operator":60502,"odometer":202513000,"fuelUsed":0.0,"io102":0,"io103":0,"io105":10410685,"io107":9405,"distance":0.0,"totalDistance":0.0}

the fuel field is 0 because you're reading io89,
while the correct value is in io84*0.1 which gives 45 litres

The teltonika docs, say:
io89 is fuel level in percent (will be sent when ignition is on).
io84 is fuel level in litres.

Should I issue a PR for this change or am I missing something else.

Thank you

Synergy Dave4 years ago

Forget to mention, I'm using last master branch code.

Anton Tananaev4 years ago

Are you sure mapping is the same for all Teltonika models, including old ones?

Synergy Dave4 years ago

Not sure about old ones, but I'll send you by email the teltonika docs,
I believe they should'nt break with old models.

Anton Tananaev4 years ago

I believe they should'nt break with old models.

That's incorrect assumption.

Lukasz4 years ago

I have researched the topic and it is not explicit
For most devices (all of Advanced Trackers category, all of Special Trackers category, ALL-CAN300 and LV-CAN200)- is like Synergy Dave wrote (io84 is fuel in liters *0,1)
https://wiki.teltonika-gps.com/view/FMB_AVL_ID

But for professional trackers (only 5 models):
io84 is Acceleration Pedal Position
io89 is Axle weight 1
https://wiki.teltonika-gps.com/view/FMB640_AVL_ID

I searched for a long time but did not find that io89 was fuel in liters.

Lukasz

Anton Tananaev4 years ago
Anton Tananaev4 years ago
Lukasz4 years ago

Yes, io89 is fuel but in percent. In the link you provided, Mladen says io89 is percents.
Note that using 89 gives different readings.
io89 = 10 this is 5 liters for a 50 liter tank
io89 = 10 this is 10 liters for a 100 liter tank

io84 this is fuel in litres always gives the same values (regardless of the tank).

From this link (https://wiki.teltonika-gps.com/view/FMB_AVL_ID):
89 Fuel level 1 Unsigned 0 100 - % Value in percentages
84 Fuel level 2 Unsigned 0 65535 0.1 l Value in liters

Lukasz

Anton Tananaev4 years ago

Feel free to send a pull request.

Lukasz4 years ago

I will gladly send, just tell where / how?
Github?

Anton Tananaev4 years ago

Yes, GitHub. There's plenty of documentation there on how to create a pull request.

Lukasz4 years ago

Is there any point in rolling back? Many values are well decoded (e.g. rpm).
Just change in TeltonikaProtocolDecoder.java (I think so) from:

case 89:
position.set(Position.KEY_FUEL_LEVEL, readValue(buf, length, false));

to:

case 84:
position.set(Position.KEY_FUEL_LEVEL, readValue(buf, length, false) * 0.1);
Anton Tananaev4 years ago

No.

Lukasz4 years ago

OK, I will create a pull request.