`meshterm emulate cardputer-zero --mock` and `meshterm emulate picocalc-lyra --mock` open a desktop window drawing MeshTerm as that device's own screen draws it. An EmulatedDevice (emulator/devices.py) holds what differs per handheld: the panel, a Linux console's top-left grid and bold-as-bright 4-bit palette for the PicoCalc, the lane keys drawn under the Cardputer's panel, and how each keyboard spells Shift with an F-key (the PicoCalc's F6-F10, the Cardputer's xterm-shifted F4-F8). It is not a strict emulator, and the docs say so wherever they offer it: MeshTerm runs on the desktop as itself, and the window mimics the display's and keyboard's constraints, never the CPU or the OS. Inside it the platform resolves with own_display (platforms.drawn_by_meshterm), so nothing offers to move to another terminal. Global options typed anywhere (--mock, --port, --db...) reach the emulated MeshTerm. The command refuses --json like specimen. The Terminus fetch moved into the package as `meshterm emulate --fetch-fonts` (with --archive for a copy fetched another way), replacing scripts/cardputer-zero/fetch-terminus.py. A build without Tk says to install with pip or pipx instead of failing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
104 lines
4.3 KiB
Markdown
104 lines
4.3 KiB
Markdown
# MeshTerm on the Cardputer Zero
|
||
|
||
> [!CAUTION]
|
||
> **The Cardputer Zero is not supported yet.**
|
||
>
|
||
> MeshTerm has never run on a real Cardputer Zero. Everything on this page was built from
|
||
> M5Stack's published source code and documentation, and tested only in an emulator on a
|
||
> desktop computer. There is no package to install on the device, the screen and keyboard
|
||
> code has never touched the hardware, and the LoRa add-on board is not wired up at all.
|
||
>
|
||
> Don't buy a Cardputer Zero to run MeshTerm on it. This page will say so when that
|
||
> changes.
|
||
|
||
M5Stack makes three Cardputers. This page is about the **Cardputer Zero**: the one with a
|
||
Raspberry Pi Compute Module 0 inside, running Linux. The original Cardputer and the
|
||
Cardputer-Adv are ESP32 microcontroller boards; they can't run MeshTerm, and nothing here
|
||
applies to them.
|
||
|
||
- [The device](#the-device)
|
||
- [Where the work stands](#where-the-work-stands)
|
||
- [Trying it in the emulator](#trying-it-in-the-emulator)
|
||
- [Radios](#radios)
|
||
|
||
---
|
||
|
||
## The device
|
||
|
||
| | |
|
||
| --- | --- |
|
||
| 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 |
|
||
|
||
MeshTerm draws the screen in 53 columns by 14 rows: the same width as on the PicoCalc,
|
||
but only about half the height, so many screens have a more compact layout here.
|
||
|
||
The launcher gives an app the whole screen and the keyboard, but no text console to run
|
||
in. So MeshTerm brings its own: a small program inside MeshTerm that draws every
|
||
character on the screen itself and reads the keys directly.
|
||
|
||
## Where the work stands
|
||
|
||
**Done, and tested only in the emulator:**
|
||
|
||
- MeshTerm's layout for the 14-row screen: a title bar that also carries the unread count
|
||
and the battery, one-row tab strips, and dialogs sized for the short screen.
|
||
- The row of function-key labels along the bottom of the screen, driven by **Fn+4** to
|
||
**Fn+8**, the keys that sit right under the display. **Shift** with them is a second set.
|
||
- The program that draws MeshTerm on the screen, and a desktop emulator built on it.
|
||
|
||
**Not done:**
|
||
|
||
- Running on the real device at all.
|
||
- A package for M5Stack's app store, so the launcher can start MeshTerm.
|
||
- The LoRa radio add-on (see [Radios](#radios)).
|
||
- Checking the keyboard on the device. Its layout was read from M5Stack's driver code,
|
||
and two printings of the keyboard exist.
|
||
|
||
## Trying it in the emulator
|
||
|
||
The emulator opens a window showing the Cardputer Zero's screen, scaled up so it's
|
||
readable. Run it with a simulated radio, and you can try the layout without the device or
|
||
a radio.
|
||
|
||
It isn't a strict emulator. It doesn't pretend to be the Cardputer Zero's computer:
|
||
MeshTerm runs on your own computer, at your computer's speed. What it copies is the
|
||
screen and the keyboard — the screen's size in pixels, the font, the colours, and the keys
|
||
that drive the labels along the bottom. That's enough to show what fits on the screen and
|
||
what doesn't, which is what it's for.
|
||
|
||
It needs MeshTerm installed with pip or pipx (see the [README](../../README.md)). The
|
||
one-file downloads leave out the part of Python that opens windows.
|
||
|
||
Once, fetch the font the screen is drawn in:
|
||
|
||
```bash
|
||
meshterm emulate --fetch-fonts
|
||
```
|
||
|
||
Then start the emulator:
|
||
|
||
```bash
|
||
meshterm emulate cardputer-zero --mock
|
||
```
|
||
|
||
`--mock` is the simulated radio. Point `MESHTERM_HOME` at an empty folder first, so its
|
||
made-up nodes stay out of your real history. `--scale 4` makes the window bigger.
|
||
|
||
In the window, your keyboard's **F4** to **F8** stand in for **Fn+4** to **Fn+8**, and
|
||
holding **Shift** shows the second set. **Ctrl+Shift+S** saves a screenshot at the screen's
|
||
real size. Closing the window quits MeshTerm.
|
||
|
||
## Radios
|
||
|
||
The Cardputer Zero has no LoRa radio built in. Once MeshTerm runs on it, there will be
|
||
three ways to add one:
|
||
|
||
| Radio | Status |
|
||
| --- | --- |
|
||
| A MeshCore companion on USB | Expected to work as on any Linux computer. |
|
||
| A MeshCore companion over Bluetooth | Expected to work as on any Linux computer. |
|
||
| M5Stack's **Cap LoRa-1262** add-on board | Not wired up. Its pins on the Cardputer Zero are known, but MeshTerm still needs two setup steps it can't do yet: switching on the board's antenna chip, and freeing two of the expansion header's pins from the USB port that shares them. |
|