Compare commits

...

6 commits

Author SHA1 Message Date
Mudhorn 7ed208dcec Update examples/adsb-config.txt 2024-07-28 23:01:05 -07:00
kn1gh7h4wk 92428b61a3
Update install.sh 2020-12-25 08:46:49 -08:00
kn1gh7h4wk 1256ce419d
Create .travis.yml 2020-07-03 21:15:02 -07:00
kn1gh7h4wk 05729e1895
Update README.md 2020-06-26 13:49:21 -07:00
kn1gh7h4wk cd77c8d805
Update README.md 2020-06-26 13:48:57 -07:00
kn1gh7h4wk 5919b44b44
Update README.md 2020-06-22 21:07:45 -07:00
4 changed files with 53 additions and 9 deletions

13
.travis.yml Normal file
View file

@ -0,0 +1,13 @@
language: shell
dist: stretch
before_install:
- sudo apt update
- sudo apt upgrade
- sudo apt install git
deploy:
provider: script
script: sudo bash ./install.sh
on:
branch: master

View file

@ -6,7 +6,7 @@ This script was designed to work with [ADS-B Exchange's Raspberry Pi image: ADSB
#### HOW DOES IT WORK?
The script runs as a service that cycles every 10 min, once the initial GPS fix is made. It uses [awk](http://manpages.ubuntu.com/manpages/bionic/man1/awk.1plan9.html) to retrieve the latitude, longitude and elevation from [gpspipe](http://manpages.ubuntu.com/manpages/trusty/man1/gpspipe.1.html). It then rounds the elevation to the nearest whole decimal. Next, it uses the values of `gpsLon` and `gpsLat` to calculate your current position with the previous position to see if it needs to update your location. If it needs to update, it will create a new config file for ADSBx and restart the services. If no update is needed, it will sleep for 10 minutes and check again.
The script runs as a service that cycles every 10 min, once the initial GPS fix is made. It uses [awk](http://manpages.ubuntu.com/manpages/bionic/man1/awk.1plan9.html) to retrieve the latitude, longitude and elevation from [gpspipe](http://manpages.ubuntu.com/manpages/trusty/man1/gpspipe.1.html). It then rounds the elevation to the nearest whole decimal. Next, it uses the values of `gpsLon` and `gpsLat` to calculate your current position with the previous position to see if it needs to update your location. If it needs to update, it will create a new config file for ADSBx and restart the services. If no update is needed, it will sleep for 10 minutes and check again. If for some reason, you cannot get a GPS fix, it will use your last know coordinates until a GPS fix can be established. The script is to designed to update only after a minimum of 4 satellites multilaterates your position (i.e. the pi receives elevation data).
#### PRE-REQUISITES
@ -53,8 +53,6 @@ At the top of the script, you'll want to edit the 2 variables to specify when th
gpsLon="0.004" #approx. 1,215 ft
#Diagonally, this is approx. 1,637 ft
I will be making updates to this script, so if you find this useful, please check back often for updates.
#### INSTALLATION
$ sudo ./install.sh

View file

@ -1,12 +1,43 @@
LATITUDE=1.12345
# !!!!! HEADS-UP WINDOWS USERS !!!!!
#
# Do not use Wordpad for editing this file, it will mangle it and your
# configuration won't work. Use a proper text editor instead.
# Recommended: Notepad, Notepad++, VSCode, Atom, SublimeText.
#
# !!!!! HEADS-UP MACOSX USERS !!!!!
#
# If you use Textedit to edit this file make sure to use "plain text format"
# and "disable smart quotes" in "Textedit > Preferences", otherwise Textedit
# will use none-compatible characters and your network configuration won't
# work!
LONGITUDE=-1.2345
# location
# note the (-) sign
# for your hemisphere
# If latitude is positive, the position is on the northern hemisphere.
# If latitude is negative, it is on the southern hemisphere.
# If west of prime meridian, then longitude is negative.
# If east of prime meridian, then longitude is positive.
LATITUDE=3.366016
LONGITUDE=-11.694583
ALTITUDE=150ft
# altitude above MSL (mean sea level)
# meters 1050m (no space between number and ft)
# feet 10050ft (no space between number and ft)
ALTITUDE=60440ft
USER="buster_adsbx_change_me"
# mlat feeder name
USER="W1LMS-ADSB01"
# dump1090
DUMP1090=yes
GAIN=49.2
GAIN=40.2
AUTOGAIN=yes
# dump978
DUMP978=no
# remote support via zerotier
ZEROTIER=no
# web GUI
PROMG=yes

View file

@ -14,8 +14,10 @@ if [ -z $DEVICES ] ; then # A GPS device must be configured for this script/serv
fi
if [ -f /boot/adsb-config.txt ] ; then # This script checks to make sure the ADSBx config file is present,
# since it has only been tested with the ADSBx Buster image
apt update
if [ "$(command -v awk | wc -l)" -eq 0 ] ; then # Installing required packages if missing
apt install gawk -y
apt install gawk -y
fi
if [ "$(command -v bc | wc -l)" -eq 0 ] ; then # Installing required packages if missing
apt install bc -y