ota: extract the motatool CLI to its own repo (github.com/vk496/motatool)

The host-side build/verify/inspect/serve CLI now lives as a standalone Rust
project at https://github.com/vk496/motatool. Remove the in-tree C++ copy
(tools/motatool/) and repoint the docs (ota_protocol.md, ota_user_guide.md,
tools/mota/README.md) at the standalone repo.

No cross-dependency either direction: MeshCore's firmware build never invoked
motatool (only tools/mota/ Python glue runs in the build), and motatool depends
only on the shared .mota wire spec in docs/ota_protocol.md. tools/mota/
(pio_endf.py EndF hook, motalib.py reference lib, gen_targets.py) is unchanged.
This commit is contained in:
Valentin Kivachuk Burda committed 2026-07-11 14:47:11 +02:00
1 parent ee6e548746
commit 872413231d
18 files changed
+14 -2386

No files matched your search

+3 -3
View File
@@ -33,7 +33,7 @@ where a section names a source file, that file is the authoritative reference fo
| Staging stores | `OtaStore.h`, `OtaStoreFlashNrf52.*`, `OtaStoreFlashEsp32.*` |
| Apply | `OtaApply.*`, bootloader `Adafruit_nRF52_Bootloader_OTAFIX` |
| Device glue (CLI/context) | `OtaCli.cpp`, `OtaContext.h` |
| Host tooling | `tools/motatool/` (C++ CLI: build/verify/inspect/serve); `tools/mota/` (Python reference lib `motalib.py` + build/test glue) |
| Host tooling | [`motatool`](https://github.com/vk496/motatool) (standalone Rust CLI: build/verify/inspect/serve); `tools/mota/` (Python reference lib `motalib.py` + build/test glue) |
---
@@ -540,8 +540,8 @@ blocks) and streams payload blocks from the source on demand; proofs are generat
A `MotaSource` is fed by a host that serves a folder over the device's **USB serial** (the same console the
CLI uses — no extra hardware) or, on an ESP32 WiFi companion, over **WiFi (TCP)**. The host is the
self-contained C++ tool `tools/motatool/` (`motatool serve --serial <port>` / `--tcp <host[:port]>`, which
also builds + validates `.mota` and runs on small hardware). The device only emits request frames *while
standalone Rust tool [`motatool`](https://github.com/vk496/motatool) (`motatool serve --serial <port>` /
`--tcp <host[:port]>`, which also builds + verifies + inspects `.mota`). The device only emits request frames *while
actively serving a fetch*, and reads the reply synchronously, so over the shared USB console binary frames
coexist with the text CLI/logs (resync on magic + checksum). Little-endian, XOR-checksummed:
+7 -6
View File
@@ -203,19 +203,20 @@ folder of firmware files to the mesh — without storing them itself. Useful for
remote area.
1. Put the firmware files (`.mota` files — see below) in a folder on the computer.
2. Build the helper tool once (`tools/motatool/`), then point it at your node and the folder — over the
node's **USB serial**, or over **WiFi** if it's an ESP32 companion on your network:
2. Install the helper tool once — the standalone `motatool` CLI (<https://github.com/vk496/motatool>) —
then point it at your node and the folder — over the node's **USB serial**, or over **WiFi** if it's
an ESP32 companion on your network:
```
cmake -S tools/motatool -B tools/motatool/build && cmake --build tools/motatool/build
git clone https://github.com/vk496/motatool && cargo install --path ./motatool
# over USB serial:
./tools/motatool/build/motatool serve --dir ./my_firmware/ --serial /dev/ttyACM0 -v
motatool serve --dir ./my_firmware/ --serial /dev/ttyACM0 -v
# …or over WiFi (ESP32 companion): the seeder is on a DEDICATED port (5001), separate from the
# phone-app port (5000), so a phone can stay connected while you serve:
./tools/motatool/build/motatool serve --dir ./my_firmware/ --tcp 192.168.1.50:5001 -v
motatool serve --dir ./my_firmware/ --tcp 192.168.1.50:5001 -v
```
It answers the node's requests; your node then advertises those updates to neighbours, who can
`ota get` them like any other. (A WiFi node prints its IP + seeder port to the serial log on connect.
Details: [tools/motatool/README.md](../tools/motatool/README.md).)
Details: <https://github.com/vk496/motatool>.)
To stop, just stop the daemon — over WiFi the node auto-detaches when the connection closes; over USB you
can also run `ota folder off` on the node. `ota folder` on its own lists what your node is offering.