Mobile computing (draft)

I've spent a few days doing a deep dive into setting up the Raspberry Pi Zero W to use with my iPad. I haven't owned a laptop for a few years, and I want a mobile console environment to program in. My 6th gen iPad is too locked down for some things, but will work fine as a terminal with a bluetooth keyboard.

Things I want to be able to do

Desiderata

I installed Raspberry Pi OS Lite (bookworm) on the pi without any fuss, but then had to spend a few days getting up to speed with the differences from other distributions I'm more familiar with, and the changes from previous versions: systemd, Network Manager, changes to boot filesystem.

There's no shortage of online information. Unfortunately, most of it is outdated, and much of it is of the quick fix -- "Here run this script and you don't have to understand anything" variety. That's fine for an appliance, but not when I want a flexible computing setup.

I successfully set it up as an ethernet gadget, following this info. I liked the idea of a single cable connection. But I couldn't get it to work unless I was powering my (6th gen) iPad through the CCK. It probably works better with newer iPads with their USB C connectors. And using the pi as an ethernet gadget prevents me using the USB port for anything else, so although this is cool, I've abandoned it.

I've setup network manager to try to connect to one of my two home wifi networks (they used to be bridged, but are now separate), and if that fails, to start up an adhoc network.

I found this excellent writeup, which uses Bluetooth PAN to connect the pi to the ipad. This is great; I can power the pi with a slim battery, and the usb port is free. But so far I haven't found out how to set it up to work with Network Manager, so it uses separate systemd startup files. Connecting over pan means I can use the internet from the pi (ie to download some missing software). Apparently this is quite insecure. Oh, well.

Software

On the Pi, mosh (like ssh), tmux and Vim (which I've been using Vim for years), rclone (dropbox syncing)

Mosh is recommended because the iPad will aggressively suspend background apps. Mosh allows it to reconnect where it left off so that this isn't noticeable.

Tmux is great, allowing multiple virtual terminals over a single connection. Particularly useful to split the window between Vim and a shell prompt.

Vim is my text environment. I have over a thousand pages of notes in VimWiki.

rclone is a handy utility for on demand dropbox folder syncing. When I have an internet connection I can pull and push any folders from/to Dropbox.

On the iPad, Termius is the terminal I'm using. It supports mosh. There is a paid version, but the free version meets my needs.

Blink is recommended by some, but I don't do subscription software. It's open source, so I might try to compile it myself -- though that's a different project.

Tags: computing, rpi

Date created: 2024-11-21