I am getting b'\x00\x00\x00 ... ' together with the data I want. For example, my Arduino is writing 'hello raspberry' to RPi. At the RPi, it receives 'b'\x00\x00\x00 ... hello raspberry\r\n '. Why?
Here's my coding at RPi:
ser=serial.Serial(port='/dev/ttyS0', baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_TWO, bytesize=serial.EIGHTBITS)
while True:
x = ser.readline()
print(x)
Whereas at Arduino Mega:
void setup()
{
Serial3.begin(9600);
}
void loop()
{
Serial3.println("hello raspberry");
}
ONE
in this case). – goldilocks Jun 21 '18 at 12:40/dev/serial0
in all code. See How-do-i-make-serial-work-on-the-raspberry-pi3 Unless you list your code who knows? – Milliways Jun 22 '18 at 04:36