Skip to content

Releases

calcterm 0.5-alpha: Bluetooth keyboard

Pre-release

Choose a tag to compare

@ctorkildson-netizen ctorkildson-netizen released this 18 Nov 22:14
d2310ce

calcterm 0.5 adds a Bluetooth keyboard (Pico 2 W), working alongside telnet's Wi-Fi.

It's still an alpha: used daily by one person on one PicoCalc, against Ubuntu.

What's new

  • A Bluetooth keyboard. Pair it once with btpair from picocalc-extras (2.3 or later). After that calcterm finds it by itself: the sign-on says which keyboard it's waiting for, and pressing a key on it connects it. Both keyboards work at once, and every key on the Bluetooth one does what it does on the PicoCalc's, Alt+F1 to Alt+F5 included.
  • Bluetooth and Wi-Fi together, sharing the one radio: telnet to your machine, typed on a full-size keyboard.
  • Alt+F3 shows the Bluetooth keyboard's state: paired, waiting or connected.
  • Switching to 80 columns inside a full-screen program (Midnight Commander, say) no longer leaves the new columns coloured when the program exits.

Installing

Copy calcterm.uf2 to the card's pico2-apps folder, replacing 0.4; your settings carry over. To pair a keyboard, run btpair (picocalc-extras 2.3) once first. calcsize.sh and calcterm.ti are attached as before (unchanged).

Known limits

  • Bluetooth and telnet need a Pico 2 W.
  • Tested with a Logitech K380; other keyboards that btpair pairs should work the same way.

Next

SSH.

Built on Blair Leduc's picocalc-text-starter and picocalc-shell, picocalc-extras 2.3 for the Bluetooth keyboard, and the Pico SDK's lwIP and BTstack. The build is e1f0bf8 (shown on the sign-on line).

calcterm 0.4-alpha: telnet

Pre-release

Choose a tag to compare

@ctorkildson-netizen ctorkildson-netizen released this 16 Nov 22:12
438ed0e

calcterm 0.4 adds telnet over Wi-Fi (Pico 2 W): pick a host from a list and you're logged in, with no serial cable.

It's still an alpha: used daily by one person on one PicoCalc, against Ubuntu.

What's new

  • Telnet. Alt+F2 opens a list of hosts kept in /calcterm/hosts; pick one, or just type an address (192.168.1.50, or bbs.example.org:2323), and one that connects is added to the list. Alt+F2 again hangs up, and when the host hangs up calcterm goes back to the serial port.
  • Wi-Fi from /ntp/ntp.cfg, the file the PicoCalc shell's NTP command uses, so the network's name and password are set up in one place. Wi-Fi only comes on when you first connect.
  • The host is told your screen size, and told again when Alt+F1 switches between 64 and 80 columns, so calcsize isn't needed over telnet. It's also told the terminal type, calcterm.
  • ZMODEM works over telnet just as over serial: sz and rz on the host.
  • ANSI art. Block characters and shades are drawn as shapes that join up, and boards that send the IBM PC's own character set (code page 437) instead of UTF-8 come out right. Telnet BBSes look like they should.
  • Screenshots (Alt+F4) also save a .raw file: the last 16 KB the host sent, exactly as received. If something draws wrongly, that's the file to send with the report.
  • Quitting leaves the Wi-Fi network properly, so the next program you run joins at once instead of waiting on the router.

A telnet server on Ubuntu

sudo apt install telnetd

If it doesn't answer on port 23 afterwards, sudo update-inetd --enable telnet and restart inetutils-inetd; the README has the details. Telnet sends everything, password included, as plain text, so keep it to your own network. SSH is planned.

Installing

Copy calcterm.uf2 to the card's pico2-apps folder, replacing 0.3; your settings carry over. calcsize.sh and calcterm.ti are attached as before (unchanged).

Known limits

  • Telnet needs a Pico 2 W; on a Pico 2, Alt+F2 says there's no Wi-Fi.
  • Names ending in .local aren't looked up; use the address.

Next

