bmwcarit / python-dlt

python-dlt is a thin Python ctypes wrapper around libdlt functions
Mozilla Public License 2.0
34 stars 29 forks source link

Issue with payload decoded between raw dlt and python-dlt/dlt-viewer #47

Closed msauvayre closed 1 year ago

msauvayre commented 1 year ago

Hi, I have an issue that I don't understand :

I have payload in string format that I could clearly read when I open the dlt file with an hex editor for exemple, but when I use python-dlt, the payload (with payload_decoded) is in ascii code.

Here is what I have :

In dlt-viewer/python-dlt :

1 2022/09/13 16:44:14.151784 46.1516 139 ECU1 SCP HCI 3335 log info verbose 1 2c 02 01 02 0b 20 28 02 f1 03 46 00 04 02 90 03 ed 48 03 ea 42 45 47 49 4e 3a 56 43 41 52 44 0d 0a 56 45 52 53 49 4f 4e 3a 32 2e 31 0d 0a 46 4e 3b 43 48 41 52 53 45 54 3d 55 54 46 2d 38 3a 0d 0a 4e 3b 43 48 41 52 53 45 54 3d 55 54 46 2d 38 3a 0d 0a 54 45 4c 3a 30 36 32 34 38 32 37 33 32 30 0d 0a 58 2d 49 52 4d 43 2d 43 41 4c 4c 2d 44 41 54 45 54 49 4d 45 3b 44 49 41 4c 45 44 3a 32 30 32 32 30 39 31 32 54 31 38 35 30 33 36 0d 0a 45 4e 44 3a 56 43 41 52 44 0d 0a 42 45 47 49 4e 3a 56 43 41 52 44 0d 0a 56 45 52 53 49 4f 4e 3a 32 2e 31 0d 0a 46 4e 3b 43 48 41 52 53 45 54 3d 55 54 46 2d 38 3a 0d 0a 4e 3b 43 48 41 52 53 45 54 3d 55 54 46 2d 38 3a 0d 0a 54 45 4c 3a 2b 33 33 37 36 39 37 35 30 35 34 34 0d 0a 58 2d 49 52 4d 43 2d 43 41 4c 4c 2d 44 41 54 45 54 49 4d 45 3b 44 49 41 4c 45 44 3a 32 30 32 32 30 39 31 32 54 31 37 30 32 30 34 0d 0a 45 4e 44 3a 56 43 41 52 44 0d 0a 42 45 47 49 4e 3a 56 43 41 52 44 0d 0a 56 45 52 53 49 4f 4e 3a 32 2e 31 0d 0a 46 4e 3b 43 48 41 52 53 45 54 3d 55 54 46 2d 38 3a 56 69 63 74 6f 72 69 61 0d 0a 4e 3b 43 48 41 52 53 45 54 3d 55 54 46 2d 38 3a 3b 56 69 63 74 6f 72 69 61 0d 0a 54 45 4c 3a 2b 33 33 36 34 36 33 38 30 32 37 30 0d 0a 58 2d 49 52 4d 43 2d 43 41 4c 4c 2d 44 41 54 45 54 49 4d 45 3b 44 49 41 4c 45 44 3a 32 30 32 32 30 39 31 32 54 31 34 35 34 34 30 0d 0a 45 4e 44 3a 56 43 41 52 44 0d 0a 42 45 47 49 4e 3a 56 43 41 52 44 0d 0a 56 45 52 53 49 4f 4e 3a 32 2e 31 0d 0a 46 4e 3b 43 48 41 52 53 45 54 3d 55 54 46 2d 38 3a 56 69 63 74 6f 72 69 61 0d 0a 4e 3b 43 48 41 52 53 45 54 3d 55 54 46 2d 38 3a 3b 56 69 63 74 6f 72 69 61 0d 0a 54 45 4c 3a 2b 33 33 36 34 36 33 38 30 32 37 30 0d 0a 58 2d 49 52 4d 43 2d 43 41 4c 4c 2d 44 41 54 45

In hex editor : image

I load ther dlt like this : d = dlt.load("light.dlt")

Have I missing an option to load the dlt ?

Thanks by advance.

aigarius commented 1 year ago

Check the details of the message in the dlt-viewer. The DLT protocol supports data structure with multiple fields in the message, each with its own data type. If the data is show in hex, then most likely the data field in the message is set to some kind of binary format and not a string. Likely because it is dumping a binary file into the message. This would need changes on the device side that produces this DLT log.

msauvayre commented 1 year ago

Thanks for the backup. For the device side, it's not possible since it was from a iVi unit. I will try to bypass this limitation with an other method.