Here is the ModeSMixer2 installation script I have prepared for myself. I would now like to share it to make things easy for others as well. However following points should be noted:
-
The version of ModeSMixer2 which the script downloads from Google Drive is current version for Pi 2 / 3 Raspbian Stretch (modesmixer2_rpi2-3_deb9_20180616.tgz). When new version is released, the script will require updating.
-
It is based on user
pi
(i.e.pi@raspberrypi
orpi@piaware
). The installation path is hard coded to/home/pi/mm2
STEP 1 of 4
Create a new file install-mm2.sh
, make it executable, and open it for editing
sudo touch /home/pi/install-mm2.sh
sudo chmod +x /home/pi/install-mm2.sh
sudo nano /home/pi/install-mm2.sh
.
STEP 2 of 4
In the new blank file install-mm2.sh
, copy-paste code given below. Save file (Ctrl+o) and close file (Ctrl+x)
.
Following is the code to be copy-pasted in file install-mm2.sh
#!/bin/bash
echo "creating folder mm2"
sudo mkdir /home/pi/mm2
echo "downloading modeSMixer2 file from Google Drive"
sudo wget -O /home/pi/mm2/modesmixer2_rpi2-3_deb9_20180616.tgz "https://drive.google.com/uc?export=download&id=1lV_tUMVIj_CvM3kxdkk8PX2pLLAJskw_"
echo "entering into folder mm2"
cd /home/pi/mm2
echo "unzipping downloaded file"
sudo tar xvzf modesmixer2_rpi2-3_deb9_20180616.tgz
echo "creating starting script"
sudo touch /home/pi/mm2/mm2.sh
echo "writing code to file mm2.sh"
FILE="/home/pi/mm2/mm2.sh"
sudo chmod 777 $FILE
/bin/cat <<EOM >$FILE
#!/bin/sh
/home/pi/mm2/modesmixer2 \\
--inConnectId 127.0.0.1:30005:ADSB \\
--inConnectId 127.0.0.1:30105:MLAT \\
--web 8787 \\
--location xx.xxxx:yy.yyyy \\
EOM
sudo chmod +x $FILE
echo "writing start-up to file /etc/rc.local"
sudo sed -i '/fi/a \
\
/home/pi/mm2/mm2.sh & \
' /etc/rc.local
echo " "
echo " "
echo "INSTALLATION COMPLETE .....PLEASE DO FOLLOWING:"
echo "(1) Edit file /home/pi/mm2/mm2.sh and in the following line and"
echo " rereplace xx.xxxx and yy.yyyy by your actual latitude and longitude"
echo " "
echo " --location xx.xxxx:yy.yyyy \ "
echo " "
echo "(2) Reboot Pi"
echo " "
exit 0
.
STEP 3 of 4
Run the file
cd /home/pi
sudo ./install-mm2.sh
.
STEP 4 of 4
When script completes installation:
It will announce completion, and will also ask you to:
- Edit file
/home/pi/mm2/mm2.sh
and replacexx.xxxx : yy.yyyy
by yor actual latitude and longitude - Reboot Pi
.
.