A Bluetooth keyboard, alongside Wi-Fi (0.5), then SSH.

Built on Blair Leduc's picocalc-text-starter and picocalc-shell (which also reads /ntp/ntp.cfg), with the Pico SDK's lwIP for TCP; telnet tested against inetutils telnetd. The build is af20930 (shown on the sign-on line).

calcterm 0.3-alpha: file transfer

Pre-release

Choose a tag to compare

@ctorkildson-netizen ctorkildson-netizen released this 12 Nov 20:46
4c2f667

calcterm 0.3 adds file transfer by ZMODEM: send a short script or config file between the host and the PicoCalc's card over the same serial line you're logged in on, without taking the card out.

It's still an alpha: used daily by one person on one PicoCalc.

What's new

  • sz file on the host sends a file to the PicoCalc. calcterm sees the transfer start and takes it, into /calcterm/files on the card; the bottom line shows how it's going, and says when it's there. Several at once work too: sz *.sh.
  • rz on the host fetches one from the PicoCalc. calcterm opens a list of the card's files: the arrows choose, Enter sends it (or opens a folder), Backspace goes up a folder.
  • Esc stops a transfer at any point, and the terminal comes back clean, with the host's prompt.
  • A damaged packet is sent again, so a noisy line slows a transfer down rather than spoiling it.

