How to Manually Download and Compile MMDVMHost or Any of the Other Components of Pi-Star

Andy Taylor, MW0MWZ, who maintains Pi-Star uses old versions of MMDVMHost and DMRGateway probably for stability, but I’ve taken to using the latest versions with all the bug fixes on my Pi-Star hotspots. Really what Andy maintains with Pi-Star for the community is the web dashboard interface as well as scripts for updating with the compiled binaries on Github and also all packaged up in an image to be installed on your microSD card. Andy has also done a fair bit of customization to the OS and BASH prompts which I find to be a bit much, but the end product is very good and easy to use for a lot of less GNU/Linux experienced hams. But the core of what makes the digital hotspot operate is the work of Jonathan Naylor, G4KLX and other contributors with honorable mention of Andy Uribe, CA6JAU for his MMDVM_HS firmware.

The tools to download the source code and compile it are already installed on the Pi-Star image, so you just need to go to Jonathan Naylor’s Github page:

https://github.com/g4klx/MMDVMHost

You’ll notice the green Code button, click on that and in the box that pops up you can click the copy button to the right of the address.

SSH into your Pi-Star machine. A lot of people promote Putty, but if you’re on Windows 10 or later you can actually just do this from the Windows Powershell prompt. Right click on the start menu and select Windows Powershell. An even better option is to download the free Windows Terminal app from the app store (really good option if you want to play with Windows Subsystem for Linux – Linux virtualization):

https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-us&gl=US

From the windows prompt just type the following:

ssh ip

If you’re on Linux, you’re probably already acquainted with the terminal and being able to SSH into machines. Bonus tip: check out Mosh which keeps the SSH connection up even after losing internet, changing IP, after sleeping computer…

Next we’ll need to make the file system read/write, it’s defaulted to read only in normal operation. Then we’ll use the git command to clone the repository of MMDVMHost, change into the directory, and then issue the compile with screen support:

rpi-rw
git clone https://github.com/g4klx/MMDVMHost.git
cd MMDVMHost/
make -f Makefile.Pi.OLED

Andy has a cronjob that will check hourly and make the file system read only, so if you get an error on compile just redo the rpi-rw command and start over. It’s more of a pain to go disable the cron job than just restarting, and if you restart you’ll have the full hour to compile and move the file (rarely happens to me). When finished compiling you should have the following in your terminal:

And we’ll compare the versions of what Andy is using to the brand new version we just compiled. The first is Andy’s and the second is the one we just compiled.

To copy our new version we just need to move it to the binary location after making a backup of the old version.

sudo cp /usr/local/bin/MMDVMHost /usr/local/bin/MMDVMHost.old
sudo systemctl stop mmdvmhost.service
sudo cp MMDVMHost /usr/local/bin/MMDVMHost
sudo systemctl restart mmdvmhost.service
rpi-ro

If using DMRGateway, I had to restart both.

sudo systemctl restart mmdvmhost dmrgateway

And we can see it’s all working as expected, DMRGateway log file at top pane of GNU/Screen, and MMDVMHost log file at bottom.

And to verify we’re on the new version, from the prompt check the version.

As a bonus if you leave the MMDVMHost directory, change into it and you can issue the following command to pull down any changes.

git pull

Clean out your previous compiled files.

make clean

And then you can compile the new code as above. And if for some reason you want to compile a specific version, just below the green code button is a commit link that will show you all the different versions with related numbers. Copy the hash of the version you want.

We’ll pick an old commit to show how to switch to it, and you can also just use the first seven digits of the hash as well. You’ll see that I switched to the older version, and then showed you how to switch back to the master branch.

And you can do this with all the different parts of what makes your hotspot work. And you can always copy the old version back if you need to. So enjoy git and being able to compile the latest version of the code to use on your hotspot.