Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

[WIP] Adapt to newer Ubuntu sources & programs #131

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fb92bd9
First version, TODO: add auto build predict which is missing in ubunt…
Cirromulus Jan 30, 2021
18d6ca9
transferred iss to new predict path
Cirromulus Jan 30, 2021
7fb5bc4
Added Meteor M2-2
Cirromulus Jan 30, 2021
b3be16c
changed the syntax of gain to allow autop_gain
Cirromulus Jan 30, 2021
3dbeeb6
Perhaps Meteor M2-2 possible
Cirromulus Jan 30, 2021
39c4b74
added amd64 packages as well
Cirromulus Jan 30, 2021
bc5d63d
added ppm error config
Cirromulus Jan 31, 2021
1321903
remove pass from predict even when it was not sucessful
Cirromulus Jan 31, 2021
832f9b2
added logfile
Cirromulus Jan 31, 2021
98a56b6
Increase rate for meteor intermediate I/Q in hope of a better analysis
Cirromulus Jan 31, 2021
5897af1
Increase rate for noaa intermediate audio in hope of a better analysis
Cirromulus Jan 31, 2021
4a19066
added ppm-error config template
Cirromulus Jan 31, 2021
7853e6c
auto-removing intermediate noaa-apt file
Cirromulus Feb 1, 2021
598830d
Conform to nopaa-apt format to auto-detext sat and time
Cirromulus Feb 1, 2021
8336bd6
Revert: Recording resampling needed for wxtoimg to work
Cirromulus Feb 1, 2021
6e9ad54
Reduced meteor bandwidth for better S/N
Cirromulus Feb 1, 2021
0b323a8
Added variable noa logfile
Cirromulus Feb 1, 2021
c494767
Maybe this removes a failed meteor pass
Cirromulus Feb 1, 2021
b887475
Meteor M2-2 will never fully recover the meteor strike
Cirromulus Feb 1, 2021
db59f8c
More verbosity
Cirromulus Feb 1, 2021
f3dbc2a
Removed obvious error
Cirromulus Feb 2, 2021
20b8c4b
reduced redundancy
Cirromulus Feb 2, 2021
eacc51d
fix
Cirromulus Feb 2, 2021
6182cbe
Getting desperate
Cirromulus Feb 2, 2021
5c5b187
Ubuntu 20.04 comes with own systemd-timesyncd, installing ntp package…
Cirromulus Feb 3, 2021
bc057f7
Increase verbosity
Cirromulus Feb 3, 2021
fe788c8
Added usr local to crontab scritp
Cirromulus Feb 3, 2021
8777089
deactivate failed iss receptions
Cirromulus Feb 3, 2021
6f44272
Increased verbosity
Cirromulus Feb 4, 2021
5d67be9
allow x86 medet as well
Cirromulus Feb 4, 2021
fd1d9dd
Works on rasberry pi 3b
Cirromulus Feb 4, 2021
0493286
Another fix
Cirromulus Feb 5, 2021
a417866
Increased verbosity. Receiving first images...
Cirromulus Feb 6, 2021
e2a5bce
using better librtlsdr that utilizes the internal IF filter to supres…
Cirromulus Feb 6, 2021
179d75e
make noaa-apt understand the local timezone
Cirromulus Feb 8, 2021
b6d7e79
Fixed sun template
Cirromulus Feb 8, 2021
5cf712d
set correct fpm sock
Cirromulus Feb 8, 2021
b4bb813
enabled more detailed samplerate experiments
Cirromulus Feb 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# set -x

. "$HOME/.noaa.conf"
export PATH=$PATH:/usr/local/bin/

declare -A levels=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3)
log_level=${LOG_LEVEL}
Expand All @@ -21,6 +22,7 @@ log() {

#log here
echo "${log_priority} : ${log_message}"
echo $(date '+%d-%m-%Y %H:%M') $0 "${log_priority} : ${log_message}" >> "$NOAA_LOG"
}

## current date and folder structure
Expand Down
96 changes: 73 additions & 23 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,11 @@ if [ "$raspbian_version" == "stretch" ]; then
fi

