Skip to content

Commit

Permalink
support files
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Jan 27, 2022
1 parent 181eec0 commit 15bfd18
Show file tree
Hide file tree
Showing 9 changed files with 246 additions and 0 deletions.
59 changes: 59 additions & 0 deletions misc/adsb-config.txt
Original file line number Diff line number Diff line change
@@ -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<br>Northern Hemisphere, positive. <br>
##Southern Hemisphere, negative. <br>
##<a href="https://www.freemaptools.com/elevation-finder.htm" target="_blank">
##This site can be used to determine lat/lon and ground altitude.</a>
LATITUDE="3.366016"

# Longitude<br> East of Greenwich, UK - positive.<br>
##West of Greenwich (including USA) - negative.
LONGITUDE="-11.694583"

# Altitude of your antenna above MSL (mean sea level)<br>
##Meters Example: "1050m" no space between number and "m"<br>
##Feet Example: "305ft" no space between number and "ft"
ALTITUDE="60440ft"

# Feeder Name for MLAT Map <br>
##No spaces or special characters.<br>
##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?<br>
##<a href="https://github.com/wiedehopf/adsb-scripts/wiki/Automatic-gain-optimization-for-readsb-and-dump1090-fa">More info</a>
AUTOGAIN="yes"

# Enable 978 UAT? (requires second SDR)
DUMP978="no"

# Allow ADSBexchange staff to access this unit <br> remotely for troubleshooting via zerotier?
ZEROTIER="no"

# Run Graphana?
PROMG="no"
10 changes: 10 additions & 0 deletions misc/adsbx-978env
Original file line number Diff line number Diff line change
@@ -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"
20 changes: 20 additions & 0 deletions misc/adsbx-env
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 8 additions & 0 deletions misc/uptime.py
Original file line number Diff line number Diff line change
@@ -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)
18 changes: 18 additions & 0 deletions misc/wpa_supplicant.conf
Original file line number Diff line number Diff line change
@@ -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
}
25 changes: 25 additions & 0 deletions motd
Original file line number Diff line number Diff line change
@@ -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



53 changes: 53 additions & 0 deletions resetdefaults.sh
Original file line number Diff line number Diff line change
@@ -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
53 changes: 53 additions & 0 deletions throttle.sh
Original file line number Diff line number Diff line change
@@ -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}"

Empty file modified update-adsbx.sh
100644 → 100755
Empty file.

0 comments on commit 15bfd18

Please sign in to comment.