简体   繁体   English

Beaglebone Black Wireless:UART未读取

[英]Beaglebone Black Wireless: UART isn't reading

I'm trying to have a Beaglebone Black Wireless(debian image 2017-07-01) communicate to another device using UART serial communication. 我正在尝试让Beaglebone Black Wireless(debian图像2017-07-01)使用UART串行通信与另一台设备通信。 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". 在示例程序中,骨骼等待设备发送字母“ A”,然后在接收到正确的字母后输出消息并发送字母“ B”。 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()
        break

The program doesn't throw any errors, however, when testing it out with the device, the program gets stuck on the "Waiting for A" line. 该程序不会引发任何错误,但是,当使用设备对其进行测试时,该程序将停留在“等待A”行中。 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). 此外,该程序可以在较旧的Beaglebone上完美运行(debian图像2015-11-12)。

Any help into this matter would be greatly appreciated. 任何对此事的帮助将不胜感激。

config-pin "Whatever Pin You Are Using" uart config-pin“您正在使用的任何引脚” uart

example: 例:

config-pin P9.14 uart 配置引脚P9.14 uart

Seth 赛斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM