Skip to content

picocalc-extras 2.6

Latest

Choose a tag to compare

@ctorkildson-netizen ctorkildson-netizen released this 28 Nov 21:41
2fa0b50

picocalc-extras 2.6 brings SSH to PicoCalc programs on a Pico 2 W. It also fixes Bluetooth crowding out Wi-Fi, and makes screenshots work without the shell.

ssh/ (new)

libssh2 1.11.1 with the Pico SDK's Mbed TLS, running over net/'s connections. picocalc_ssh(path/to/libssh2) in CMake, then ssh_session(conn) gives a non-blocking libssh2 session on a net/ connection, so the program's screen and keyboard keep going while it works. The rest is libssh2's own API.

On a PicoCalc logging in to a Linux machine on the home network, the handshake takes about 350 ms and a password login about 25 ms. libssh2 and Mbed TLS together use about 80 KB of memory at most. Random numbers come from the RP2350's hardware TRNG.

Key exchange is ECDH (P-256/384/521) or DH; host keys are ECDSA or RSA; ciphers are chacha20-poly1305 and AES. Every OpenSSH server offers these. ed25519 and curve25519 aren't available yet (Mbed TLS 3.6 lacks them). Logging in with a key isn't wrapped yet either.

sshprobe (attached) is the example: it joins Wi-Fi, logs in to the machine in /ssh/probe.cfg, runs one command, and shows each step's time and the most memory used. The password sits in that file as plain text, so it's for trying SSH out. calcterm 0.6 is the full use of it.

bluetooth/: sparing the radio while Wi-Fi is on

One chip does both Wi-Fi and Bluetooth. Before this release, a paired classic keyboard that was switched off got called every 15 seconds, and each call held the radio for about 5 seconds. Wi-Fi lost packets meanwhile, and telnet and SSH sessions stalled for seconds at a time. Now, while Wi-Fi is joined, a classic keyboard isn't called; it reconnects when a key on it is pressed. BLE devices are listened for less often too. Without Wi-Fi, nothing changes. Programs get this automatically.

screenshot/

lcd_screenshot() no longer needs Blair's picocalc-shell, so it works in an RP2040 build, or any program without the shell. Without the shell, files are numbered (myprog-001.bmp); with it, they're still dated.

Tried with

calcterm over SSH to Ubuntu (OpenSSH) and to Windows 11's own OpenSSH server, with a Bluetooth keyboard connected and switched off, over Wi-Fi. sshprobe against Ubuntu. An RP2040 build with screenshots and no shell (built, not yet run).