The host needs lrzsz (sudo apt install lrzsz, if sz isn't found; Ubuntu has it already).

BOTH WAYS, A FILE OF THE SAME NAME IS REPLACED WITHOUT ASKING: on the card by sz, and in the host's folder by rz. That's deliberate, for small files sent back and forth while you work on them, but there's no undo.

How long it takes

At 115200, a 10 KB script takes about a second, 100 KB about 10 seconds, 1 MB about a minute and a half. It's a serial line: for anything big, the card in a reader or FTP is the better way.

Installing

Copy calcterm.uf2 to the card's pico2-apps folder, replacing 0.2, and start it from UF2 Loader or the shell. Your settings carry over. calcsize.sh and the terminfo entry calcterm.ti are attached as before; the README has the Linux set-up, and now a note on logging out and on keeping the serial login running when the PicoCalc is unplugged.

Known limits

  • After rz, the host's prompt takes another two or three seconds to come back while rz closes up.
  • The line has to carry all eight bits (8N1, as it is unless changed in the setup menu).

Next

0.4 brings telnet: calcterm over Wi-Fi as well as serial.

Built on Blair Leduc's picocalc-text-starter and picocalc-shell; tested against lrzsz's sz and rz. The build is ff566b6 (shown on the sign-on line).

calcterm 0.2-alpha: 80 columns

Pre-release

Choose a tag to compare

@ctorkildson-netizen ctorkildson-netizen released this 08 Nov 22:42
df9304e

calcterm 0.2 adds an 80-column mode: the whole screen in a small 4×10 font, so programs that expect an 80-column terminal (Midnight Commander, vim's split windows, wide ls and htop output) fit without wrapping.

It's still an alpha: used daily by one person on one PicoCalc.

What's new

  • 80 columns. Alt+F1 switches between 64 columns (the 5×10 font, as before) and 80 (calcterm's own 4×10 font, white on black, no grey). The setup menu (Alt+F5) has a Width line too (W), and the choice is saved with the other settings.
  • calcsize, for the host. A serial line can't tell Linux the screen's size, so extras/calcsize.sh asks calcterm: it moves the cursor to the far corner, asks where it ended up, and sets the size from the answer. Add it to ~/.bashrc (cat calcsize.sh >> ~/.bashrc) and it runs at each login on a serial line; type calcsize again after Alt+F1. No need for resize from the xterm package.
  • The sign-on line now mentions Alt+F1.

Installing

Copy calcterm.uf2 to the card's pico2-apps folder, replacing 0.1, and start it from UF2 Loader or the shell. Your settings carry over. For the host, calcsize.sh and the terminfo entry calcterm.ti are attached; the README has the Linux set-up.

Known limits

  • Programs already running when the width changes keep the old width until they're restarted: quit, press Alt+F1, run calcsize, start them again.
  • The keyboard firmware still keeps Alt+, Alt+. Alt+Space and Alt+B for itself.

Next

0.3 brings file transfer by ZMODEM: sz file on the host sends a file to the PicoCalc's card, rz fetches one from it.

Built on Blair Leduc's picocalc-text-starter and picocalc-shell. The build is df9304e (shown on the sign-on line).

calcterm 0.1-alpha

calcterm 0.1-alpha Pre-release
Pre-release

Choose a tag to compare

@ctorkildson-netizen ctorkildson-netizen released this 05 Nov 22:17

calcterm

A VT100 terminal for the PicoCalc (RP2350, Pico 2 W). For now it talks over a serial line; telnet, SSH and an FTP client are to follow.

The screen is 64 columns by 32 rows, in Blair Leduc's 5×10 font with the VT100's line-drawing characters added, so boxes join up.

What it does

  • VT100, after the VT100 User Guide: cursor movement, erasing, scrolling regions, origin mode, tab stops, insert and delete of characters and lines, double-height lines excepted. It answers the host's questions (DA, DSR, the cursor-position report).
  • VT52 mode, entered and left as the VT100 does (ESC [ ? 2 l, ESC <).
  • What Linux sends anyway: the 16 colours (256-colour and RGB requests are matched to the nearest of them), bold, underline, reverse, the alternate screen that vim, less and htop use, and UTF-8. Box-drawing characters arrive as UTF-8 from most programs today and are shown with the line-drawing glyphs; other non-ASCII characters show as ?.
  • Anything it doesn't know is ignored, window titles included, so it never leaves litter on the screen.

Keys

Key Sends
F1–F10 function keys: F1–F4 as the VT100's PF1–PF4, F5–F10 as xterm's (Shift+F1–F5 gives F6–F10)
Arrows cursor keys (application mode when the host asks)
Home, End, Ins, Del, PgUp, PgDn the xterm sequences
Backspace DEL (^?), or BS — see the setup menu
Alt + key Esc then the key (meta)
Ctrl tapped on its own makes the next key a Ctrl key (a ^ shows in the top-right corner)
Brk a quarter-second break on the line
Alt+F4 a screenshot, to /screenshots on the card (a .bmp, and a .txt of the screen's text)
Alt+F5 the setup menu

The setup menu (Alt+F5)

Port, speed, format (8N1, 7E1 and so on), XON/XOFF, local echo, what Enter sends, and what Backspace sends. Each line has a highlighted letter that changes or does it in one key (P for the port, S the speed, T a screenshot, Q to quit calcterm for the PicoCalc's own shell, and so on); the arrow keys work too. Changes take effect at once. Save these settings writes them to /calcterm/calcterm.cfg on the card (a folder of its own, as the PicoCalc's programs keep theirs), a plain text file that can be edited by hand. The menu also sends a break, resets the terminal, and quits calcterm for the PicoCalc's shell (the host's session carries on, to be picked up next time).

The serial ports

  • USB-C (UART0, the default). The PicoCalc's USB-C socket goes to the Pico's UART0 (GP0/GP1) through its CH340, so a USB cable to another computer is a serial line with nothing else needed.
  • GP4/GP5 (UART1). For a real RS-232 port, through a MAX3232 level-shifter board: GP4 is TX, GP5 RX. Don't use the UART0 pins on the side header for this; the CH340 is on the same lines.

Wiring a MAX3232 board

The pins are the upper of the two rows of eight holes on the PicoCalc's left side (the "Core GPIOs" in ClockworkPi's assembly guide). Counting from the end nearest the volume knob:

Hole Pin MAX3232 board
1 3V3 OUT VCC (3.3 V, not 5 V)
4 GP4 (TX) see below
5 GP5 (RX) see below
8 GND GND

Boards differ in how they label TX and RX. Most name the direction of the signal (connect the board's RXD to the Pico's TX). Some, such as the common blue HW-044, name the pin they connect to: on those, TXD goes to GP4 and RXD to GP5. If nothing comes through, swap the two wires; the wrong way round does no harm. Don't use the lower row's UART1 holes: those go to the keyboard's own processor, not the Pico.

To check the PicoCalc's half on its own, bridge pins 2 and 3 of the board's DB9 socket: with local echo off, what you type should come back. From the board's DB9 to a PC is a null-modem connection (both ends are terminals).

XON/XOFF is on by default: if the PicoCalc falls behind (it has a 16 KB buffer), it asks the host to pause.

Trying it with Linux

Plug the PicoCalc's USB-C into the Linux machine. The CH340 shows up as /dev/ttyUSB0 (dmesg | tail says for certain). On Ubuntu and its relatives, if the port vanishes a moment after it appears, the braille-display service has taken it: sudo apt remove brltty.

A quick test, typing at each end:

picocom -b 115200 /dev/ttyUSB0          # Ctrl-A Ctrl-X to leave

The terminfo entry

calcterm.ti tells Linux programs exactly what calcterm can do: its size, colours, line drawing and keys. Copy it to the host and install it once:

sudo tic -x calcterm.ti

Then TERM=calcterm gives colour, line drawing and working function keys in htop, mc, vim and the rest, with nothing borrowed from vt100 or xterm.

A login on the PicoCalc

The PicoCalc doesn't drive the line's carrier-detect signal, so agetty has to be told it's a local line (-L), or it waits for a carrier that never comes. Once, to set that up:

sudo systemctl edit serial-getty@ttyUSB0.service

and put in

[Service]
ExecStart=
ExecStart=-/sbin/agetty -L -o '-p -- \\u' 115200 %I calcterm

(the empty ExecStart= clears the original; use vt100 in place of calcterm if the entry isn't installed). Then

sudo systemctl restart serial-getty@ttyUSB0.service

and press Enter on the PicoCalc for the login prompt. After logging in, type this on the PicoCalc (it sets the size of the PicoCalc's own line; typed in a terminal on the Linux machine's screen it changes that one instead):

stty rows 32 cols 64

To have it done at every login on that line, add this to ~/.bashrc on the Linux machine:

[ "$(tty)" = /dev/ttyUSB0 ] && stty rows 32 cols 64

If Midnight Commander's top line scrolls off the screen, or its key bar wraps, this is what's missing.

(resize, from the xterm package, finds the size by asking the terminal.) If the Up arrow moves the cursor rather than recalling the last command, the login shell is plain sh: chsh -s /bin/bash. sudo systemctl stop serial-getty@ttyUSB0.service ends it.

Midnight Commander

Typing long shell commands on the PicoCalc's keyboard is a chore. Midnight Commander (mc) is a full-screen file manager in the style of Norton Commander: two directory panels, the arrow keys to move, Enter to open or run, and the function keys along the bottom to view, edit, copy, move, make folders and delete. It fits calcterm well, and makes the PicoCalc a comfortable way to look after another machine:

sudo apt install mc
mc

Its command line is still there at the bottom for when you need it, and F10 leaves it.

Other tests

vim, less, htop, top and vttest 32x64 are good ones.

Building

With the Pico SDK (2.2.0) and arm-none-eabi-gcc:

git clone --recurse-submodules https://github.com/ctorkildson-netizen/calcterm
cd calcterm
cmake -B build -G Ninja -DPICO_SDK_PATH=/path/to/pico-sdk
ninja -C build                 # build/calcterm.uf2

Copy calcterm.uf2 to the card's pico2-apps folder and start it from UF2 Loader or the shell.

Tests

host/ has the terminal's tests, which run on Linux: make -C host check. test_vt checks the escape sequences one by one. ptyrun runs a real program against the terminal and prints the screen it leaves. screentest does the same through the renderer, against a model of the LCD and its scrolling, and checks the result matches a fresh whole-screen draw pixel for pixel.

Built on

These are git submodules pinned to release tags; Dependabot proposes new releases as pull requests.
e tags; Dependabot proposes new releases as pull requests.