Files
MeshTerm/scripts/README.md
T
Jean-Pierre MartineauandClaude Fable 5.1 ec21d03c03 The SPI bridge drives openhop_core, and stands its shims down where the library caught up
pymc_core was renamed openhop_core in 2026 and the current meshcore-uconsole
package depends on the new name, so a bridge that only knew the old one failed
its own preflight on a fresh install. It now finds either runtime, newest first
(an interpreter with openhop_core beats an earlier candidate with pymc_core;
MESHTERM_PYMC_PYTHON still overrides), imports through the name it found, and
lets two of its three compat shims stand down under openhop_core, which accepts
long ACK payloads and pushes completed trace replies itself; pushing a trace
twice was the alternative. The raw RX-log push is still the bridge's.

What the port found on the device shaped the rest. The 1.12.0 .deb is built for
trixie against Python 3.13 and cannot run on a bookworm uConsole, so the bridge
looks first in a venv of its own (~/.local/share/meshterm-spi-bridge/venv, made
with openhop-core[hardware]) and, without the GUI's helpers there, configures
the radio itself with the uConsole AIO preset rather than the runtime's
Waveshare defaults (TX-enable on pin 6, no DIO2 switch, no TCXO -- deaf on the
AIO), every MESHCORE_* knob the GUI reads honoured and passed only where the
constructor accepts it. It also loads the GUI's identity key first, so a bridge
in its own venv is still the same node. Verified on the uConsole: openhop-core
1.1.3, radio up, 159 contacts restored, info and contacts answered over TCP,
and the boot service now runs from that venv. The manual and the index say all
of this instead of the rename warning.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 01:29:28 -04:00

4.0 KiB
Raw Blame History

scripts

Device-side helpers that put MeshTerm on real hardware: bringing up a ClockworkPi PicoCalc (Luckfox Lyra, Calculinux) and building its console font, giving that handheld a real MeshCore radio over UART, and fronting an SPI-attached LoRa chip as if it were a companion device. They run on the device, most of them as root, and they are meant to be read before they are run.

docs/hardware.md is the manual — what each target is, what the scripts assume about the machine, why each step is the way it is, and what has only ever been proven on one bench. Start there and pick your target; the table below is the index.

File Runs on What it does
calculinux-setup.sh the Lyra (root) One-time bring-up: python packages, the Wi-Fi boot-scan kick, a boot clock sync (there is no RTC), the deploy user, the checkout, the venv and pip install -e ., the login PATH, and the console font. Idempotent.
calculinux-console-font.sh the Lyra (root) Just the console font: builds, installs and persists the 512-glyph meshterm PSF (braille, node marks, rounded frame corners, the list cursor) and restores the stock 16-slot palette. Calls the 6×8 build below when it sits alongside. Run it alone after a MeshTerm update.
calculinux-console-font-6x8.sh the Lyra (root) The shorter-cell companion font, meshterm8 (6×8 → 53×40), for anyone who wants more rows than the 6×12 default gives. Its base bitmap is the kernel's font_6x8, so this one file and the PSF it builds are GPL-2.0-only (LICENSE.GPL-2.0); it reads the donor/alias/keeper tables out of the script above rather than keeping a second copy. Pick between the two fonts from MeshTerm's Preferences page.
calculinux-wifi-set.sh the Lyra (sudo) Interactive Wi-Fi join: prompts for an SSID and passphrase, writes iwd's credentials, connects now. This is how a network becomes known to the boot kick.
calculinux-radio-bridge.sh the Lyra (root) Unfinished, unsupported. An early UART-to-TCP pump, superseded by xiao-radio/lyra-setup.sh; its header describes routing it does not contain. See the manual before reading it.
meshterm-spi-bridge the radio host (your user) Runs a mesh node in software over an SPI-attached SX1262 (uConsole AIO, Waveshare HATs) and serves the companion protocol on 127.0.0.1:5000. Setup menu, preflight, optional systemd --user service. Runs on openhop_core (preferred) or its predecessor pymc_core; see the manual for the venv it wants on a bookworm uConsole.
xiao-radio/ see below Everything for the XIAO nRF52840 + Wio-SX1262 radio wired to the Lyra's UART1.
xiao-radio/build-firmware.sh dev machine Clones and patches MeshCore, builds the Xiao_nrf52_companion_radio_serial environment, emits the .uf2.
xiao-radio/flash.py dev machine Flashes the .uf2 to the XIAO over its UF2 bootloader, refusing the wrong board or SoftDevice; prints the serial-DFU command when the bootloader offers no drive.
xiao-radio/meshcore-uart1.patch — The two firmware hunks: the companion on nRF52 Serial1, and I²C moved off the UART pads. Not upstream yet.
xiao-radio/lyra-setup.sh the Lyra (root) Boot-persistent UART1 → GP4/GP5 mux service, dialout membership, and a default MeshTerm serial profile for /dev/ttyS1.
xiao-radio/uart1-mux.py the Lyra (root) The matrix-IO register poke that routes UART1 to the header pads, run once per boot by the service above.

The PicoCalc scripts and the SPI bridge belong to different machines and share nothing but MeshTerm. On the Lyra, only one program may hold /dev/ttyS1 — MeshTerm directly, or a pump in front of it, never both.