I want to communicate between Jetson nano and arduino nano through serial.
I wrote a simple script to test functionality but I receive strange data
here is the arduino code
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("work fine");
delay(10000);
}
and this is the python code run on jetson nano
import serial
import time
arduino = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
while True:
try:
data = arduino.readline()
if data:
print(data)
print('Hi Arduino')
except:
arduino.close
the output is
b'\x17\x0f\t\x0b\x01\x06\t\x0e\x15\r\n'
Hi Arduino
if tried different baud rates but nothing change.
when is use serial monitor on windows it works fine.
77, 6F, 72, 6B, 20, 66, 69, 6E, 65, 0D, 0A
and the Jetson receives17, 0F, 09, 0B, 01, 06, 09, 0E, 15, 0D, 0A
... possibly a speed mismatch, or the data buffer is being swamped by incoming data