diff --git a/misc/adsb-config.txt b/misc/adsb-config.txt new file mode 100644 index 0000000..86ad7b1 --- /dev/null +++ b/misc/adsb-config.txt @@ -0,0 +1,59 @@ +# !!!!! 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! + +# 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
Northern Hemisphere, positive.
+##Southern Hemisphere, negative.
+## +##This site can be used to determine lat/lon and ground altitude. +LATITUDE="3.366016" + +# Longitude
East of Greenwich, UK - positive.
+##West of Greenwich (including USA) - negative. +LONGITUDE="-11.694583" + +# Altitude of your antenna above MSL (mean sea level)
+##Meters Example: "1050m" no space between number and "m"
+##Feet Example: "305ft" no space between number and "ft" +ALTITUDE="60440ft" + +# Feeder Name for MLAT Map
+##No spaces or special characters.
+##Numbers, letters, underscore ( _ ) and period ( . ) only. +USER="ADSBX_initial" + +# Enable 1090 using readsb? +DUMP1090="yes" + +# Gain setting for 1090 readsb +GAIN="42.1" + +# Adjust gain every 24 hours automatically?
+##More info +AUTOGAIN="yes" + +# Enable 978 UAT? (requires second SDR) +DUMP978="no" + +# Allow ADSBexchange staff to access this unit
remotely for troubleshooting via zerotier? +ZEROTIER="no" + +# Run Graphana? +PROMG="no" diff --git a/misc/adsbx-978env b/misc/adsbx-978env new file mode 100644 index 0000000..717c888 --- /dev/null +++ b/misc/adsbx-978env @@ -0,0 +1,10 @@ +RECEIVER_978_OPTIONS="--net-only" +DECODER_978_OPTIONS="--max-range 460" +NET_978_OPTIONS="--net --net-heartbeat 60 --net-ro-interval 0.5 --net-ro-port 0 --net-sbs-port 0 --net-bi-port 0 --net-bo-port 0 --net-connector localhost,30004,beast_out" +AVR_978_IN_PORT=37981 +JSON_978_OPTIONS="--json-location-accuracy 2" + +ENABLED=yes +RECEIVER_OPTIONS="--sdr-gain 36.4 --sdr driver=rtlsdr,serial=978 --format CS8" +DECODER_OPTIONS="" +NET_OPTIONS="--raw-port 30978 --json-port 30979" diff --git a/misc/adsbx-env b/misc/adsbx-env new file mode 100644 index 0000000..7258bc5 --- /dev/null +++ b/misc/adsbx-env @@ -0,0 +1,20 @@ +# Default no serial single SDR mode +# use # to comment out for 1090 mode +RECEIVER_OPTIONS="--device-type rtlsdr --ppm 0" + +# 1090 serialed SDR +# Remove # for 1090 serial mode +#RECEIVER_OPTIONS="--device 1090 --device-type rtlsdr --ppm 0" + +DECODER_OPTIONS="--max-range 450" +NET_OPTIONS="--net --net-heartbeat 60 --net-ro-size 1200 --net-ro-interval 0.1 \ + --net-ri-port 30001 --net-ro-port 30002 --net-sbs-port 30003 \ + --net-bi-port 30004,30104 --net-bo-port 30005" +JSON_OPTIONS="--json-location-accuracy 2" + +INPUT="127.0.0.1:30005" +RESULTS="--results beast,connect,localhost:30104 --results basestation,listen,31003" +MLATSERVER="feed.adsbexchange.com:31090" +INPUT_TYPE="dump1090" +#INPUT_TYPE="dump1090 --privacy" +SERVERPORT="30005" diff --git a/misc/uptime.py b/misc/uptime.py new file mode 100644 index 0000000..239d722 --- /dev/null +++ b/misc/uptime.py @@ -0,0 +1,8 @@ +#!/usr/bin/python3 + +import shlex, subprocess +cmd = "uptime -p" +args = shlex.split(cmd) +p = subprocess.Popen(args, stdout=subprocess.PIPE) +output = p.communicate() +print (output) diff --git a/misc/wpa_supplicant.conf b/misc/wpa_supplicant.conf new file mode 100644 index 0000000..299e44d --- /dev/null +++ b/misc/wpa_supplicant.conf @@ -0,0 +1,18 @@ +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev +update_config=1 +country=US +p2p_disabled=1 + +network={ + ssid="YourSSID" + scan_ssid=1 + psk="WifiPassword" +} + +network={ + ssid="ADSBx-config" + disabled=1 + mode=2 + frequency=2432 + key_mgmt=NONE +} diff --git a/motd b/motd new file mode 100644 index 0000000..46ac63e --- /dev/null +++ b/motd @@ -0,0 +1,25 @@ + + ^ + / \ + //V\\ + / \|/ \ + /// v \\\ + / \ + / ADSBx \ + / Buster \ + / /| |\ \ + / / \ / \ \ + \ / X X \ / + \/ / \ / \ \/ + / V \ + | | + + +WiFi: place wpa_supplicant.conf in /boot + +Config: adsb-config.txt located in /boot + +ALL CHANGES REQUIRE REBOOT + + + diff --git a/resetdefaults.sh b/resetdefaults.sh new file mode 100755 index 0000000..d044017 --- /dev/null +++ b/resetdefaults.sh @@ -0,0 +1,53 @@ +#! /bin/bash + + +if [ $(id -u) -ne 0 ]; then + echo -e "This script must be run as root. \n" + exit 1 +fi + +echo -e "\n\n APT clean" +apt-get autoremove +apt-get clean + +echo -e "\n\n RESET UUID" +rm /boot/adsbx-uuid + +echo -e "\n\n RESET ZT" +rm /var/lib/zerotier-one/identity.* +rm /var/lib/zerotier-one/authtoken.secret + +echo -e "\n RESET SSH" +rm /etc/ssh/ssh_host_* + +echo -e "\n RESET WPA_SUPPLICANT CONF" +rm /etc/wpa_supplicant/wpa_supplicant.conf +cp /home/pi/adsbexchange/.adsbx/wpa_supplicant.conf /boot/wpa_supplicant.conf + +echo -e "\n RESET /boot/adsb-config.txt" +sed -i 's/\r$//' /home/pi/adsbexchange/.adsbx/adsb-config.txt +rm /boot/adsb-config.txt +cp /home/pi/adsbexchange/.adsbx/adsb-config.txt /boot/adsb-config.txt + +echo -e "\n RESET /boot/adsbx-env" +sed -i 's/\r$//' /home/pi/adsbexchange/.adsbx/adsbx-env +rm /boot/adsbx-env +cp /home/pi/adsbexchange/.adsbx/adsbx-env /boot/adsbx-env + +echo -e "\n RESET /boot/adsbx-978env" +sed -i 's/\r$//' /home/pi/adsbexchange/.adsbx/adsbx-978env +rm /boot/adsbx-978env +cp /home/pi/adsbexchange/.adsbx/adsbx-978env /boot/adsbx-978env + +echo -e "\n REMOVE BASH HISTORY" +rm /home/pi/.bash_history + + +echo -e "\n RESET PI PASSWORD TO DEFAULT" +echo "pi:adsb123" | sudo chpasswd + +echo -e "\n UNLOCKING UNIT UNTIL FIRST CONFIG" +touch /boot/unlock + + +exit 0 diff --git a/throttle.sh b/throttle.sh new file mode 100755 index 0000000..476f890 --- /dev/null +++ b/throttle.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +#Flag Bits +UNDERVOLTED=0x1 +CAPPED=0x2 +THROTTLED=0x4 +SOFT_TEMPLIMIT=0x8 +HAS_UNDERVOLTED=0x10000 +HAS_CAPPED=0x20000 +HAS_THROTTLED=0x40000 +HAS_SOFT_TEMPLIMIT=0x80000 + + +#Text Colors +GREEN=`tput setaf 2` +RED=`tput setaf 1` +NC=`tput sgr0` + +#Output Strings +GOOD="${GREEN}NO${NC}" +BAD="${RED}YES${NC}" + +#Get Status, extract hex +STATUS=$(vcgencmd get_throttled) +STATUS=${STATUS#*=} + +echo -n "Status: " +(($STATUS!=0)) && echo "${RED}${STATUS}${NC}" || echo "${GREEN}${STATUS}${NC}" + +echo "Undervolted:" +echo -n " Now: " +((($STATUS&UNDERVOLTED)!=0)) && echo "${BAD}" || echo "${GOOD}" +echo -n " Run: " +((($STATUS&HAS_UNDERVOLTED)!=0)) && echo "${BAD}" || echo "${GOOD}" + +echo "Throttled:" +echo -n " Now: " +((($STATUS&THROTTLED)!=0)) && echo "${BAD}" || echo "${GOOD}" +echo -n " Run: " +((($STATUS&HAS_THROTTLED)!=0)) && echo "${BAD}" || echo "${GOOD}" + +echo "Frequency Capped:" +echo -n " Now: " +((($STATUS&CAPPED)!=0)) && echo "${BAD}" || echo "${GOOD}" +echo -n " Run: " +((($STATUS&HAS_CAPPED)!=0)) && echo "${BAD}" || echo "${GOOD}" + +echo "Softlimit:" +echo -n " Now: " +((($STATUS&SOFT_TEMPLIMIT)!=0)) && echo "${BAD}" || echo "${GOOD}" +echo -n " Run: " +((($STATUS&HAS_SOFT_TEMPLIMIT)!=0)) && echo "${BAD}" || echo "${GOOD}" + diff --git a/update-adsbx.sh b/update-adsbx.sh old mode 100644 new mode 100755