Juha-Matti Santala
Community Builder. Dreamer. Adventurer.

My on the go solution with iPad and Raspberry Pi

My Macbook Pro is in shambles. Its battery lasts about 60 seconds at best, half of the keys don’t work properly and the touchbar is in eternal disco mode. Therefore, it’s not much of a laptop anymore. It still works great so I use it at home docked to a display with keyboard and mouse but taking it to a cafe or library with me isn’t really feasible. To remain productive on the road, I had to figure out budget friendly solutions.

Everything below can be done with a proper laptop much easier and with better ergonomics. So I wouldn’t switch a laptop into this system if I had a choice but due to budgetary restrictions, buying a new laptop is not an option currently.

iPad + Raspberry Pi

I already owned an iPad which I use as my main driver when I’m not at home. It’s great for watching videos, writing notes / generic blog posts and chatting in slacks and discords. But anything software development or file / data management related, it falls short quickly.

I’m also relatively often offline so I needed a solution that doesn’t rely on cloud services like a cloud IDE. I wanted a local development environment that I can access via SSH or browser.

Some time ago, I had ran into TechCraft’s Youtube video on using a Raspberry Pi with iPad and had made notes about it so when I recently got a gift card to local computer shop, I bought a Raspberry Pi 5 (I’ll call it RPi in this post), a case and an USB-C cable.

The Raspberry Pi can power itself from iPad’s USB-C port which is what makes this set up so great. I carry my RPi with some accessories in my backpack and can boot it up with my iPad wherever I go. I can either connect to a wifi hotspot that I’ve set up before hand (like my home wifi or my mobile hotspot) or I can connect via USB-C ethernet to the iPad. Andrea Grandi has a good how-to guide for how to do that.

Software development and technical blogging

For software development, I have my usual shell environment that I can access with mosh using Blink on iPad. With tmux, starship, bash and neovim, I’m well equipped to do almost everything.

I have set up a folder with Jupyter Notebook in a Python virtual environment that I can fire up and write Python code via browser. I wouldn’t normally have a “shared” Python virtual environment across projects but in this setup, it’s nice to have one with my most used libraries installed so I can start it up with one script (and make it even easier with iOS Shortcuts, sending the command through ssh) and then start a new Python notebook in browser.

The ability to work offline is the key here. I want my RPi to have a lot of libraries installed up front because I might not be able to download and install them when I need them.

This is helpful not only for writing code but writing technical blog posts. I often blog about Python or Javascript and being able to run code and iteratively build towards a working and refactored solution makes writing technical blog posts on the go a breeze.

I haven’t used Jupyter Notebooks a lot before this but with this setup, I’ve become a huge fan. Having an easy environment where I can write code and documentation all in one place in a way that’s easy to export to other formats makes writing technical stuff fun.

When I’m working in non-notebook environment, I usually code with neovim but I also have a VS Code Server set up as a service so whenever I’m connected to the RPi, I can open a VS Code environment and code there. This was my starting point when I set up this system but to be honest, I barely ever open it and rather just code in neovim.

Just the other week, I was having lunch downtown and made some design sketches with pen and paper on an RSS feed hydrator. After the lunch, I went to library, booted up Jupyter Notebook session and iteratively built the first working version. I then converted that notebook to a .py script, continued developing in neovim where I built a single endpoint Flask web app around it and I was able to do the full thing on the go with this combo. It’s a lot of fun.

Offline “Internet”

When I’m offline with no access to the Internet, I still want to be able to read documentation and browse Stack Overflow – or if I’m bored, watch TED talks or browse Wikipedia. I set up a local Kiwix server with a bunch of aforementioned resources available. Basically, I have a library of Kiwix ZIM files that contain Wikipedia, Stack Overflow, programming language docs and some other resources and the server provides them easy to read through its own UI that I can then access via browser on my iPad.

It requires a bit of manual maintenance as the files are not updated automatically and to my knowledge, there’s no (easy) way to update them incrementally so every now and then I redownload the newer versions of the ZIMs and copy them over to my RPi.

I’m still in the learning process of figuring out how the ZIMs are exactly built so that I can make my own from the resources I want but that’s one thing I’m looking into.

iPad as a display with a capture card

I recently also learned that iOS supports capture cards. The RPi has two mini-HDMI connections and I have Genki’s old Shadowcast capture card that I keep with me so I decided to give it a go.

By connecting the Shadowcast to RPi’s HDMI port and iPad’s USB-C port, I’m able to use it as a display for RPi’s desktop if I ever need to use it that way - for example debugging non-working SSH connections.

If I didn’t have a Steam Deck, I’d set up some emulators for this use case to extend my gaming-on-the-go capabilities but since I do, there hasn’t really been a need for that.

Blogging and this website

My current blogging and website building workflow includes writing blog posts in Notion, then downloading them with custom script to my Eleventy project and building the site with it. Until now, I wasn’t able to run the full flow with my iPad since I don’t think there’s a way to run Eleventy on it locally.

I can now write my blog post, jump to my RPi over mosh, download the post, run Eleventy dev server and preview it with a browser in iPad.

Earlier, I had to wait until I get home to be able to do all this but now I’m able to do the a full idea → blog post → preview → pull request to GitHub → deploy pipeline through my iPad.

Running shell scripts and CLI tools

Let’s say I’m watching an online video on my iPad and I run into something I want to preserve a local copy of. I can send the link to the video via SSH to my RPi which then runs yt-dlp and downloads the video to my RPi.

Or maybe I’m debugging an RSS feed. I can mosh over to RPi, run curl and inspect the output with way better ergonomics than directly in iPad.

Anything I can do on in the shell, I can now do through my iPad.

iOS Shortcuts and focus mode

I never really found much use for iOS’s shortcuts feature until I set up this combo. The ability to send shell commands over SSH through a click of an icon is too good not to take full advantage of.

As I already mentioned, I can start development environments or download videos with the shortcuts. I also have one shortcut for shutting down the RPi safely.

I’m sure there’s plenty more that I’ll discover when I use the system more.

Using iOS’s Focus mode feature I set up a “Raspberry Pi environment” mode. When activated, I’m directed to a home page view that has all the shortcuts, related apps and browser bookmarks ready. I don’t ever need them when using iPad on its own so it’s nice to hide them into their own page where they are easy to find and access when I’m connected. I think there is even a way to activate it automatically when RPi is connected but I haven’t explored that far yet.

Battery usage?

As RPi powers itself from iPad, a big question is how much power it draws. I haven’t done much of benchmarking but so far it’s been almost negligible: I have not had any issues practical issues with it so far. It doesn’t allow a full day of usage for sure but it’s enough for the kinds of sessions I use it with.

And if need arises, I can always connect the iPad and RPi separately to a power brick and connect over a wifi hotspot.