Ask a question

3590 questions

4090 answers

3024 comments

34728 members

Ask a question
0 votes
303 views
in Vehicle tracking by

Hi,

I have some problems decoding Teltonika FMM125 UDP messages. As far as I understand, the messages I've received do not match protocol definition that is described here: https://wiki.teltonika-gps.com/view/Teltonika_Data_Sending_Protocols

I've logged the messages with a Python script.  Here's one example:

b'\x04\xeb\xca\xfe\x01&\x00\x0f867035042881290\x08\x13\x00\x00\x01u\xd6Y\x9a\xf0\x00\rO\xf9\x99$\x07e\xa6\x00>\x00\xf9\x08\x00\x00\xf0\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x07\xb6\x00\x06B2\xa9C\x0f\x8dD\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00\x00\x00\x00\x00\x01u\xd6Z\xac`\x00\rO\xf9\xfe$\x07e\xc7\x00;\x01%\x08\x00\x00\xf0\x0c\x05\xef\x00\xf0\x00\x15\x05\xc8\x00E\x01\x05\xb5\x00\x07\xb6\x00\x06B2\xa6C\x0f\x8dD\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00\x00\x00\x00\x00\x01u\xd6h\xc9\xa8\x00\rO\xf6&$\x07d\x8a\x00:\x01\x17\t\x00\x00\xf0\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x07\xb6\x00\x06B2\xaeC\x0f]D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00\x00\x00\x00\x00\x01u\xd6h\xec\xd0\x00\rO\xfb\x19$\x07di\x00:\x01\x0c\t\x00\n\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x0e\xb6\x00\x07B2\xa7C\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00\x07\x00\x00\x00\x01u\xd6i\x00X\x00\rO\xf7B$\x07d\x16\x00:\x00\xfc\x06\x00\x07\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\t\xb6\x00\x07B2\xa0C\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00\r\x00\x00\x00\x01u\xd6i\x04@\x00\rO\xf4"$\x07d\x05\x00:\x01\x04\x07\x00\x1d\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x07\xb6\x00\x06B2\xa0C\x0f]D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00\x12\x00\x00\x00\x01u\xd6i\x0f\xf8\x00\rO\xec\xe8$\x07c\xc2\x008\x01\n\x06\x00\x13\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x0f\xb6\x00\x08B2\x9eC\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00\x1c\x00\x00\x00\x01u\xd6i\x17\xc8\x00\rO\xee\x88$\x07c\xe4\x007\x00\xfc\x07\x00\r\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x0e\xb6\x00\x07B2\x9eC\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00\x1c\x00\x00\x00\x01u\xd6i#\x80\x00\rO\xef\xc5$\x07bd\x005\x00\xf2\t\x00\x07\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\r\xb6\x00\x07B2\x9eC\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00!\x00\x00\x00\x01u\xd6i3 \x00\rO\xf09$\x07b"\x003\x00\xfe\t\x00\x06\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\r\xb6\x00\x07B2\x9eC\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00!\x00\x00\x00\x01u\xd6i7\x08\x00\rO\xf0J$\x07bC\x002\x01\x0b\t\x00\x07\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x08\xb6\x00\x05B2\x9eC\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00!\x00\x00\x00\x01u\xd6i:\xf0\x00\rO\xf0\x08$\x07b\xe9\x001\x01\x01\t\x00\x07\x00\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x0e\xb6\x00\x07B2\x9eC\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00!\x00\x00\x00\x01u\xd6k#8\x00\rO\xf3\'$\x07b\xc8\x00\x1d\x00\x83\t\x00\x00\xf0\x0c\x05\xef\x00\xf0\x00\x15\x05\xc8\x00E\x01\x05\xb5\x00\x07\xb6\x00\x06B2\x9eC\x0f^D\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00)\x00\x00\x00\x01u\xd6v\xb0@\x00\rO\xf3\'$\x07b\xc8\x009\x00\x83\n\x00\x00\x00\x0c\x05\xef\x00\xf0\x00\x15\x05\xc8\x00E\x01\x05\xb5\x00\x07\xb6\x00\x05B2\x9eC\x0fbD\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00)\x00\x00\x00\x01u\xd6v\xb0J\x00\rO\xfdq$\x07d\x05\x009\x00\xd9\n\x00\x00\xf0\x0c\x05\xef\x00\xf0\x01\x15\x05\xc8\x00E\x01\x05\xb5\x00\x07\xb6\x00\x05B2\x9eC\x0fbD\x00\x00\x02\xf1\x00\x00_U\x10\x00\x00\x00)\x00\x00\x00\x01u\xd6w\x830\x00\rO\xfa\xd6$\x07c\x1c\x006\x01\x01\x07\x00\x06'

 There is 867035042881290 close to the start of the message but I can't make sense of the rest. Where does the data start and how do I parse it to human readable format?

