diff --git a/CLAUDE.md b/CLAUDE.md index e04c792..1d6ad14 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -743,9 +743,12 @@ derived sweep that runs **every** registered command twice, once plain and once One codebase, three flavours: **regular** (desktop/ssh, 72 cols, truecolor, emoji), **picocalc-lyra** (the PicoCalc's 53×26/53×40 framebuffer console, 16 palette slots, a -512-glyph font, no emoji), and **cardputer-zero** (M5Stack's Cardputer Zero, 53×14 in 6×12 -cells on a 320×170 panel MeshTerm paints itself, truecolor, no emoji — hardware not -yet in hand, so it is chosen by flag only). +512-glyph font, no emoji), and **cardputer-zero** (M5Stack's Cardputer Zero, both the +standard model and the Lite, 53×14 in 6×12 cells on a 320×170 panel MeshTerm paints +itself, truecolor, no emoji — chosen by flag only: its device-tree model is the CM0's +generic string, so MeshTerm's own console passes the flag). Never hot-swap a Cap on it, +the LoRa one included: M5Stack says it may make the device malfunction, so the docs say +to power off first. A frozen `Platform` spec (`meshterm/platforms.py`) resolves once at boot; consumers bind at platform-switch time via `platforms.on_platform` — never branch on the platform per frame, and never `from meshterm.platforms import PLATFORM`. diff --git a/README.md b/README.md index 6752509..eb60995 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,10 @@ https://github.com/user-attachments/assets/f91a6695-14d5-4ae0-8fdc-e65492d0955d
The dashboard, the map, a trace, the paths of a message, and the whole app on a PicoCalc.
+
+
+
The dashboard, the map, a trace, the paths of a message, the whole app on a PicoCalc, and the start screen on a Cardputer Zero.
--- @@ -198,6 +201,7 @@ mesh. You can look at the app before you buy anything. ### On the Cardputer Zero Install MeshTerm from M5Stack's app store on the handheld. Its share code is `MTRM`. +MeshTerm works on both models, the Cardputer Zero and the Cardputer Zero Lite. [MeshTerm on the Cardputer Zero](docs/devices/cardputer-zero.md) has the details. ### Coming @@ -248,6 +252,10 @@ meshterm --mock # custom console font, and an F-key hint lane. Preview it anywhere, or inspect it: meshterm --mock --platform picocalc-lyra meshterm specimen + +# On a Cardputer Zero, MeshTerm draws its 53×14 display itself. See that display in a +# window of its own (download its font once with `meshterm emulate --fetch-fonts`): +meshterm emulate cardputer-zero --mock ``` MeshTerm has its own manuals for handhelds. **[MeshTerm on the diff --git a/docs/README.md b/docs/README.md index f8fb768..7064c4d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -37,7 +37,7 @@ MeshCore companion on USB, Bluetooth, or Wi-Fi does not need them. | **[MeshTerm on hardware](devices/README.md)** | Start here. It says which of the manuals below is the correct one for you, and what the scripts on the device do. | | [MeshTerm on the PicoCalc](devices/picocalc-lyra.md) | How to change a stock ClockworkPi PicoCalc into a Linux handheld that has a LoRa radio soldered inside: the shopping list, the change to a Luckfox Lyra core, Calculinux, and the radio. | | [MeshTerm on the uConsole](devices/uconsole.md) | A uConsole (CM4 or CM5) with the hackergadgets AIO LoRa board. Its SX1262 is on the computer's own SPI bus. MeshTerm can control it directly with `--spi`. Or a small bridge can make it a companion for a node that is always on. | -| [MeshTerm on the Cardputer Zero](devices/cardputer-zero.md) | M5Stack's Linux Cardputer: how to install MeshTerm from the app store, use the Cap LoRa-1262 radio, and try the layout in the desktop emulator. | +| [MeshTerm on the Cardputer Zero](devices/cardputer-zero.md) | M5Stack's Linux Cardputer, the standard model or the Lite: how to install MeshTerm from the app store, use the Cap LoRa-1262 radio, and try the layout in the desktop emulator. | ## Reading the code diff --git a/docs/devices/README.md b/docs/devices/README.md index aedbea8..a3ba764 100644 --- a/docs/devices/README.md +++ b/docs/devices/README.md @@ -15,7 +15,7 @@ has its own manual with numbered steps. This page tells you which manual is your | a ClockworkPi **PicoCalc**, stock or already running Calculinux on a Luckfox Lyra, and I want MeshTerm on its own display | **[MeshTerm on the PicoCalc](picocalc-lyra.md)**: from the shopping list to a working machine | | …and I want a **radio** inside it | the same manual, [Phase 3](picocalc-lyra.md#phase-3-add-the-radio): a XIAO nRF52840 + Wio-SX1262 soldered to the UART of the Lyra | | a ClockworkPi **uConsole** with the hackergadgets AIO board (an SX1262 on the SPI bus of the host) | **[MeshTerm on the uConsole](uconsole.md)**: MeshTerm drives the radio directly with `--spi`. A bridge service can also present the radio as a companion, if you want it always on | -| an M5Stack **Cardputer Zero**, the one with a Raspberry Pi inside (not the ESP32 Cardputer or the Cardputer-Adv) | **[MeshTerm on the Cardputer Zero](cardputer-zero.md)**: install MeshTerm from M5Stack's app store. MeshTerm drives the Cap LoRa-1262 directly, or it uses a companion | +| an M5Stack **Cardputer Zero** or **Cardputer Zero Lite**, the models with a Raspberry Pi inside (not the ESP32 Cardputer or the Cardputer-Adv) | **[MeshTerm on the Cardputer Zero](cardputer-zero.md)**: install MeshTerm from M5Stack's app store. MeshTerm drives the Cap LoRa-1262 directly, or it uses a companion | | a MeshCore companion on USB, Bluetooth, or Wi-Fi | nothing here. Read the [README](../../README.md). If the companion does not connect, read [When a companion does not connect](../guide/connecting.md) | The handhelds have nothing in common except MeshTerm. Each manual runs scripts on the diff --git a/docs/devices/cardputer-zero.md b/docs/devices/cardputer-zero.md index d69dc4b..f32c7a7 100644 --- a/docs/devices/cardputer-zero.md +++ b/docs/devices/cardputer-zero.md @@ -7,7 +7,8 @@ this page applies to them. MeshTerm is an app in M5Stack's app store for the Cardputer Zero. It starts from the launcher of the handheld and draws on its display. It can drive M5Stack's Cap LoRa-1262 -radio directly, or it can use a MeshCore companion. +radio directly, or it can use a MeshCore companion. MeshTerm supports both models of the +handheld: the Cardputer Zero and the Cardputer Zero Lite. - [The device](#the-device) - [What works](#what-works) @@ -21,11 +22,18 @@ radio directly, or it can use a MeshCore companion. | | | | --- | --- | +| Models | Cardputer Zero (C154) and Cardputer Zero Lite (C155). MeshTerm supports both | | Computer | Raspberry Pi Compute Module 0: four 1 GHz cores, 512 MB of memory | | Screen | 1.9 inches, 320×170 pixels | | Keyboard | 46 keys, with Shift, Fn and Sym layers | | System | Raspberry Pi OS "Trixie", with M5Stack's own app launcher | +The two models have the same computer, display, keyboard, battery, and expansion header. +The Cardputer Zero also has a camera, motion sensors, and a 32 GB microSD card. MeshTerm +uses none of these three parts, thus it works in the same way on both models. The Lite +comes without a microSD card. It needs a card with M5Stack's system on it before it can +start (refer to [M5Stack's documentation](https://docs.m5stack.com/en/CardputerZero)). + MeshTerm draws the display in 53 columns by 14 rows. The width is the same as on the PicoCalc, but the height is approximately half. Thus many screens have a more compact layout here. @@ -177,8 +185,18 @@ The Cardputer Zero has no LoRa radio built in. You can add one in three ways: ### The Cap LoRa-1262 -1. Push the Cap onto the expansion header at the back. -2. Start MeshTerm. +**CAUTION:** Turn off the Cardputer Zero before you install or remove a Cap, also the Cap +LoRa-1262. M5Stack does not support hot swapping of a Cap on the Cardputer Zero. In +M5Stack's words, "hot-swapping may cause the device to malfunction" (refer to +[M5Stack's documentation](https://docs.m5stack.com/en/CardputerZero)). + +**CAUTION:** Install the antenna on the Cap before you turn on the Cardputer Zero. M5Stack +says that power without the antenna can permanently damage the radio. + +1. Turn off the Cardputer Zero. +2. Install the antenna on the Cap. +3. Push the Cap onto the expansion header at the back. +4. Turn on the Cardputer Zero, and start MeshTerm. The device screen lists the Cap as **Cap LoRa-1262**. `meshterm --spi` also reaches it from the command line. @@ -189,7 +207,7 @@ radio library. The package from the store has it. If you install MeshTerm with p install the library next to it: ```bash -pip install 'mesh-term[spi]' +pip install 'mesh-term[spi] @ git+https://github.com/jpmartineau/MeshTerm' ``` When MeshTerm connects, it does three things that the Cardputer Zero needs before the @@ -202,7 +220,8 @@ radio answers: - It switches on the antenna path of the Cap. When MeshTerm quits, it switches the power of the header off. Thus the Cap does not drain -the battery while nothing uses it. +the battery while nothing uses it. But this does not make it safe to remove the Cap. Turn +off the Cardputer Zero first. A new node starts with the US/Canada settings of MeshCore (910.525 MHz). In other regions, change the settings on **Device config** before you send anything. MeshTerm keeps the key, diff --git a/docs/devices/uconsole.md b/docs/devices/uconsole.md index 39756cb..736903e 100644 --- a/docs/devices/uconsole.md +++ b/docs/devices/uconsole.md @@ -138,7 +138,7 @@ the route that agrees with how you installed MeshTerm. (refer to [Step 3](#step-3-install-meshterm)): ```bash - pip install 'mesh-term[spi]' + pip install 'mesh-term[spi] @ git+https://github.com/jpmartineau/MeshTerm' ``` - **Do you run the one-file Linux ARM64 build?** It is a single frozen binary, and it @@ -181,7 +181,7 @@ pipx inject mesh-term 'openhop-core[hardware]' Or use `pip`, which adds the radio library as its own extra in one line: ```bash -pip install 'mesh-term[spi]' +pip install 'mesh-term[spi] @ git+https://github.com/jpmartineau/MeshTerm' ``` --- diff --git a/docs/screenshots/cardputer-zero.png b/docs/screenshots/cardputer-zero.png new file mode 100644 index 0000000..42b99b4 Binary files /dev/null and b/docs/screenshots/cardputer-zero.png differ diff --git a/meshterm/assets/pages/about.md b/meshterm/assets/pages/about.md index 1b2f96d..0c87787 100644 --- a/meshterm/assets/pages/about.md +++ b/meshterm/assets/pages/about.md @@ -18,7 +18,7 @@ I wanted something I could run from my computer. I wanted it to run on Windows, ## Platform-specific developments -In addition to a generic terminal setup, I wanted it to run on two devices I had lying around in my nerdcave. +In addition to a generic terminal setup, I wanted it to run on two devices I had lying around in my nerdcave. Then a third one showed up. ### ClockworkPi uConsole MeshTerm is compatible with the **HackerGadgets AIO board (v1 or v2)**. The **AIO** board has just a raw LoRa radio, meaning it can't run MeshCore firmware. MeshTerm can run the mesh node in software itself, straight over the board's SPI bus, for as long as MeshTerm is running — no separate service needed. If you'd rather the node stayed on the mesh while MeshTerm is closed, an optional bridge service can run it all the time instead. @@ -36,6 +36,14 @@ Getting MeshTerm to run on the **PicoCalc** is a bit more involved, but totally The UX is a bit different on the PicoCalc's 16-colour 53-column screen layout, but it's been tailored to make good use of the available space and the PicoCalc's F-keys. The result is, in my humble opinion, the best MeshCore experience you can get on a portable device. It runs on one 18650 battery, and a second one roughly doubles the runtime. +### M5Stack Cardputer Zero +The **Cardputer Zero** is the easiest of the three: MeshTerm is in **M5Stack**'s app store, so installing it takes a few keypresses. Both models work, the standard **Cardputer Zero** and the **Cardputer Zero Lite**. +- Add the **Cap LoRa-1262**, and MeshTerm runs the mesh node itself, straight over SPI, just like on the uConsole. The Cap's GPS works too. +- Power the Cardputer off before you plug in or remove a Cap — the LoRa one included. M5Stack doesn't support hot-swapping Caps, and says it may cause the device to malfunction. +- Put the antenna on the Cap before you power it on. M5Stack warns that the radio can be permanently damaged without it. + +The screen is tiny — 53 columns by 14 rows — so MeshTerm draws every pixel itself, and every screen has been squeezed to fit. The F-key labels run along the bottom of the screen, right above the number keys that press them. It's a mesh terminal that fits in your pocket! + ## What the future holds MeshTerm will evolve over time. It is a work in progress. diff --git a/meshterm/platforms.py b/meshterm/platforms.py index 31b8229..696e73b 100644 --- a/meshterm/platforms.py +++ b/meshterm/platforms.py @@ -274,13 +274,17 @@ PICOCALC_LYRA = Platform( #: The Cardputer Zero of M5Stack. Its display is 320×170 pixels, drawn in cells of 6×12 #: (53×14). Under it is a keyboard of 46 keys, and the number keys 4 to 8 are right below -#: the display. The hardware was not in hand on 2026-10-04. Thus only ``--platform -#: cardputer-zero`` or ``MESHTERM_PLATFORM`` chooses this platform. There is no -#: device-tree auto-detection until the device reports its own model string. +#: the display. Both models are this platform: the Cardputer Zero and the Cardputer Zero +#: Lite. They differ only in parts that MeshTerm does not use (a camera, motion sensors, +#: and a microSD card in the box). Only ``--platform cardputer-zero`` or +#: ``MESHTERM_PLATFORM`` chooses this platform. There is no device-tree auto-detection, +#: because the model string of the handheld is the generic string of its compute module +#: ("Raspberry Pi Compute Module 0 Rev 1.0", seen on the device on 2026-10-05). On the +#: handheld, MeshTerm's own console (:mod:`meshterm.emulator`) supplies the platform. #: #: It has the same 53 columns as the PicoCalc, so most of the flavour of the PicoCalc #: applies. The new constraint is the number of rows. It has its own F-key lane deck (Fn+4…8, -#: with the chips centred over their keys). For now, the deck deals the lanes of the PicoCalc +#: with the chips placed as on the PicoCalc). For now, the deck deals the lanes of the PicoCalc #: (JP, 2026-09-30). MeshTerm draws the display itself in RGB565 (:mod:`meshterm.emulator`), #: so the 16-slot palette does not limit it (``truecolor``). These values are provisional #: until MeshTerm measures them on the device: the cadences, which come from the PicoCalc,