Rpi4 desktop replacement

From Studiosg
Jump to: navigation, search

Welcome to Simone Giustetti's wiki pages.


Languages: English - Italiano


Raspberry Pi 4 as a Desktop Replacement

Recently I was required to replace some aging hardware with new and cheap one. The obsolete hardware consisting of some Mac laptops equipped with a PowerPC processor running MacOsX version 10.4. Initially used for photo retouching and design work, the Macs were subsequently converted into office computers and used as such for the best part of ten years. The laptops were commonly used for:

  • Surfing the Internet.
  • Read e-mail.
  • Word processing.
  • Creating Spreadsheets.
  • Printing documents.
  • Scanning documents.

Moreover some power users were using the laptops for high level tasks, more out of habit than actual need. Those were however occasional needs since alternatives with significantly better performances and a wider range of functionalities have been available for years. Sporadic uses were ignored to focus on actual work. All in all the only extra request agreed upon was the need to connect USB drives to the new hardware in order to copy files, transfer data and create temporary back-up copies.

Of all the previously listed tasks nothing tests old PowerPC CPUs harder than surfing the net. Modern web pages are monsters ripe with hundreds of nested HTML files, JavaScript code, photos, libraries, movies, style sheets and many more effects that make their rendering a really demanding task, stressing processors to their limits. Another well known and sensitive topic is the need of frequent software updates for web browsers that have to patch security flaws discovered with time. Apple deprecated the PowerPC platform more than ten years ago, nevertheless a group of enthusiasts kept providing patches and software updates. Two projects:

Allow safe surfing the net, but, in spite of their optimized code, cannot comply with the growing demand for resources used by JavaScript and all of the components making up a modern web page.

Before considering a platform switch, I gave some thought to adopt a lighter operating system; one requiring less resources. In the past some laptops were migrated to a version of Linux that ran on PowerPC in order to configure a scanner not supported by MacOsX. Some distributions were installed and tested for the occasion: Slackintosh, Yellow Dog Linux and Kubuntu with a positive response from users. The listed projects are unfortunately dead or switched away from and no longer consider the Gx family of processors worthy of development and updates. One of the advantages of Open Source software however is that it tries to be useful for as many users as possible, not limiting to the vision and interests of a single company. Apple and some of the most popular Linux distributions do not consider the minority of users and companies still using the PowerPC architecture worthy of their efforts, then someone else will. Specifically, I conducted a preliminary analysis among the operating systems of the BSD family. Both NetBSD and OpenBSD support old Mac laptops and desktops. They are significantly lighter platforms than Linux or MacOsX, but unfortunately do not provide compiled packages of all of their supported software. Firefox, LibreOffice, Thunderbird and more require building from source code. An indigestible solution for IT professionals which penalizes even more graphic designers and other users who do not share a deep knowledge of computer science or platforms, nor the desire to spend a lot of time in activities other than producing art, retouching photos, etc. The almost monthly release schedule for security updates of modern web browsers represents the cornerstone for the possibility of a migration to a BSD platform.

Once the need for a platform switch was agreed upon, I started searching for a potential candidate.

Desktop Replacement ?

I've been hearing the term "desktop replacement" for the good part of the past 15 years. At first it referred to laptops too large and clumsy to be effortlessly moved around, but lately it started referring more insistently to small sized space-saving computers. The diffusion of single-board computers has been steadily increasing over the past decade while costs dramatically dropped, resulting in the introduction of super-economic platforms based on the low-power ARM architecture. The Raspberry Pi family of computers is certainly the best known and appreciated among single-board computers.

Raspberry Pi 4


The last introduced Raspberry Pi model is the Raspberry Pi 4, released in June 2019, about a year after the Raspberry Pi 3 B+ model. The developers admitted that everything was ready to go and there was no point in delaying the release further. Many innovations were introduced: an increase of available RAM memory and the inclusion of a Giga-bit Ethernet port with uncapped speed are the most prominent. There are many more improvements, but certainly the RAM and network upgrade were requested with increasing insistence by the community of Raspberry Pi enthusiasts because they grant enough resources to replace old desktop systems. The cost of a single board is another winning factor. I sponsored the version equipped with 4 Giga-bytes of RAM as a replacement for the aging Macs.

Operating System

Once the Raspberry Pi was chosen we needed to agree on an operating system to install. The Raspberry Pi Foundation supports its own Linux distribution, but a multitude of operating systems can be installed. Among them: Android, the previously mentioned systems of the BSD family an even a Windows 10 version. No MacOS version whatsoever sadly. MacOs is a closed system, designed to run on proprietary hardware only and is limited to a single architecture.