3 Answers

0 votes
by
Apparently issue was that message was longer than 1024, that was defined in the script. I doubled the length and now I'm getting messages that decode without any issue.
Best answer
0 votes
by
Hello

Please provide data string in Hex format (without /x01& /x01u etc..)
by
Hi,

Here it is:

04ebcafe010a000f383637303335303432383831323930081300000175d6599af0000d4ff999240765a6003e00f9080000f00c05ef00f0011505c800450105b50007b600064232a9430f8d44000002f100005f5510000000000000000175d65aac60000d4ff9fe240765c7003b0125080000f00c05ef00f0001505c800450105b50007b600064232a6430f8d44000002f100005f5510000000000000000175d668c9a8000d4ff6262407648a003a0117090000f00c05ef00f0011505c800450105b50007b600064232ae430f5d44000002f100005f5510000000000000000175d668ecd0000d4ffb1924076469003a010c09000a000c05ef00f0011505c800450105b5000eb600074232a7430f5e44000002f100005f5510000000070000000175d6690058000d4ff74224076416003a00fc060007000c05ef00f0011505c800450105b50009b600074232a0430f5e44000002f100005f55100000000d0000000175d6690440000d4ff42224076405003a010407001d000c05ef00f0011505c800450105b50007b600064232a0430f5d44000002f100005f5510000000120000000175d6690ff8000d4fece8240763c20038010a060013000c05ef00f0011505c800450105b5000fb6000842329e430f5e44000002f100005f55100000001c0000000175d66917c8000d4fee88240763e4003700fc07000d000c05ef00f0011505c800450105b5000eb6000742329e430f5e44000002f100005f55100000001c0000000175d6692380000d4fefc524076264003500f2090007000c05ef00f0011505c800450105b5000db6000742329e430f5e44000002f100005f5510000000210000000175d6693320000d4ff03924076222003300fe090006000c05ef00f0011505c800450105b5000db6000742329e430f5e44000002f100005f5510000000210000000175d6693708000d4ff04a240762430032010b090007000c05ef00f0011505c800450105b50008b6000542329e430f5e44000002f100005f5510000000210000000175d6693af0000d4ff008240762e900310101090007000c05ef00f0011505c800450105b5000eb6000742329e430f5e44000002f100005f5510000000210000000175d66b2338000d4ff327240762c8001d0083090000f00c05ef00f0001505c800450105b50007b6000642329e430f5e44000002f100005f5510000000290000000175d676b040000d4ff327240762c8003900830a0000000c05ef00f0001505c800450105b50007b6000542329e430f6244000002f100005f5510000000290000000175d676b04a000d4ffd7124076405003900d90a0000f00c05ef00f0011505c800450105b50007b6000542329e430f6244000002f100005f5510000000290000000175d6778330000d4ffad62407631c00360101070006
0 votes
by

Hi...Teltonika has an instrument considered Parser that requires information in HEX organization prior to deciphering the qualities enrolled by the gadget. With little HEX Converter apparatus you can change over the first message in an intelligible organization that can take care of the parser. Deciphering the parser results requires the gadget convention archive gave by Teltonika.

turnkey assembly

by

I tried decoding the message with parser provided by Teltonika and it returned an error saying that the data is corrupt. This was the message:

