I have a Raspberry Pi B and a Raspberry Pi 3. I am trying to get the Raspberry Pi 3's serial port working. I have put a jumper across pins 8 and 10 to check the serial port is working.
I've executed the following code:
import serial
import time
port = serial.Serial("/dev/ttyS0", baudrate = 9600, timeout = 2)
port.write("test data")
time.sleep(1)
rcv = port.read(9)
print "received", rcv
My problem is that I'm not receiving anything.
I have tried the same code on /dev/ttyAMA0 on the Pi B and it works fine.
I have disabled the console from using the serial port in raspi-config and rebooted.
What could I be doing wrong?
enable_uart=1
in/boot/config.txt
. – Dmitry Grigoryev Aug 08 '17 at 16:15