Windows 10 was not really a feasible choice for a series of reasons:

  • It is resource hungry.
  • It requires an emulation layer to run classic (32 bit x86) software and is consequently affected by slowdowns.
  • Its license fees are a hyper guarded secret and the activation procedure can be defined Kafkaesque at best.
  • Geological update times and a considerable distrust for the platform are one of the reasons why obsolete machines have been kept for over 10 years and represent the tombstone for Windows as a choice.

The BSD family of operating systems built for the ARM platform are afflicted by the same issues of the PowerPC version: a chronic lack of pre-built, ready to install software. As previously mentioned, the lack of packages is well compensated by a port system, that is a set of programs and libraries that can be built and installed optionally. Unfortunately, this solution is ill-suited to a scenario other than a software house whose staff is used to build the software it requires to work.

Ultimately, Linux was opted for as it offers advantages over all alternatives in terms of package availability, hardware support and licensing costs. The staff having some previous experience and familiarity with the platform is an added bonus.

Distribution

Linux was the operating system chosen to perform some usage tests. Which distribution is the more suitable to support Raspberry Pi 4 ? Many of the recent Linux distributions seem to be eager to include all of the available open source software. This effort provide users with a wide choice of software, but results in bloated programs linked to dozens of libraries, some of which add only marginally useful and obscure features. Not all distributions offer support for architectures other than classic AMD or Intel CPUs. Some guidelines agreed upon to drive the distro selection are:

  • Must support all of the hardware as best as it can.
  • Must offer a selection of packages ready to install and able to comply with most of user needs.
  • Should be as light as possible.

The set of general use distributions supporting the Raspberry Pi 4 was filtered down to include:

  • Raspian: A Debian derived distribution developed expressly for the Raspberry Pi family of computers by the foundation bearing the same name.
  • SlackwareARM: A version of Slackware Linux optimized for ARM based devices.

Out of the two I choose the latter because:

  • Both provide the same level of support for various Raspberry Pi models.
  • Both provide comprehensive installing and configuring instructions.
  • The 14.2 current version of SlackwareARM has been in development for over three years, it is highly stable and does not resort to software emulation, resulting in no performance drop.
  • Slackware is not explicitly developed for teaching programming to kids and as such includes a reasonable amount of programs and libraries aimed at an office environment. It does not exceed in including software useless for the project purposes.
  • Having previously installed and configured Slackintosh, a version of Slackware Linux designed for PowerPC Macs, I was certain that all devices used by end users were well supported.

All that remains is to select additional software to install and expand SlackwareARM customizing it to meet the project guidelines.

Desktop Environment

First you'll need to choose a desktop environment then install and configure it. The desktop environment is the first thing users will see when starting a computer thus its selection requires some care. Luckily, given its more then 50 years of history, UNIX operating systems have plenty of graphical user interfaces to choose from. Each one was developed with a different purpose and exhibits specific strong points, support degree and maturity. The criteria followed to select the graphical user interface are:

  • It must be as light as possible to leave enough resources for programs and utilities to run smoothly. Nobody wants an environment full of effects where pressing any button leads to endless waits.
  • It must be pleasant to see, intuitive and configurable enough to satisfy different people tastes.
  • Must be made up of a limited number of packages and dependencies in order to keep update time to a minimum.

All three criteria bear the same weight. Users expect to adapt some of their habits by upgrading hardware, but don't want to waste time learning the same stuff over and over again. The working environment, if possible, should be a follow up to what they are used to.

Slackware Linux includes some solid desktop environments among its default software:

The former is very light, but supports limited functionality and is no real match for the MacOS GUI. The following one requires an unacceptable amount of resources. That is a real pity as KDE 4 is very pleasant and highly customizable. Another downside of recent KDE 4 and 5 releases consists of the uncontrolled proliferation of packages. A proliferation making harder and harder to keep up to updates. The latter would appear to be a forced choice unless you compile an alternative environment to the distribution included ones.

Gnome never impressed me much as a desktop environment. It has always been a monster hungry for resources and plagued by an endless series of issues. To somewhat improve its state, developers systematically removed functionality migrating it to extensions and customizations to install and configure by choice. The outcome is an environment requiring a lot of configuration work to attain an acceptable set of functionality. My attention turned to Trinity Desktop Environment, which I used in the past with other Raspberry Pi models and always satisfied me with its performances. It is becoming a little outdated on the graphic side, but that happens to be a minor problem given the age of the laptops to be replaced and the consequent end user expectations.