04ebcafe0165000f383637303335303432383831323930081300000175d6599af0000d4ff999240765a6003e00f9080000f00c05ef00f0011505c800450105b50007b600064232a9430f8d44000002f100005f5510000000000000000175d65aac60000d4ff9fe240765c7003b0125080000f00c05ef00f0001505c800450105b50007b600064232a6430f8d44000002f100005f5510000000000000000175d668c9a8000d4ff6262407648a003a0117090000f00c05ef00f0011505c800450105b50007b600064232ae430f5d44000002f100005f5510000000000000000175d668ecd0000d4ffb1924076469003a010c09000a000c05ef00f0011505c800450105b5000eb600074232a7430f5e44000002f100005f5510000000070000000175d6690058000d4ff74224076416003a00fc060007000c05ef00f0011505c800450105b50009b600074232a0430f5e44000002f100005f55100000000d0000000175d6690440000d4ff42224076405003a010407001d000c05ef00f0011505c800450105b50007b600064232a0430f5d44000002f100005f5510000000120000000175d6690ff8000d4fece8240763c20038010a060013000c05ef00f0011505c800450105b5000fb6000842329e430f5e44000002f100005f55100000001c0000000175d66917c8000d4fee88240763e4003700fc07000d000c05ef00f0011505c800450105b5000eb6000742329e430f5e44000002f100005f55100000001c0000000175d6692380000d4fefc524076264003500f2090007000c05ef00f0011505c800450105b5000db6000742329e430f5e44000002f100005f5510000000210000000175d6693320000d4ff03924076222003300fe090006000c05ef00f0011505c800450105b5000db6000742329e430f5e44000002f100005f5510000000210000000175d6693708000d4ff04a240762430032010b090007000c05ef00f0011505c800450105b50008b6000542329e430f5e44000002f100005f5510000000210000000175d6693af0000d4ff008240762e900310101090007000c05ef00f0011505c800450105b5000eb6000742329e430f5e44000002f100005f5510000000210000000175d66b2338000d4ff327240762c8001d0083090000f00c05ef00f0001505c800450105b50007b6000642329e430f5e44000002f100005f5510000000290000000175d676b040000d4ff327240762c8003900830a0000000c05ef00f0001505c800450105b50007b6000542329e430f6244000002f100005f5510000000290000000175d676b04a000d4ffd7124076405003900d90a0000f00c05ef00f0011505c800450105b50007b6000542329e430f6244000002f100005f5510000000290000000175d6778330000d4ffad62407631c00360101070006

Then I tried decoding sample message I found from the internet and decoded without any issues. This is the message (this is not from my device, I found it from the internet):
 

0086cafe0101000f3335323039333038353639383230368e0100000167efa919800200000000000000000000000000000000fc0013000800ef0000f00000150500c80000450200010000710000fc00000900b5000000b600000042305600cd432a00ce6064001100090012ff22001303d1000f0000000200f1000059d900100000000000000000010086cafe0191000f3335323039333038353639383230368e0100000167efad92080200000000000000000000000000000000fc0013000800ef0000f00000150500c80000450200010000715800fc01000900b5000000b600000042039d00cd432a00ce60640011015f0012fd930013036f000f0000000200f1000059d900100000000000000000010086cafe01a0000f3335323039333038353639383230368e01000000f9cebaeac80200000000000000000000000000000000fc0013000800ef0000f00000150000c80000450200010000710000fc00000900b5000000b600000042305400cd000000ce0000001103570012fe8900130196000f0000000200f10000000000100000000000000000010083cafe0101000f3335323039333038353639383230368e0100000167f1aeec00000a750e8f1d43443100f800b210000000000012000700ef0000f00000150500c800004501000100007142000900b5000600b6000500422fb300cd432a00ce60640011000700120007001303ec000f0000000200f1000059d90010000000000000000001

To me, they both look pretty much the same. 

How should I go about debugging what's wrong with the message I'm getting from my device?

Here's my simple Python script I'm using to log messages:

import binascii

import logging

import socket

from pathlib import Path, PurePath

from datetime import datetime

logging.basicConfig(filename=PurePath.joinpath(Path(__file__).parent.parent.absolute(), 'log', 'app.log'), level=logging.INFO,

format='%(asctime)s:%(message)s')

logger = logging.getLogger('UDP listener')

UDP_IP = "0.0.0.0"

UDP_PORT = xxxx

sock = socket.socket(socket.AF_INET,

socket.SOCK_DGRAM)

