Total Engine Hours

Saqib2 years ago

Hello to all after a long time..
I have installed Fifo tracker https://www.fifotrack.com/gps-tracker-s20 in heavy machine

I need to see total engine hours but somehow I am not getting it in the state panel. any help would be appreciated.

Anton Tananaev2 years ago

Is your device reporting it?

Saqib2 years ago

yes it does and timezone is also correct.

Anton Tananaev2 years ago

Do you want to provide a sample so we can something to work with?

Saqib2 years ago

sure. you want decoded version of logs?

Anton Tananaev2 years ago

Either one works.

Saqib2 years ago
2022-01-18 06:25:39  INFO: user: 1, report: events, from: 2022-01-17 20:00, to: 2022-01-18 20:00, devices: [2], groups: []
2022-01-18 06:25:58  INFO: [bd21f9a5: fifotrack < 111.119.183.30] HEX: 24243131372c3836323237333034383236373330362c3143332c4130312c2c3232303131383035313730322c412c32342e3832333331362c36372e3239343832302c31302c3238352c33322c3839373438312c302c303030302c30322c302c3431307c347c3243327c3536322c3138437c3541397c37432c312c2a33410d0a
2022-01-18 06:25:58  INFO: [bd21f9a5] id: 862273048267306, time: 2022-01-18 06:17:02, lat: 24.82332, lon: 67.29482, speed: 5.4, course: 285.0
2022-01-18 06:26:10  INFO: [1df686f6] connected
2022-01-18 06:26:11  INFO: [1df686f6: fifotrack < 111.119.183.16] HEX: 24243131372c3836323237333034383236373330362c3143382c4130312c2c3232303131383035323535322c412c32342e3832333833352c36372e3239343530382c31352c3335392c33302c3839373532322c302c303030302c30322c302c3431307c347c3245427c3633412c3138377c3538337c37432c312c2a33330d0a
2022-01-18 06:26:11  INFO: [1df686f6] id: 862273048267306, time: 2022-01-18 06:25:52, lat: 24.82384, lon: 67.29451, speed: 8.1, course: 359.0
2022-01-18 06:26:21  INFO: [1df686f6: fifotrack < 111.119.183.16] HEX: 24243131362c3836323237333034383236373330362c3143372c4130312c2c3232303131383035323534382c412c32342e3832333638362c36372e3239343439382c31312c32302c32382c3839373530382c302c303030302c30322c302c3431307c347c3245427c3633412c3138437c3538437c37432c312c2a30340d0a
2022-01-18 06:26:21  INFO: [1df686f6] id: 862273048267306, time: 2022-01-18 06:25:48, lat: 24.82369, lon: 67.29450, speed: 5.9, course: 20.0
2022-01-18 06:26:24  INFO: [1df686f6: fifotrack < 111.119.183.16] HEX: 24243131372c3836323237333034383236373330362c3143362c4130312c342c3232303131383035323531312c562c32342e3832333635312c36372e3239343134312c302c3332372c32362c3839373530382c302c303030302c30322c302c3431307c347c3245427c3633412c3138437c3335427c37432c312c2a32300d0a
2022-01-18 06:26:24  INFO: [1df686f6] id: 862273048267306, time: 2022-01-18 06:25:11, lat: 24.82365, lon: 67.29414, course: 327.0
2022-01-18 06:26:27  INFO: [1df686f6: fifotrack < 111.119.183.16] HEX: 24243131372c3836323237333034383236373330362c3143332c4130312c2c3232303131383035313730322c412c32342e3832333331362c36372e3239343832302c31302c3238352c33322c3839373438312c302c303030302c30322c302c3431307c347c3243327c3536322c3138437c3541397c37432c312c2a33410d0a
2022-01-18 06:26:27  INFO: [1df686f6] id: 862273048267306, time: 2022-01-18 06:17:02, lat: 24.82332, lon: 67.29482, speed: 5.4, course: 285.0
2022-01-18 06:26:54  INFO: user: 1, report: events, from: 2022-01-17 20:00, to: 2022-01-18 20:00, devices: [2], groups: []
Anton Tananaev2 years ago

OK, and where are the hours?

Saqib2 years ago

Actually device doesn't send the engine hour data directly, but can it be calculated by the platform based on the ignition status?

$$117,862273048267306,1C3,A01,,220118051702,A,24.823316,67.294820,10,285,32,897481,0,0000,02,0,410|4|2C2|562,18C|5A9|7C,1,*3A

in the above data line, 02 is ignition status

Saqib2 years ago
$$115,862273048267306,47,A01,,220118095515,A,24.823688,67.294326,0,276,20,899387,0,0000,02,0,410|4|2C2|526,18D|5AE|80,1,*4F
$$117,862273048267306,45,A01,,220118095451,A,24.823411,67.294726,11,301,22,899368,0,0000,02,0,410|4|2E7|2909,18F|5A9|80,1,*34
$$115,862273048267306,49,A01,,220118095606,A,24.823716,67.294166,0,344,26,899387,0,0000,00,0,410|4|2C2|526,18D|55C|80,1,*36
$$116,862273048267306,48,A01,5,220118095535,A,24.823716,67.294166,0,344,21,899387,0,0000,00,0,410|4|2C2|526,18D|5A9|80,1,*0B
$$117,862273048267306,45,A01,,220118095451,A,24.823411,67.294726,11,301,22,899368,0,0000,02,0,410|4|2E7|2909,18F|5A9|80,1,*34
$$115,862273048267306,4C,A01,,220118095737,A,24.823716,67.294166,0,344,21,899387,0,0000,00,0,410|4|2C2|526,18F|52C|80,1,*4D
$$115,862273048267306,4D,A01,,220118095807,A,24.823716,67.294166,0,344,27,899387,0,0000,00,0,410|4|2C2|526,18E|528|80,1,*38
$$115,862273048267306,4E,A01,,220118095837,A,24.823716,67.294166,0,344,24,899387,0,0000,00,0,410|4|2C2|526,18C|51E|80,1,*41
$$115,862273048267306,4F,A01,,220118095908,A,24.823716,67.294166,0,344,27,899387,0,0000,00,0,410|4|2C2|526,18F|523|80,1,*3C
Anton Tananaev2 years ago

Do you see ignition in the state?

Saqib2 years ago

Yes I do.

Saqib2 years ago

And I can see ignition in the state because I added a computed attribute

attribute: ignition
input > 2 ? true : false
Anton Tananaev2 years ago

That explains it. The problem is that engine hours are calculated before computed attributes:

https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/BasePipelineFactory.java#L134-L135