sudo apt update -yq
sudo apt install -yq predict \
python-setuptools \
ntp \
sudo apt install -yq python-setuptools \
unzip zip \
cmake \
libusb-1.0 \
sox \
libusb-1.0-0-dev \
sox libsox-fmt-mp3 \
at \
bc \
nginx \
Expand All @@ -72,8 +71,8 @@ sudo apt install -yq predict \
libjpeg9 \
libjpeg9-dev \
socat \
php7.2-fpm \
php7.2-sqlite \
php7.3-fpm \
php7.3-sqlite3 \
sqlite3

if [ "$raspbian_version" == "stretch" ]; then
Expand Down Expand Up @@ -105,11 +104,11 @@ fi
if [ -e /usr/local/bin/rtl_fm ]; then
log_done "rtl-sdr was already installed"
else
log_running "Installing rtl-sdr from osmocom..."
log_running "Installing rtl-sdr from librtlsdr..."
(
cd /tmp/
git clone https://github.com/osmocom/rtl-sdr.git
cd rtl-sdr/
git clone https://github.com/librtlsdr/librtlsdr.git
cd librtlsdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
Expand All @@ -131,6 +130,19 @@ else
log_done "WxToIMG installed"
fi

### install predict
if command -v predict &> /dev/null; then
log_done "predict was already installed"
else
$orig_dir=$(pwd)
cd software
tar -xzf predict-2.2.7.tar.gz
cd predict-2.2.7
sudo ./configure #this also installs :X
cd $orig_dir
log_done "predict installed"
fi

### Install default config file
if [ -e "$HOME/.noaa.conf" ]; then
log_done "$HOME/.noaa.conf already exists"
Expand Down Expand Up @@ -177,38 +189,69 @@ else
fi

### Install medet_arm
if [ -e /usr/bin/medet_arm ]; then
log_done "medet_arm was already installed"
if [ -e /usr/bin/medet ]; then
log_done "medet was already installed"
else
log_running "Installing medet_arm..."
sudo cp software/medet_arm /usr/bin/medet_arm
sudo chmod +x /usr/bin/medet_arm
log_done "medet_arm installed"
if [[ $(uname -m) == *"arm"* ]]; then
log_running "Installing medet_arm..."
sudo cp software/medet_arm /usr/bin/medet
elif [[ $(uname -m) == *"x86_64"* ]]; then
log_running "Installing medet_x86_64..."
sudo cp software/medet_x86_64 /usr/bin/medet
else
log_error "Unknown archictecture $(uname -m)!"
exit -1
fi
sudo chmod +x /usr/bin/medet
log_done "medet installed"
fi

### Install noaa-apt
if command -v noaa-apt &> /dev/null; then
log_done "noaa-apt was already installed"
else
if [[ $(uname -m) == *"arm"* ]]; then
log_running "Installing noaa-apt arm..."
unzip software/noaa-apt-1.3.0-armv7-linux-gnueabihf-nogui.zip
sudo mv noaa-apt /usr/bin
sudo mv res /usr/bin #ok, this is not so nice, but it works
elif [[ $(uname -m) == *"x86_64"* ]]; then
log_running "Installing noaa-apt x86..."
sudo dpkg -i software/noaa-apt_1.3.0-1_amd64.deb
else
log_error "Unknown archictecture $(uname -m)!"
exit -1
fi
mkdir -p "$HOME/.config/noaa-apt"
cp templates/settings.toml "$HOME/.config/noaa-apt"
log_done "noaa-apt installed"
fi


### Cron the scheduler
set +e
crontab -l | grep -q "raspberry-noaa"
if [ $? -eq 0 ]; then
log_done "Crontab for schedule.sh already exists"
else
cat <(crontab -l) <(echo "1 0 * * * /home/pi/raspberry-noaa/schedule.sh") | crontab -
cat <(crontab -l) <(echo "1 0 * * * $HOME/raspberry-noaa/schedule.sh") | crontab -
log_done "Crontab installed"
fi
set -e

### Setup Nginx
log_running "Setting up Nginx..."
usr=$(whoami)
sudo cp templates/nginx.cfg /etc/nginx/sites-enabled/default
(
sudo mkdir -p /var/www/wx/images
sudo chown -R pi:pi /var/www/wx
sudo usermod -a -G www-data pi
sudo chown -R $usr:$usr /var/www/wx
sudo usermod -a -G www-data $usr
sudo chmod 775 /var/www/wx
)
sudo systemctl restart nginx
sudo cp -rp templates/webpanel/* /var/www/wx/

sed -i -e "s/pi/${usr}/g" "/var/www/wx/Model/Conn.php"
log_done "Nginx configured"

### Setup ramFS
Expand Down Expand Up @@ -243,6 +286,7 @@ else
log_done "pd120_decoder installed"
fi

cp templates/sun.py .

success "Install (almost) done!"

Expand Down Expand Up @@ -298,10 +342,12 @@ read -rp "Enter your longitude (West values are negative): "
read -rp "Enter your timezone offset (ex: -3 for Argentina time): "
tzoffset=$REPLY

sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.noaa.conf"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g;s/pi/${usr}/g" "$HOME/.noaa.conf"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.wxtoimgrc"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/$(echo "$lon * -1" | bc)/g" "$HOME/.predict/predict.qth"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g" "$HOME/.predict/predict.qth"
sed -i -e "s/change_latitude/${lat}/g;s/change_longitude/${lon}/g;s/change_tz/$(echo "$tzoffset * -1" | bc)/g" "sun.py"
sed -i -e "s/change_tz/$tzoffset/g" "$HOME/.config/noaa-apt/settings.toml"
sed -i -e "s/change_tz/$tzoffset/g" "sun.py"

success "Install done! Double check your $HOME/.noaa.conf settings"

Expand All @@ -315,4 +361,8 @@ set +e
### Running WXTOIMG to have the user accept the licensing agreement
wxtoimg

sudo reboot
read -rp "reboot now? (Y/n)"
doreboot=$REPLY

[ ! -z "$doreboot" ] || sudo reboot
[ "$doreboot" == "y" ] && sudo reboot
5 changes: 4 additions & 1 deletion receive_iss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi
# $7 = Satellite max elevation

log "Starting rtl_fm record" "INFO"
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -M fm -f 145.8M -s 48k -g $GAIN -E dc -E wav -E deemp -F 9 - | sox -t raw -r 48k -c 1 -b 16 -e s - -t wav "${NOAA_OUTPUT}/audio/${3}.wav" rate 11025
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -M fm -f ${2}M -s 48k $GAIN -E dc -E wav -E deemp -F 9 - | sox -t raw -r 48k -c 1 -b 16 -e s - -t wav "${NOAA_OUTPUT}/audio/${3}.wav" rate 11025

if [ -f "$NOAA_HOME/demod.py" ]; then
log "Decoding ISS pass" "INFO"
Expand All @@ -52,5 +52,8 @@ if [ -f "$NOAA_HOME/demod.py" ]; then
fi
fi
sqlite3 "$NOAA_HOME/panel.db" "update predict_passes set is_active = 0 where (predict_passes.pass_start) in (select predict_passes.pass_start from predict_passes inner join decoded_passes on predict_passes.pass_start = decoded_passes.pass_start where decoded_passes.id = $pass_id);"
else
log "Did not receive any images from ISS" ERROR
sqlite3 "$NOAA_HOME/panel.db" "update predict_passes set is_active = 0 where predict_passes.pass_start = $5;"
fi
fi
33 changes: 21 additions & 12 deletions receive_meteor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fi
. "$HOME/.tweepy.conf"
. "$NOAA_HOME/common.sh"

log "starting $0" DEBUG

SYSTEM_MEMORY=$(free -m | awk '/^Mem:/{print $2}')
if [ "$SYSTEM_MEMORY" -lt 2000 ]; then
log "The system doesn't have enough space to store a Meteor pass on RAM" "INFO"
Expand Down Expand Up @@ -42,11 +44,15 @@ fi
# $6 = Time to capture
# $7 = Satellite max elevation

log "Starting rtl_fm record" "INFO"
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -M raw -f "${2}"M -s 288k -g $GAIN | sox -t raw -r 288k -c 2 -b 16 -e s - -t wav "${RAMFS_AUDIO}/audio/${3}.wav" rate 96k
pre_rate=288k

log "Starting rtl_fm record for $1 at $2 to $3 at epoch $5" "INFO"
log "timeout \"${6}\" /usr/local/bin/rtl_fm ${BIAS_TEE} -p $PPM_ERROR -M raw -f ${2}M -F0 -s $pre_rate $GAIN | sox -t raw -r $pre_rate -c 2 -b 16 -e s - -t wav \"${RAMFS_AUDIO}/audio/${3}.wav\"" DEBUG
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -p $PPM_ERROR -M raw -f ${2}M -F0 -s $pre_rate $GAIN | sox -t raw -r $pre_rate -c 2 -b 16 -e s - -t wav "${RAMFS_AUDIO}/audio/${3}.wav" #rate 96k

log "Demodulation in progress (QPSK)" "INFO"
meteor_demod -B -o "${METEOR_OUTPUT}/${3}.qpsk" "${RAMFS_AUDIO}/audio/${3}.wav"
[[ $1 == "METEOR-M22" ]] && demod_extra="-m opsk"
log "Demodulation in progress (QPSK) $demod_extra" "INFO"
meteor_demod $demod_extra -B -o "${METEOR_OUTPUT}/${3}.qpsk" "${RAMFS_AUDIO}/audio/${3}.wav" 2>> $NOAA_LOG

if [ "$DELETE_AUDIO" = true ]; then
log "Deleting audio files" "INFO"
Expand All @@ -58,20 +64,21 @@ else
rm "${RAMFS_AUDIO}/audio/${3}.wav"
fi

log "Decoding in progress (QPSK to BMP)" "INFO"
medet_arm "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}" -cd
log "Decoding in progress (QPSK to BMP)" INFO
[[ $1 == "METEOR-M22" ]] && medet_extra="-diff"
medet $medet_extra "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}" -cd

rm "${METEOR_OUTPUT}/${3}.qpsk"

if [ -f "${METEOR_OUTPUT}/${3}.dec" ]; then

log "Sun elevation: ${SUN_ELEV}" DEBUG
if [ "${SUN_ELEV}" -lt "${SUN_MIN_ELEV}" ]; then
log "I got a successful ${3}.dec file. Decoding APID 68" "INFO"
medet_arm "${METEOR_OUTPUT}/${3}.dec" "${NOAA_OUTPUT}/images/${3}-122" -r 68 -g 68 -b 68 -d
medet "${METEOR_OUTPUT}/${3}.dec" "${NOAA_OUTPUT}/images/${3}-122" -r 68 -g 68 -b 68 -d
/usr/bin/convert $FLIP -negate "${NOAA_OUTPUT}/images/${3}-122.bmp" "${NOAA_OUTPUT}/images/${3}-122.bmp"
else
log "I got a successful ${3}.dec file. Creating false color image" "INFO"
medet_arm "${METEOR_OUTPUT}/${3}.dec" "${NOAA_OUTPUT}/images/${3}-122" -r 65 -g 65 -b 64 -d
medet "${METEOR_OUTPUT}/${3}.dec" "${NOAA_OUTPUT}/images/${3}-122" -r 65 -g 65 -b 64 -d
fi

log "Rectifying image to adjust aspect ratio" "INFO"
Expand All @@ -82,13 +89,15 @@ if [ -f "${METEOR_OUTPUT}/${3}.dec" ]; then
rm "${METEOR_OUTPUT}/${3}.bmp"
rm "${METEOR_OUTPUT}/${3}.dec"

sqlite3 /home/pi/raspberry-noaa/panel.db "insert into decoded_passes (pass_start, file_path, daylight_pass, sat_type) values ($5,\"$3\", 1,0);"
pass_id=$(sqlite3 /home/pi/raspberry-noaa/panel.db "select id from decoded_passes order by id desc limit 1;")
sqlite3 $HOME/raspberry-noaa/panel.db "insert into decoded_passes (pass_start, file_path, daylight_pass, sat_type) values ($5,\"$3\", 1,0);"
pass_id=$(sqlite3 $HOME/raspberry-noaa/panel.db "select id from decoded_passes order by id desc limit 1;")
sqlite3 $HOME/raspberry-noaa/panel.db "update predict_passes set is_active = 0 where (predict_passes.pass_start) in (select predict_passes.pass_start from predict_passes inner join decoded_passes on predict_passes.pass_start = decoded_passes.pass_start where decoded_passes.id = $pass_id);"

if [ -n "$CONSUMER_KEY" ]; then
log "Posting to Twitter" "INFO"
python3 "${NOAA_HOME}/post.py" "$1 ${START_DATE} Resolución completa: https://weather.reyni.co/detail.php?id=$pass_id" "$7" "${NOAA_OUTPUT}/images/${3}-122-rectified.jpg"
fi
sqlite3 /home/pi/raspberry-noaa/panel.db "update predict_passes set is_active = 0 where (predict_passes.pass_start) in (select predict_passes.pass_start from predict_passes inner join decoded_passes on predict_passes.pass_start = decoded_passes.pass_start where decoded_passes.id = $pass_id);"
else
log "Decoding failed, either a bad pass/low SNR or a software problem" "ERROR"
sqlite3 $HOME/raspberry-noaa/panel.db "update predict_passes set is_active = 0 where predict_passes.pass_start = $5;"
fi
30 changes: 21 additions & 9 deletions receive.sh → receive_noaa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ fi
# $6 = Time to capture
# $7 = Satellite max elevation

log "Starting rtl_fm record" "INFO"
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -f "${2}"M -s 60k -g $GAIN -E wav -E deemp -F 9 - | /usr/bin/sox -t raw -e signed -c 1 -b 16 -r 60000 - "${RAMFS_AUDIO}/audio/${3}.wav" rate 11025
pre_samplerate=60k

log "Starting rtl_fm record for $1 at $2 to $3 at epoch $5" "INFO"
log "timeout ${6} /usr/local/bin/rtl_fm ${BIAS_TEE} -f ${2}M -s$pre_samplerate $GAIN -p $PPM_ERROR -E wav -E deemp -F 0 - | /usr/bin/sox -t raw -e signed -c 1 -b 16 -r $pre_samplerate - ${RAMFS_AUDIO}/audio/${3}.wav rate 11025" DEBUG
timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -f "${2}"M -s$pre_samplerate $GAIN -p $PPM_ERROR -E wav -E deemp -F 0 - | /usr/bin/sox -t raw -e signed -c 1 -b 16 -r $pre_samplerate - "${RAMFS_AUDIO}/audio/${3}.wav" rate 11025

if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then
ENHANCEMENTS="ZA MCIR MCIR-precip MSA MSA-precip HVC-precip HVCT-precip HVC HVCT"
Expand All @@ -41,24 +44,33 @@ else
daylight="false"
fi

log "Bulding pass map" "INFO"
log "Bulding pass map wxtoimg" "INFO"
/usr/local/bin/wxmap -T "${1}" -H "${4}" -p 0 -l 0 -o "${PASS_START}" "${NOAA_HOME}/map/${3}-map.png"
for i in $ENHANCEMENTS; do
log "Decoding image" "INFO"
/usr/local/bin/wxtoimg -o -m "${NOAA_HOME}/map/${3}-map.png" -e "$i" "${RAMFS_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/images/${3}-$i.jpg"
/usr/bin/convert -quality 90 -format jpg "${NOAA_OUTPUT}/images/${3}-$i.jpg" -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE} Elev: $7°" "${NOAA_OUTPUT}/images/${3}-$i.jpg"
/usr/bin/convert -quality 98 -format jpg "${NOAA_OUTPUT}/images/${3}-$i.jpg" -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE} Elev: $7°" "${NOAA_OUTPUT}/images/${3}-$i.jpg"
/usr/bin/convert -thumbnail 300 "${NOAA_OUTPUT}/images/${3}-$i.jpg" "${NOAA_OUTPUT}/images/thumb/${3}-$i.jpg"
done

log "Building noaa-apt maps" DEBUG
curpath=$(pwd) # needed for faulty noaa-apt arm version
cd /usr/bin
noaa-apt "${RAMFS_AUDIO}/audio/${3}.wav" -R auto -m yes -o "${NOAA_OUTPUT}/images/${3}-noaa-apt.png"
cd $curpath
/usr/bin/convert -quality 98 -format jpg "${NOAA_OUTPUT}/images/${3}-noaa-apt.png" -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE} Elev: $7°" "${NOAA_OUTPUT}/images/${3}-noaa-apt.jpg"
/usr/bin/convert -thumbnail 300 "${NOAA_OUTPUT}/images/${3}-noaa-apt.jpg" "${NOAA_OUTPUT}/images/thumb/${3}-noaa-apt.jpg"

rm "${NOAA_OUTPUT}/images/${3}-noaa-apt.png"
rm "${NOAA_HOME}/map/${3}-map.png"

if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then
sqlite3 /home/pi/raspberry-noaa/panel.db "insert into decoded_passes (pass_start, file_path, daylight_pass, sat_type) values ($5,\"$3\", 1,1);"
sqlite3 $HOME/raspberry-noaa/panel.db "insert into decoded_passes (pass_start, file_path, daylight_pass, sat_type) values ($5,\"$3\", 1,1);"
else
sqlite3 /home/pi/raspberry-noaa/panel.db "insert into decoded_passes (pass_start, file_path, daylight_pass, sat_type) values ($5,\"$3\", 0,1);"
sqlite3 $HOME/raspberry-noaa/panel.db "insert into decoded_passes (pass_start, file_path, daylight_pass, sat_type) values ($5,\"$3\", 0,1);"
fi

pass_id=$(sqlite3 /home/pi/raspberry-noaa/panel.db "select id from decoded_passes order by id desc limit 1;")
pass_id=$(sqlite3 $HOME/raspberry-noaa/panel.db "select id from decoded_passes order by id desc limit 1;")

if [ -n "$CONSUMER_KEY" ]; then
log "Posting to Twitter" "INFO"
Expand All @@ -69,12 +81,12 @@ if [ -n "$CONSUMER_KEY" ]; then
fi
fi

sqlite3 /home/pi/raspberry-noaa/panel.db "update predict_passes set is_active = 0 where (predict_passes.pass_start) in (select predict_passes.pass_start from predict_passes inner join decoded_passes on predict_passes.pass_start = decoded_passes.pass_start where decoded_passes.id = $pass_id);"
sqlite3 $HOME/raspberry-noaa/panel.db "update predict_passes set is_active = 0 where (predict_passes.pass_start) in (select predict_passes.pass_start from predict_passes inner join decoded_passes on predict_passes.pass_start = decoded_passes.pass_start where decoded_passes.id = $pass_id);"

if [ "$DELETE_AUDIO" = true ]; then
log "Deleting audio files" "INFO"
rm "${RAMFS_AUDIO}/audio/${3}.wav"
else
log "Moving audio files out to the SD card" "INFO"
mv "${RAMFS_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/audio/${3}.wav"
mv "${RAMFS_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/audio/${3}_${pre_samplerate}_${7}.wav"
fi
6 changes: 5 additions & 1 deletion schedule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ fi
. "$HOME/.noaa.conf"
. "$NOAA_HOME/common.sh"

log "Scheduling new passes" INFO

wget -qr http://www.celestrak.com/NORAD/elements/weather.txt -O "${NOAA_HOME}"/predict/weather.txt
wget -qr http://www.celestrak.com/NORAD/elements/amateur.txt -O "${NOAA_HOME}"/predict/amateur.txt
grep "NOAA 15" "${NOAA_HOME}"/predict/weather.txt -A 2 > "${NOAA_HOME}"/predict/weather.tle
grep "NOAA 18" "${NOAA_HOME}"/predict/weather.txt -A 2 >> "${NOAA_HOME}"/predict/weather.tle
grep "NOAA 19" "${NOAA_HOME}"/predict/weather.txt -A 2 >> "${NOAA_HOME}"/predict/weather.tle
grep "METEOR-M 2" "${NOAA_HOME}"/predict/weather.txt -A 2 >> "${NOAA_HOME}"/predict/weather.tle
grep "METEOR-M2 2" "${NOAA_HOME}"/predict/weather.txt -A 2 >> "${NOAA_HOME}"/predict/weather.tle
if [ "$SCHEDULE_ISS" == "true" ]; then
grep "ZARYA" "${NOAA_HOME}"/predict/amateur.txt -A 2 > "${NOAA_HOME}"/predict/amateur.tle
fi
Expand All @@ -27,7 +30,8 @@ for i in $(atq | awk '{print $1}');do atrm "$i";done
if [ "$SCHEDULE_ISS" == "true" ]; then
"${NOAA_HOME}"/schedule_iss.sh "ISS (ZARYA)" 145.8000
fi
"${NOAA_HOME}"/schedule_meteor.sh "METEOR-M 2" 137.1000
"${NOAA_HOME}"/schedule_sat.sh "METEOR-M 2" 137.1000
#"${NOAA_HOME}"/schedule_sat.sh "METEOR-M2 2" 137.9000 #Meteor M2-2 will never send LRPT again :(
"${NOAA_HOME}"/schedule_sat.sh "NOAA 19" 137.1000
"${NOAA_HOME}"/schedule_sat.sh "NOAA 18" 137.9125
"${NOAA_HOME}"/schedule_sat.sh "NOAA 15" 137.6200
Loading