sock.bind((UDP_IP, UDP_PORT))

while True:

data, addr = sock.recvfrom(1024)

logger.info(data.hex())


 

by

Hello

Below is parsed data

Codec 8/UDP: https://wiki.teltonika-gps.com/view/Codec#Codec_8

04eb - length

cafe - packet ID

01 – not usable byte

0a – AVL packet ID

000f – imei length

383637303335303432383831323930 - imei

08 - codec id (codec 8)

13 – number of data 1

00000175d6599af0 - timestamp

00 - priority

0d4ff999 - longitude

240765a6 - latitude

003e - altitude

00f9 - angle

08 - satellites

0000 - speed

f0 - Event IO ID

0c – N of total ID (12)

05 - N1 of One Byte IO

Ef – AVL 239 (ignition)

00 – value (ignition = 0)

f0 – AVL 240 (movement)

01 - 01

15 – AVL ID 21

05 - 5

c8 – AVL ID 200

00 - 00

45- AVL ID 69

01 - 1

05 - N2 of Two Bytes IO

b5 -AVL ID 181

0007 - 7

b6 – AVL ID 182

0006 - 6

42 – AVL ID 66 (external voltage)

32a9 – 12969 (12969 mV)

43 – AVL ID 67

0f8d - 3981

44 – AVL ID 68

0000 - 0

02 - N4 of four Bytes IO

f1 – AVL ID 241

00005f55 - 24405

10 – AVL ID 16

00000000 - 0

00 - N8 of eight Bytes IO

Next record

00000175d65aac60 – Timestamp……….

000d4ff9fe240765c7003b0125080000f00c05ef00f0001505c800450105b50007b600064232a6430f8d44000002f100005f5510000000000000000175d668c9a8000d4ff6262407648a003a0117090000f00c05ef00f0011505c800450105b50007b600064232ae430f5d44000002f100005f5510000000000000000175d668ecd0000d4ffb1924076469003a010c09000a000c05ef00f0011505c800450105b5000eb600074232a7430f5e44000002f100005f5510000000070000000175d6690058000d4ff74224076416003a00fc060007000c05ef00f0011505c800450105b50009b600074232a0430f5e44000002f100005f55100000000d0000000175d6690440000d4ff42224076405003a010407001d000c05ef00f0011505c800450105b50007b600064232a0430f5d44000002f100005f5510000000120000000175d6690ff8000d4fece8240763c20038010a060013000c05ef00f0011505c800450105b5000fb6000842329e430f5e44000002f100005f55100000001c0000000175d66917c8000d4fee88240763e4003700fc07000d000c05ef00f0011505c800450105b5000eb6000742329e430f5e44000002f100005f55100000001c0000000175d6692380000d4fefc524076264003500f2090007000c05ef00f0011505c800450105b5000db6000742329e430f5e44000002f100005f5510000000210000000175d6693320000d4ff03924076222003300fe090006000c05ef00f0011505c800450105b5000db6000742329e430f5e44000002f100005f5510000000210000000175d6693708000d4ff04a240762430032010b090007000c05ef00f0011505c800450105b50008b6000542329e430f5e44000002f100005f5510000000210000000175d6693af0000d4ff008240762e900310101090007000c05ef00f0011505c800450105b5000eb6000742329e430f5e44000002f100005f5510000000210000000175d66b2338000d4ff327240762c8001d0083090000f00c05ef00f0001505c800450105b50007b6000642329e430f5e44000002f100005f5510000000290000000175d676b040000d4ff327240762c8003900830a0000000c05ef00f0001505c800450105b50007b6000542329e430f6244000002f100005f5510000000290000000175d676b04a000d4ffd7124076405003900d90a0000f00c05ef00f0011505c800450105b50007b6000542329e430f6244000002f100005f5510000000290000000175d6778330000d4ffad62407631c00360101070006

<!--[if gte mso 9]> <![endif]--><!--[if gte mso 9]> Normal 0 false false false EN-GB X-NONE X-NONE <![endif]--><!--[if gte mso 9]> <![endif]--><!--[if gte mso 10]> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:8.0pt; mso-para-margin-left:0cm; line-height:107%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} <![endif]-->