TDE is the winner. You'll have to build it yourselves because Slackware Linux includes no TDE package. I dealt with the task more than once in the past, always coming out successful. Desktop environment updates have a sane release cycle and should pose no problem considering you'll have to rebuild the full environment from time to time. The base packages are counted and installing them provides a working environment rich in functionality. The TDE build procedure was described in depth in a series of articles in this very same web site. The most recently released can be read following this link: Build TDE 14.0.6 for the Raspberry Pi 4.

Driver and Software

After choosing the operating system and graphical interface to install, move on to packages needed by users to perform their day to day tasks. Office work is quite common so there is no shortage of software and resources for Linux that can match any other operating system.

Firefox and Thunderbird

TenFourFox and TenFourBird were available on old Macs to surf the net and read e-mails. SlackwareArm includes both Firefox and Thunderbird thus replacing the former two with the latter is a piece of cake. The programs share the same interface, functionality and even the source code. The migration consists of copying some files and directories from the old computers to new ones. Search for the directories containing the settings of both programs and once you find it, it is trivial to move the content to the Pis, importing in one pass both program configuration and user credentials, old locally saved e-mails , links, bookmarks, etc. Perhaps the easiest part of the whole migration and the least destabilizing for users.

LibreOffice

A PowerPC optimized version of OpenOffice was installed on Macs, used mainly to write documents and spreadsheets. The software didn't receive updates in a long time as both the OpenOffice and LibreOffice projects don't offer support for the PowerPC platform anymore and the latest available release is the installed one. In spite of the software age, users were always able to read and write their documents and files from other platforms.

The migration presents as the best opportunity to switch to a recent version of LibreOffice, allowing everyone to take advantage of the many additions and improvements developed in recent years. Slackware Linux and consequently SlackwareARM does not include a LibreOffice package, but with a little work, brain and patience it is possible to build it from source code. Building LibreOffice for ARM and Slackware platform is the subject of another article presented in a page of this site: Build LibreOffice for Slackware. The article delves in all the precautions taken to make up for some of the quirks of the source code and the dependencies used by LibreOffice. I recommend reading it to avoid running into trivial errors while building your customized version of the software suite.

The only downside of the migration consists in the change in look of the program, the icons in particular. Many projects were taken by a kind of frenzy to update the default icon set with each release in recent years. Usually they go from 32-bit color icons to ugly monochromatic scribbles that are hard to recognize. Luckily the default theme can be replaced with the old Tango icons or with other ones downloaded from the net. Configurability remains one of LibreOffice strengths. To configure a new set of icons, open the Tools → Options → View menu and select the desired theme through the "Icon Style" drop-down menu. Archives of new icons can be downloaded and installed both individually and in the form of extensions. Switching icon set may require you to restart the program to take effect.

System Clock

Raspberry Pi computers equip no hardware system clock and as a consequence both date and time are reset with each shutdown / reboot. A common workaround consists of installing a NTP client to query a time server via network and properly set the clock. The server room hosts some servers and network devices, a firewall and a router, that can be configured to function as local time server. One of the aforementioned devices was promoted to local time server and the Raspberry Pis were configured to query it at startup and, in case of failure only, to query a remote server via the Internet.

It is possible to purchase an expansion card equipped with a system clock and a battery. The card keeps time settings through each reboot. However, the purchase was deemed unnecessary, and recurring to a centralized time system to synchronize the entire network was preferred.

For Slackware Linux the synchronization command should be added to the script /etc/rc.d/rc.local. That way it will be executed at every boot. A trivial example of a synchronization command follows:

  ntpdate pool.ntp.org

Printers and Scanners

The last step to conclude the migration is the configuration of devices connected to the Raspberry Pis. The office printers are a network laser printer and a couple of smaller printers connected locally via the USB port. Local printers are not shared. Two of the laptops are also connected to A4 flat scanners, used to perform quick scans of draft documents and sketches.

The printers are supported by MacOsX via CUPS (Common Unix Printing System): the standard UNIX print daemon. CUPS is the standard printing service in Linux too therefore their configuration does not require any real effort for the Raspberry Pi and SlackwareARM. Drivers are included in standard distribution packages and the *.ppd configuration files can be copied from one of the old machines or downloaded from the net. For safety and convenience, download and install the latest version from the Internet. If the latest release causes problems, just copy the old configuration files. It is a remote eventuality, however store and keep readily available a copy of the old configuration files.

