Skip to content

Instantly share code, notes, and snippets.

@SteveCooling
Last active December 10, 2017 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveCooling/86c3a9a4fb7b3ee7bc4e41404a71feeb to your computer and use it in GitHub Desktop.
Save SteveCooling/86c3a9a4fb7b3ee7bc4e41404a71feeb to your computer and use it in GitHub Desktop.
MMDVM firmware updater
#!/bin/bash
#
# Quick and dirty script to update firmware on DVMega hotspots without detaching from Raspberry Pi
#
# Will only work if you do G0WFV mod on the DVMega. See this link:
# https://g0wfv.wordpress.com/how-to-update-dvmega-firmware-without-a-programmer-or-an-arduino/
#
# Main install procedures in this script are from the G0WFV webpage.
# Use this script only at your own risk!
#
echo "DVMega firmware updater"
echo "======================="
echo ""
echo "Will flash newest firmware to DVMega equipped with G0WFV mod wire."
echo ""
echo "* Make sure MMDVMHost is stopped!"
echo "* The script will install and modify software as root if needed."
echo "* Use this script only at your own risk!"
echo ""
echo " 73 de LA1FTA"
echo ""
echo "Press Y+<enter> to continue"
read confirm
if [ $confirm != "Y" ]
then
exit 42
fi
cd /tmp
function autoreset_install {
sudo apt-get update
sudo apt-get install git avrdude python-dev python-rpi.gpio
git clone https://github.com/openenergymonitor/avrdude-rpi.git
cd avrdude-rpi
sudo cp autoreset /usr/bin
sudo cp avrdude-autoreset /usr/bin
sudo mv /usr/bin/avrdude /usr/bin/avrdude-original
sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude
}
if [ ! -x /usr/bin/autoreset ]
then
echo "Installing patched version of avrdude..."
echo ""
autoreset_install
fi
#
# Hopefully in the future DVMEGA will have a nice way to automatically find the newest firmware.
# Patch this if you want.
#
FILE=DVMEGA_RH_V318_UNO.zip
HEXFILE=DVMEGA_RH_V318_UNO.hex
wget http://www.dvmega.auria.nl/images/$FILE
unzip $FILE
# make sure MMDVMHost is stopped
sudo killall MMDVMHost
sleep 1
avrdude -p m328p -c arduino -P /dev/ttyAMA0 -b 115200 -F -U "flash:w:$HEXFILE" -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment