Hello everyone,
I'm integrating a JT606X fuel sensor with a Teltonika FMB125. The sensor sends RS232 ASCII data using a custom protocol and responds to the command @01E0006# with a string like @01E130644332180384091068D6#. The fuel level (e.g., 384.09 liters) is encoded as a 6-digit number within a specific substring of this response.
While analog communication between the sensor and FMB125 works seamlessly, digital communication requires parsing the custom protocol. I see two potential approaches:
- Modify the TeltonikaProtocolDecoder to handle a new codec (e.g., codec 0x0C) for directly parsing the RS232 data.
- Use computed attributes in Traccar, for example, by applying an expression such as CAST(SUBSTRING(text, 16, 6) AS FLOAT) / 100 to extract the fuel level.
Is this computed attribute approach valid for extracting the fuel level?
thanks
The expression is not valid, but the general approach should work.
Thanks for your response, Anton.
I understand that the general approach is valid even though my example expression isn’t supported as-is.
Could you please provide some guidance or an example of a valid computed attribute expression for extracting the fuel level from the sensor response? Also, is there any documentation on the functions or syntax available in Traccar’s computed attributes that I could refer to?
Hello everyone,
I'm integrating a JT606X fuel sensor with a Teltonika FMB125. The sensor sends RS232 ASCII data using a custom protocol and responds to the command @01E0006# with a string like @01E130644332180384091068D6#. The fuel level (e.g., 384.09 liters) is encoded as a 6-digit number within a specific substring of this response.
While analog communication between the sensor and FMB125 works seamlessly, digital communication requires parsing the custom protocol. I see two potential approaches:
Is this computed attribute approach valid for extracting the fuel level?
thanks