2026-07-31 23:46:37 -07:00
|
|
|
# Board examples
|
|
|
|
|
|
|
|
|
|
These examples connect a MicroPython board to the hardware UART exposed by a
|
|
|
|
|
Meshtastic radio. The radio must have its serial module enabled in `PROTO` mode at
|
|
|
|
|
115200 baud.
|
|
|
|
|
|
|
|
|
|
| Board | Example | MicroPython UART | TX pin | RX pin |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
|
|
|
|
| Seeed Studio XIAO RP2040 | `xiao_rp2040.py` | UART0 | D6 / GPIO0 | D7 / GPIO1 |
|
|
|
|
|
| Raspberry Pi Pico / Pico W | `raspberry_pi_pico.py` | UART0 | GP0 | GP1 |
|
|
|
|
|
| Generic ESP32 | `esp32.py` | UART2 | GPIO17 | GPIO16 |
|
|
|
|
|
|
2026-08-01 00:46:04 -07:00
|
|
|
## Desktop curses dashboard
|
|
|
|
|
|
|
|
|
|
`curses_dashboard.py` is a host-side dashboard for macOS or Linux. It displays
|
|
|
|
|
connection statistics, known nodes, and received messages, and it can send broadcast
|
|
|
|
|
messages. It can connect directly to a radio or through a XIAO RP2040 UART bridge.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
python -m pip install -e . pyserial
|
|
|
|
|
python examples/curses_dashboard.py /dev/cu.usbmodem123456
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For a radio wired to a XIAO RP2040, first install the bridge as the XIAO's boot script:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
mpremote connect /dev/cu.usbmodem2101 fs cp examples/xiao_dashboard_bridge.py :main.py
|
|
|
|
|
mpremote connect /dev/cu.usbmodem2101 reset
|
|
|
|
|
python examples/curses_dashboard.py --xiao-bridge /dev/cu.usbmodem2101
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Do not run `mpremote` at the same time as the dashboard; only one program can own the
|
|
|
|
|
XIAO USB serial port. To return to the regular example, replace `main.py` with
|
|
|
|
|
`xiao_rp2040.py`.
|
|
|
|
|
|
|
|
|
|
Use `mpremote connect list`, `python -m serial.tools.list_ports`, or your operating
|
|
|
|
|
system's device list to find the radio port. The message field is always active: type
|
|
|
|
|
and press Enter to send. Use Escape to clear it, F5 to refresh, and F10 to quit.
|
|
|
|
|
`Ctrl-R` and `Ctrl-Q` are also supported. On Windows, install `windows-curses` and use
|
|
|
|
|
a port such as `COM4`.
|
|
|
|
|
|
2026-07-31 23:46:37 -07:00
|
|
|
## Wiring
|
|
|
|
|
|
|
|
|
|
UART signals cross between the two boards:
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
MicroPython board TX -> radio RX
|
|
|
|
|
MicroPython board RX <- radio TX
|
|
|
|
|
MicroPython board GND --- radio GND
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Both ends must use 3.3 V UART logic. Do not connect the power pins unless you have
|
|
|
|
|
confirmed the voltage and current requirements for both boards. Meshtastic radio UART
|
|
|
|
|
pin names vary by model and may need to be configured in the radio firmware.
|
|
|
|
|
|
|
|
|
|
## Run an example
|
|
|
|
|
|
|
|
|
|
Install MicroMesh, copy the matching example to the board as `main.py`, and reset it:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
mpremote mip install package.json
|
|
|
|
|
mpremote fs cp examples/xiao_rp2040.py :main.py
|
|
|
|
|
mpremote reset
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Each example requests the node configuration, listens for text messages, and broadcasts
|
|
|
|
|
one greeting after configuration completes. Remove the `mesh.sendText(...)` line for a
|
|
|
|
|
receive-only application.
|