Headless MMDVM Firmware Building

From PiStar Wiki
Jump to navigationJump to search

Pi-Star is a great system for hosting your hotspot and/or repeater, but for repeater keepers it lacks an important tool; The ability to compile and install new firmware on your MMDVM Hardware; With that in mind below are some instructions for building the MMDVM firmware on your PI-Star.

  • This guide it built based on an excellent video from Andy CA6JAU, and en excellent blog post from Florian Wolters - thank you both

1. Expand the file system if you have not done so already

 [email protected](ro):~$ sudo pistar-expand

2. Reboot after the expand process completes.

 [email protected](ro):~$ sudo reboot

3. Make a script to install the required tools for compiling the firmware (Arduino IDE - but without the GUI) This script is from Florian's excellent blog here: [[1]https://www.florian-wolters.de/blog/2017/05/24/headless-building-mmdvm-firmware/]

 [email protected](ro):~$ rpi-rw
 [email protected](rw):~$ touch install-arduino-ide.sh
 [email protected](rw):~$ nano install-arduino-ide.sh

Now you can copy/paste the below script into your terminal window

install-arduino-ide.sh

#!/bin/bash

# Try to auto detect latest Arduino IDE version
FILE=$(wget "https://www.arduino.cc/en/Main/Software" -qO - | grep "arduino-[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}-linuxarm.tar.xz" | sed -e 's/.*\(arduino-.*-linuxarm\.tar\.xz\).*/\1/')

# Uncomment next line and set version manually if auto detection does not work
# FILE=arduino-1.8.2-linuxarm.tar.xz

if [ -z "$FILE" ]; then
  echo "Error detecting latest Arduino version."
  echo "Please set version manually!"
  exit 1
fi

DIR=$(echo $FILE | sed -e 's/-linuxarm\.tar\.xz//')

# Now get the Arduino IDE archive
wget "https://downloads.arduino.cc/$FILE" -O $FILE

# Extract the Arduino software
tar -xvf $FILE

# Install latest version for ARM M3 boards
cd $DIR
./arduino --install-boards "arduino:sam"

exit 0

Now make the file executable and run it with:

 [email protected](rw):~$ chmod +x install-arduino-ide.sh
 [email protected](rw):~$ ./install-arduino-ide.sh

4. Make the /usr/local/src directory where we will compile the source;

 [email protected](rw):~$ sudo mkdir /usr/local/src
 [email protected](rw):~$ sudo chmod 777 /usr/local/src

5. Change to the new src directory and pull in the MMDVM Firmware source

 [email protected](rw):~$ cd /usr/local/src
 [email protected](rw):~$ git clone https://github.com/g4klx/MMDVM.git
 

6. Make any edits you need to in 'Config.h' and then compile;

 [email protected](rw):~$ cd MMDVM 
 [email protected](rw):~$ make -f Makefile.Arduino compile

7. Upload your firmware onto your DUE board;

 [email protected](rw):~$ sudo systemctl stop pistar-watchdog
 [email protected](rw):~$ sudo systemctl stop mmdvmhost
 [email protected](rw):~$ sudo systemctl stop mmdvmhost.timer
 [email protected](rw):~$ make -f Makefile.Arduino upload

At this point its a good idea to reboot Pi-Star, you may also have to re-calibrate your board using 'pistar-mmdvmcal' after the reboot.