Hi all,
I’ve been building firmware for my PicoCalc with a Pico 2 W and it’s ready to share. It’s called PicoDeck OS. It’s C11 on FreeRTOS, and the idea is to make the PicoCalc a pocket SSH terminal that also works as a personal organiser.
The headline feature: Tailscale on the device itself
The PicoCalc joins your tailnet by itself, with no relay machine or phone hotspot trick. Choose Wi-Fi & web → Tailscale → Connect. It shows a login URL, you approve it from your phone, and the device appears on your tailnet as an ordinary machine with a 100.x address. After that you can SSH to anything on your tailnet from any Wi-Fi network. Connections go through the tunnel, directly when a path exists and via a Tailscale relay otherwise, and are end-to-end encrypted.
The Tailscale client is MicroLink (MIT), vendored with every change I made to it documented. If you don’t want Tailscale, there’s a second, lighter image without it.
Terminal and SSH
- A real terminal at 40x38 with 48 lines of scrollback. It handles VT100/ECMA-48, scroll regions, the alternate screen (vi, mc and similar draw properly), 256-colour and truecolour mapped to the current theme, and box drawing.
- SSH is deliberately minimal: curve25519, ed25519 host and user keys, and chacha20-poly1305. Nothing weaker is offered. Host keys are pinned on first use.
- You can generate an ed25519 key on the device using the RP2350’s hardware RNG, or copy your own onto the SD card.
- Telnet is included too, with CP437, for BBS use.
- Saved connections can be imported from your ~/.ssh/config with a helper script.
Not supported: password login, agent, port forwarding and SFTP/SCP.
The organiser side
Everything is stored on the SD card as readable files, and the whole device runs from the keyboard.
- Calendar with recurring appointments, to-dos with priorities and due dates, a “Today” view, notes, and a daily Markdown journal
- A text editor that handles files of any size, paged 4 KiB at a time
- A file manager, full-text search, a scientific calculator, a timer, and backup and restore
- A web PIM: join Wi-Fi and the device shows an address and a PIN. From a browser you can edit your agenda, notes and files, and import or export .ics. tools/pim-sync.sh mirrors the card to a folder.
- A startup PIN (salted, 50k rounds of SHA-256)
- 8 themes, battery warnings, and backlight dimming
- Games: Tetris, a dungeon crawler with 8 editable text-map floors, Space Invaders, Solitaire, Snake, Minesweeper and 2048, each with sound and high scores
The hard part: fitting it in 520 KB of RAM
A sixteen-machine tailnet sends a 32 KB network map, and a normal JSON parse of that would need about 87 KB. I ended up stripping the fields we never read and parsing the peer list one machine at a time. The terminal only takes its buffers while a session is open, and the web PIM hands its memory back while Tailscale runs. The README has a write-up of these problems and of a nasty lwIP lock bug that froze the device on direct connections but never on relayed ones. If you’re doing network code on the Pico, it might save you some time.
Testing
Everything outside the hardware drivers builds and runs on a PC. There are eleven test suites, including SSH crypto against the RFC and NIST vectors and a live SSH session against a throwaway sshd. The UI also runs headless under ASan/UBSan with a 12,000-key fuzz run. I can’t test every setup, though, so real-hardware reports are very welcome.
Caveats
- The SD card is not encrypted. The startup PIN keeps people out of the device, not out of the card. Wi-Fi passwords are stored in plain text, so use a dedicated SSH key.
- Tailscale works with Tailscale’s own control plane only (no Headscale), and the peer table holds 20 machines.
- The web PIM is plain HTTP. It’s meant for trusted networks only.
- While Tailscale is running, the web PIM is paused to save memory.
Try it
- Format a FAT32 card (or use tools/prepare-sd.sh)
- Hold BOOTSEL, plug in the Pico 2 W, and copy picocalc_pim-pico2w-tailscale.uf2 onto it
- Follow “Getting started” in the README
Feedback, bug reports and feature ideas are all welcome, especially from anyone running a different keyboard or SD setup than mine. Thanks for reading!