Custom commands for Teltonika protocol

Victor Butler2 months ago

I did some tests with sending commands to a teltonika device and I get the following errors in the log:

2024-09-16 15:24:06  INFO: [Tfb18b8ef: teltonika > 185.99.27.226] 00000000000000130c01050000000b6765747374617475730d0a010000745e
2024-09-16 15:24:06  INFO: [Tfb18b8ef: teltonika < 185.99.27.226] 00000000000000900c01060000008844617461204c696e6b3a203120475052533a20312050686f6e653a20302053494d3a2030204f503a203238343031205369676e616c3a2033204e6577534d533a203020526f616d696e673a203120534d5346756c6c3a2030204c41433a20313430302043656c6c2049443a2032343637204e6574547970653a20312046775570643a2d3635353336010000307c
2024-09-16 15:24:06  WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute:138@1:1 variable 'event' is undefined - Variable (ComputedAttributesHandler:139 < *:150 < ProcessingHandler:178 < MotionHandler:41 < ProcessingHandler:178 < ...)
2024-09-16 15:24:06  WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute:138@1:1 variable 'event' is undefined - Variable (ComputedAttributesHandler:139 < *:150 < ProcessingHandler:178 < MotionHandler:41 < ProcessingHandler:178 < ...)
2024-09-16 15:24:06  WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute:138@1:1 variable 'event' is undefined - Variable (ComputedAttributesHandler:139 < *:150 < ProcessingHandler:178 < MotionHandler:41 < ProcessingHandler:178 < ...)
2024-09-16 15:24:06  WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute:138@1:1 variable 'event' is undefined - Variable (ComputedAttributesHandler:139 < *:150 < ProcessingHandler:178 < MotionHandler:41 < ProcessingHandler:178 < ...)
2024-09-16 15:24:06  WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute:138@1:1 variable 'event' is undefined - Variable (ComputedAttributesHandler:139 < *:150 < ProcessingHandler:178 < MotionHandler:41 < ProcessingHandler:178 < ...)
2024-09-16 15:24:06  WARN: Attribute computation error - org.traccar.handler.ComputedAttributesHandler.computeAttribute:138@1:1 variable 'event' is undefined - Variable (ComputedAttributesHandler:139 < *:150 < ProcessingHandler:178 < MotionHandler:41 < ProcessingHandler:178 < ...)
2024-09-16 15:24:06  INFO: Event id: XXXXXXXXXXXXXXX, time: 2024-09-16 15:24:06, type: commandResult, notifications: 0
2024-09-16 15:24:06  INFO: [Tfb18b8ef] id: XXXXXXXXXXXXXXX, time: 2024-09-16 15:22:03, lat: XX.XXXXX, lon: XX.XXXXX, course: 0.0, result: Data Link: 1 GPRS: 1 Phone: 0 SIM: 0 OP: 28401 Signal: 3 NewSMS: 0 Roaming: 1 SMSFull: 0 LAC: 1400 Cell ID: 2467 NetType: 1 FwUpd:-65536

I don't have any computed attributes configured, so why the errors?

Also, the device is set to TCP protocol but it seems that the command and the command response use UDP. Is this expected behavior?

Thanks!

Anton Tananaev2 months ago

The errors indicate that you definitely have computed attributes, so you must be missing something.

Victor Butler2 months ago

Found it thanks. It was this one:

event == "247" ?  "accident" : null.

For teltonika all records contain an event parameter so for regular data records, this attribute evaluates correctly.

Which is not the case for commands response HEX, hence the error.