import serial
ser = serial.Serial(‘/dev/ttyS1’) # open serial port
print(ser.name) # check which port was really used
ser.write(b’hello’) # write a string
ser.close() # close port
Try /dev/ttyS0, assuming your pin is connected to GPIOA16, GPIOA17 and ground, if not, try switching A17 and A16. I just tried echo ‘hello’ > /dev/ttyS0 and it works. I have adafruit ttl usb 3.3v connected to 16, 17 and ground. Also with UART tutorial, boot without ttl usb then plugin ttl usb otherwise it doesnt work, see note in the link at the end of the article uart
I just tried you code and it works for me, my Linux terminal is set at 9600 baud, you can find your milkv duo setting in python by executing ser return and it will return the baud rate, see picture link below