Traducido del English por IA ·
Peleé con la placa de expansión del Edison para un laboratorio el año pasado. Abrir /dev/ttyMFD1 no basta en esa placa: los pines 0 y 1 pasan por un multiplexor de pines y los convertidores de nivel, y hasta que se configuran la UART no está conectada al conector, los pines son GPIO normales. Por eso se abre sin problemas pero no lee nada.La forma sencilla es la biblioteca mraa, que configura el multiplexor por usted al abrir la UART por su número de placa:
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"])
Compruebe también que el cableado está cruzado: TX de la OpenMV al RX del Edison (pin 0), RX de la OpenMV al TX del Edison (pin 1). El pin 0 es RX en la placa de expansión, así que si lo que escribió es exactamente como está cableado, intercámbielos.
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.

