RaspberryPi OS 13 Networking tidy up & broken lm-sensors

Since RaspberryPi are now forcing users of its SBC to use RaspberryPi OS 13 (via the RaspberryPi Imager tool) instead of the reliably stable Debian 11 or 12 several issues have come to light.

Firstly if like me you run most of the your Pi4/5 SBCs headless/lights out you’ll notice that networking is now ridiculously managed via Network Manager and Netplan.

This is a ridiculous method of managing such a simple device, it’s over complicated, messy and ill thought out. Yet another classic example of change for the sake of change and not to actually improve things.

This combination of Network Manager (often referred to as Network Mangler for good reason) and Netplan is fraught with bugs. Try setting a second IP address on an interface and you’ll find it doesn’t work. nmtui will show the ip address as being configured however, netplan never actually puts the config into play.

Having to use nmtui on the command line to manage ethernet interfaces is also ridiculous. Its badly laid out menu system takes an age to get through to do the simplest of config changes. What’s wrong with just editing the /etc/network/interfaces file?

After much frustration trying to configure the ethernet interface on my headless Pi5 I decided to get rid of this hideous method of managing ethernet interfaces and put it back to using the simple interfaces file.

I’ve documented the steps just in case anyone else wants to do the same.

Step 1: Make sure the traditional networking stack is installed:

sudo apt install ifupdown

Step 2 – Disable NetworkManager:

sudo systemctl stop NetworkManager.service
sudo systemctl disable NetworkManager.service
sudo systemctl mask NetworkManager.service

(Optional but tidy: )

sudo apt purge network-manager

Step 3 – Disable Netplan

