Different output data USB-RS232 with Pyserial in windows and jetson nano

I’ll let you know in advance that I’m not a programmer, but I’m developing an application to automatically collect weights with a scale. The issue I’ve encountered is that with the same Python source code, when reading data from the serial port in Windows, I correctly read the data even if it’s in a binary string. However, on the Jetson Nano running Ubuntu, it returns the following value. Same source code.

CODE:

import serial

ser = serial.Serial(
    port='COM4',  # in Jetson nano '/dev/ttyUSB0'
    baudrate=9600,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS,
)

while True:
    x=ser.readline()    
    print(x)

OUTPUT WINDOWS:

b'\\x0cN:         3.344g  \\r\\n'

OUTPUT JETSON NANO:

b'\\x08\\x01\\x0c\\x0e\\t\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x02\\x1a\\x12\\t\\x13\\x13\\x16\\x02\\n

How can I convert output jetson nano in a output windows?

Hi Ceres96,

Are you using the devkit or custom board for Jetson Nano?
What’s your Jetpack version in use?

Do you think the issue is relating to the OS?
If so, have you also tried with the Ubuntu host PC?

Or is it an issue about HEX and ASCII output?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.