How to decode data from xethru to normal data

Discussion in 'Module Connector (MC)' started by YuriiKulyk, Nov 18, 2019.

  1. YuriiKulyk

    YuriiKulyk New Member

    I've received data that looks like byte code, how can I decode this byte code with python?
    one of the string that I received
    }Pl\xA1u#\xB6X\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00Z\xF7\xFE>\x04\x00\x00\x00\x16\xB6\xABB\x90H\xEBA\x09~
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

  3. YuriiKulyk

    YuriiKulyk New Member

    Yes it has, but all these files need to connect to device, can i somehow decode just this string?
    When i've tried to create file with this string, and run some of the file from github, with argument -d MY_FILE i got an error `Error parsing incoming data: lost bytes`
     
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

    Could you provide more detail about how you get the string? Which example script did you run?
     
  5. YuriiKulyk

    YuriiKulyk New Member

    So I get this string from nginx log file, when device send data to my server, but I've tried to convert this string to hex format, and get another string
    7d:50:6c:a1:75:23:1e:57:02:00:01:00:00:00:00:00:00:00:85:a9:f4:3e:08:00:00:00:bf:e8:a3:42:c3:30:ec:41:fa:7e
    is it possible to get normal data from this one?

    I've tried to run alomost every file with argument -d or -f and MY_FILE as value of argument, but when i run -f argument, it just said me that it can open my file, and if i run -d argument, it returns me
    2.009188 : Timeout waiting for response
    4.018404 : Timeout waiting for response
    6.022742 : Timeout waiting for response
    and then error
    RuntimeError: Timeout waiting for response

    and each string has different length
    for example if i try to convert other string to hex format i get
    different result
    7d:50:6c:a1:75:23:fc:56:02:00:01:00:00:00:00:00:00:00:91:eb:02:3f
     
    Last edited: Nov 20, 2019
  6. Charlie Shao

    Charlie Shao Moderator Staff Member

    Still confusing about this Nginx log file. It seems that ModuleConnector has no support to output this kind of log file.

    I suggest you check the latest MC examples from this repo: https://github.com/xethru/XeThru_ModuleConnector_Examples/tree/master/PYTHON
    Following the instructions in front of each example to get data from the radar module. In most of the examples, "-d" is used to specify the serial port used by the module. "-f" is used to playback recordings recorded from the module.

    MCP document also has details about the messages of different kinds of XeThru modules can output.
    https://www.xethru.com/community/resources/xethru-module-communication-protocol.130/