Von English mit KI übersetzt ·
Ich habe mich letztes Jahr für ein Labor mit dem Edison-Breakout herumgeschlagen. Das Öffnen von /dev/ttyMFD1 reicht auf dieser Platine nicht aus: Die Pins 0 und 1 laufen über einen Pin-Multiplexer und die Pegelwandler, und solange diese nicht eingerichtet sind, ist die UART gar nicht an die Header-Leiste angeschlossen, die Pins sind reines GPIO. Deshalb lässt sie sich problemlos öffnen, liest aber nichts.Der einfache Weg ist die mraa-Bibliothek, die beim Öffnen der UART über ihre Board-Nummer den Mux für Sie setzt:
import mraa
u = mraa.Uart(0) # pins 0/1 on the Arduino breakout, sets the mux
u.setBaudRate(115200)
u.setMode(8, mraa.UART_PARITY_NONE, 1)
while True:
if u.dataAvailable(1000):
line = u.readStr(64).strip() # "caps_ok=1823;caps_rej=12"
vals = dict(kv.split("=") for kv in line.split(";"))
# add to the payload the Edison already sends:
payload["caps_ok"] = int(vals["caps_ok"])
payload["caps_rej"] = int(vals["caps_rej"])
Prüfen Sie außerdem, ob die Verkabelung gekreuzt ist: OpenMV TX an RX des Edison (Pin 0), OpenMV RX an TX des Edison (Pin 1). Pin 0 ist auf dem Breakout RX, also tauschen Sie die Leitungen, falls Ihre Verkabelung genau so ausgeführt ist, wie Sie sie beschrieben haben.
I fought the Edison breakout for a lab last year. Opening /dev/ttyMFD1 isn’t enough on that board: pins 0 and 1 go through a pin multiplexer and the level shifters, and until those are set up the UART isn’t connected to the header at all, the pins are plain GPIO. That’s why it opens fine and reads nothing.
The easy way is the mraa library, which sets the mux for you when you open the UART by its board number:
import mraa
u = mraa.Uart(0) # pins 0/1 on the Arduino breakout, sets the mux
u.setBaudRate(115200)
u.setMode(8, mraa.UART_PARITY_NONE, 1)
while True:
if u.dataAvailable(1000):
line = u.readStr(64).strip() # "caps_ok=1823;caps_rej=12"
vals = dict(kv.split("=") for kv in line.split(";"))
# add to the payload the Edison already sends:
payload["caps_ok"] = int(vals["caps_ok"])
payload["caps_rej"] = int(vals["caps_rej"])
Also check the wiring is crossed: OpenMV TX to the Edison’s RX (pin 0), OpenMV RX to the Edison’s TX (pin 1). Pin 0 is RX on the breakout, so if what you wrote is exactly how it’s wired, swap them.

