I'm trying to have a Beaglebone Black Wireless(debian image 2017-07-01) communicate to another device using UART serial communication. In an example program, the bone waits for the device to send the letter "A", then, upon receiving the right letter, outputs a message and transmits the letter "B". The pins used for transmitting and receiving are "P9_24" and "P9_26" respectively. Here is the following program:
import Adafruit_BBIO.UART as UART
import serial
#Enabling the serial ports
UART.setup("UART1")
#Serial setup values
ser = serial.Serial()
ser.port = "/dev/ttyO1"
ser.baudrate = 9600
READ_LEN = 1
ser.close()
rx = ""
while True:
print "Waiting for A... "
ser.open()
rx = ser.read()
ser.close()
if (rx == 'A'):
print "Got it!"
ser.open()
ser.write("B")
ser.close()
breakThe program doesn't throw any errors, however, when testing it out with the device, the program gets stuck on the "Waiting for A" line. I have thoroughly checked that all connections are correct and that the other device is sending data. Additionally, the program runs perfectly on an older Beaglebone (debian image 2015-11-12).
Any help into this matter would be greatly appreciated.