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())