This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWR6843: Deciphering Output Data

Part Number: IWR6843

Hi Expert,

I have question concerning the output data for sense and direct lab.

I have managed to use python serial to get some output from the sensor. Some of the data are as follows:

b''
b''
b''
b''
b''
b'\x02\x01\x04\x03\x06\x05\x08\x07\x04\x00\x05\x03B\x16\n\x00\xa0\xca`a\x92\x02\x00\x00e[\x01\x00\x00\x00\x00\x00S\x00\x00\x00\x8a2\x00\x00\xd1\x10\x00\x00\xaa\x1d\x00\x00\x01\x00C\xeb\x06\x00\x00\x00^\x02\x00\x00\xfa~*?u\x84\xbf=\xccL\xb8=\x00\x00\x00>8\x01\x1c\x00?\x00U\x00\x13\x00\xe1\x00T\x00\x11\x00\xd6\x01T\x00\x12\x00\xf8\x02S\x00\x10\x00(\x00O\x003\x00\x18\x02I\x00\x15\x00\x19\x01H\x00\x14\x00X\x02F\x002\x00'
b''
b'\x8e\x00E\x00C\x00=\x00E\x00G\x00\xe4\x02D\x00F\x00)\x01D\x00H\x006\x01;\x00I\x00\xb4\x009\x00J\x00e\x004\x00X\x00P\x003\x00Y\x00\xa3\x00-\x00V\x00|\x00+\x00U\x00r\x00&\x00!\x00;\x00!\x00#\x00\xf4\x01 \x00$\x00\xbb\x02\x1f\x00%\x00O\x00\x1f\x00<\x008\x00\x1c\x00H\x00\\\x01\x1b\x00"\x00\x7f\x00\x19\x00I\x00T\x02\x16\x00J\x00\xe2\x01\x16\x00\\\x00\xa0\x02\x16\x00]\x00\x8e\x01'
b''
b''
b''
b'\x16\x00^\x00^\x00\x15\x00K\x00B\x00\x15\x00[\x00\xb4\x01\x14\x00X\x008\x00\x11\x00Y\x00`\x00\n\x00(\x00?\x00\n\x00,\x00L\x00\t\x00)\x00?\x00\x08\x00+\x00\x91\x00\x04\x00*\x00@\x00\x01\x00m\x00\x94\x03\x00\x00n\x00\xdd\x11\x00\x00o\x000\x19\x00\x00l\x00%\x01\xff\x00i\x00\xb3\x00\xff\x00j\x00]\x02\xfe\x00k\x00|\x01\xfb\x00/\x00Z\x05\xfb\x000\x00F\n\xfb\x001\x00F\x03\xf9\x00.\x00G\x00\xf3\x00'
b''
b''
b'd\x00@\x00\xf2\x005\x00m\x00\xf2\x00e\x00I\x00\xf1\x006\x00\x89\x00\xf1\x007\x005\x00\xea\x00f\x00\xe3\x00\xe6\x00h\x00\x07\x01\xe5\x00H\x00\x10\x01\xe5\x00g\x00X\x01\xe4\x00I\x00\xe4\x00\xe3\x00\x1f\x00\x81\x00\xe3\x00J\x00=\x00\xe2\x00 \x006\x00\xe2\x00A\x00j\x00\xe0\x00\x1e\x00t\x00\xe0\x00p\x001\x00\xde\x00B\x00,\x00\xdd\x00\x1a\x00#\x02\xdd\x00\x1d\x00\x96\x00\xdd\x00.\x00:\x00\xdd\x00S\x00n\x00\xdc\x00/\x00'
b''
b''
b'y\x01\xdb\x00\x19\x00[\x01\xdb\x000\x00-\x02\xda\x00\x16\x00\xc4\x00\xda\x00\x17\x00\xc7\x00\xda\x00\x1b\x00V\x03\xda\x001\x00\xe3\x00\xda\x00P\x00\x98\x00\xd9\x00\x1c\x00\xd3\x01\xd7\x00\x18\x00\x8c\x00\xd5\x00N\x00E\x00\xd4\x00O\x00\xec\x00\xd2\x004\x00D\x00\xd1\x005\x008\x00\xd1\x00;\x00W\x00\xc7\x00\x08\x00\xf6\x00\xc0\x00\x07\x00\x8d\x03\xbf\x00\n\x00t\x00\xbd\x00.\x00\xbe\x00\xbc\x00\x05\x003\x00\xbc\x00\x06\x00\xe7\x01\xba\x00\x04\x00I\x00\xb7\x00\x0c\x00*\x00\xb0\x00\x1c\x00\xc6\x00\xac\x00\t\x00)\x00'

