Decoding Datastring with unknown encoding

Hello everyone,

I’m working on a project that involves decoding a series of complex datastrings.I’ve identified some patterns and meanings for the characters, but I’m struggling to develop a reliable method to decode these strings consistently.

My issues appear because in this case not a character stands for only one other characters. Some characters appear to have more than one meaning and I dont manage to see a pattern yet. I know the meaning of each answer.

The message is typically build up as following:

\!>|R||||||||

this one more specifically stands for GN00,+0000.0000CRLF

What Ive identified so far, is that only the last nine are interesting for me. R/P stand for a + and H/J for a - the rest are numbers 0000.0000.

Here are some examples:

|Nr.|Command|Measurement|Output|
|---|---|---|---|
|1.|GA00|0.0000mm|\!>xR|||||||||
|2.|GA00|0.0000mm|\!>|R|||||||||
|3.|GA00|0.0000mm|\!>|R|||||||||
|4.|GA00|0.0000mm|\!>|R|||||||||
|5.|GA00|0.0000mm|\!>|R|||||||||
|6.|GA00|0.0000mm|\!>|R|||x|||||
|7.|GA00|0.0000mm|\!>|R|||||||||
|8.|GA00|0.0000mm|X!>xR|||||||||
|9.|GA00|0.0000mm|\!>xR|||||||||
|10.|GA00|0.0000mm|X!>|R|||||||||
|11.|GA00|0.0005mm|\!>|R|||||||T|
|12.|GA00|0.0005mm|\!>|R|||||||T|
|13.|GA00|0.0005mm|\!>|R|||||||T|
|14.|GA00|0.0005mm|\!>|R|||||||T|
|15.|GA00|0.0005mm|\!>|Rx||||||T|
|16.|GA00|0.0005mm|\!>|R|||||||T|
|17.|GA00|0.0005mm|\!>|R|||||||T|
|18.|GA00|0.0005mm|\!>|R||x||||T|
|19.|GA00|0.0005mm|\!>|P|||||||T|
|20.|GA00|0.0005mm|\!>|R|||||||T|
|21.|GA00|0.0010mm|\!>|R||||||t>|
|22.|GA00|0.0010mm|\!>|R||||||t<|
|23.|GA00|0.0010mm|\!>|R|||xx|t>|
|24.|GA00|0.0010mm|X!>|R||||x|t<|
|25.|GA00|0.0010mm|\!>|R||||||t<|
|26.|GA00|0.0010mm|\!>|R|||||xt>|
|27.|GA00|0.0010mm|\!>|R||||||t>|
|28.|GA00|0.0010mm|\!>xR|||||xt<|
|29.|GA00|0.0010mm|\!>|R||||||t>|
|30.|GA00|0.0010mm|\!>|R||||||t>|
|31.|GA00|0.0020mm|\!>|R||||||l>|
|32.|GA00|0.0020mm|\!>|R||||||l>|
|33.|GA00|0.0020mm|\!>|R||||||l>|
|34.|GA00|0.0020mm|\!>|R||||||l>|
|35.|GA00|0.0020mm|\!>|R|||||xl>|
|36.|GA00|0.0020mm|\!>|P||||||l>|
|37.|GA00|0.0020mm|X!>|R||||||l>|
|38.|GA00|0.0020mm|\!>|R||||||l>|
|39.|GA00|0.0020mm|\!>|Rx|||||l>|
|40.|GA00|0.0020mm|\!>|R|||x||l>|
|41.|GA00|0.0030mm|\!>|R||||||d||
|42.|GA00|0.0030mm|X!>|R||||||d||
|43.|GA00|0.0030mm|X!>|R||||||d||
|44.|GA00|0.0030mm|\!>|R||||||d||
|45.|GA00|0.0030mm|\!>|R||||||d||
|46.|GA00|0.0030mm|\!>|R||||||d||
|47.|GA00|0.0030mm|\!>|Rx|||||d||
|48.|GA00|0.0030mm|\!>|R||||||d||
|49.|GA00|0.0030mm|\!>|P||||||`x|
|50.|GA00|0.0030mm|\!>|P||||||d||
|51.|GA00|0.0040mm|\!>|R||||||\>|
|52.|GA00|0.0040mm|\!>|R||||||\<|
|53.|GA00|0.0040mm|\!>|R||||||X>|
|54.|GA00|0.0040mm|\!>|R||||||\>|
|55.|GA00|0.0040mm|\!>|R||||x|\>|
|56.|GA00|0.0040mm|\!>|R||||||X>|
|57.|GA00|0.0040mm|\!>|R||||||X<|
|58.|GA00|0.0040mm|\!>|R|||||x\>|
|59.|GA00|0.0040mm|\!>|R||||||\>|
|60.|GA00|0.0040mm|\!>|R||||||\>|
|61.|GA00|0.0050mm|\!>|P|||||xT||
|62.|GA00|0.0050mm|\!>|R||||||T||
|63.|GA00|0.0050mm|\!>|R||x|||T||
|64.|GA00|0.0050mm|\!>|R||||||P||
|65.|GA00|0.0050mm|\!>|R|||||| ||
|66.|GA00|0.0050mm|\!>|R||||||T||
|67.|GA00|0.0050mm|\!>|R||||x|T||
|68.|GA00|0.0050mm|\!>|R||x|||T||
|69.|GA00|0.0050mm|\!>|Px|||||T||
|70.|GA00|0.0050mm|\!>|R||||||T||
|71.|GA00|0.0060mm|\!>|R||||||L||
|72.|GA00|0.0060mm|X!>|R||||||L||
|73.|GA00|0.0060mm|\!>|R|||x||L||
|74.|GA00|0.0060mm|\!>|R||||||L||
|75.|GA00|0.0060mm|\!>|P||||||L||
|76.|GA00|0.0060mm|\!>|R||||||Lx|
|77.|GA00|0.0060mm|\!>|P||||||H||
|78.|GA00|0.0060mm|\!>|R|||x||H||
|79.|GA00|0.0060mm|\!>|R||||||L||
|80.|GA00|0.0060mm|\!>|R||||||L||
|81.|GA00|0.0070mm|\!>|R||||||D>|
|82.|GA00|0.0070mm|\!>|Rx|||||D>|
|83.|GA00|0.0070mm|\!>|R||||||D<|
|84.|GA00|0.0070mm|\!>|P||||||D>|
|85.|GA00|0.0070mm|\!>|R||||||D>|
|86.|GA00|0.0070mm|\!>|R||||||D>|
|87.|GA00|0.0070mm|\!>|R||||||D>|
|88.|GA00|0.0070mm|\!>|R||||||D<|
|89.|GA00|0.0070mm|\!>|R||||||D>|
|90.|GA00|0.0070mm|\!>|R||||||D>|
|91.|GA00|0.0080mm|\!>|P||||||<>|
|92.|GA00|0.0080mm|X!>|R|||x||<<|
|93.|GA00|0.0080mm|\!>|R||||||<<|
|94.|GA00|0.0080mm|\!>|R||||x|<>|
|95.|GA00|0.0080mm|\!>|P||x|||<>|
|96.|GA00|0.0080mm|\!>|R||||||<>|
|97.|GA00|0.0080mm|\!>|R||||||<>|
|98.|GA00|0.0080mm|\!>|R||||||<>|
|99.|GA00|0.0080mm|\!>|Rx|||x|<>|
|100.|GA00|0.0080mm|\!>|R||||||<>|
|101.|GA00|0.0090mm|\!>|R||||||4||
|102.|GA00|0.0090mm|X!>|R||||||4||
|103.|GA00|0.0090mm|\!>|R||||||4||
|104.|GA00|0.0090mm|\!>|R||||||4||
|105.|GA00|0.0090mm|\!>|R||x|||4||
|106.|GA00|0.0090mm|\!>|R||||||4||
|107.|GA00|0.0090mm|\!>|R||||||4||
|108.|GA00|0.0090mm|X!>|R||||||4||
|109.|GA00|0.0090mm|\!>|P||||||4||
|110.|GA00|0.0090mm|\!>|P||||x|4||

That are all the possible meanings I have found so far:

‘-’ = H, J
‘+’ = R, P
9 = 4, &
8 = <, 8
7 = D
6 = L,
5 = T, *, (
4 = , F
3 = d
2 = l
1 = t, :
0 = |, <, >

x=|
X=\

Which LoRaWAN device is this coming from?

None. This is the output of a measuring device connected via serial port.

I know this forum primarily focuses on LoRaWAN® and related technologies. However, I believe the community’s expertise in data encoding and decoding could provide valuable insights for my problem.

Potentially, although we either have total control over our data or we are using documented data formats.

This forum is funded by TTI for discussions related to LoRaWAN on TTN or TTI. As such we keep the focus on exactly that - it’s not appropriate to expect TTI to fund resources for general embedded questions - there are plenty out there that do.

And by not telling us what this measuring device is, this looks like the start of a topic that takes forever to unearth details rather than just being upfront with all of the infos from the beginning. Having the slightest clue what it is measuring would make all the difference to what sort of data to expect.

You’ve got peoples attention now, if they recognise the format they can send you a private message.