Choosing the right mobile tablet OS
Christian Cawley shows you how to customise your Raspberry Pi tablet project and choose the right touchfriendly operating system.
Raspberry Pi projects are never quite as straightforward as they appear. Many (if not all) of the tutorials featured in APC are crystallised moments – the result of days, weeks or even months of research that bring us to a point of usability. The project might work and work well, but there is always room for improvement.
CHOOSING A CHASSIS
Raspberry Pi tablet-builders have two options for a case: take advantage of an existing product, or else fabricate a customisable option (this will typically be a 3D-printed case).
Cases designed to fit a Raspberry Pi and the official touchscreen display are a good starting point. The OneNineDesign Case for Raspberry Pi Official 7-inch Touchscreen from The Pi Hut (http://bit.ly/LXF261-case) is an acceptable starting point, but it’s short of space for portable power. The SmartiPi Touch Case (http://bit.ly/ LXF261-smartipi) has similar shortcomings, although the superior build quality and mounting options make it a must-have regardless. With some redundant behind-screen space, it’s just possible that this could make a suitable tablet case for your Raspberry Pi.
There is no reason to stick with a Raspberry Pi for your DIY tablet project. STL files are available from Thingiverse for NovelDesignLab’s Tablet Frame for Raspberry Pi, Arduino, and other SBCs (http://bit. ly/LXF261-frame). Mounting the Pi (or your chosen board) on a removable panel that doubles as a tablet stand is a smart piece of design.
Assembling a 3D-printed case for your Raspberry Pi might require additional components. These are typically listed with the STL files. For example, the case might be designed with screws for securing the components. Take the time to order the exact size of screw from the suggested resource. When assembling the case for your tablet, take extra care not just with the electronic components within but with screws and screwdrivers, and the 3D-printed plastic. It might be wise to tape wires clear of screw holes to avoid inadvertent power issues and shorts.
Other materials can be used to build your own Raspberry Pi tablet. You could rely on Lego, although this is likely to be unnecessarily bulky. Whatever you use, take your time to plan everything. Ensure you have the right Raspberry Pi and touch display for the chassis you’re planning to use. If you’re starting from nothing and don’t own a 3D printer, consider using cardboard for early development.
Of course, 3D printing a case for a Raspberry Pi 3 when you’re using a Raspberry Pi 4 is going to result in some tweaking. Take care to ensure that the ports are correctly lined up with access slots.
POWER TO THE PI
Rechargeable batteries for the Raspberry Pi have improved considerably since its release in 2012. Back then, the solution was almost always a portable smartphone charger. Big, bulky and difficult to keep permanently attached the computer, such chargers are rarely used these days.
The right power solution for a tablet project needs to be compact and capable of delivering power to both the Raspberry Pi and the touch display. LiPo batteries are almost certainly the best option (although you could go completely DIY and power your Raspberry Pi tablet with AA or AAA batteries) with the 4000mAh battery from The Pi Hut (http://bit.ly/LXF261-lipo) capable of powering a Raspberry Pi for several hours. This contrasts with the original project that uses a 1000mAh cell. While space might be at a premium with your chosen Raspberry Pi chassis, it’s worth exploring all options for maximum uptime.
Note, however, that the size of the display will impact on battery life. So
the larger the display, the larger the battery capacity you’ll need for any sort of prolonged use, unless you keep the tablet near a plug or attach a portable smartphone charger… which of course defeats the object.
In addition, a PowerBoost device from Adafruit is recommended. This should be chosen specifically for use with the corresponding battery; it’s a device for managing power and enabling the battery to be recharged via a USB port, so it’s important to get this right. Additionally, a power switch can be mounted and connected to the PowerBoost, immediately elevating the Raspberry Pi to the level of an actual tablet, rather than just an SBC with no power button that is posing as a tablet.
The customisable nature of a DIY Raspberry Pi 3D-printed tablet makes upgrading your chosen power solution
far simpler. You can upgrade it as and when it’s required!
RIP OFF RASPBIAN
If you’ve spent any time with Raspbian then you’ll know that as good as the PIXEL desktop is, it’s almost useless as a tablet user interface UI). If anything, it harks back to the original Windows tablets in the early 2000s, in which a finger or stylus was required to drag the mouse pointer around.
Most operating systems are designed for mouse and keyboard. While it is quite possible that you’re happy to retain Raspbian as your tablet’s operating system, several choices are available that will make your tablet a lot easier to use.
A Raspberry Pi tablet requires a touch UI that is simple and straightforward to use, one that
makes the best use of the display real estate as possible. There’s no point having an icon that most fingers can’t hit properly, for example.
So, aside from a few menus and desktop icons, Raspbian (and other standard Raspberry Pi operating systems) is utterly useless as a tablet. The solution, therefore, is to create something from scratch, or embrace a
“While a web interface can easily prioritise mobile websites, for example,
it’s much tougher to rework the user interface of existing Linux apps to be suddenly touch friendly. ”
tablet operating system. The problem with a custom solution – perhaps a web UI like Webian (http://bit.ly/LXF261webiantouch) – is that you’re limited to those apps that can be configured to be ‘touch friendly’.
While a web interface can easily prioritise mobile websites, for example, it’s much tougher to rework the user interface of existing Linux apps to be suddenly touch friendly.
Our tablet tutorial featured the Android-based LineageOS, which works well with a Raspberry Pi 3B. However, some alternatives are available, which we explore further in the boxouts. But what if you really want to use Raspbian?
INJECT THE PLASMA
Fortunately, the solution here is straightforward. If you’re already running Raspbian, or just want to avoid the other operating systems, Plasma Mobile is a great way to add a tablet-style user interface. Designed for touchscreens (specifically phones), 2019 saw Plasma Mobile’s development team introduce support for the Raspberry Pi.
Specifically, you’ll need Raspbian
Lite installed, flashed to your SD card using Etcher (http://bit.ly/LXF261etcher), or via NOOBS setup. You have two options to enable SSH:
1 Open the /boot/ directory on your PC, create a blank text file called ssh (no file extension). 2 Alternatively, you can boot the Pi with a keyboard attached and open raspi-config, then open Interfaces to enable SSH.
Whichever you choose, your Raspberry Pi will then be remotely accessible within your local network via your SSH client.
Next, update the firmware and reboot: sudo rpi-update sudo reboot
Once backed up and running, open config.txt in nano: sudo nano /boot/config.txt Scroll through and uncomment the line near the end: #dtoverlay=vc4-fkms-v3d
Hit Ctrl-X to save and exit, then reboot again. After, confirm dirmngr is installed:
sudo apt update && sudo apt install -y dirmngr
It’s necessary to edit the sources list to add repos.
sudo nano /etc/apt/sources. list
Then ensure that the following repos are listed, adding if necessary:
deb http://raspbian. raspberrypi.org/raspbian/ buster main contrib non-free rpi
deb http://ftp.debian.org/ debian/ buster main contrib non-free
deb https://repo.kaidan.im/ debpm buster main
Once again, save and exit nano, then add new keys for the repos:
sudo apt-key adv --keyserver keyserver.ubuntu. com --recv-keys 8B48AD6246925553 CF319275556E40EC
Follow this with a full Raspbian upgrade:
sudo apt update && sudo apt -y full-upgrade && sudo apt autoclean && sudo apt -y autoremove
We are almost done here, with just a little bit of sysadmining required. Create a new user, phablet and add it to sudoers: sudo adduser phablet sudo usermod -aG sudo phablet
Change to user phablet and input the password when you’re prompted: su - phablet
Remove user pi: sudo deluser pi
Finally, you can install the following components for Plasma Mobile:
sudo apt -y install plasmaphone-components plasmaphone-settings plasmasettings kwin-wayland simplelogin dbus-x11
Follow this with a reboot; just a few moments later, the Raspberry Pi tablet should boast a shiny Plasma Mobile user interface.