I want to send/receive data between PC and Pi-Zero over USB port near PWR port.
I followed the instructions here https://www.tal.org/tutorials/raspberry-pi-zero-usb-serial-console But I don't enable
Pi appears as a serial device on Device Manager in Windows with port
COM13
. I wrote two scripts that will run on each side. On pc I have,
port = serial.Serial(port='COM13', baudrate=115200,)
while True:
num = port.write('hi\n')
print num
time.sleep(1)
This script successfully opens COM port and prints the number of bytes which is 3 bytes in this case.
On Pi zero,
/dev/ttyAMA0
appears as a serial device. And the code,
port = serial.Serial(port='/dev/ttyAMA0', baudrate=115200,)
rec = port.read(3)
print rec
which opens the port successfully but outputs nothing, gets stuck in port.read
instruction. What am I missing here?
putty
... do same in linux .... that way you can change the settings easily, such as the baud rate