How-to Get VRS-Like Coverage Map on RPi


#1

Last updated:Feb 27, 2018 (Added PI 1 B+ in first post)

If you don’t want to run 24/7 your Windows/Mac + VRS, you can still generate VRS-like coverage plot, as well as Charts by running modeSMixer2 right in your RPi which is already running 24/7. No need to run Windows/Mac 24/7.

STEP-1:
Go to following page:
http://xdeco.org/?page_id=30

At top you will find ModeSDeco2 :x:. Ignore it, you dont need it.

Scroll down till you see ModeSMixer2 :heavy_check_mark:. This is what you need.
Scroll down a little further till you see ARM sign
arm

On Windows/Mac Desktop/Laptop, download one of the following which matches your OS:

For Raspberry Pi 2/3 with Jessie (also for Piaware SD card image)
modesmixer2_rpi2-3_20170924.tgz

OR

For Raspberry Pi 2/3 with Stretch
modesmixer2_rpi2-3_deb9_20170924.tgz

OR

For Raspberry Pi 1 B+ with Jessie
modesmixer2_rpi1_20170506.tgz

STEP-2:
In Pi, create a new folder mm2
sudo mkdir mm2

STEP-3:
On Windows / Mac computer, download and install file transfer App Filezilla.

https://filezilla-project.org/download.php?show_all=1

STEP-4:
Using Filezilla, upload from Windows/Mac computer, to Pi’s folder mm2, the downloaded file
modesmixer2_rpi2-3_20170924.tgz
OR
modesmixer2_rpi2-3_deb9_20170924.tgz
OR
modesmixer2_rpi1_20170506.tgz

EDIT Feb 08, 2018: Alternative to STEPS 1 to 4.

I have now uploaded the modeSMixer2 files to my Dropbox account. From there, it can be downloaded directly on Pi using wget command as follows. No need for Filezilla

#Create a folder mm2 to hold ModeSMixer2 files
sudo mkdir mm2

#Download ModeSMixer file directly to mm2 folder of Pi
#Use one of the following commands according to your OS

#FOR **Pi 2/3** with JESSIE or Piaware SD card image
sudo wget -O mm2/modesmixer2_rpi2-3_20170924.tgz "https://www.dropbox.com/s/fm8zclxxq0kg8u4/modesmixer2_rpi2-3_20170924.tgz?dl=1"     

#FOR Pi 2/3 with STRETCH
sudo wget -O mm2/modesmixer2_rpi2-3_deb9_20170924.tgz  "https://www.dropbox.com/s/vzuviwuy0610tu5/modesmixer2_rpi2-3_deb9_20170924.tgz?dl=1"     

#FOR Pi 1 B+ with JESSIE or Piaware SD card image
sudo wget -O mm2/modesmixer2_rpi1_20170506.tgz "https://www.dropbox.com/s/hpt66mrk81w9fjo/modesmixer2_rpi1_20170506.tgz?dl=1"     

.

STEP-5:
Unzip the downloaded file

#Move to folder mm2
cd mm2

#Give one of the following 2 commands according to the file you have downloaded

#For RPi 2/3 with JESSIE
sudo tar xvzf modesmixer2_rpi2-3_20170924.tgz

#FOR RPi 2/3 with STRETCH
sudo tar xvzf modesmixer2_rpi2-3_deb9_20170924.tgz

#For RPi 1 B+ with JESSIE
sudo tar vxzf modesmixer2_rpi1_20170506.tgz

STEP-6:
Inside folder mm2, create a new file mm2.sh

cd mm2
sudo nano mm2.sh

.

For RPi 2/3
COPY-PASTE following text to blank file mm2.sh

#!/bin/sh
cd /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     

#In above code, replace xx.xxxx by your latitude, and yy.yyyy by your longitude

.

For RPi 1 B+
COPY-PASTE following text to blank file mm2.sh

#!/bin/sh
cd /home/pi/mm2/
./modesmixer2_rpi1  --inConnectId 127.0.0.1:30005:ADSB  --inConnectId 127.0.0.1:30105:MLAT --web 8787 --location xx.xxxx:yy.yyyy     

#In above code, replace xx.xxxx by your latitude, and yy.yyyy by your longitude

.

Alternatively, instead of above text, copy-paste following text to file mm2.sh.
This text is broken into parts for ease of viewing/future editing, but still works OK.

(THANKS to @evangelyul for this tip)

.