sudo apt purge netplan.io
sudo rm -f /etc/netplan/*.yaml

Also ensure /lib/systemd/systemd-networkd is disabled, since Netplan can trigger it:

sudo systemctl disable systemd-networkd
sudo systemctl mask systemd-networkd

Step 4 – Create your /etc/network/interfaces file

# Example /etc/network/interfaces for Ethernet (eth0) with static IP:
#
# Loopback
auto lo
iface lo inet loopback

# Ethernet
auto eth0
iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 1.1.1.1 8.8.8.8

Example for DHCP:

auto eth0
iface eth0 inet dhcp

If you use Wi-Fi:

auto wlan0
iface wlan0 inet dhcp
    wpa-ssid "YourSSID"
    wpa-psk "YourPassword"

Step 5 – Enable the traditional networking service

sudo systemctl enable networking.service
sudo systemctl restart networking.service

Then confirm:

ip a

You should see your interfaces up with the expected IP addresses, managed by ifupdown.

Step 6 – (Optionally) Clean residual files

Remove leftover NetworkManager/Netplan configs to avoid confusion:

sudo rm -rf /etc/NetworkManager
sudo rm -rf /etc/netplan

Verification

Check which subsystem is active:

systemctl is-active NetworkManager
systemctl is-active networking

Expected output:

inactive
active

The /etc/network/interfaces method works perfectly on Pi 5 and is lighter weight and ideal for embedded or headless servers.

If you later reinstall NetworkManager, it will override interfaces again unless you mark them as unmanaged in /etc/NetworkManager/NetworkManager.conf.

You can still use ifup / ifdown commands manually for control.

You now have your Pi running the classic, lightweight networking stack which is ideal if you use your Pi as a 24/7 server like I do.

Note: This method is still supported on RaspberryPi Debian 13 but, it’s no longer the default.

As a final note, if you want to add a second IP Address to your Ethernet interface it’s extremely simple to define in the /etc/network/interfaces file. I’ve created an example of how to do this below for reference.

# Loopback
auto lo
iface lo inet loopback

#
# Primary interface - static IP
#
auto eth0
iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 1.1.1.1 8.8.8.8

#
# Secondary IP on same interface
#
auto eth0:1
iface eth0:1 inet static
    address 192.168.1.11
    netmask 255.255.255.0

Check both IP Addresses appear on the same interface:

ip a show eth0

For the example above you’ll see:

inet 192.168.1.10/24
inet 192.168.1.11/24

Finally, if like me you use lm-sensors to keep check on how hot your Pi is running you’ll find that the sensors command no longer works, it just throws a segmentation fault. This is a nuisance as I use this as part of my Node-Red Monitoring Dashboard.

A partial work around is to use the vcgencmd command as it can return the temperature of the system on a chip (SOC) device.

vcgencmd measure_temp

You can create an alias for this command in your ~/.profile file, I’ve named the alias ‘cputemp’ in this example:

alias cputemp="vcgencmd measure_temp"

Once you’ve saved your .profile file logout and back in again and you’ll now have a new command to use to get the CPU temp.

More soon …

Updates to my install-pihpsdr.sh script

Over the last few weeks I’ve been working on my install-pihpsdr script to build a version of the DL1YCF PiHPSDR fork that will work with the Adalm Pluo, Pluto+ and LibreSDR transceivers.

Since I don’t own any of these devices, Steve M0XVT has loaned me his Adalm Pluto and LibreSDR devices to test with.

Initially neither of the devices would work with the PiHPSDR build that my script was creating. After some investigation I found this was due to the fact that the developer build script was only building the SOAPYSDR library, it wasn’t building the modules for each device type.

This was easily fixed by adding some extra code that would build the necessary SOAPYSDR modules so that the devices were discovered on the local LAN.

Since I had the devices to hand I took the opportunity to test the updated build script on a number of Linux Distro’s that I have to hand.

PiHPSDR running on Linuxmint 22.1 Cinnamon Edition using the LibreSDR transceiver
PiHPSDR running on Linuxmint 22.1 Cinnamon Edition using the LibreSDR transceiver

I tested the updated build script on Kubuntu 22.04LTS, Linuxmint 22.1 Cinnamon Edition and RaspberryPi 4/5 running the latest RaspberryPi OS 64bit version.

These all worked great with the transceivers and will now make a great platform for QO-100 stations that use either the Adalm Pluto, Pluto+ or LibreSDR devices.

Of course this build of PiHPSDR will also work with the Hermes Lite 2 and RadioBerry devices that I use most of the time in my own radio shack.

The updated PiHPSDR install script can be downloaded from my original blog article on the subject that is located here: https://m0aws.co.uk/?p=3686

The updated build script will most likely work on most Debian based Linux distro’s and build a working version of PiHPSDR. If you find a distro where you have problems please email me and let me know the details and I’ll happily look at the issue and try to resolve it.

Thanks to Steve for the loan of his precious SDR transceivers, I had a lot of fun with them!

More soon …

Building a new Desktop Environment for the RaspberryPi 5

Regular readers of my blog will already know that I am a huge fan of the Linux operating system, it’s clearly evident in most of the content on this website.

I am also a very enthusiastic user of one of the first credit card sized computers that came to be, namely the RaspberryPi. I own all the iterations of this wonderful little computer from the very first version to the latest and greatest, RaspberryPi 5.

This little computer has done more for computing in education than Microsoft and Apple will ever achieve and it’s done it at an incredibly low price making it more accessible to schools, colleges and students than any other platform.

The RaspberryPi has what most consider to be the best support on the planet when it comes to single board computers (SBCs). From the dedicated team that build Raspberry Pi OS, to all the amazing projects and forums that are available, for free on the internet today.

The RaspberryPi computer really has revolutionised computing for the masses.

My RaspberryPi 5 that I am writing this article on
My RaspberryPi 5 that I am using to write this article.

Raspberry Pi OS really is very good. It’s based on the great Debian distro’ that many of us seasoned Linux users dearly love. It’s light weight, fast and meets the needs of everyone that is venturing into the exciting world of Linux and SBCs for the first time.

Overtime as we all become more experienced with Linux on the RaspberryPi we become more demanding and start to find the Raspberry Pi OS desktop environment lacking. Sure it can be enhanced by adding more and more to it however, it never quite reaches the point of satisfaction and we are always wishing for something more.

With the Pi-5, the latest iteration of this great credit card sized computer, users are now able to seriously think about building a more powerful desktop environment for their little berry flavoured computers.

On my desktop PCs dotted around the house I have used Kubuntu for decades. It’s a slick and powerful desktop environment that has met my needs for many years and I love it more than any other Linux desktop. Sadly Kubuntu isn’t easily available out the box for the RaspberryPi and so I decided that it was time to replicate it as closely as possible on my new, super powerful RaspberryPi 5.

When I ordered my RaspberryPi 5 from Pimoroni I added the NVMe base and 250GB M.2 SSD drive to the order. Up until now I’d always used SD cards however, they are slow and unreliable and so I decided that since the Pi-5 has PCIe it was time to take the step away from SD cards and start using SSD technology.

Getting the OS onto the SSD is a two stage affair. First you have to create a bootable SD card to boot the Pi-5 from and then use it via the RaspberryPi Imager to install the OS onto the SSD. It’s a bit long winded but, easy enough.

Since I’m a huge Kubuntu fan I decided my desktop of choice for my new Pi-5 was going to be KDE-Plasma. I had tried to install this desktop before on older model Pi’s however, it ran so slow that it was unusable. With the new Pi-5’s increased computing power and the speed of the SSD I was confident that this was now possible.

I started out installing the Lite version of Raspberry Pi OS on the SSD. This is a command line only version of Linux that doesn’t include any desktop environment, a nice clean slate to start from.

RaspberryPi Imager showing Pi OS Liite (64bit)
RaspberryPi Imager showing Pi OS Lite (64bit)

Once the Lite version of the OS was installed on the SSD I shutdown the Pi-5 and removed the SD card and then powered the Pi-5 back up again so that it booted from the SSD.

Upon booting I was presented with the simple Linux Login prompt. After entering my username and password as setup during OS install I landed at the Linux command prompt.

sudo su -

I used sudo to become root user as shown above and then set about building my new KDE based super computer. First I needed to update the operating system with all the latest patches and security fixes.

apt update && apt dist-upgrade

The update and upgrade process ran for a while but, it was soon complete.

reboot

I issued the reboot command and then logged back in again, I was now ready to start building the KDE desktop environment.

sudo su -
apt install kde-plasma-desktop gldriver-test

Becoming root again I type the command to install the KDE-Plasma desktop and the graphics-related config services. There’s a lot of packages to download and install so, I left it to do its thing.

A little while later all the packages were installed and ready to go. I now needed to tell the system to boot into the new graphical user interface instead of the command prompt using systemctl.

systemctl set-default graphical.target

Once this was done I needed to make a change to the display settings using the raspi-config program.

raspi-config

Selecting No.2 on the menu, Display Options and then D2 Screen Blanking, I disabled screen blanking so that I got the full 4K support for my KDE Desktop.

Once the system had been configured for a graphical user interface there was only one thing left to do and that was to shutdown the RaspberryPi.

shutdown -h now
The beautiful KDE-Plasma Desktop on RaspberryPi 5
The beautiful KDE-Plasma Desktop on RaspberryPi 5

Powering the Pi-5 back up again I was greeted by the standard KDE Plasma login screen and then, after logging in I was transported to the beautiful KDE desktop. I was now smiling like a Cheshire cat!

The KDE desktop is incredibly snappy on the Pi-5 with an SSD, app’s open instantly and run with minimum CPU exertion. It was now time to load the rest of the KDE application suite to complete the build. Popping open a terminal I hit the command line once more.

sudo su -
apt install kde-full vim yakuake vlc firefox rsyslog

This loads the full set of KDE applications adding just about everything you’ll ever need to the desktop environment. It’s about 1GB of packages and so depending on your internet speed it could take a while but, it’s well worth the wait.

Once complete you are ready to go with a fully functional, snappy, powerful desktop.

I’m extremely pleased with the performance of the Pi-5. KDE is super fast, snappy and responsive. With 8GB of RAM on tap the RaspberryPi has no problem with performance. The Pi-5 and KDE-Plasma really do make a great desktop computer at an incredible cheap price.

Looking for a new computer?

Add a cheap USB sound card and a pair of speakers and this little setup will meet the needs of 90% of the population with ease and go on to satisfy the more seasoned, demanding Linux user or programmer without breaking the bank.

More soon …

Using the DL1YCF version of PiHPSDR with the RadioBerry

(This information is also for the Hermes Lite 2, Adalm Pluto, Pluto+ and LibreSDR)

During my RadioBerry build I started out using the version of PiHPSDR that was created just for the RadioBerry. The problem with this is that it is hard coded for a very small screen making it hard to use on a big screen since the user cannot resize the window dynamically.

I decided to look for a forked version of the PiHPSDR software that had the ability to change the window size to suit all use cases. During my search I stumbled across the DL1YCF fork of the source code that has some enhancements, one of which is the ability to change the display size.

In no time at all I had the source code downloaded and compiled only to find that it didn’t work with the RadioBerry. After some investigation I found that this was due to the fact that the RadioBerry software has compiled into it code that is used to access the GPIO pins on the RaspberryPi so that it can communicate with the RadioBerry HAT. This is fine except that the DL1YCF version of PiHPSDR also has code in it to use the GPIO pins. This of course causes a conflict and the net result is that nothing works.

Reading through the source code and Makefile I found that all I needed to do was to compile a version of PiHPSDR without GPIO support. This would then remove the conflict and allow the RadioBerry software to operate correctly.

To this end I put together a download/compile/install script for the DL1YCF version of PiHPSDR that will work on a RaspberryPi with a RadioBerry HAT and give the ability to resize the window to fit any size screen.

The script also works on a Linux Desktop PC running Ubuntu/Kubuntu/Linuxmint/Debian operating systems. (It will most likely work on other distro’s too but, these are all I have to hand currently). You can of course also use this software with a Hermes Lite 2 transceiver.

DL1YCF PiHPSDR running on RaspberryPi 4 with RadioBerry HAT on a large monitor
DL1YCF PiHPSDR running on RaspberryPi 4 with RadioBerry HAT on a large monitor

To install this enhanced version of PiHPSDR on your RaspberryPi/Desktop PC with GPIO support disabled, download the installation script below, unzip it and run it in a terminal on your RaspberryPi/Desktop PC in your home directory. (/home/<your-username>).

The script will download the latest source code from the DL1YCF github, disable the GPIO code and then compile and install it to your computer. If installing on a RaspberryPi it will create an icon on the desktop for you to use to start the software.

If installing on a PC then you will need to create your own desktop icon as the one created only works on a RaspberryPi. You can of course just start the software from the command line in a terminal. (My preferred method).

If you have a RaspberryPi 5 then I highly recommend that you run this version of PiHPSDR on it as it has a lot more computing power and handles using dual receive with ease. It will run on a Pi4 but, you will load the CPU more as it’s not as powerful as the later model Pi5.

The script will ask if you want to compile in SOAPYSDR support so that PiHPSDR will work with RTL-SDR, Adalm-Pluto, Pluto+ and LibreSDR. Enter Y to compile in support or N if you don’t need it.


I hope this proves useful to all the RadioBerry, Hermes Lite 2 and Pluto users out there who want to use PiHPSDR on a big screen.

More soon …

Building HAM Clock on an old RaspberryPi

I’ve got a couple of old RaspberryPi computers on the shelf in the shack and so decided it was time for me to put one of them to good use. The first model on the shelf is the oldest and is one of the very first RaspberryPi 1 computers that was released. (It’s the one with the yellow analog video signal output on the board!). This particular model is extremely slow but, I hang onto it just as a reminder of the first SBC in the line.

The second one is a RaspberryPi 2, a quad core machine that is only slightly faster than the first model but, it’s powerful enough to run HAM Clock.

It didn’t take long to install a vanilla Raspbian Desktop O/S and get it configured on the local LAN. I installed a few packages that I like to have available on all my Linux machines and then started on the HAM Clock install.

The first thing I needed to do was install the X11 development library that is required to compile the HAM Clock binary. To do this, open a terminal and enter the command below to install the package.

sudo apt install libx11-dev

You will need to type in your password to obtain root privileges to complete the installation process and then wait for the package to be installed.

The HAM Clock source code is available from the HAM Clock Website under the Download tab in .zip format. Once downloaded unzip the file and change directory into the ESPHamClock folder ready to compile the code.

cd ~/Downloads/ESPHamClock

Once in the ESPHamClock directory you can run a command to get details on how to compile the source code.

make help

This will check your system to see what screen resolutions are available and then list out the options available to you for compiling the code as shown below.

The following targets are available (as appropriate for your system)

    hamclock-800x480          X11 GUI desktop version, AKA hamclock
    hamclock-1600x960         X11 GUI desktop version, larger, AKA hamclock-big
    hamclock-2400x1440        X11 GUI desktop version, larger yet
    hamclock-3200x1920        X11 GUI desktop version, huge

    hamclock-web-800x480      web server only (no display)
    hamclock-web-1600x960     web server only (no display), larger
    hamclock-web-2400x1440    web server only (no display), larger yet
    hamclock-web-3200x1920    web server only (no display), huge

    hamclock-fb0-800x480      RPi stand-alone /dev/fb0, AKA hamclock-fb0-small
    hamclock-fb0-1600x960     RPi stand-alone /dev/fb0, larger, AKA hamclock-fb0
    hamclock-fb0-2400x1440    RPi stand-alone /dev/fb0, larger yet
    hamclock-fb0-3200x1920    RPi stand-alone /dev/fb0, huge

For my system 1600×960 was the best option and so I compiled the code using the command as follows.

make hamclock-1600x960

It’s no surprise that it takes a while to compile the code on such a low powered device. I can’t tell you how long exactly as I went and made a brew and did a few other things whilst it was running but, it took a while!

Once the compilation was complete you then need to install the application to your desktop environment and move the binary to the correct directory.

make install

Once the install is complete there should be an icon on the GUI desktop to start the app. If like mine it didn’t create the icon then you can start the HAM Clock by using the following command in the terminal.

/usr/local/bin/hamclock &

The first time you start the app you’ll need to enter your station information, callsign, location etc and then select the settings you want to use. There are 4 pages of options for configuring the app all of which are described in the user documentation.

M0AWS - HAM Clock running on RaspberryPi Computer
M0AWS – HAM Clock running on RaspberryPi Computer

Once the configuration is complete the map will populate with the default panels and data. I tailored my panels to show the items of interest to me namely, POTA, SOTA, International Beacon Project and the ISS space station track. I was hoping to be able to display more than one satellite at a time on the map however, the interface only allows for one bird to be tracked at a time.

You can access the HAM Clock from another computer using a web browser pointed at your RaspberryPi on your local LAN using either the IP address or the hostname of the device.

http://<hostname>:8081/live.html

or

http://<ip-address>:8081/live.html

You can also control the HAM Clock remotely via web browser using a set of web commands that are detailed on port 8080 of the device.

http://<hostname or ip-address>:8080/

M0AWS - HAM Clock remote command set
M0AWS – HAM Clock remote command set

This is a great addition to any HAM shack especially if, like me you have an old HDTV on the wall of the shack that is crying out to display something useful.

More soon …

Home-Brew 12v DC Distribution Box

I’ve been wanting to tidy up the cabling to the 12v DC PSU for some time in the radio shack as like many HAMs I have a number of radios/devices that all need a 12v feed but, only two connectors on the front of the PSU. The net result was a birds nest of wires all connected to the PSU making it impossible to disconnect one device without others getting disconnected at the same time.

Looking online I found that many of the HAM outlets stores sell nice little 12v DC distribution boxes that would be ideal however, they’re all priced somewhat high for what they are so, I decided to purchase the parts and make one myself.

Searching on Amazon I found all the necessary parts for less than a quarter of the cost of commercially made units. A couple of days later the parts arrived and sat on my desk in the shack for a few weeks. Yesterday I finally found the time to make a start on the project.

M0AWS home-brew 12v DC Distribution Box
M0AWS home-brew 12v DC Distribution Box

After much drilling and filing I had the necessary holes/slots cut in the plastic box for the 4mm connectors and fuse holders and started wiring them up. Part way through my 30 year old soldering iron decided to die and so I had to stop and wait for a replacement to arrive.

M0AWS completed 12v DC Distribution Box
M0AWS completed 12v DC Distribution Box

With the new soldering iron in hand it only took 30mins or so to complete all the joints and I soon had the box together ready to test with my multimeter to ensure I didn’t have any shorts or crossed wires.

With testing complete and fuses in place I connected it up to the PSU and then connected all the devices one by one checking for voltage drops as I went.

M0AWS 12v DC Distribution Box
M0AWS 12v DC Distribution Box

I now have my CG3000 remote auto ATU, GPSDO, QO-100 ground station and IC-705 all nicely connected in a much tidier fashion than before, all for considerably less than the commercially available alternatives.

More soon …