@@ -116,8 +116,13 @@ stage_2() {
|
||||
echo "Follow the instructions to fill out the LATITUDE and LONGITUDE variables
|
||||
and set the passwords for the live audio stream. Save the file after editing
|
||||
and then close the Mouse Pad editing window to continue."
|
||||
mousepad ${my_dir}/Birders_Guide_Installer_Configuration.txt &> /dev/null
|
||||
while pgrep mouse &> /dev/null;do
|
||||
if ( env | grep SSH_CONNECTION &> /dev/null );then
|
||||
editor=nano
|
||||
else
|
||||
editor=mousepad
|
||||
fi
|
||||
$editor ${my_dir}/Birders_Guide_Installer_Configuration.txt &> /dev/null
|
||||
while pgrep $editor &> /dev/null;do
|
||||
sleep 1
|
||||
done
|
||||
source ${my_dir}/Birders_Guide_Installer_Configuration.txt || exit 1
|
||||
|
||||
@@ -5,6 +5,7 @@ source /etc/birdnet/birdnet.conf
|
||||
# Document this run's birdnet.conf settings
|
||||
# Make a temporary file to compare the current birdnet.conf with
|
||||
# the birdnet.conf as it was the last time this script was called
|
||||
my_dir=$(realpath $(dirname $0))
|
||||
make_thisrun() {
|
||||
sleep .4
|
||||
awk '!/#/ && !/^$/ {print}' /etc/birdnet/birdnet.conf \
|
||||
@@ -76,6 +77,7 @@ run_analysis() {
|
||||
|
||||
cd ${HOME}/BirdNET-Lite || exit 1
|
||||
for i in "${files[@]}";do
|
||||
echo "${1}/${i}" > ./analyzing_now.txt
|
||||
[ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12
|
||||
[ ${RECORDING_LENGTH} == "60" ] && RECORDING_LENGTH=01:00
|
||||
FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)"
|
||||
@@ -150,6 +152,8 @@ run_birdnet() {
|
||||
run_analysis "${1}"
|
||||
}
|
||||
|
||||
date
|
||||
|
||||
if [ $(find ${RECS_DIR} -maxdepth 1 -name '*wav' | wc -l) -gt 0 ];then
|
||||
run_birdnet "${RECS_DIR}"
|
||||
fi
|
||||
|
||||
+80
-36
@@ -1,11 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# BirdNET Stats Page
|
||||
trap 'setterm --cursor on' EXIT
|
||||
trap 'setterm --cursor on && exit' EXIT
|
||||
trap 'rm -f "${TMP_FILE}" && exit' EXIT
|
||||
source /etc/birdnet/birdnet.conf
|
||||
setterm --cursor off
|
||||
TMP_FILE="$(mktemp)"
|
||||
|
||||
while true;do
|
||||
cat << "EOF"
|
||||
cat << "EOF"
|
||||
.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.
|
||||
( _ ____ __ _ )
|
||||
) |_)o.__||\ ||_ |__(_ __|_ _ ._ _ |_) _ ._ _ .__|_ (
|
||||
@@ -13,37 +15,79 @@ cat << "EOF"
|
||||
) / | (
|
||||
"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"+.+"
|
||||
EOF
|
||||
if [ "$(find ${EXTRACTED} -name '*.wav' | wc -l)" -ge 1 ];then
|
||||
a=$( find "${EXTRACTED}" -name '*.wav' \
|
||||
| awk -F "/" '{print $NF}' \
|
||||
| cut -d'-' -f1 \
|
||||
| sort -n \
|
||||
| tail -n1 )
|
||||
else
|
||||
a=0
|
||||
fi
|
||||
echo
|
||||
if [ "${a}" -ge "1" ];then
|
||||
SOFAR=$(($(wc -l ${IDFILE}| cut -d' ' -f1)/2))
|
||||
else
|
||||
SOFAR=0
|
||||
fi
|
||||
echo " -$a detections so far"
|
||||
echo
|
||||
echo " -$SOFAR species identified so far"
|
||||
echo
|
||||
if [ ${a} -ge 1 ];then
|
||||
while read -r line;do
|
||||
SPECIES="$(echo "${line}" | awk -F: '/Common Name/ {print $2}')"
|
||||
SPECIES=${SPECIES// /_}
|
||||
SPECIES=${SPECIES/_}
|
||||
[ -z ${SPECIES} ] && continue
|
||||
DETECTIONS="$(ls -1 ${EXTRACTED}/By_Date/*/${SPECIES}| wc -l)"
|
||||
echo -e " | $line # of detections so far: ${DETECTIONS}\n"
|
||||
done < ${IDFILE}
|
||||
fi
|
||||
echo
|
||||
echo -n "Listening since "${INSTALL_DATE}""
|
||||
sleep 20
|
||||
clear
|
||||
done
|
||||
if [ "$(find ${EXTRACTED} -name '*.wav' | wc -l)" -ge 1 ] &> /dev/null;then
|
||||
a=$( find "${EXTRACTED}" -name '*.wav' \
|
||||
| awk -F "/" '{print $NF}' \
|
||||
| cut -d'-' -f1 \
|
||||
| sort -n \
|
||||
| tail -n1 )
|
||||
else
|
||||
a=0
|
||||
fi
|
||||
echo
|
||||
if [ "${a}" -ge "1" ];then
|
||||
SOFAR=$(($(wc -l ${IDFILE}| cut -d' ' -f1)/2))
|
||||
else
|
||||
SOFAR=0
|
||||
fi
|
||||
if [ $SOFAR = 1 ];then
|
||||
verbage=detection
|
||||
else
|
||||
verbage=detections
|
||||
fi
|
||||
echo " -$a $verbage so far"
|
||||
echo
|
||||
echo " -$SOFAR species identified so far"
|
||||
echo
|
||||
if [ "${SOFAR}" -ge "1" ];then
|
||||
MOST_RECENT="$(find ${EXTRACTED}/By_Date/$(date +%Y-%m-%d) \
|
||||
| sort -t"%" -rk2 \
|
||||
| head -n1 \
|
||||
| cut -d'/' -f8)"
|
||||
AT_TIME="$(find ${EXTRACTED}/By_Date/$(date +%Y-%m-%d) \
|
||||
| sort -t"%" -rk2 \
|
||||
| head -n1 \
|
||||
| rev \
|
||||
| cut -d'-' -f1 \
|
||||
| rev \
|
||||
| cut -d'.' -f1)"
|
||||
echo " -Most recent species detection: ${MOST_RECENT//_/ } at ${AT_TIME}"
|
||||
echo
|
||||
fi
|
||||
if [ ${a} -ge 1 ];then
|
||||
while read -r line;do
|
||||
|
||||
# Get species name
|
||||
SPECIES="$(echo "${line}" | awk -F: '/Common Name/ {print $2}')"
|
||||
SPECIES="${SPECIES// /_}"
|
||||
SPECIES="$(echo ${SPECIES/_} | tr -d "'")"
|
||||
[ -z ${SPECIES} ] && continue
|
||||
|
||||
# Get all detection files
|
||||
ALL_DETECTION_FILES="$(find ${EXTRACTED}/By_Date/*/${SPECIES} -name '*.wav')"
|
||||
ALL_DETECTION_FILES="$(echo ${ALL_DETECTION_FILES[@]} | tr ' ' '\n')"
|
||||
|
||||
# Parse highest confidence score
|
||||
MAX_SCORE="$(echo "${ALL_DETECTION_FILES}"| awk -F% '{print $1}')"
|
||||
MAX_SCORE="$(echo "${MAX_SCORE[@]}" | rev |cut -d"-" -f1|rev | sort -r | head -n1)"
|
||||
|
||||
# Set noun-plurality agreement for grammar
|
||||
DETECTIONS="$(ls -1 ${EXTRACTED}/By_Date/*/${SPECIES} | wc -l)"
|
||||
if [ ${DETECTIONS} = 1 ];then
|
||||
verbage=detection
|
||||
else
|
||||
verbage=detections
|
||||
fi
|
||||
|
||||
# Write results to temporary file
|
||||
echo "${DETECTIONS} $verbage for ${SPECIES//_/ } | max conf ${MAX_SCORE}%"
|
||||
done < "${IDFILE}" > ${TMP_FILE}
|
||||
|
||||
# Print temporary file sorted by # of detections
|
||||
sort -rk1 -h "${TMP_FILE}"
|
||||
fi
|
||||
echo
|
||||
echo -n "Listening since "${INSTALL_DATE}""
|
||||
sleep 20
|
||||
clear
|
||||
done
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
shell_exec("/home/pi/BirdNET-Lite/scripts/clear_all_data.sh");
|
||||
header('Location: http://birdnetsystem.local/scripts/index.html?success=true');
|
||||
?>
|
||||
+11
-26
@@ -4,38 +4,23 @@
|
||||
# you are okay will losing all the data that you've collected and processed
|
||||
# so far.
|
||||
source /etc/birdnet/birdnet.conf
|
||||
|
||||
echo "
|
||||
This script removes all data that has been collected. It is tantamount to
|
||||
starting all data-collection from scratch. Only run this if you are sure
|
||||
you are okay with losing all the data that you've collected and processed
|
||||
so far.
|
||||
|
||||
"
|
||||
read -n1 -p "Are you sure you want to wipe away ALL data?" YN
|
||||
echo
|
||||
while true; do
|
||||
case $YN in
|
||||
[Yy]) break;;
|
||||
*) echo "Exiting since you didn't answer with Y or y." && exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "Stopping services"
|
||||
sudo systemctl stop birdnet_recording.service
|
||||
echo "Removing all data . . . "
|
||||
sudo rm -drf "${RECS_DIR}"
|
||||
rm "${IDFILE}"
|
||||
|
||||
echo "Recreating necessary directories"
|
||||
[ -d ${RECS_DIR} ] || mkdir -p ${RECS_DIR}
|
||||
[ -d ${EXTRACTED} ] || mkdir -p ${EXTRACTED}
|
||||
[ -d ${EXTRACTED}/By_Date ] || mkdir -p ${EXTRACTED}/By_Date
|
||||
[ -d ${EXTRACTED}/By_Common_Name ] || mkdir -p ${EXTRACTED}/By_Common_Name
|
||||
[ -d ${EXTRACTED}/By_Scientific_Name ] || mkdir -p ${EXTRACTED}/By_Scientific_Name
|
||||
[ -d ${PROCESSED} ] || mkdir -p ${PROCESSED}
|
||||
cp ~/BirdNET-Lite/templates/index.html ${EXTRACTED}/
|
||||
|
||||
[ -d ${RECS_DIR} ] || sudo -u ${BIRDNET_USER} mkdir -p ${RECS_DIR}
|
||||
[ -d ${EXTRACTED} ] || sudo -u ${BIRDNET_USER} mkdir -p ${EXTRACTED}
|
||||
[ -d ${EXTRACTED}/By_Date ] || sudo -u ${BIRDNET_USER} mkdir -p ${EXTRACTED}/By_Date
|
||||
[ -d ${EXTRACTED}/By_Common_Name ] || sudo -u ${BIRDNET_USER} mkdir -p ${EXTRACTED}/By_Common_Name
|
||||
[ -d ${EXTRACTED}/By_Scientific_Name ] || sudo -u ${BIRDNET_USER} mkdir -p ${EXTRACTED}/By_Scientific_Name
|
||||
sudo -u ${BIRDNET_USER} ln -s /home/pi/BirdNET-Lite/templates/index.html ${EXTRACTED}
|
||||
[ -d ${PROCESSED} ] || sudo -u ${BIRDNET_USER} mkdir -p ${PROCESSED}
|
||||
[ -L ${EXTRACTED}/scripts ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/BirdNET-Lite/scripts ${EXTRACTED}/
|
||||
[ -L ${EXTRACTED}/spectrogram.php ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/BirdNET-Lite/scripts/spectrogram.php ${EXTRACTED}
|
||||
[ -L ${EXTRACTED}/spectrogram.sh ] || sudo -u ${BIRDNET_USER} ln -s /home/pi/BirdNET-Lite/scripts/spectrogram.sh ${EXTRACTED}
|
||||
|
||||
sudo -u ${BIRDNET_USER} cp ~/BirdNET-Lite/templates/index.html ${EXTRACTED}/
|
||||
echo "Restarting services"
|
||||
sudo systemctl restart birdnet_recording.service
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
shell_exec("/home/pi/BirdNET-Lite/scripts/edit_birdnet.conf.sh");
|
||||
header('Location: http://birdnetsystem.local:9898');
|
||||
?>
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
sudo systemctl start edit_birdnet_conf.service
|
||||
@@ -3,12 +3,13 @@
|
||||
#set -x
|
||||
set -e
|
||||
# Keep track of the last executed command
|
||||
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
|
||||
# Echo an error message before exiting
|
||||
trap 'echo "\"${last_command}\" command exited with code $?."' EXIT
|
||||
#trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
|
||||
## Echo an error message before exiting
|
||||
#trap 'echo "\"${last_command}\" command exited with code $?."' EXIT
|
||||
# Remove temporary file
|
||||
trap 'rm -f $TMPFILE' EXIT
|
||||
source /etc/birdnet/birdnet.conf
|
||||
[ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12
|
||||
|
||||
# Set Variables
|
||||
TMPFILE=$(mktemp)
|
||||
@@ -73,7 +74,7 @@ for h in "${SCAN_DIRS[@]}";do
|
||||
START="$(echo "${line}" | awk -F\; '!/birdnet/{print $1}')"
|
||||
END="$(echo "${line}" | awk -F\; '!/birdnet/{print $2}')"
|
||||
COMMON_NAME=""$(echo ${line} \
|
||||
| awk -F\; '!/birdnet/{print $4}')""
|
||||
| awk -F\; '!/birdnet/{print $4}'|tr -d "'")""
|
||||
SCIENTIFIC_NAME=""$(echo ${line} \
|
||||
| awk -F\; '!/birdnet/{print $3}')""
|
||||
CONFIDENCE=""$(echo ${line} \
|
||||
@@ -115,10 +116,10 @@ for h in "${SCAN_DIRS[@]}";do
|
||||
|
||||
# If there are already 20 extracted entries for a given species
|
||||
# for today, remove the oldest file and create the new one.
|
||||
# if [[ "$(find ${NEWSPECIES_BYDATE} | wc -l)" -ge 21 ]];then
|
||||
# if [[ "$(find ${NEWSPECIES_BYDATE} | wc -l)" -ge 20 ]];then
|
||||
# echo "20 ${SPECIES}s, already! Removing the oldest by-date and making a new one"
|
||||
# cd ${NEWSPECIES_BYDATE} || exit 1
|
||||
# ls -1t . | tail -n +21 | xargs -r rm -vv
|
||||
# ls -1t . | tail -n +20 | xargs -r rm -vv
|
||||
# fi
|
||||
|
||||
echo "Extracting audio . . . "
|
||||
@@ -127,34 +128,48 @@ for h in "${SCAN_DIRS[@]}";do
|
||||
# structured by-species, symbolic links are made to populate the new
|
||||
# directory.
|
||||
|
||||
### TESTING longer extraction context
|
||||
# This section sets the SPACER that will be used to pad the audio clip with
|
||||
# context. If EXTRACTION_LENGTH is 10, for instance, 3 seconds are removed
|
||||
# from that value and divided by 2, so that the 3 seconds of the call are
|
||||
# within 3.5 seconds of audio context before and after.
|
||||
[ -z ${EXTRACTION_LENGTH} ] && EXTRACTION_LENGTH=6
|
||||
SPACER=$(echo "scale=1;(${EXTRACTION_LENGTH} - 3 )/2" |bc -l)
|
||||
START=$(echo "scale=1;${START} - ${SPACER}"|bc -l)
|
||||
END=$(echo "scale=1;${END} + ${SPACER}"|bc -l)
|
||||
|
||||
if (( $(echo "scale=1;${START} < 1" | bc -l) ));then START=0;fi
|
||||
if (( $(echo "scale=1;${END} > ${RECORDING_LENGTH}" | bc -l) ));then END=${RECORDING_LENGTH};fi
|
||||
# If the SPACER would have the START value less that 0, start at the
|
||||
# beginning of the audio file. If the SPACER would make the END value
|
||||
# exceed the end of the audio file, end the extraction at the end of the
|
||||
# audio file.
|
||||
if (( $(echo "${START} < 1" | bc -l) ));then START=0;fi
|
||||
if (( $(echo "${END} > ${RECORDING_LENGTH}" | bc -l) ));then END=${RECORDING_LENGTH};fi
|
||||
|
||||
ffmpeg -hide_banner -loglevel error -nostdin -i "${h}/${OLDFILE}" \
|
||||
-acodec copy -ss "${START}" -to "${END}"\
|
||||
"${NEWSPECIES_BYDATE}/${a}-${NEWFILE}"
|
||||
if [[ "$(find ${NEWSPECIES_BY_COMMON} | wc -l)" -ge 21 ]];then
|
||||
|
||||
|
||||
# Remove the oldest symbolic links that would made the directory have more
|
||||
# than 20 entries.
|
||||
if [[ "$(find ${NEWSPECIES_BY_COMMON} | wc -l)" -ge 20 ]];then
|
||||
echo "20 ${SPECIES}s, already! Removing the oldest by-species and making a new one"
|
||||
cd ${NEWSPECIES_BY_COMMON} || exit 1
|
||||
ls -1t . | tail -n +21 | xargs -r rm -vv
|
||||
ls -1t . | tail -n +20 | xargs -r rm -vv
|
||||
ln -fs "${NEWSPECIES_BYDATE}/${a}-${NEWFILE}"\
|
||||
"${NEWSPECIES_BY_COMMON}/${a}-${NEWFILE}"
|
||||
echo "Success! New extraction for ${COMMON_NAME}"
|
||||
else
|
||||
# Make symbolic link of the extraction to add to By_Common_Name
|
||||
ln -fs "${NEWSPECIES_BYDATE}/${a}-${NEWFILE}"\
|
||||
"${NEWSPECIES_BY_COMMON}/${a}-${NEWFILE}"
|
||||
fi
|
||||
|
||||
if [[ "$(find ${NEWSPECIES_BY_SCIENCE} | wc -l)" -ge 21 ]];then
|
||||
# Remove the oldest symbolic links that would made the directory have more
|
||||
# than 20 entries.
|
||||
if [[ "$(find ${NEWSPECIES_BY_SCIENCE} | wc -l)" -ge 20 ]];then
|
||||
echo "20 ${SPECIES}s, already! Removing the oldest by-species and making a new one"
|
||||
cd ${NEWSPECIES_BY_SCIENCE} || exit 1
|
||||
ls -1t . | tail -n +21 | xargs -r rm -vv
|
||||
ls -1t . | tail -n +20 | xargs -r rm -vv
|
||||
ln -fs "${NEWSPECIES_BYDATE}/${a}-${NEWFILE}"\
|
||||
"${NEWSPECIES_BY_SCIENCE}/${a}-${NEWFILE}"
|
||||
echo "Success! New extraction for ${COMMON_NAME}"
|
||||
|
||||
+8
-1
@@ -1,3 +1,7 @@
|
||||
<form action="/scripts/edit_birdnet.conf.php">
|
||||
<input type="submit" value="Edit the birdnet.conf file">
|
||||
</form>
|
||||
|
||||
<form action="/scripts/restart_services.php">
|
||||
<input type="submit" value="Restart ALL BirdNET-system Services">
|
||||
</form>
|
||||
@@ -18,6 +22,10 @@
|
||||
<input type="submit" value="Restart Caddy">
|
||||
</form>
|
||||
|
||||
<form action="/scripts/clear_all_data.php">
|
||||
<input type="submit" value="Clear ALL data">
|
||||
</form>
|
||||
|
||||
<form action="/scripts/reboot_system.php">
|
||||
<input type="submit" value="Reboot BirdNET-system">
|
||||
</form>
|
||||
@@ -25,4 +33,3 @@
|
||||
<form action="/scripts/shutdown_system.php">
|
||||
<input type="submit" value="Shutdown BirdNET-system">
|
||||
</form>
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ create_necessary_dirs() {
|
||||
[ -d ${EXTRACTED}/By_Scientific_Name ] || sudo -u ${USER} mkdir -p ${EXTRACTED}/By_Scientific_Name
|
||||
[ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED}
|
||||
[ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED}
|
||||
[ -L ${EXTRACTED}/spectrogram.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED}
|
||||
}
|
||||
|
||||
install_alsa() {
|
||||
@@ -196,6 +197,9 @@ ${EXTRACTIONS_URL} {
|
||||
basicauth /Processed* {
|
||||
birdnet ${HASHWORD}
|
||||
}
|
||||
basicauth /scripts* {
|
||||
birdnet ${HASHWORD}
|
||||
}
|
||||
basicauth /stream {
|
||||
birdnet ${HASHWORD}
|
||||
}
|
||||
@@ -209,6 +213,9 @@ http://birdnetsystem.local {
|
||||
basicauth /Processed* {
|
||||
birdnet ${HASHWORD}
|
||||
}
|
||||
basicauth /scripts* {
|
||||
birdnet ${HASHWORD}
|
||||
}
|
||||
basicauth /stream {
|
||||
birdnet ${HASHWORD}
|
||||
}
|
||||
@@ -311,7 +318,7 @@ RestartSec=3
|
||||
Type=simple
|
||||
User=${USER}
|
||||
Environment=TERM=xterm-256color
|
||||
ExecStart=/usr/local/bin/gotty -p 9090 --title-format "BirdNET-Lite Statistics" /usr/local/bin/birdnet_stats.sh
|
||||
ExecStart=/usr/local/bin/gotty -p 9090 --title-format "BirdNET-Lite Statistics" tmux new -A -s birdstats /usr/local/bin/birdnet_stats.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -319,6 +326,29 @@ EOF
|
||||
systemctl enable --now birdstats.service
|
||||
}
|
||||
|
||||
install_tmux() {
|
||||
echo "Installing tmux dependencies"
|
||||
apt -qqy install libevent-2* \
|
||||
libevent-dev \
|
||||
ncurses-bin \
|
||||
ncurses-base \
|
||||
ncurses-term \
|
||||
libncurses-dev
|
||||
|
||||
cp $(dirname ${my_dir})/templates/tmux.conf /etc/tmux.conf
|
||||
}
|
||||
|
||||
install_sox() {
|
||||
if which sox &> /dev/null;then
|
||||
echo "Sox is installed"
|
||||
else
|
||||
echo "Installing sox"
|
||||
apt -qq update
|
||||
apt install -y sox
|
||||
echo "Sox installed"
|
||||
fi
|
||||
}
|
||||
|
||||
install_php() {
|
||||
if ! which pip &> /dev/null || ! which php-fpm7.3;then
|
||||
echo "Installing PHP and PHP-FPM"
|
||||
@@ -337,6 +367,25 @@ EOF
|
||||
chmod 0440 /etc/sudoers.d/010_caddy-nopasswd
|
||||
}
|
||||
|
||||
install_edit_birdnet_conf() {
|
||||
cat << EOF > /etc/systemd/system/edit_birdnet_conf.service
|
||||
[Unit]
|
||||
Description=Edit birdnet.conf
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
Type=simple
|
||||
User=pi
|
||||
Environment=TERM=xterm-256color
|
||||
ExecStart=/usr/local/bin/gotty -w -p 9898 --title-format "Edit birdnet.conf" tmux new -A -s editbirdnet nano /home/pi/BirdNET-Lite/birdnet.conf
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
install_icecast() {
|
||||
if ! which icecast2;then
|
||||
echo "Installing IceCast2"
|
||||
@@ -443,7 +492,10 @@ install_selected_services() {
|
||||
install_Caddyfile
|
||||
install_avahi_aliases
|
||||
install_gotty_logs
|
||||
install_tmux
|
||||
install_sox
|
||||
install_php
|
||||
install_edit_birdnet_conf
|
||||
fi
|
||||
|
||||
if [ ! -z "${ICE_PWD}" ];then
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
shell_exec("/home/pi/BirdSongs/Extracted/spectrogram.sh");
|
||||
header('Location: http://birdnetsystem.local/spectrogram.png');
|
||||
?>
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Make sox spectrogram
|
||||
source /etc/birdnet/birdnet.conf
|
||||
analyzing_now="$(cat /home/pi/BirdNET-Lite/analyzing_now.txt)"
|
||||
spectrogram_png=${EXTRACTED}/spectrogram.png
|
||||
sudo -u pi sox "${analyzing_now}" -n spectrogram -o "${spectrogram_png}"
|
||||
Executable
BIN
Binary file not shown.
@@ -7,9 +7,12 @@ SCRIPTS=(birdnet_analysis.sh
|
||||
birdnet_recording.sh
|
||||
birdnet_stats.sh
|
||||
cleanup.sh
|
||||
clear_all_data.php
|
||||
clear_all_data.sh
|
||||
disk_usage.sh
|
||||
dump_logs.sh
|
||||
edit_birdnet.conf.php
|
||||
edit_birdnet.conf.sh
|
||||
extract_new_birdsounds.sh
|
||||
install_birdnet.sh
|
||||
install_config.sh
|
||||
@@ -31,7 +34,10 @@ restart_extraction.php
|
||||
restart_extraction.sh
|
||||
restart_services.php
|
||||
restart_services.sh
|
||||
shutdown_system.php
|
||||
shutdown_system.sh
|
||||
species_notifier.sh
|
||||
tmux
|
||||
uninstall.sh
|
||||
update_species.sh
|
||||
${HOME}/.gotty)
|
||||
@@ -51,6 +57,7 @@ birdstats.service
|
||||
birdterminal.service
|
||||
caddy.d
|
||||
caddy.service
|
||||
edit_birdnet_conf.service
|
||||
extraction_log.service
|
||||
extraction.d
|
||||
extraction.service
|
||||
@@ -89,8 +96,8 @@ remove_icecast() {
|
||||
|
||||
remove_scripts() {
|
||||
for i in "${SCRIPTS[@]}";do
|
||||
if [ -L "${i}" ];then
|
||||
sudo rm -v "${i}"
|
||||
if [ -L "/usr/local/bin/${i}" ];then
|
||||
sudo rm -v "/usr/local/bin/${i}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
+60
-44
@@ -54,6 +54,16 @@ h1 {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
h2 {
|
||||
padding-left: 5%;
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
overflow-x: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
color: #000;
|
||||
margin: 0 4px;
|
||||
@@ -128,12 +138,13 @@ td {
|
||||
}
|
||||
|
||||
td:nth-child(2) {
|
||||
width: 80%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
td:nth-child(3),
|
||||
th:nth-child(3) {
|
||||
padding: 0 20px 0 20px;
|
||||
#padding: 0 20px 0 20px;
|
||||
width: 0px;
|
||||
}
|
||||
|
||||
th:nth-child(4),
|
||||
@@ -269,9 +280,9 @@ footer {
|
||||
<path d="M285.22 37.55h-142.6L110.9 0H31.7C14.25 0 0 16.9 0 37.55v75.1h316.92V75.1c0-20.65-14.26-37.55-31.7-37.55z" fill="#FFA000"/>
|
||||
<path d="M285.22 36H31.7C14.25 36 0 50.28 0 67.74v158.7c0 17.47 14.26 31.75 31.7 31.75H285.2c17.44 0 31.7-14.3 31.7-31.75V67.75c0-17.47-14.26-31.75-31.7-31.75z" fill="#FFCA28"/>
|
||||
</g>
|
||||
<g id="folder-shortcut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="folder-shortcut-group" fill-rule="nonzero">
|
||||
<g id="folder-shortcut-shape">
|
||||
<g id="folder" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="folder-group" fill-rule="nonzero">
|
||||
<g id="folder-shape">
|
||||
<path d="M285.224876,37.5486902 L142.612438,37.5486902 L110.920785,0 L31.6916529,0 C14.2612438,0 0,16.8969106 0,37.5486902 L0,112.646071 L316.916529,112.646071 L316.916529,75.0973805 C316.916529,54.4456008 302.655285,37.5486902 285.224876,37.5486902 Z" id="Shape" fill="#FFA000"></path>
|
||||
<path d="M285.224876,36 L31.6916529,36 C14.2612438,36 0,50.2838568 0,67.7419039 L0,226.451424 C0,243.909471 14.2612438,258.193328 31.6916529,258.193328 L285.224876,258.193328 C302.655285,258.193328 316.916529,243.909471 316.916529,226.451424 L316.916529,67.7419039 C316.916529,50.2838568 302.655285,36 285.224876,36 Z" id="Shape" fill="#FFCA28"></path>
|
||||
</g>
|
||||
@@ -311,30 +322,25 @@ footer {
|
||||
<a href="">BirdNET-Lite System</a>
|
||||
</h1>
|
||||
</header>
|
||||
<h2>
|
||||
<a href="./stream">
|
||||
<span class="name">Live Audio Stream</span>
|
||||
</a>
|
||||
</h2>
|
||||
<h2>
|
||||
<a href="http://birdnetsystem.local:9090">
|
||||
<span class="name">BirdNET-system Report</span>
|
||||
</a>
|
||||
</h2>
|
||||
<main>
|
||||
<div class="meta">
|
||||
<div id="summary">
|
||||
<span class="meta-item"><b>5</b> directories</span>
|
||||
<span class="meta-item"><b>1</b> file</span>
|
||||
<span class="meta-item"><input type="text" placeholder="filter" id="filter" onkeyup='filter()'></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listing">
|
||||
<table aria-describedby="summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
<a href="?sort=namedirfirst&order=desc" class="icon"><svg width="1em" height=".5em" version="1.1" viewBox="0 0 12.922194 6.0358899"><use xlink:href="#up-arrow"></use></svg></a>
|
||||
<a href="?sort=name&order=asc">Name</a>
|
||||
<a href="?sort=name&order=asc">Extractions</a>
|
||||
</th>
|
||||
<th>
|
||||
<a href="?sort=size&order=asc">Size</a>
|
||||
</th>
|
||||
<th class="hideable">
|
||||
<a href="?sort=time&order=asc">Modified</a>
|
||||
</th>
|
||||
<th class="hideable"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -346,9 +352,6 @@ footer {
|
||||
<span class="name">By_Common_Name</span>
|
||||
</a>
|
||||
</td>
|
||||
<td data-order="-1">—</td>
|
||||
<td class="hideable"><time datetime="2021-10-03T23:13:48Z">10/03/2021 11:13:48 PM +00:00</time></td>
|
||||
<td class="hideable"></td>
|
||||
</tr>
|
||||
<tr class="file">
|
||||
<td></td>
|
||||
@@ -358,9 +361,6 @@ footer {
|
||||
<span class="name">By_Date</span>
|
||||
</a>
|
||||
</td>
|
||||
<td data-order="-1">—</td>
|
||||
<td class="hideable"><time datetime="2021-10-03T23:13:48Z">10/03/2021 11:13:48 PM +00:00</time></td>
|
||||
<td class="hideable"></td>
|
||||
</tr>
|
||||
<tr class="file">
|
||||
<td></td>
|
||||
@@ -370,45 +370,61 @@ footer {
|
||||
<span class="name">By_Scientific_Name</span>
|
||||
</a>
|
||||
</td>
|
||||
<td data-order="-1">—</td>
|
||||
<td class="hideable"><time datetime="2021-10-03T23:13:48Z">10/03/2021 11:13:48 PM +00:00</time></td>
|
||||
<td class="hideable"></td>
|
||||
</tr>
|
||||
<tr class="file">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="./Processed/">
|
||||
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder-shortcut"></use></svg>
|
||||
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
|
||||
<span class="name">Processed</span>
|
||||
</a>
|
||||
</td>
|
||||
<td data-order="-1">—</td>
|
||||
<td class="hideable"><time datetime="2021-10-03T23:23:16Z">10/03/2021 11:23:16 PM +00:00</time></td>
|
||||
<td class="hideable"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
<a href="?sort=name&order=asc">Tools</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tr class="file">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="./scripts/">
|
||||
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder-shortcut"></use></svg>
|
||||
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
|
||||
<span class="name">scripts</span>
|
||||
</a>
|
||||
</td>
|
||||
<td data-order="-1">—</td>
|
||||
<td class="hideable"><time datetime="2021-10-03T23:13:48Z">10/03/2021 11:13:48 PM +00:00</time></td>
|
||||
<td class="hideable"></td>
|
||||
</tr>
|
||||
<tr class="file">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="./stream">
|
||||
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 265 323"><use xlink:href="#file"></use></svg>
|
||||
<span class="name">stream</span>
|
||||
<a href="http://birdnetsystem.local:8080">
|
||||
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
|
||||
<span class="name">birdlog</span>
|
||||
</a>
|
||||
</td>
|
||||
<td data-order="0">0 B</td>
|
||||
<td class="hideable"><time datetime="2021-10-03T23:29:52Z">10/03/2021 11:29:52 PM +00:00</time></td>
|
||||
<td class="hideable"></td>
|
||||
</tr>
|
||||
<tr class="file">
|
||||
<td></td>
|
||||
<td>
|
||||
<a href="http://birdnetsystem.local:8888">
|
||||
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
|
||||
<span class="name">extractionlog</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="file">
|
||||
<td></td>
|
||||
<td>
|
||||
<form action="/spectrogram.php">
|
||||
<input type="submit" value="Spectrogram View">
|
||||
</form>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user