My Raspberry Pi 400 Keyboard Computer
As I previously mentioned when I wrote about all the computers I've owned, my Raspberry Pi 400 keyboard computer (which I'll just call "Pi" from here on out) is dead. Although I don't intend to replace it, I learned a few things I probably need to remember.
I bought the Pi in 2021, but I didn't start working with it until 2022, after I returned to the Philippines. I used it quite a lot when I visited my younger son and his family in Washington in 2023. I also used it while I was waiting for a replacement battery for my laptop until I received the mini PC I ordered from China.
The default desktop environment for Raspberry Pi OS was called "PIXEL", based on LXDE. I didn't like it, so I installed Raspberry Pi OS Lite (no desktop environment) on a portable solid-state drive and then a different desktop environment. This article at RaspberryTips helped me along the way.
Enabling Trim
It's called "TRIM" with the ATA command set, and "UNMAP" with the SCSI command set. Trim is not supported by default with an operating system installed on a solid-state drive plugged into a computer's USB port. The provisioning mode has to be stored as "unmap" or the "fstrim" command will fail.The provisioning mode can be exampled with this line of code:
cat /sys/block/sda/device/scsi_disk/*/provisioning_mode
I've never seen it read as "unmap" when first booting up and, as soon as I execute "fstrim" manually, it changes to "disabled". It can be fixed with this code:
sudo -s echo unmap | tee /sys/block/sda/device/scsi_disk/*/provisioning_mode
The "sda" in that line has to match the drive. On the Pi, it's "sda". When it's the only external drive plugged into a PC, it's "sdb".
When the operating system automatically runs the "fstrim" command, the provisioning mode will change to "disabled" and remain that way. The next time it runs the command, it will fail.
This shell script can make it ready for the "fstrim" command again. Save it as a crontab owned by root ("crontab -e"):
if [ "cat /sys/block/sda/device/scsi_disk/*/provisioning_mode" != "unmap" ] ; then echo unmap | tee /sys/block/sda/device/scsi_disk/*/provisioning_mode fi
I like to have it run once an hour because there's no telling when the system will decide to run the "fstrim" command. The script doesn't write anything if it reads "unmap", so running the script hourly doesn't hurt anything.
I tested all this with both the Pi and my mini PC, so I'm pretty confident it works.
Overclocking
Overclocking isn't necessary for everyday use, but some people like to squeeze out a little more performance. I did it just because I could. All I had to do was edit the "/boot/firmware/config.txt" file and add this to end:
over_voltage=6 arm_freq=2147
After rebooting, the command "lscpu" displayed the maximum MHz as 2200 instead of 1800.
Pi Apps
A software developer created the "Pi Apps" application store. With it, all sorts of applications can be installed on any Raspberry Pi model. Most of them are not available in the regular Raspberry Pi repository.
To install "Pi Apps" at the terminal:
wget -qO- https://raw.githubusercontent.com/Botspot/pi-apps/master/install | bash
The only thing I remember installing was "zram", called "More RAM" in the menu.
Image from the Raspberry Pi Official Magazine