Scanners are not natively supported by MacOsX, but they work through Twain emulation. Twain is the old scanner interface used in Windows. The Twain interface was configured for simplicity, but with a little effort it is possible to configure the SANE standard scan service in Linux. Xsane, the graphic interface of the scanning system, is organized into 4 or 5 separate windows and is somewhat chaotic at first glance. To ease the adoption of the new hardware, search for another scanning software, possibly single windowed. Again you only have to choose:

  • Trinity includes a scanning software among its applications: Kooka / libkscan.
  • SwingSane is an interface for SANE written in Java that can run on any platform supporting a Java Virtual Machine.

Heat Sinks and Fans

A sore trait of the Raspberry Pi 4 compared to previous models is the heat it produces. In short the Pi 4 is hot; much more than its predecessors because its engineers opted for a CPU with higher performance, while they had previously preferred to limit its temperature. The downside is the occurrence of thermal throttling, i.e. the performance degradation aimed at preventing damage to the CPU from high temperatures. Excessively prolonged CPU use leads to an increase in temperature resulting in degraded performance to preserve it. To prevent that from happening it is possible to install some heat sinks or a fan.

Heat sink size varies based on the chip it is meant for.

A set of 4 heat sinks for the Raspberry Pi 4

The recommended heat sink count amounts to a minimum of 3:

  • One heat sink for the CPU and GPU.
  • One heat sink for the RAM chip.
  • One heat sink for the Ethernet chip.

More heat sinks can be added for:

  • The USB chip.
  • The Bluetooth / Wi-Fi chip.

Larger heat sinks are available. They are designed to cover more than one chip of the card. Heat sinks allow you to lower the operating temperature of the chips by a handful of degrees, accumulating heat and delaying the occurrence of thermal throttling. They are not a definitive solution for the overheating problem, but allow to improve the thermal management and the overall performance of the Raspberry Pi nevertheless.

Fans come in a wide variety of sizes and count, single and multiple, and can be connected to the Raspberry Pi through the GPIO BUS and housed in its case.

Simple fan for the Raspberry Pi 4
Twin fan for the Raspberry Pi 4

Fans are an optimal solution for overheating issues deriving from a high CPU load as they keep the temperature constant around 50° C, ideal for operating the Pi. A fan can be connected to both the 5 Volt or the 3.3 Volt PIN. In both cases the fans have the disadvantage of staying always on emitting a constant and somewhat annoying noise. Connecting the fan to the 3.3 Volt PIN allows you to reduce its speed and consequently the emitted noise.

The bare Raspberry Pi configuration cannot dynamically drive fans adapting their speed to sensor detected temperature. For those interested, however, several projects can be found surfing the Internet that aim to control fans speed. A non-exhaustive list of projects includes:

Each guide contains instructions to put together software controlled circuits piloted with a language such as Python. Some expertise with electronic components and soldering is required. Whichever project you choose, make sure that the resources required by Python are not enough as to overheat the CPU. It would be a waste of money, time and effort.

In my case, I choose a 5 Volt powered fan. In the coming months I'll carry out periodic market searches for expansion cards designed to dynamically cool down the Raspberry Pi. If and when such cards will reach the market, after some testing, I'll purchase and install one for every Raspberry Pi.

Once all devices are configured, the migration is complete.

Training

Any migration activity from old to new hardware or software platforms should always be followed by some training. Transferring user data is not enough, people need training to use the new computers in order not to get stuck into trivial problems and confused by minor differences, resulting in frustration and diffidence of the new environment. In order to prevent the mentioned inconveniences, in agreement with the management, some meetings were held explaining the main differences between MacOsX and Linux. The bulk of the subject was addressed in some group meetings followed by some question time and personal training during which specific questions from individual users were answered. The training proved to be quite useful to slightly refine configurations and satisfying specific user needs.


CONCLUSIONS

A migration from obsolete hardware to cheap computers of the Raspberry Pi 4 family was performed for a single machine at first and, after testing performance, stability and ease of use, later definitively for all remaining office laptops of a graphic studio. Fans were deemed essential to guarantee performance and preserve CPU health. I will keep on monitoring the state of the hardware in months to come to verify the opportunity to replace the fixed speed fans with a dynamic cooling system.


For any feedback, questions, errors and such, please e-mail me at studiosg [at] giustetti [dot] net


External links





Languages: English - Italiano