K3LTC.com Experimentation

HamPi - a raspberry pi image for amateurs

If you're looking for a project to do with that spare Raspberry Pi I recommend checking out hampi. Its jam packed with amateur radio software which "just works" and turns that raspberry pi into a low powered PC you can bring along in the field (some assembly required) for digital mode operations, or just logging. Items needed to get started
  • a standard computer (Windows, Mac, Linux) which you can use to prepare the hampi image and edit a file on the image if things don't work right away. I highly recommend using a linux based PC for this if you're comfortable doing so.
  • Raspberry Pi 3 or better
  • mini SD card (any size should work)
  • mini SD card adapter
    • this provides a way to plug your miniSD card into a standard computer: if you have a laptop it might have a mini SD card slot (probably not) or it could have a standard SD card slot in which case you'll need one of those little adapters which accepts the miniSD card, or you can use a USB adapter which provides lots of different sized SD card slots.
    • hopefully you'll only need this the first time to "burn" the hampi image you will use in the pi, BUT you might need it again if things don't work so you can edit a special file on the image called config.txt to get it working.
  • Power supply for raspberry pi (which provides at least 1A)
  • hdmi cable (full size at least for pi 3)
  • monitor with hdmi port
  • USB keyboard and mouse (can be wireless or use a single USB dongle if wireless)
  • patience

On the standard computer visit:
https://sourceforge.net/projects/hampi/files/2021-03%20Release/
and download the latest image for hampi. I downloaded HamPi_v1.3a.img.xz image. In our example we'll download to C:\Temp in windows or our home directory ~/ in linux.

There is another file up there you want named HamPi_v1.3a.img.xz.sha256sum which is a text file with a single line in it. That line provides a "hash" which should match the hash you get when you check the 256sum on the downloaded image. This is a way for you to check that the image is the exact image that W3DJS uploaded and that it hasn't been altered through nefarious means. Its possible to skip this step as it is highly unlikely anything like this has happened, its simple enough to check for peace of mind.

To check the hash in Windows, open command window with "cmd" and type:
certUtil -hashfile C:\HamPi_v1.3a.img.xz SHA256
To check the hash in Linux, in a terminal type:
sha256sum ./HamPi_v1.3a.img.xz
On a Mac, in a Terminal:
shasum -a 256 /path/to/HamPi_v1.3a.img.xz

That will produce an output in the terminal and you're looking for a long string of characters, the "sum" or "hash". That should match the string in the file HamPi_v1.3a.img.xz.sha256sum exactly. If it doesn't, you either did something wrong (highly likely if you've never done this before) or the image file has been modified from what was originally uploaded (unlikely but possible).

Assuming you have a good image, the next step is to burn it to the SD card.

The simplest method for this that I have found is using balena etcher.
Download from https://www.balena.io/etcher/ for Windows, Linux, or Mac Install that program.

Make sure you have the SD card plugged into your PC and can access it.

Run Balena Etcher and it will walk you through three steps:

  • Pick the image you want to burn (HamPi_v1.3a.img.xz)
  • Pick the drive you want to burn it to - VERY important that you pick the SD card and not something else! This process will wipe the drive you pick and all data on it! If you know the size of the SD card (16GB, 8GB, etc) its usually easy to find the right one in the drop down (assuming you have it plugged in)
  • Burn the image (this will probably ask you for admin password because writing disks like this is destructive)

If it is working the process will take some time. If its done immediately probably something didn't work.

When its done, you have a hampi image!

Insert into the pi, connect screen, keyboard, and mouse and lastly connect to power. You should see both a red led (power) steady illumination and a green led (sd card reading) flashing. If you see both of these but nothing ever comes up on the screen, you might need to make some changes on the images to force it.

Just unplug the power cord from the pi and remove the SD card and put it back into a reader or plug into your standard PC. Once the drive is recognized look for a file in the drive named boot called config.txt. Open that in notepad (Windows), or textedit (Linux and Mac) and take a quick look at the settings. Anything with a # at the beginning of the line is a comment and not active. Look for these settings, and if they have a # in front of them delete it:
hdmi_drive=1
hdmi_force_hotplug=1
then save the config.txt, eject the SD card and put it back into the pi and power up again. Hopefully that will solve the issue. If not, there are a bunch of other hdmi related settings in config.txt which may help. There are so many its easier to just link to the official page for this:
https://www.raspberrypi.org/documentation/configuration/config-txt/video.md

Another common video related issue is a black border around the desktop.
To remove it and use your full screen, you can set:
overscan=1 (delete the # at the beginning of that line if it exists)

If the pi boots up and the display is working, the rest of the setup is done on-screen through a series of prompts.

hampi contains almost all the programs a ham could want to play with already installed. Each program will require some amount of configuration depending on what you intend to do, but I was happy to see that many of those I tried worked out of the box. CubicSDR recognized my RTL-SDR that I thought was broken and it worked right away! hampi even includes JS8Call which you would otherwise have to compile from source.

A raspberry pi running hampi might make an excellent companion for a Parks on the Air or field day event because its so low-power, but remember that to use it you will need a screen and some kind of keyboard and mouse. There are several interesting ways to solve this problem, but all of them are out of scope for this article.

Related information

Power a raspberry pi from a 12V Battery
https://desertbot.io/blog/raspberry-pi-battery

Support

https://groups.io/g/Ham-Pi/
https://github.com/dslotter/HamPi/issues