For RPi 2/3
COPY-PASTE following text to blank file mm2.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 \

.
For RPi 1 B+
COPY-PASTE following text to blank file mm2.sh

/home/pi/mm2/modesmixer2_rpi1 \
 --inConnectId 127.0.0.1:30005:ADSB \
 --inConnectId 127.0.0.1:30105:MLAT \
 --web 8787 \
 --location xx.xxxx:yy.yyyy \

.

STEP-7:
Make file mm2.sh executeable

cd mm2
sudo chmod +x mm2.sh

STEP-8:
To Manually Start modeSMixer2

cd mm2
./mm2.sh & disown

Exit terminal
The script will keep running even after closing the terminal due to & disown in the above command. You can stop it by reboot, or by command sudo killall modesmixer2

STEP-9:
To Automatically start ModeSMixer2 at boot/reboot:

Open file rc.local for editing
sudo nano /etc/rc.local

Add following line just above the last, single-worded line (i.e. above exit0)
/home/pi/mm2/mm2.sh &
Save (Ctrl+o) and close file (Ctrl+x)

Now the ModeSMixer2 will automatically start at Boot / Reboot.

STEP-10:
Go to page ip-of-pi:8787. This will show Charts. To see map, Click item Map on menu bar.

On map, you will see range plot being built, like VRS.

On map, the MLAT planes are shown green, and ADS-B planes are shown white.
.
.
MAP WITH VRS-LIKE COVERAGE PLOT

.
.

CHARTS


Pi Aware Skyview
Multiple Feeds and Maximum Range
ADSB Receiver Project Uninstall
SkyView, enhance on hover
MLAT from PiAware not plotting on Planeplotter
#2

I like this visualization, thanks for posting the instructions to install it. BTW if you’re running a full installation of Raspbian, you can run a web browser on the pi and directly download the file, rather than downloading to a PC or Mac and transferring to the pi with filezilla.


#3

Those who are using flight feeders,ssh isn’t possible for them. They have to obtain google map API key first,write down location coordinates and ip of their pi in this script and save it as batch file and run. This script will also work for kinetic basestation software .In modesmixer2 It will open as 127.0.0.1:8080 in your browser.
@echo off
cmd /c modesmixer2.exe --google-key ( ) --web 8080 --db c:\data\basestation.sqb --silhouettes c:\data\silhouettes --pictures c:\data\pictures --location xx.xxxx:xx.xxxx --metric --inConnect (ip of your pi):30005 --inConnectId (ip of your pi):30105:MLAT --outServer sbs10001:10001 --outServer msg:30003 --outServer beast:33033 --outServer beastmlat:30115
PAUSE
exit

enjoy


#4

@GDoggRaspberry

Thanks for your suggestion for using browser of Pi to directly download ModeSMixer2 files from Google Drive to the PI.

However your suggestion can be used by only those users who have full version of Raspbian with GUI and Browser.

Unfortunately direct download to Pi cannot be used by a large number of users who have Piaware SD card, or Jessie Lite or Stretch Lite images. None of these have GUI/Browser.

In view of above situation, I have uploaded the ModeSMixer files to my Dropbox account, from where it can be downloaded directly to Pi using wget command. I have edited my original post and added wget command with url of Dropbox files.

Please see this EDIT in my original post:

EDIT Feb 08, 2018: Alternative to STEPS 1 to 4.
.


#5

I get an error when trying run mm2.sh on a flight aware build

./mm2.sh & disown
[1] 27840
pi@piaware:~/mm2$ Illegal instruction

my lat long is 47 -122. Plus the following 4 numbers. Is the -122 killing it?


#6

Thanks abcd567! very helpful.

I omitted the “sudo” on the “alternative 1-4” and through to step 10. It seems to work OK. …just a comment for those who prefer to run without root privileges when possible. I’m going to see this up in CRON @reboot so it will start up at boot time automatically… don’t forget the full path names in mm2.sh if using cron!


#7

Wow! Thanks for the full path in mm2.sh tip. Now I will try to put full path to modesdeco2 in file mm2.sh

Actually I have already tried to start it automatically on boot by editing file /etc/rc.local and adding following line just above last line (i.e. above exit0)

/home/pi/mm2/mm2.sh &

To my surprise, the modesdeco2 did not start at boot.


#8

Done, and Original Post Edited and updated as follows:

STEP-6:
Line cd /home/pi/mm2/ added to file mm2.sh, which is now:

#!/bin/sh
cd /home/pi/mm2/
./modesmixer2  --inConnectId 127.0.0.1:30005:ADS-B  --inConnectId 127.0.0.1:30106:MLAT --web 8787 --location xx.xxxx:yy.yyyy

STEP-9:
To Automatically start ModeSMixer2 at boot/reboot:

Open file rc.local for editing
sudo nano /etc/rc.local

Add following line just above the last, single-worded line (i.e. above exit0)
/home/pi/mm2/mm2.sh &
Save (Ctrl+o) and close file (Ctrl+x)

Now the ModeSMixer2 will automatically start at Boot / Reboot.


#9

Just deleted the directory and redid the file exactly as above.

Still get the ILLEGAL instruction.


#10

Just FYI - my lat long is 40.xxxxx:-111.xxxxx and it works just fine.
That is to say the contents of my mm2.sh file is:

#!/bin/sh
./modesmixer2  --inConnectId 127.0.0.1:30005:ADS-B  --inConnectId 127.0.0.1:30106:MLAT --web 8787 --location 40.xxxxx:-111.xxxxx

So your illegal instruction is somewhere besides the -122 !


#11

I also added a sleep 60 to wait for mlat to come up… not sure if that was really required or not though.

Also, rc.local runs as root. If you use cron you can select Pi as the user to run the job. (Or use sudo in rc.local to specify Pi as the user I suppose.)

I decided to use the mlat results from adsbexchange mlat as input to modesmixer. That way I have skyview showing the FA mlat results, and the modesmixer map will show me the adsbexchange ones. I have had problems with duplicate aircraft, and aircraft icons jumping around, if I try to show both these feeds on one map.


#12

Here is Mine
#!/bin/sh
./modesmixer2 --inConnectId 127.0.0.1:30005:ADS-B --inConnectId 127.0.0.1:30106:MLAT --web 8787 --location 47.XXXX:-122.XXXX


#13

.
Instead of running file mm2.sh, try running the command directly, and see if it still gives error message. Dont forget to replace xx.xx:yy.yyy by your actual lat:lon. Negative values are ok. Mine is 43.5xxx:-79.6yyy and works fine.

pi@piaware:~$ cd mm2
pi@piaware:~/mm2$ sudo ./modesmixer2  --inConnectId 127.0.0.1:30005:ADS-B  --inConnectId 127.0.0.1:30106:MLAT --web 8787 --location xx.xxxx:yy.yyyy    


#14

using sudo it took the command, but when I go to 8787 it says connection refused.


#15

did you create the mm2.sh file on a PC and then transfer it to the Pi? That can give rise to “illegal instruction” errors. If so, you need to remove the CRLF at the end of each line. These are hidden windows characters so you won’t see them. the DOS2UNIX command will fix it, or because the file is so little, just re-create it in an editor on the Pi.


#17

Did it in Nano. Copied everything letter for letter. Im using a flightaware build.


#18

@w7psk

Please check what are contents of your folder mm2.

May be the file did not unzip properly by sudo tar xvzf command, or it got corrupted during download.

Following are commands of a fresh install of Piaware sd card, which I did today again to check, and found all was working ok

pi@piaware:~$ sudo mkdir mm2

pi@piaware:~$ sudo wget -O mm2/modesmixer2_rpi2-3_20170924.tgz "https://www.dropbox.com/s/fm8zclxxq0kg8u4/modesmixer2_rpi2-3_20170924.tgz?dl=1"    

pi@piaware:~$ cd mm2

pi@piaware:~/mm2$ sudo tar xvzf modesmixer2_rpi2-3_20170924.tgz

pi@piaware:~/mm2$ ls
LICENSE.MIT  modesmixer2.readme
mm2.sh       modesmixer2_rpi2-3_20170924.tgz
modesmixer2

#19

exact same files. I’ve deleted the folder and did the commands several times with the same issues. Ill try again. See whats going on.


#20

@w7psk

There are two versions of modesmixer2, one for Jessie, other for Stretch.

First check what is the version of your Raspbian by the command below, then use the relevant version of modesmixer2

cat /etc/os-release

Output for Jessie
PRETTY_NAME=“Raspbian GNU/Linux 8 (jessie)”
… … … … … …

Output for Stretch
PRETTY_NAME=“Raspbian GNU/Linux 9 (stretch)”
… … … … … … …


#21

I use jessie, its a flightaware build.
Ive deleted and ran the files several times and same results.

Oh well