I understand that the first seven bytes:"x02\x01\x04\x03\x06\x05\x08\x07" are the sync pattern data. However, I cant seem to understand the rest of the data output. Some of the bytes contain weird characters like '\n' and '\xca`a'. Are those data supposed to be there. Is there a way to better understand it?

  • Hi,

    There is certainly some artifacts in this output from the tool which you have used to capture it. Often when writing a binary stream of data to a file/terminal, some of the data may be interpreted as special characters by the program, which can cause it be displayed oddly. What method did you use to retreive/save this capture? I typically recommend using a teraterm serial terminal, enable logging, and make sure to set the log file to be written as binary data.

    Best Regards,
    Alec

  • Hi Alec,

    Thank you for your reply.

    I have used the following python program to get the value from the sensor COM port.

    -------------------------------------------------------------------------------------------------------

    import serial
    from serial.serialutil import Timeout

    comport = input("The comport for your standard comport : ")

    ser = serial.Serial(comport, 921600)

    while True:
        byteCount =ser.inWaiting()
        s = ser.read(byteCount)
        print(s)
    -------------------------------------------------------------------------------------------------------
    I have tried to log via tera term but cant seem to be able to get the binary data from the sensor.
    The output is as follows:
    À=¥:@ @@ l ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¾¾¾¾ B
    g“9~a 79 S ,1 ¥ Š( «$ ^ ú~*?u„¿=ÌL¸= >ýý ª þý f þ  þ ‚ ÿ j ÿ Ñ ÿ “ Ò ý ’ • à ÿ ˆ « ÿ r  M 1 IL A - K 2 T F I = F K R A J ž < [ B 8 \ < 7
    õ 7
    g3 7 3
    M2 / O 1 . ‹ , o T * 1 * _ D ) y( '
    ( ! ×.& - 9& n . % . Ñ % /  % 0 % 1 } % B ? $ " - # K $ â N : — M I O / b (
    K v
    i J h A - [ B / ñ 0 - ‚ @ 9 X l Y ˜ ÷ÿ #þ 1 q þ W Z þ Z p ú ? 6 ù Ä
    ö Q ð Ç ï  î "$î [ ¹ î { 9 í í I C í J z ë b ä B - ã ’ß @ b ß A i ß w * Þ ? K Ó z 8 Ë N , É % h É y H Å d ? à w , À í » 3 º [ Ó · 6 ± ^ 2 L î53½Ne@|
    <¬¼¾>_·<œ¤¾uˆ–Aº nÀ3“µ>º nÀ‰C=¿3“µ>=¿ï‡D@ @@ s ÿÿÿÿÿ ÿÿ ÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¾¾¾¾ B
    q|Ò~i 89 S ¢1 T 0& 4= p ú~*?u„¿=ÌL¸= >üý f üý £ ýý w ýý À þý ƒ þý Ù þ € ÿý „ ÿý å ÿ Š ý { Þ ý ¨ ˆ ý j Ç ý   { © þ Ž h ‹ M 1 5L 2 j G K d F I T A J Á < [ G 9
    36
    ð 5 ` 2 3 7 2 . ‰ - o k + _  * 0 ) x( º
    ( ! ñ-' B : & - 0& n : % . £ % /  % 0 % 1 ‹ $ " .# I / ! Z , u ( # G $ Þ ± N c M d
    K b
    t
     o : J  A 1 I 0 [ R / ÿ 0 - £ X f j @ < Y Tm ÿ lÿ W ] ÿ Z ‹ þ 1 t ú ? 8 ù 1
    ö L ð Á ï ˆ ï [ – î #&î J M í ¬í { F ë _ ã Vã B C à A Q à X _ ß w , Þ ? [ Þ @ ` É % g
    This is my configuration for the tera term:
    This is the settings for the log file:
    Are there any errors in my setup?
    How do you interface this tera term serial monitor with python?
    Thank you for your assistance.
  • Hi Alec,

    Thank you for your reply.

    I have used the following python program to get the value from the sensor COM port.

    -------------------------------------------------------------------------------------------------------

    import serial
    from serial.serialutil import Timeout

    comport = input("The comport for your standard comport : ")

    ser = serial.Serial(comport, 921600)

    while True:
        byteCount =ser.inWaiting()
        s = ser.read(byteCount)
        print(s)
    -------------------------------------------------------------------------------------------------------
    I have tried to log via tera term but cant seem to be able to get the binary data from the sensor.
    The output is as follows:
    À=¥:@ @@ l ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¾¾¾¾ B
    g“9~a 79 S ,1 ¥ Š( «$ ^ ú~*?u„¿=ÌL¸= >ýý ª þý f þ  þ ‚ ÿ j ÿ Ñ ÿ “ Ò ý ’ • à ÿ ˆ « ÿ r  M 1 IL A - K 2 T F I = F K R A J ž < [ B 8 \ < 7
    õ 7
    g3 7 3
    M2 / O 1 . ‹ , o T * 1 * _ D ) y( '
    ( ! ×.& - 9& n . % . Ñ % /  % 0 % 1 } % B ? $ " - # K $ â N : — M I O / b (
    K v
    i J h A - [ B / ñ 0 - ‚ @ 9 X l Y ˜ ÷ÿ #þ 1 q þ W Z þ Z p ú ? 6 ù Ä
    ö Q ð Ç ï  î "$î [ ¹ î { 9 í í I C í J z ë b ä B - ã ’ß @ b ß A i ß w * Þ ? K Ó z 8 Ë N , É % h É y H Å d ? à w , À í » 3 º [ Ó · 6 ± ^ 2 L î53½Ne@|
    <¬¼¾>_·<œ¤¾uˆ–Aº nÀ3“µ>º nÀ‰C=¿3“µ>=¿ï‡D@ @@ s ÿÿÿÿÿ ÿÿ ÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¾¾¾¾ B
    q|Ò~i 89 S ¢1 T 0& 4= p ú~*?u„¿=ÌL¸= >üý f üý £ ýý w ýý À þý ƒ þý Ù þ € ÿý „ ÿý å ÿ Š ý { Þ ý ¨ ˆ ý j Ç ý   { © þ Ž h ‹ M 1 5L 2 j G K d F I T A J Á < [ G 9
    36
    ð 5 ` 2 3 7 2 . ‰ - o k + _  * 0 ) x( º
    ( ! ñ-' B : & - 0& n : % . £ % /  % 0 % 1 ‹ $ " .# I / ! Z , u ( # G $ Þ ± N c M d
    K b
    t
     o : J  A 1 I 0 [ R / ÿ 0 - £ X f j @ < Y Tm ÿ lÿ W ] ÿ Z ‹ þ 1 t ú ? 8 ù 1
    ö L ð Á ï ˆ ï [ – î #&î J M í ¬í { F ë _ ã Vã B C à A Q à X _ ß w , Þ ? [ Þ @ ` É % g
    This is my configuration for the tera term:
    This is the settings for the log file:
    Are there any errors in my setup?
    How do you interface this tera term serial monitor with python?
    TI's mmwave demo also uses python to read the data. How does TI able to avoid/handle such cases?
    Thank you for your assistance.
  • Hi,

    Okay, so lets focus on the python testing for now. Are you looking to just read in the UART stream and write it to a file, or are you looking to parse the data within your script? If You are just writing the data, then the lines you showed above should be sufficient once you add in write to file. 

    If you are looking to parse the frame in your script you can look at the visualizer which is included in the People Counting folder of the Industrial Toolbox, as that has all the parsing capabilities built in.

    To quickly give a rundown of how to parse the frame:

    • I would recommend you first look for the magic word. In my python parser scripts, I look for the pattern 
      • MAGIC_WORD = bytearray(b'\x02\x01\x04\x03\x06\x05\x08\x07')
      • This ensures you always start parsing from the start of a frame
    • Read in the frame header, which is the same pattern for every frame.
      • Make sure to get the number of TLV's for the frame from this header
    • Loop and parse each TLV
      • First grab the TLV header, which will tell you the type and length
      • For any TLV's which you dont want to parse, you can skip to the next one
      • For any TLV's you DO want to parse, you will need to add the parsing of that TLV based on the defined format in the lab

    Best Regards,
    Alec

  • Hi Alec,

    I am looking to read and to decipher the data.

    Would the deciphering of the data be affected if there were presence of these undefined characters such as '\n' and '\xca`a'.

    I would like to try to decipher to create a different user interface for myself.

  • Hi,

    Please keep in mind that the data only appears as such since you are viewing it in a program which is displaying the hex/bin data as ascii/unicode. If you were to view the bin file you received from teraterm in a program which supports hex/bin file viewing/editing, you would not see these discrepancies. 

    Best Regards,
    Alec