From 5145c9750fd58c9ad1efd6a819fdaded1be8ac99 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Sat, 16 Oct 2021 21:24:40 -0400 Subject: [PATCH 01/77] Update Birders_Guide_Installer.sh --- Birders_Guide_Installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Birders_Guide_Installer.sh b/Birders_Guide_Installer.sh index c45aa57..6df0592 100755 --- a/Birders_Guide_Installer.sh +++ b/Birders_Guide_Installer.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -e my_dir=${HOME}/BirdNET-Pi -branch=main +branch=testing trap '${my_dir}/scripts/dump_logs.sh && exit' EXIT SIGHUP SIGINT From dc730e7b872dda725101f68277140f11f972af98 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 17 Oct 2021 16:35:05 -0400 Subject: [PATCH 02/77] DB view refreshes after 30 seconds --- scripts/viewdb.php | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/viewdb.php b/scripts/viewdb.php index ac70b0f..a8da518 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -1,4 +1,5 @@ Date: Sun, 17 Oct 2021 19:22:54 -0400 Subject: [PATCH 03/77] testing new updater -- not for general testing --- scripts/install_services.sh | 16 +++---- scripts/update_birdnet.sh | 92 ++----------------------------------- scripts/update_birdnet2.sh | 28 +++++++++++ scripts/update_services.sh | 21 +++++---- 4 files changed, 51 insertions(+), 106 deletions(-) create mode 100644 scripts/update_birdnet2.sh diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 388e029..e090b71 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -90,7 +90,7 @@ ExecStart=/usr/local/bin/species_notifier.sh [Install] WantedBy=multi-user.target EOF - systemctl enable --now pushed_notifications + systemctl enable pushed_notifications.service } create_necessary_dirs() { @@ -234,7 +234,7 @@ ExecStart=/bin/bash -c "/usr/bin/avahi-publish -a -R %I $(avahi-resolve -4 -n %H [Install] WantedBy=multi-user.target EOF - systemctl enable --now avahi-alias@birdnetpi.local.service + systemctl enable avahi-alias@birdnetpi.local.service } install_spectrogram_service() { @@ -250,7 +250,7 @@ ExecStart=/usr/local/bin/spectrogram.sh [Install] WantedBy=multi-user.target EOF - systemctl enable --now spectrogram_viewer.service + systemctl enable spectrogram_viewer.service } install_gotty_logs() { @@ -277,7 +277,7 @@ ExecStart=/usr/local/bin/gotty -p 8080 --title-format "BirdNET-Pi Log" journalct [Install] WantedBy=multi-user.target EOF - systemctl enable --now birdnet_log.service + systemctl enable birdnet_log.service echo "Installing the extraction_log.service" cat << EOF > /etc/systemd/system/extraction_log.service [Unit] @@ -294,7 +294,7 @@ ExecStart=/usr/local/bin/gotty -p 8888 --title-format "Extractions Log" journalc [Install] WantedBy=multi-user.target EOF - systemctl enable --now extraction_log.service + systemctl enable extraction_log.service } install_sox() { @@ -357,12 +357,12 @@ install_icecast() { echo "icecast2 icecast2/icecast-setup boolean false" | debconf-set-selections apt install -qqy icecast2 config_icecast - systemctl enable --now icecast2 + systemctl enable icecast2.service /etc/init.d/icecast2 start else echo "Icecast2 is installed" config_icecast - systemctl enable --now icecast2 + systemctl enable icecast2.service /etc/init.d/icecast2 start fi } @@ -395,7 +395,7 @@ ExecStart=/usr/local/bin/livestream.sh [Install] WantedBy=multi-user.target EOF - systemctl enable --now livestream.service + systemctl enable livestream.service } install_nomachine() { diff --git a/scripts/update_birdnet.sh b/scripts/update_birdnet.sh index aeb041d..96792ba 100755 --- a/scripts/update_birdnet.sh +++ b/scripts/update_birdnet.sh @@ -8,69 +8,7 @@ HOME=/home/pi my_dir=${HOME}/BirdNET-Pi/scripts tmpfile=$(mktemp) -scripts=(birdnet_analysis.sh -birdnet_recording.sh -birdnet_stats.sh -cleanup.sh -clear_all_data.php -clear_all_data.sh -createdb.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 -install_services.sh -install_tmux_services.sh -install_zram_service.sh -livestream.sh -pretty_date.sh -reboot_system.php -reboot_system.sh -reconfigure_birdnet.sh -restart_birdnet_analysis.php -restart_birdnet_analysis.sh -restart_birdnet_recording.php -restart_birdnet_recording.sh -restart_caddy.php -restart_caddy.sh -restart_extraction.php -restart_extraction.sh -restart_services.php -restart_services.sh -shutdown_system.php -shutdown_system.sh -species_notifier.sh -spectrogram.php -spectrogram.sh -tmux -uninstall.sh -update_species.sh -${HOME}/.gotty) - - -# Change this to sourcing from current uninstall.sh -# Create a pre-update services array for disabling -# Create a post-update services array for restarting -services=(avahi-alias@birdlog.local.service -avahi-alias@birdnetpi.local.service -avahi-alias@birdstats.local.service -avahi-alias@extractionlog.local.service -avahi-alias@birdterminal.local.service -birdnet_analysis.service -birdnet_log.service -birdnet_recording.service -birdstats.service -birdterminal.service -edit_birdnet_conf.service -extraction_log.service -extraction.service -extraction.timer -livestream.service -pushed_notifications.service -spectrogram_viewer.service) +services=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) remove_services() { for i in "${services[@]}"; do @@ -109,34 +47,12 @@ remove_scripts() { done } -restart_services() { - for i in ${services[@]};do - sudo systemctl restart ${i} - done -} - # Stage 1 removes old stuff remove_services remove_scripts # Stage 2 does a git pull to fetch new things -sudo -u${USER} git -C ${HOME}/BirdNET-Pi pull || exit 1 - -# Stage 3 updates the services -sudo ${my_dir}/update_services.sh - -# Stage 4 restarts the services -services=(avahi-alias@birdnetpi.local.service -birdnet_analysis.service -birdnet_log.service -birdnet_recording.service -edit_birdnet_conf.service -extraction_log.service -extraction.service -extraction.timer -livestream.service -pushed_notifications.service -spectrogram_viewer.service) - -restart_services +sudo -u${USER} git -C ${HOME}/BirdNET-Pi pull -f || exit 1 +# Trigger the new update_birdnet2.sh +sudo -u${USER} ${my_dir}/update_birdnet2.sh diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh new file mode 100644 index 0000000..2926e69 --- /dev/null +++ b/scripts/update_birdnet2.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# Second stage of update + + +# Stage 1 updates the services +my_dir=${HOME}/BirdNET-Pi/scripts +sudo ${my_dir}/update_services.sh + +# Stage 2 restarts the services +services=(avahi-alias@birdnetpi.local.service +birdnet_analysis.service +birdnet_log.service +birdnet_recording.service +edit_birdnet_conf.service +extraction_log.service +extraction.service +extraction.timer +livestream.service +pushed_notifications.service +spectrogram_viewer.service) + +restart_services() { + for i in ${services[@]};do + sudo systemctl restart ${i} + done +} + +restart_services diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 97e3b4c..15d2cfa 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# This installs the services that have been selected +# This reinstalls the services #set -x # Uncomment to enable debugging trap 'rm -f ${tmpfile}' EXIT trap 'exit 1' SIGINT SIGHUP @@ -24,6 +24,8 @@ install_mariadb() { apt -qqy install mariadb-server echo "MariaDB Installed" fi + sed -i "s/databasepassword/${DB_PWD}/g" /home/pi/BirdNET-Pi/analyze.py + sed -i "s/databasepassword/${DB_PWD}/g" /home/pi/BirdNET-Pi/scripts/viewdb.php } install_birdnet_analysis() { @@ -88,7 +90,7 @@ ExecStart=/usr/local/bin/species_notifier.sh [Install] WantedBy=multi-user.target EOF - systemctl enable --now pushed_notifications + systemctl enable pushed_notifications.service } create_necessary_dirs() { @@ -104,7 +106,6 @@ create_necessary_dirs() { [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} [ -L ${EXTRACTED}/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini - } install_alsa() { @@ -232,7 +233,7 @@ ExecStart=/bin/bash -c "/usr/bin/avahi-publish -a -R %I $(avahi-resolve -4 -n %H [Install] WantedBy=multi-user.target EOF - systemctl enable --now avahi-alias@birdnetpi.local.service + systemctl enable avahi-alias@birdnetpi.local.service } install_spectrogram_service() { @@ -248,7 +249,7 @@ ExecStart=/usr/local/bin/spectrogram.sh [Install] WantedBy=multi-user.target EOF - systemctl enable --now spectrogram_viewer.service + systemctl enable spectrogram_viewer.service } install_gotty_logs() { @@ -275,7 +276,7 @@ ExecStart=/usr/local/bin/gotty -p 8080 --title-format "BirdNET-Pi Log" journalct [Install] WantedBy=multi-user.target EOF - systemctl enable --now birdnet_log.service + systemctl enable birdnet_log.service echo "Installing the extraction_log.service" cat << EOF > /etc/systemd/system/extraction_log.service [Unit] @@ -292,7 +293,7 @@ ExecStart=/usr/local/bin/gotty -p 8888 --title-format "Extractions Log" journalc [Install] WantedBy=multi-user.target EOF - systemctl enable --now extraction_log.service + systemctl enable extraction_log.service } install_sox() { @@ -354,12 +355,12 @@ install_icecast() { echo "icecast2 icecast2/icecast-setup boolean false" | debconf-set-selections apt install -qqy icecast2 config_icecast - systemctl enable --now icecast2 + systemctl enable icecast2.service /etc/init.d/icecast2 start else echo "Icecast2 is installed" config_icecast - systemctl enable --now icecast2 + systemctl enable icecast2.service /etc/init.d/icecast2 start fi } @@ -392,7 +393,7 @@ ExecStart=/usr/local/bin/livestream.sh [Install] WantedBy=multi-user.target EOF - systemctl enable --now livestream.service + systemctl enable livestream.service } install_nomachine() { From 96fd368a1357fc90f64c3758ac87634a2f840441 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Sun, 17 Oct 2021 19:30:47 -0400 Subject: [PATCH 04/77] new caution for update --- scripts/index.html | 3 +-- scripts/update_birdnet2.sh | 0 2 files changed, 1 insertion(+), 2 deletions(-) mode change 100644 => 100755 scripts/update_birdnet2.sh diff --git a/scripts/index.html b/scripts/index.html index 7c52582..9690b51 100644 --- a/scripts/index.html +++ b/scripts/index.html @@ -27,12 +27,11 @@ -
-
+
diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh old mode 100644 new mode 100755 From b2cfd31945e3c019c9eb3bc6bcee16224879bef4 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 12:59:57 -0400 Subject: [PATCH 05/77] adding change and testing updater --- scripts/viewdb.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/viewdb.php b/scripts/viewdb.php index a8da518..41075cf 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -21,6 +21,11 @@ $sql = "SELECT * FROM detections $fulltable = $mysqli->query($sql); $totalcount=mysqli_num_rows($fulltable); +$sql1 = "SELECT * FROM detections + ORDER BY Date DESC, Time DESC + LIMIT 500"; +$mosttable = $mysqli->query($sql1); + $sql2 = "SELECT * FROM detections WHERE Date = CURDATE()"; $todaystable = $mysqli->query($sql2); @@ -243,7 +248,7 @@ while($rows=$speciestally ->fetch_assoc()) fetch_assoc()) +while($rows=$mosttable ->fetch_assoc()) { ?> From 95563a4d9f4c5af4badb0d3ded683d4570aabbb8 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 13:07:45 -0400 Subject: [PATCH 06/77] Update update_birdnet.sh --- scripts/update_birdnet.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update_birdnet.sh b/scripts/update_birdnet.sh index 96792ba..e797ac0 100755 --- a/scripts/update_birdnet.sh +++ b/scripts/update_birdnet.sh @@ -52,6 +52,7 @@ remove_services remove_scripts # Stage 2 does a git pull to fetch new things +sudo -u${USER} git -C ${HOME}/BirdNET-Pi checkout -f || exit 1 sudo -u${USER} git -C ${HOME}/BirdNET-Pi pull -f || exit 1 # Trigger the new update_birdnet2.sh From e4afa5245d2263709eb1074fc5d32b98353adc19 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 13:57:23 -0400 Subject: [PATCH 07/77] Update update_birdnet2.sh --- scripts/update_birdnet2.sh | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh index 2926e69..cc9a1db 100755 --- a/scripts/update_birdnet2.sh +++ b/scripts/update_birdnet2.sh @@ -7,22 +7,12 @@ my_dir=${HOME}/BirdNET-Pi/scripts sudo ${my_dir}/update_services.sh # Stage 2 restarts the services -services=(avahi-alias@birdnetpi.local.service -birdnet_analysis.service -birdnet_log.service -birdnet_recording.service -edit_birdnet_conf.service -extraction_log.service -extraction.service -extraction.timer -livestream.service -pushed_notifications.service -spectrogram_viewer.service) +newservices=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) -restart_services() { - for i in ${services[@]};do +restart_newservices() { + for i in ${newservices[@]};do sudo systemctl restart ${i} done } -restart_services +restart_newservices From 0e235c9e098ea2ea006986b57c07079b2368ef65 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 14:46:19 -0400 Subject: [PATCH 08/77] Create update_inprogress.php --- scripts/update_inprogress.php | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 scripts/update_inprogress.php diff --git a/scripts/update_inprogress.php b/scripts/update_inprogress.php new file mode 100644 index 0000000..cd35c9b --- /dev/null +++ b/scripts/update_inprogress.php @@ -0,0 +1,40 @@ + + + + + + + + +
+ + + + From 97c6abbb1c0164ec04eac34d335ccbb96bc3b704 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 14:47:53 -0400 Subject: [PATCH 09/77] Update update_birdnet.php --- scripts/update_birdnet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update_birdnet.php b/scripts/update_birdnet.php index ff20b68..a5d5b44 100644 --- a/scripts/update_birdnet.php +++ b/scripts/update_birdnet.php @@ -1,4 +1,4 @@ /tmp/phpupdate.log 2&>1"); -header('Location: http://birdnetpi.local/index.html?success=true'); +header('Location: http://birdnetpi.local/scripts/update_inprogress.php'); ?> From 2d62dbd239f77e18d9616b59ff4d94d1eea61442 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 15:02:34 -0400 Subject: [PATCH 10/77] Update update_services.sh --- scripts/update_services.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 15d2cfa..5aa37ac 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -11,6 +11,14 @@ nomachine_url="https://download.nomachine.com/download/7.6/Arm/nomachine_7.6.2_3 gotty_url="https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_arm.tar.gz" config_file="$(dirname ${my_dir})/birdnet.conf" +set_hostname() { + if [ "$(hostname)" != "birdnetpi" ];then + echo "Setting hostname to 'birdnetpi'" + hostnamectl set-hostname birdnetpi + sed -i 's/raspberrypi/birdnetpi/g' /etc/hosts + fi +} + install_scripts() { echo "Installing BirdNET-Pi scripts to /usr/local/bin" ln -sf ${my_dir}/* /usr/local/bin/ @@ -417,6 +425,7 @@ install_cleanup_cron() { } install_selected_services() { + set_hostname install_scripts install_birdnet_analysis From b75a23b95820130cd9f230340d2a598648511da4 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 15:06:02 -0400 Subject: [PATCH 11/77] Update install_services.sh --- scripts/install_services.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index e090b71..1a89790 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -11,6 +11,14 @@ nomachine_url="https://download.nomachine.com/download/7.6/Arm/nomachine_7.6.2_3 gotty_url="https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_arm.tar.gz" config_file="$(dirname ${my_dir})/birdnet.conf" +set_hostname() { + if [ "$(hostname)" != "birdnetpi" ];then + echo "Setting hostname to 'birdnetpi'" + hostnamectl set-hostname birdnetpi + sed -i 's/raspberrypi/birdnetpi/g' /etc/hosts + fi +} + install_scripts() { echo "Installing BirdNET-Pi scripts to /usr/local/bin" ln -sf ${my_dir}/* /usr/local/bin/ @@ -419,6 +427,7 @@ install_cleanup_cron() { } install_selected_services() { + set_hostname install_scripts install_birdnet_analysis From 383d6132b925455b0fac79b9d84c9b1aab7d4b8e Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 15:09:46 -0400 Subject: [PATCH 12/77] Update Birders_Guide_Installer.sh --- Birders_Guide_Installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Birders_Guide_Installer.sh b/Birders_Guide_Installer.sh index 6df0592..de5d05e 100755 --- a/Birders_Guide_Installer.sh +++ b/Birders_Guide_Installer.sh @@ -244,7 +244,7 @@ DO_RECORDING=y ## Setting this (even to http://localhost) will also allow you to enable the ## GoTTY web logging features below. -EXTRACTIONS_URL=http://raspberrypi.local +EXTRACTIONS_URL=http://birdnetpi.local ## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## the "Processed" directory and live audio stream. This MUST be set if you From 08e3cc3f25a5a3bff7eb8d85fa4777b585b28b77 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 15:13:22 -0400 Subject: [PATCH 13/77] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25caf5a..0698a6a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # BirdNET-Pi -![version](https://img.shields.io/badge/version-0.2-orange) +![version](https://img.shields.io/badge/version-0.3-orange) A realtime acoustic bird classification system for the Raspberry Pi 4B From ab536792aec76f5e87b7ea03c56b4938ee523653 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 15:20:35 -0400 Subject: [PATCH 14/77] Update and rename version to version.md --- version | 2 -- version.md | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) delete mode 100644 version create mode 100644 version.md diff --git a/version b/version deleted file mode 100644 index 0c0f9ab..0000000 --- a/version +++ /dev/null @@ -1,2 +0,0 @@ -main - 0.1b -* renamed to BirdNET-Pi diff --git a/version.md b/version.md new file mode 100644 index 0000000..9156dde --- /dev/null +++ b/version.md @@ -0,0 +1,10 @@ +# testing - 0.3 +## What's new +* Sets Raspberry Pi's hostname to birdnet and sets default +{EXTRACTIONS_URL} to http://birdnetpi.local + - This should help in having http://birdnetpi.local always be + the URL to which we all go to reach the BirdNET-Pi. Now the Raspberry Pi + will only know of itself as birdnetpi. +* The updater now takes you to a 60 count down screen after which you are + dumped back to the homepage (of course, you'll have to wait until your next + update to see that.) From 5c5efa025ced29feac0cd8f52da993ba67ba24bd Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 16:30:51 -0400 Subject: [PATCH 15/77] Update install_services.sh --- scripts/install_services.sh | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 1a89790..7be6d4a 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -198,25 +198,6 @@ ${EXTRACTIONS_URL} { reverse_proxy /stream localhost:8000 php_fastcgi unix//run/php/php7.3-fpm.sock } - -http://birdnetpi.local { - root * ${EXTRACTED} - file_server browse - basicauth /Processed* { - birdnet ${HASHWORD} - } - basicauth /scripts* { - birdnet ${HASHWORD} - } - basicauth /stream { - birdnet ${HASHWORD} - } - basicauth /phpsysinfo* { - birdnet ${HASHWORD} - } - reverse_proxy /stream localhost:8000 - php_fastcgi unix//run/php/php7.3-fpm.sock -} EOF systemctl reload caddy } From cb42ce7b85e03c34b80d809a89962d682aed4a0f Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Mon, 18 Oct 2021 16:31:49 -0400 Subject: [PATCH 16/77] Update update_services.sh --- scripts/update_services.sh | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 5aa37ac..1cdd1ce 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -197,25 +197,6 @@ ${EXTRACTIONS_URL} { reverse_proxy /stream localhost:8000 php_fastcgi unix//run/php/php7.3-fpm.sock } - -http://birdnetpi.local { - root * ${EXTRACTED} - file_server browse - basicauth /Processed* { - birdnet ${HASHWORD} - } - basicauth /scripts* { - birdnet ${HASHWORD} - } - basicauth /stream { - birdnet ${HASHWORD} - } - basicauth /phpsysinfo* { - birdnet ${HASHWORD} - } - reverse_proxy /stream localhost:8000 - php_fastcgi unix//run/php/php7.3-fpm.sock -} EOF systemctl reload caddy } From 3f03f55f9bbd6337b46538352de706d5ba88faa8 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Tue, 19 Oct 2021 14:56:40 -0400 Subject: [PATCH 17/77] Delete spectrogram.php --- scripts/spectrogram.php | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 scripts/spectrogram.php diff --git a/scripts/spectrogram.php b/scripts/spectrogram.php deleted file mode 100644 index 3aa0629..0000000 --- a/scripts/spectrogram.php +++ /dev/null @@ -1,4 +0,0 @@ - From 10e458a363397699ca27531f0f19461774bc10bd Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Tue, 19 Oct 2021 14:57:06 -0400 Subject: [PATCH 18/77] Update index.html --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 832b58f..e0d7485 100644 --- a/templates/index.html +++ b/templates/index.html @@ -432,7 +432,7 @@ footer { -
+
From 3f44ba2550b320cdcc75ae18abf48db781ca9a05 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 15:30:42 -0400 Subject: [PATCH 19/77] adding two new tools --- scripts/rebuild_db.sh | 9 +++++++++ scripts/update_db_pwd.sh | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 scripts/rebuild_db.sh create mode 100755 scripts/update_db_pwd.sh diff --git a/scripts/rebuild_db.sh b/scripts/rebuild_db.sh new file mode 100755 index 0000000..fed7f04 --- /dev/null +++ b/scripts/rebuild_db.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Rebuild DB from BirdDB.txt +source /etc/birdnet/birdnet.conf +BIRDNET_DIR=/home/pi/BirdNET-Pi +sudo ${BIRDNET_DIR}/scripts/createdb.sh +sudo mysql birds -e " + LOAD DATA LOCAL INFILE '/home/pi/BirdNET-Pi/BirdDB.txt' + INTO TABLE detections + FIELDS TERMINATED BY ';'" diff --git a/scripts/update_db_pwd.sh b/scripts/update_db_pwd.sh new file mode 100755 index 0000000..eba6dd0 --- /dev/null +++ b/scripts/update_db_pwd.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Update database password +source /etc/birdnet/birdnet.conf + +sudo mysql -e " + UPDATE mysql.user + SET Password=PASSWORD('${DB_PWD}') + WHERE USER='birder' + AND Host='localhost'; + FLUSH PRIVILEGES"; +git -C /home/pi/BirdNET-Pi checkout -f analyze.py +git -C /home/pi/BirdNET-Pi checkout -f scripts/viewdb.php +sed -i "s/databasepassword/${DB_PWD}/g" /home/pi/BirdNET-Pi/analyze.py +sed -i "s/databasepassword/${DB_PWD}/g" /home/pi/BirdNET-Pi/scripts/viewdb.php From 58000a049fcd88b3ecab03290ef7d7668b34f375 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 15:42:55 -0400 Subject: [PATCH 20/77] adding two variables for testing public installation access --- scripts/install_services.sh | 18 ++++++++++++++++++ scripts/update_services.sh | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 7be6d4a..b087af3 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -199,6 +199,24 @@ ${EXTRACTIONS_URL} { php_fastcgi unix//run/php/php7.3-fpm.sock } EOF + if [ ! -z ${EXTRACTIONLOG_URL} ];then + cat << EOF >> /etc/caddy/Caddyfile + +${EXTRACTIONLOG_URL} { + reverse_proxy localhost:8888 +} + systemctl reload caddy +} +EOF + fi + if [ ! -z ${BIRDNETLOG_URL} ];then + cat << EOF >> /etc/caddy/Caddyfile + +${BIRDNETLOG_URL} { + reverse_proxy localhost:8080 +} +EOF + fi systemctl reload caddy } diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 1cdd1ce..ab35fb0 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -198,6 +198,24 @@ ${EXTRACTIONS_URL} { php_fastcgi unix//run/php/php7.3-fpm.sock } EOF + if [ ! -z ${EXTRACTIONLOG_URL} ];then + cat << EOF >> /etc/caddy/Caddyfile + +${EXTRACTIONLOG_URL} { + reverse_proxy localhost:8888 +} + systemctl reload caddy +} +EOF + fi + if [ ! -z ${BIRDNETLOG_URL} ];then + cat << EOF >> /etc/caddy/Caddyfile + +${BIRDNETLOG_URL} { + reverse_proxy localhost:8080 +} +EOF + fi systemctl reload caddy } From c9ab41ca00876c2fcd5d41e2f04338eb971804b8 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 15:49:57 -0400 Subject: [PATCH 21/77] fixing typos --- scripts/install_services.sh | 2 -- scripts/update_services.sh | 2 -- 2 files changed, 4 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index b087af3..b036efe 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -204,8 +204,6 @@ EOF ${EXTRACTIONLOG_URL} { reverse_proxy localhost:8888 -} - systemctl reload caddy } EOF fi diff --git a/scripts/update_services.sh b/scripts/update_services.sh index ab35fb0..80dee83 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -203,8 +203,6 @@ EOF ${EXTRACTIONLOG_URL} { reverse_proxy localhost:8888 -} - systemctl reload caddy } EOF fi From e5a27ac5cad0f3931f8a729283c46c74688ccb4e Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 15:58:55 -0400 Subject: [PATCH 22/77] edits to replace links in index for now --- scripts/update_services.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 80dee83..126a944 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -109,6 +109,8 @@ 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}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} + sudo sed -i "s/http://birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/templates/index.html + sudo sed -i "s/http://birdnetpi.local:8888/${EXTRACTIONLOG_URL}/g" $(dirname ${my_dir})/templates/index.html [ -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} [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} From 3bedefe43210aa26bc1a2523a60dad77c09696c9 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 16:01:18 -0400 Subject: [PATCH 23/77] typos of course --- analyze.py | 2 +- scripts/update_services.sh | 4 ++-- scripts/viewdb.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/analyze.py b/analyze.py index 4177070..9e1b6da 100644 --- a/analyze.py +++ b/analyze.py @@ -246,7 +246,7 @@ def main(): connection = mysql.connector.connect(host='localhost', database='birds', user='birder', - password='databasepassword') + password='changearoo') cursor = connection.cursor() mySql_insert_query = """INSERT INTO detections (Date, Time, Sci_Name, Com_Name, Confidence, Lat, Lon, Cutoff, Week, Sens, Overlap) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """ diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 126a944..7054736 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -109,8 +109,8 @@ 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}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} - sudo sed -i "s/http://birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/templates/index.html - sudo sed -i "s/http://birdnetpi.local:8888/${EXTRACTIONLOG_URL}/g" $(dirname ${my_dir})/templates/index.html + sudo sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/templates/index.html + sudo sed -i "s/http:\/\/birdnetpi.local:8888/${EXTRACTIONLOG_URL}/g" $(dirname ${my_dir})/templates/index.html [ -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} [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 41075cf..663beb1 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -2,7 +2,7 @@ header("refresh: 30;"); $user = 'birder'; -$password = 'databasepassword'; +$password = 'changearoo'; $database = 'birds'; From 3917807a308f20501d3aaf1eeaa5a1b380115008 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 16:05:16 -0400 Subject: [PATCH 24/77] adding removed defaults --- analyze.py | 2 +- scripts/update_services.sh | 4 ++-- scripts/viewdb.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/analyze.py b/analyze.py index 9e1b6da..4177070 100644 --- a/analyze.py +++ b/analyze.py @@ -246,7 +246,7 @@ def main(): connection = mysql.connector.connect(host='localhost', database='birds', user='birder', - password='changearoo') + password='databasepassword') cursor = connection.cursor() mySql_insert_query = """INSERT INTO detections (Date, Time, Sci_Name, Com_Name, Confidence, Lat, Lon, Cutoff, Week, Sens, Overlap) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """ diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 7054736..0a9385a 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -109,8 +109,8 @@ 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}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} - sudo sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/templates/index.html - sudo sed -i "s/http:\/\/birdnetpi.local:8888/${EXTRACTIONLOG_URL}/g" $(dirname ${my_dir})/templates/index.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/templates/index.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${EXTRACTIONLOG_URL}/g" $(dirname ${my_dir})/templates/index.html [ -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} [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 663beb1..41075cf 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -2,7 +2,7 @@ header("refresh: 30;"); $user = 'birder'; -$password = 'changearoo'; +$password = 'databasepassword'; $database = 'birds'; From c638210e7891a396fdffd75810419e7ba7dbfbe9 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 16:19:42 -0400 Subject: [PATCH 25/77] working links replacement --- scripts/install_services.sh | 8 ++++++++ scripts/update_services.sh | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index b036efe..4c96547 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -109,6 +109,14 @@ 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}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} + if [ ! -z ${BIRDNETLOG_URL} ];then + BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + fi + if [ ! -z ${EXTRACTIONLOG_URL} ];then + EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + fi [ -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} [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 0a9385a..031eec4 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -109,8 +109,14 @@ 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}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/templates/index.html - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${EXTRACTIONLOG_URL}/g" $(dirname ${my_dir})/templates/index.html + if [ ! -z ${BIRDNETLOG_URL} ];then + BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + fi + if [ ! -z ${EXTRACTIONLOG_URL} ];then + EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + fi [ -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} [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} From ebc28fa2c000f0ba51512b44be7f05f2c85699e5 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 16:35:50 -0400 Subject: [PATCH 26/77] adding more link editors --- scripts/install_services.sh | 26 ++++++++++++++++++-------- scripts/update_services.sh | 11 +++++++++++ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 4c96547..d67cc0c 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -108,16 +108,26 @@ create_necessary_dirs() { [ -d ${EXTRACTED}/By_Common_Name ] || sudo -u ${USER} mkdir -p ${EXTRACTED}/By_Common_Name [ -d ${EXTRACTED}/By_Scientific_Name ] || sudo -u ${USER} mkdir -p ${EXTRACTED}/By_Scientific_Name [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} + [ -L ${EXTRACTED}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} - if [ ! -z ${BIRDNETLOG_URL} ];then - BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html - fi - if [ ! -z ${EXTRACTIONLOG_URL} ];then - EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html - fi + if [ ! -z ${BIRDNETLOG_URL} ];then + BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + fi + if [ ! -z ${EXTRACTIONLOG_URL} ];then + EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + fi + [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} + if [ ! -z ${EXTRACTIONS_URL} ];then + EXTRACTIONS_URL="$(echo ${EXTRACTIONS_URL} | sed 's/\/\//\\\/\\\//g')" + phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" + for i in "${phpfiles[@]}";do + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${EXTRACTIONS_URL}"/g" ${i} + done + fi + [ -L ${EXTRACTED}/spectrogram.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 031eec4..2e0c76d 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -108,6 +108,7 @@ create_necessary_dirs() { [ -d ${EXTRACTED}/By_Common_Name ] || sudo -u ${USER} mkdir -p ${EXTRACTED}/By_Common_Name [ -d ${EXTRACTED}/By_Scientific_Name ] || sudo -u ${USER} mkdir -p ${EXTRACTED}/By_Scientific_Name [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} + [ -L ${EXTRACTED}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" @@ -117,7 +118,17 @@ create_necessary_dirs() { EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html fi + [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} + if [ ! -z ${EXTRACTIONS_URL} ];then + EXTRACTIONS_URL="$(echo ${EXTRACTIONS_URL} | sed 's/\/\//\\\/\\\//g')" + phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" + for i in "${phpfiles[@]}";do + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${EXTRACTIONS_URL}"/g" ${i} + done + fi + + [ -L ${EXTRACTED}/spectrogram.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} From bb86cbe3fd3bdeb3fea93bdb4920f4fa1feb4caf Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 19 Oct 2021 17:49:36 -0400 Subject: [PATCH 27/77] editing url referals --- scripts/install_birdnet.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/install_birdnet.sh b/scripts/install_birdnet.sh index 458f99c..6b620fc 100755 --- a/scripts/install_birdnet.sh +++ b/scripts/install_birdnet.sh @@ -98,10 +98,7 @@ echo " BirdNet is installed!! 'sudo systemctl disable --now birdnet_analysis.service' Visit - http://birdnetpi.local to see your extractions, - http://birdlog.local to see the log output of the birdnet_analysis.service, - http://extractionlog.local to see the log output of the extraction.service, and - http://birdstats.local to see the BirdNET-Pi Report" + the BirdNET-Pi homepage at http://birdnetpi.local" echo read -n1 -p " Would you like to run the birdnet_analysis.service now?" YN echo From 3698618063d729cd7991578c1e65f9050c5476fe Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 10:04:24 -0400 Subject: [PATCH 28/77] changing EXTRACTIONS_URL to BIRDNETPI_URL --- Birders_Guide_Installer.sh | 8 ++++---- birdnet.conf-defaults | 4 ++-- scripts/install_services.sh | 10 +++++----- scripts/update_services.sh | 10 +++++----- templates/Caddyfile_livestream | 16 +--------------- templates/Caddyfile_nostream | 15 +-------------- 6 files changed, 18 insertions(+), 45 deletions(-) diff --git a/Birders_Guide_Installer.sh b/Birders_Guide_Installer.sh index de5d05e..9003a9f 100755 --- a/Birders_Guide_Installer.sh +++ b/Birders_Guide_Installer.sh @@ -238,13 +238,13 @@ DO_RECORDING=y # Leave these EMPTY if you do not want to enable web access # -## EXTRACTIONS_URL is the URL where the extractions, data-set, and live-stream +## BIRDNETPI_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep -## the BirdNET-Pi on your local network, you can set this to http://localhost. -## Setting this (even to http://localhost) will also allow you to enable the +## the BirdNET-Pi on your local network, you can set this to +## http://birdnetpi.local. Setting this will also allow you to enable the ## GoTTY web logging features below. -EXTRACTIONS_URL=http://birdnetpi.local +BIRDNETPI_URL=http://birdnetpi.local ## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## the "Processed" directory and live audio stream. This MUST be set if you diff --git a/birdnet.conf-defaults b/birdnet.conf-defaults index f3de83c..160884f 100644 --- a/birdnet.conf-defaults +++ b/birdnet.conf-defaults @@ -59,13 +59,13 @@ DO_RECORDING= # Leave these EMPTY if you do not want to enable web access # -## EXTRACTIONS_URL is the URL where the extractions, data-set, and live-stream +## BIRDNETPI_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep ## BirdNET-Pi on your local network, you can set this to http://localhost. ## Setting this (even to http://localhost) will also allow you to enable the ## GoTTY web logging features below. -EXTRACTIONS_URL= +BIRDNETPI_URL= ## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## the "Processed" directory and live audio stream. This MUST be set if you diff --git a/scripts/install_services.sh b/scripts/install_services.sh index d67cc0c..6822698 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -120,11 +120,11 @@ create_necessary_dirs() { fi [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} - if [ ! -z ${EXTRACTIONS_URL} ];then - EXTRACTIONS_URL="$(echo ${EXTRACTIONS_URL} | sed 's/\/\//\\\/\\\//g')" + if [ ! -z ${BIRDNETPI_URL} ];then + BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" for i in "${phpfiles[@]}";do - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${EXTRACTIONS_URL}"/g" ${i} + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" ${i} done fi @@ -198,7 +198,7 @@ install_Caddyfile() { fi HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) cat << EOF > /etc/caddy/Caddyfile -${EXTRACTIONS_URL} { +http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth /Processed* { @@ -455,7 +455,7 @@ install_selected_services() { install_recording_service fi - if [ ! -z "${EXTRACTIONS_URL}" ];then + if [ ! -z "${BIRDNETPI_URL}" ];then install_caddy install_Caddyfile install_avahi_aliases diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 2e0c76d..5576216 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -120,11 +120,11 @@ create_necessary_dirs() { fi [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} - if [ ! -z ${EXTRACTIONS_URL} ];then - EXTRACTIONS_URL="$(echo ${EXTRACTIONS_URL} | sed 's/\/\//\\\/\\\//g')" + if [ ! -z ${BIRDNETPI_URL} ];then + BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" for i in "${phpfiles[@]}";do - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${EXTRACTIONS_URL}"/g" ${i} + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" ${i} done fi @@ -198,7 +198,7 @@ install_Caddyfile() { fi HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) cat << EOF > /etc/caddy/Caddyfile -${EXTRACTIONS_URL} { +http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth /Processed* { @@ -454,7 +454,7 @@ install_selected_services() { install_recording_service fi - if [ ! -z "${EXTRACTIONS_URL}" ];then + if [ ! -z "${BIRDNETPI_URL}" ];then install_caddy install_Caddyfile install_avahi_aliases diff --git a/templates/Caddyfile_livestream b/templates/Caddyfile_livestream index ad4a10d..53f522b 100644 --- a/templates/Caddyfile_livestream +++ b/templates/Caddyfile_livestream @@ -1,15 +1,4 @@ -${EXTRACTIONS_URL} { - root * ${EXTRACTED} - file_server browse - basicauth ${PROCESSED}* { - birdnet ${HASHWORD} - } - basicauth /stream { - birdnet ${HASHWORD} - } - reverse_proxy /stream localhost:8000 -} -http://birdnetpi.local { +http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth ${PROCESSED}* { @@ -26,6 +15,3 @@ http://birdlog.local { http://extractionlog.local { reverse_proxy localhost:8888 } -http://birdterminal.local { - reverse_proxy localhost:9111 -} diff --git a/templates/Caddyfile_nostream b/templates/Caddyfile_nostream index eef82f8..f60161f 100644 --- a/templates/Caddyfile_nostream +++ b/templates/Caddyfile_nostream @@ -1,14 +1,4 @@ -${EXTRACTIONS_URL} { - root * ${EXTRACTED} - file_server browse - basicauth ${PROCESSED}* { - birdnet ${HASHWORD} - } - basicauth /stream { - birdnet ${HASHWORD} - } -} -http://birdnetpi.local { +http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth ${PROCESSED}* { @@ -24,6 +14,3 @@ http://birdlog.local { http://extractionlog.local { reverse_proxy localhost:8888 } -http://birdterminal.local { - reverse_proxy localhost:9111 -} From 8c4b557ae2f11b24679a26c6acc33ecf97010d54 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 11:37:53 -0400 Subject: [PATCH 29/77] debugging update_services.sh install_Caddyfile --- scripts/update_services.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 5576216..1c948bb 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -191,6 +191,7 @@ install_caddy() { } install_Caddyfile() { + set -x echo "Installing the Caddyfile" [ -d /etc/caddy ] || mkdir /etc/caddy if [ -f /etc/caddy/Caddyfile ];then @@ -234,6 +235,7 @@ ${BIRDNETLOG_URL} { EOF fi systemctl reload caddy + set +x } install_avahi_aliases() { From 064f5f61535d92cd84619c898053312b151d7473 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 11:45:06 -0400 Subject: [PATCH 30/77] adding step to update_birdnet2.sh --- scripts/update_birdnet2.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh index cc9a1db..6076cca 100755 --- a/scripts/update_birdnet2.sh +++ b/scripts/update_birdnet2.sh @@ -1,8 +1,12 @@ #!/usr/bin/env bash # Second stage of update +# Stage 1 updates the birdnet.conf +sudo -upi sed -i 's/EXTRACTIONS_URL/BIRDNETPI_URL/g' /home/pi/BirdNET-Pi/birdnet.conf +echo "EXTRACTIONLOG_URL=" >> /home/pi/BirdNET-Pi/birdnet.conf +echo "BIRDNETLOG_URL=" >> /home/pi/BirdNET-Pi/birdnet.conf -# Stage 1 updates the services +# Stage 2 updates the services my_dir=${HOME}/BirdNET-Pi/scripts sudo ${my_dir}/update_services.sh From b6ce7c821ba7f19a77aaa87ba999335afc6c3752 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 11:52:00 -0400 Subject: [PATCH 31/77] only make these changes once --- scripts/update_birdnet2.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh index 6076cca..05a98cd 100755 --- a/scripts/update_birdnet2.sh +++ b/scripts/update_birdnet2.sh @@ -1,11 +1,13 @@ #!/usr/bin/env bash # Second stage of update +birdnet_conf=/home/pi/BirdNET-Pi/birdnet.conf # Stage 1 updates the birdnet.conf -sudo -upi sed -i 's/EXTRACTIONS_URL/BIRDNETPI_URL/g' /home/pi/BirdNET-Pi/birdnet.conf -echo "EXTRACTIONLOG_URL=" >> /home/pi/BirdNET-Pi/birdnet.conf -echo "BIRDNETLOG_URL=" >> /home/pi/BirdNET-Pi/birdnet.conf - +sudo -upi sed -i 's/EXTRACTIONS_URL/BIRDNETPI_URL/g' +if ! grep EXTRACTIONLOG ${birdnet_conf} &> /dev/null;then + echo "EXTRACTIONLOG_URL=" >> ${birdnet_conf} + echo "BIRDNETLOG_URL=" >> ${birdnet_conf} +fi # Stage 2 updates the services my_dir=${HOME}/BirdNET-Pi/scripts sudo ${my_dir}/update_services.sh From 49dabb6c853eaeb0e7086eb8a7c701e35552630e Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 12:01:52 -0400 Subject: [PATCH 32/77] it is now assumed that caddy is installed I will likely reduce the installer significantly to force all services to install, except keeping NoMachine and Pushed.Co notifications optional --- scripts/update_services.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 1c948bb..aa14e38 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -456,7 +456,6 @@ install_selected_services() { install_recording_service fi - if [ ! -z "${BIRDNETPI_URL}" ];then install_caddy install_Caddyfile install_avahi_aliases @@ -467,7 +466,6 @@ install_selected_services() { install_spectrogram_service install_edit_birdnet_conf install_pushed_notifications - fi if [ ! -z "${ICE_PWD}" ];then install_icecast From 1a1bb006f25b6bab65f837a376848a9ecb056bcd Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 12:22:47 -0400 Subject: [PATCH 33/77] wrapping up URL variable changes for public installations --- Birders_Guide_Installer.sh | 10 +++++----- birdnet.conf-defaults | 6 ++---- scripts/install_config.sh | 16 +++++++++------- scripts/update_services.sh | 2 -- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Birders_Guide_Installer.sh b/Birders_Guide_Installer.sh index 9003a9f..c32069b 100755 --- a/Birders_Guide_Installer.sh +++ b/Birders_Guide_Installer.sh @@ -232,7 +232,7 @@ DO_RECORDING=y ################################################################################ #----------------------- Web-hosting/Caddy File-server -----------------------# -#__________The two variables below can be set to enable web access_____________# +#________The four variables below can be set to enable internet access_________# #____________to your data,(e.g., extractions, raw data, live___________________# #______________audio stream, BirdNET.selection.txt files)______________________# @@ -240,11 +240,11 @@ DO_RECORDING=y ## BIRDNETPI_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep -## the BirdNET-Pi on your local network, you can set this to -## http://birdnetpi.local. Setting this will also allow you to enable the -## GoTTY web logging features below. +## the BirdNET-Pi on your local network, keep this EMPTY. -BIRDNETPI_URL=http://birdnetpi.local +BIRDNETPI_URL= +EXTRACTIONLOG_URL= +BIRDNETLOG_URL= ## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## the "Processed" directory and live audio stream. This MUST be set if you diff --git a/birdnet.conf-defaults b/birdnet.conf-defaults index 160884f..118e0d4 100644 --- a/birdnet.conf-defaults +++ b/birdnet.conf-defaults @@ -53,7 +53,7 @@ DO_RECORDING= ################################################################################ #----------------------- Web-hosting/Caddy File-server -----------------------# -#__________The two variables below can be set to enable web access_____________# +#_______The two variables below can be set to enable internet access___________# #____________to your data,(e.g., extractions, raw data, live___________________# #______________audio stream, BirdNET.selection.txt files)______________________# @@ -61,9 +61,7 @@ DO_RECORDING= ## BIRDNETPI_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep -## BirdNET-Pi on your local network, you can set this to http://localhost. -## Setting this (even to http://localhost) will also allow you to enable the -## GoTTY web logging features below. +## BirdNET-Pi on your local network, keep this empty. BIRDNETPI_URL= diff --git a/scripts/install_config.sh b/scripts/install_config.sh index 2dafe15..d51bc6a 100755 --- a/scripts/install_config.sh +++ b/scripts/install_config.sh @@ -43,7 +43,7 @@ get_DO_RECORDING() { done } -get_EXTRACTIONS_URL() { +get_BIRDNETPI_URL() { while true;do read -n1 -p "Would you like to access the extractions via a web browser? @@ -56,11 +56,11 @@ get_EXTRACTIONS_URL() { case $CADDY_SERVICE in [Yy] ) read -p "What URL would you like to publish the extractions to? *Note: Set this to http://localhost if you do not want to make the - extractions publically available: " EXTRACTIONS_URL + extractions publically available: " BIRDNETPI_URL get_CADDY_PWD get_ICE_PWD break;; - [Nn] ) EXTRACTIONS_URL= CADDY_PWD= ICE_PWD=;break;; + [Nn] ) BIRDNETPI_URL= CADDY_PWD= ICE_PWD=;break;; * ) echo "Please answer Yes or No";; esac done @@ -165,7 +165,7 @@ configure() { get_DB_PWDS get_DO_EXTRACTIONS get_DO_RECORDING - get_EXTRACTIONS_URL + get_BIRDNETPI_URL get_PUSHED get_INSTALL_NOMACHINE get_CHANNELS @@ -226,19 +226,21 @@ DO_RECORDING=${DO_RECORDING} ################################################################################ #----------------------- Web-hosting/Caddy File-server -----------------------# -#__________The two variables below can be set to enable web access_____________# +#________The four variables below can be set to enable internet access_________# #____________to your data,(e.g., extractions, raw data, live___________________# #______________audio stream, BirdNET.selection.txt files)______________________# # Leave these EMPTY if you do not want to enable web access # -## EXTRACTIONS_URL is the URL where the extractions, data-set, and live-stream +## BIRDNETPI_URL is the URL where the extractions, data-set, and live-stream ## will be web-hosted. If you do not own a domain, or would just prefer to keep ## BirdNET-Pi on your local network, you can set this to http://localhost. ## Setting this (even to http://localhost) will also allow you to enable the ## GoTTY web logging features below. -EXTRACTIONS_URL=${EXTRACTIONS_URL} +BIRDNETPI_URL=${BIRDNETPI_URL} +EXTRACTIONLOG_URL=${EXTRACTIONLOG_URL} +BIRDNETLOG_URL=${BIRDNETLOG_URL}} ## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## the "Processed" directory and live audio stream. This MUST be set if you diff --git a/scripts/update_services.sh b/scripts/update_services.sh index aa14e38..3b72821 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -191,7 +191,6 @@ install_caddy() { } install_Caddyfile() { - set -x echo "Installing the Caddyfile" [ -d /etc/caddy ] || mkdir /etc/caddy if [ -f /etc/caddy/Caddyfile ];then @@ -235,7 +234,6 @@ ${BIRDNETLOG_URL} { EOF fi systemctl reload caddy - set +x } install_avahi_aliases() { From e81da45231ce5f5446ca27e7561742545ba9a219 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Wed, 20 Oct 2021 13:34:34 -0400 Subject: [PATCH 34/77] Update install_config.sh --- scripts/install_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_config.sh b/scripts/install_config.sh index d51bc6a..e435af7 100755 --- a/scripts/install_config.sh +++ b/scripts/install_config.sh @@ -240,7 +240,7 @@ DO_RECORDING=${DO_RECORDING} BIRDNETPI_URL=${BIRDNETPI_URL} EXTRACTIONLOG_URL=${EXTRACTIONLOG_URL} -BIRDNETLOG_URL=${BIRDNETLOG_URL}} +BIRDNETLOG_URL=${BIRDNETLOG_URL} ## CADDY_PWD is the plaintext password (that will be hashed) and used to access ## the "Processed" directory and live audio stream. This MUST be set if you From 3787633855a12d031e838857f0a752804ade594e Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Wed, 20 Oct 2021 13:41:44 -0400 Subject: [PATCH 35/77] Update install_services.sh --- scripts/install_services.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 6822698..cb039da 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -455,7 +455,6 @@ install_selected_services() { install_recording_service fi - if [ ! -z "${BIRDNETPI_URL}" ];then install_caddy install_Caddyfile install_avahi_aliases @@ -466,7 +465,6 @@ install_selected_services() { install_spectrogram_service install_edit_birdnet_conf install_pushed_notifications - fi if [ ! -z "${ICE_PWD}" ];then install_icecast From 7f78800abe092d9f7cbb206aa868ffec58ed3c28 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Wed, 20 Oct 2021 13:50:28 -0400 Subject: [PATCH 36/77] Update install_services.sh --- scripts/install_services.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index cb039da..7dab9c0 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -109,7 +109,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}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/index.html ${EXTRACTED} if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html @@ -128,10 +128,10 @@ create_necessary_dirs() { done fi - [ -L ${EXTRACTED}/spectrogram.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} - [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} - [ -L ${EXTRACTED}/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini + [ -L ${EXTRACTED}/phpsysinfo/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini } From 8ad586791b8dd2b5d9a8beb03e0857791dc4c308 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Wed, 20 Oct 2021 13:52:33 -0400 Subject: [PATCH 37/77] Update update_services.sh --- scripts/update_services.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 3b72821..708334a 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -109,7 +109,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}/index.html ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/templates/index.html ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/index.html ${EXTRACTED} if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html @@ -119,7 +119,7 @@ create_necessary_dirs() { sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html fi - [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} if [ ! -z ${BIRDNETPI_URL} ];then BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" @@ -129,10 +129,10 @@ create_necessary_dirs() { fi - [ -L ${EXTRACTED}/spectrogram.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} - [ -L ${EXTRACTED}/viewdb.php ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} - [ -L ${EXTRACTED}/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini + [ -L ${EXTRACTED}/phpsysinfo/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini } install_alsa() { From 73417ee3afdfbc82833e414601cb2be9f97db723 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 18:47:00 -0400 Subject: [PATCH 38/77] adding new homepage for testing :) - replaced all SERVICES arrays with commands - altered {install,update}_services.sh to install new homepage - renamed old index.html to mobile.html for mobile redirect --- Testing_UPDATER | 1 - homepage/external.html | 60 ++++++++++++++++ homepage/footer.html | 28 ++++++++ homepage/index.html | 37 ++++++++++ homepage/menu.html | 28 ++++++++ templates/index.html => homepage/mobile.html | 0 homepage/top.html | 36 ++++++++++ scripts/dump_logs.sh | 17 +---- scripts/install_services.sh | 11 ++- scripts/install_tmux_services.sh | 76 -------------------- scripts/restart_services.sh | 13 +--- scripts/uninstall.sh | 24 +------ scripts/update_services.sh | 9 ++- scripts/viewdb.php | 9 +-- 14 files changed, 210 insertions(+), 139 deletions(-) delete mode 100644 Testing_UPDATER create mode 100644 homepage/external.html create mode 100644 homepage/footer.html create mode 100644 homepage/index.html create mode 100644 homepage/menu.html rename templates/index.html => homepage/mobile.html (100%) create mode 100644 homepage/top.html delete mode 100755 scripts/install_tmux_services.sh diff --git a/Testing_UPDATER b/Testing_UPDATER deleted file mode 100644 index 1f7ec48..0000000 --- a/Testing_UPDATER +++ /dev/null @@ -1 +0,0 @@ -I hope this works:) diff --git a/homepage/external.html b/homepage/external.html new file mode 100644 index 0000000..ec8343d --- /dev/null +++ b/homepage/external.html @@ -0,0 +1,60 @@ + + +HTML Frames Example - Content + + + +tbc.... +

Thanks

+stefan kahl +patrick mcguire +

Similar Systems

+

Technical Details

+machine learning +deep learning +

Used Tools

+SoX +ffmpeg +Python +Tensorfflow (Lite) +Rasberian OS +

Disclaimer

+

Other Systems

+links to other systems + + + +

Content

+

Replacing the Contents of the Current Frame

+

Clicking on these links will open the new page within the current frame.

+ + +

Replacing the Whole Frameset

+

When you click on any of the following links, the whole frameset is replaced with the new website. This is because we're using target="_top" in the anchor links.

+ + +

Open a New Window

+

These links open in a new browser window. This is because we use target="_blank".

+ + + + \ No newline at end of file diff --git a/homepage/footer.html b/homepage/footer.html new file mode 100644 index 0000000..0afb85b --- /dev/null +++ b/homepage/footer.html @@ -0,0 +1,28 @@ + + +HTML Frames Example - Footer + + + +

External Services

+

Project Page | + Wiki Help Page | + Live Audio Stream | + Realtime Spectrogram | + Links to External Pages | + Weather | + The Cornell Lab of Ornitology +

+ + diff --git a/homepage/index.html b/homepage/index.html new file mode 100644 index 0000000..5c6892a --- /dev/null +++ b/homepage/index.html @@ -0,0 +1,37 @@ + + + + +BirdNET-Pi + + + + + + + + + + + + + + +<p>This section (everything between the 'noframes' tags) will only be displayed if the users' browser doesn't support frames. You can provide a link to a non-frames version of the website here. Feel free to use HTML tags within this section.</p> + + + + diff --git a/homepage/menu.html b/homepage/menu.html new file mode 100644 index 0000000..52de33d --- /dev/null +++ b/homepage/menu.html @@ -0,0 +1,28 @@ + + +HTML Frames Example - Menu + + + +

Extractions

+By Common Name
+By Date
+By Scientiffic Name
+Processed
+

GitHub

+Repository
+Discussions
+Issues
+ + diff --git a/templates/index.html b/homepage/mobile.html similarity index 100% rename from templates/index.html rename to homepage/mobile.html diff --git a/homepage/top.html b/homepage/top.html new file mode 100644 index 0000000..5f9eaae --- /dev/null +++ b/homepage/top.html @@ -0,0 +1,36 @@ + + + BirdNET-Pi + + + +
+ +
+

BirdNET-Pi

+

+ Recognized Birds Library | + Deep Learning Analysis | + Audio Extraction | + Hardware | + System +

+ + diff --git a/scripts/dump_logs.sh b/scripts/dump_logs.sh index 101e967..bc11c8b 100755 --- a/scripts/dump_logs.sh +++ b/scripts/dump_logs.sh @@ -3,25 +3,14 @@ # set -x # Uncomment to debug source /etc/birdnet/birdnet.conf &> /dev/null LOG_DIR="${HOME}/BirdNET-Pi/logs" -SERVICES=(avahi-alias@.service -birdnet_analysis.service -birdnet_log.service -birdnet_recording.service -birdstats.service -birdterminal.service -caddy.service -extraction_log.service -extraction.service -extraction.timer -icecast2.service -livestream.service -${SYSTEMD_MOUNT}) + +services=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) # Create logs directory [ -d ${LOG_DIR} ] || mkdir ${LOG_DIR} # Create services logs -for i in "${SERVICES[@]}";do +for i in "${services[@]}";do if [ -L /etc/systemd/system/multi-user.target.wants/${i} ];then journalctl -u ${i} -n 100 --no-pager > ${LOG_DIR}/${i}.log cp -L /etc/systemd/system/multi-user.target.wants/${i} ${LOG_DIR}/${i} diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 7dab9c0..ffa8303 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -109,17 +109,17 @@ 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} - sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/index.html ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* fi if [ ! -z ${EXTRACTIONLOG_URL} ];then EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/homepage/* fi - [ -L ${EXTRACTED}/scripts ] || sudo -u ${USER} ln -s $(dirname ${my_dir})/scripts ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} if [ ! -z ${BIRDNETPI_URL} ];then BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" @@ -132,9 +132,8 @@ create_necessary_dirs() { sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} [ -L ${EXTRACTED}/phpsysinfo/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini - } - + install_alsa() { echo "Checking for alsa-utils and pulseaudio" if which arecord &> /dev/null ;then diff --git a/scripts/install_tmux_services.sh b/scripts/install_tmux_services.sh deleted file mode 100755 index 49512af..0000000 --- a/scripts/install_tmux_services.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash -# This script installs a web-based terminal @ http://birdterminal.local -# ONLY run this additional script if you trust everyone on your -# local network completely as the credentials are sent WITHOUT -# any SSL/TLS encryption. For a secure remote connection to your -# BirdNET-Pi command line, consider enabling SSH on the -# Raspberry Pi and using another Linux machine or an SSH -# client software, or you can alternately add the 'tls internal' -# directive to the Caddyfile to add a self-signed certificate for TLS/SSL -# encryption. For remote desktop access, NoMachine can be installed. -source /etc/birdnet/birdnet.conf -my_dir=$(realpath $(dirname $0)) - -# Install tmux from version control -install_tmux() { - DEPENDS=( - automake - autoconf - libevent-2* - libevent-dev - ncurses-bin - ncurses-base - ncurses-term - libncurses-dev - build-essential - bison - pkg-config - gcc - ) - - if which tmux &>/dev/null; then - echo "tmux is installed" - else - - sudo apt update && sudo apt -y install "${DEPENDS[@]}" - - cd ${HOME} && git clone https://github.com/tmux/tmux.git - cd tmux - sh autogen.sh - ./configure && make && sudo make install - cd && rm -drf ./tmux - sudo ln -sf "$(dirname ${my_dir})/templates/tmux.conf" /etc/tmux.conf - fi -} - -install_web_terminal() { - cat << EOF | sudo tee /etc/systemd/system/birdterminal.service -[Unit] -Description=A BirdNET-Pi Web Terminal - -[Service] -Restart=on-failure -RestartSec=3 -Type=simple -User=${BIRDNET_USER} -Environment=TERM=xterm-256color -ExecStart=/usr/local/bin/gotty -w --title-format "Login!" -p 9111 tmux new -A -s Login sudo bash -c login - -[Install] -WantedBy=multi-user.target -EOF - HASHWORD="$(caddy hash-password -plaintext "${CADDY_PWD}")" - cat << EOF | sudo tee -a /etc/caddy/Caddyfile -http://birdterminal.local { - reverse_proxy localhost:9111 - basicauth { - birdnet "${HASHWORD}" - } -} -EOF - sudo systemctl enable --now birdterminal.service - sudo systemctl enable --now avahi-alias@birdterminal.local.service - sudo systemctl restart caddy -} -install_tmux -install_web_terminal diff --git a/scripts/restart_services.sh b/scripts/restart_services.sh index f767776..1cc4367 100755 --- a/scripts/restart_services.sh +++ b/scripts/restart_services.sh @@ -6,18 +6,9 @@ sudo systemctl stop birdnet_recording.service sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/* sudo systemctl start birdnet_recording.service -SERVICES=(avahi-alias@birdlog.local.service -avahi-alias@birdnetpi.local.service -avahi-alias@birdstats.local.service -avahi-alias@extractionlog.local.service -birdnet_analysis.service -birdnet_log.service -birdstats.service -extraction.timer -extractionlog.service -livestream.service) +services=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) -for i in "${SERVICES[@]}";do +for i in "${services[@]}";do sudo systemctl restart ${i} done diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index ed8fc6c..9cd8ce5 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -45,30 +45,10 @@ uninstall.sh update_species.sh ${HOME}/.gotty) - -SERVICES=(avahi-alias@birdlog.local.service -avahi-alias@birdnetpi.local.service -avahi-alias@birdstats.local.service -avahi-alias@extractionlog.local.service -avahi-alias@birdterminal.local.service -birdnet_analysis.service -birdnet_log.service -birdnet_recording.d -birdnet_recording.service -birdstats.service -birdterminal.service -caddy.service -edit_birdnet_conf.service -extraction_log.service -extraction.service -extraction.timer -livestream.service -pushed_notifications.service -spectrogram_viewer.service -${SYSTEMD_MOUNT}) +services=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) remove_services() { - for i in "${SERVICES[@]}"; do + for i in "${services[@]}"; do if [ -L /etc/systemd/system/multi-user.target.wants/"${i}" ];then sudo systemctl disable --now "${i}" fi diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 708334a..9ebbb43 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -109,14 +109,14 @@ 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} - sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/index.html ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* fi if [ ! -z ${EXTRACTIONLOG_URL} ];then EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/templates/index.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/homepage/* fi sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} @@ -128,13 +128,12 @@ create_necessary_dirs() { done fi - sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} [ -L ${EXTRACTED}/phpsysinfo/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini } - + install_alsa() { echo "Checking for alsa-utils and pulseaudio" if which arecord &> /dev/null ;then diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 41075cf..9b55c4c 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -59,18 +59,17 @@ $mysqli->close(); - + BirdNET-Pi DB - + +

Number of Detections

From 91ca1ab271c67822b23354a9c6ad8ad1d3cd2a73 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 18:56:14 -0400 Subject: [PATCH 39/77] adjusting updater to new homepage --- scripts/update_birdnet2.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh index 05a98cd..cede40e 100755 --- a/scripts/update_birdnet2.sh +++ b/scripts/update_birdnet2.sh @@ -8,6 +8,8 @@ if ! grep EXTRACTIONLOG ${birdnet_conf} &> /dev/null;then echo "EXTRACTIONLOG_URL=" >> ${birdnet_conf} echo "BIRDNETLOG_URL=" >> ${birdnet_conf} fi +sudo -upi sed -i 's/=http:\/\/birdnetpi.local/=/g' ${birdnet_conf} + # Stage 2 updates the services my_dir=${HOME}/BirdNET-Pi/scripts sudo ${my_dir}/update_services.sh From cd405df80229aaaa1c988dde6ebae22036b811ea Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 19:03:25 -0400 Subject: [PATCH 40/77] ready to test --- README.md | 2 +- version.md | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0698a6a..81a6a96 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # BirdNET-Pi -![version](https://img.shields.io/badge/version-0.3-orange) +![version](https://img.shields.io/badge/version-0.4-blue) A realtime acoustic bird classification system for the Raspberry Pi 4B diff --git a/version.md b/version.md index 9156dde..84e5ccd 100644 --- a/version.md +++ b/version.md @@ -1,10 +1,5 @@ -# testing - 0.3 +# testing - 0.4 ## What's new -* Sets Raspberry Pi's hostname to birdnet and sets default -{EXTRACTIONS_URL} to http://birdnetpi.local - - This should help in having http://birdnetpi.local always be - the URL to which we all go to reach the BirdNET-Pi. Now the Raspberry Pi - will only know of itself as birdnetpi. -* The updater now takes you to a 60 count down screen after which you are - dumped back to the homepage (of course, you'll have to wait until your next - update to see that.) +- New desktop web interface +- Better support for public installations + - Needs better documentation to explain how to set it up From 274729a8277682d1f4d15e7d18753bcce83f0c0b Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 19:20:43 -0400 Subject: [PATCH 41/77] spectrogram view now updates itself --- homepage/footer.html | 2 +- homepage/mobile.html | 2 +- scripts/install_services.sh | 2 +- scripts/update_services.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homepage/footer.html b/homepage/footer.html index 0afb85b..8e0dd3a 100644 --- a/homepage/footer.html +++ b/homepage/footer.html @@ -19,7 +19,7 @@ a {

Project Page | Wiki Help Page | Live Audio Stream | - Realtime Spectrogram | + Realtime Spectrogram | Links to External Pages | Weather | The Cornell Lab of Ornitology diff --git a/homepage/mobile.html b/homepage/mobile.html index e0d7485..832b58f 100644 --- a/homepage/mobile.html +++ b/homepage/mobile.html @@ -432,7 +432,7 @@ footer {

-
+
diff --git a/scripts/install_services.sh b/scripts/install_services.sh index ffa8303..d534172 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -128,7 +128,7 @@ create_necessary_dirs() { done fi - sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/spectrogram.php ${EXTRACTED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} [ -L ${EXTRACTED}/phpsysinfo/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 9ebbb43..b48c502 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -128,7 +128,7 @@ create_necessary_dirs() { done fi - sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/spectrogram.* ${EXTRACTED} + sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/spectrogram.php ${EXTRACTED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/viewdb.php ${EXTRACTED} sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED} [ -L ${EXTRACTED}/phpsysinfo/phpsysinfo.ini ] || sudo -u ${USER} cp ${HOME}/phpsysinfo/phpsysinfo.ini.new ${HOME}/phpsysinfo/phpsysinfo.ini From 8cfe2ac8be5d5f7316a6814500c12933d9ac4914 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 19:23:46 -0400 Subject: [PATCH 42/77] adding images and spectrogram.php --- homepage/images/.DS_Store | Bin 0 -> 6148 bytes homepage/images/bird.png | Bin 0 -> 5937 bytes scripts/spectrogram.php | 5 +++++ 3 files changed, 5 insertions(+) create mode 100644 homepage/images/.DS_Store create mode 100644 homepage/images/bird.png create mode 100644 scripts/spectrogram.php diff --git a/homepage/images/.DS_Store b/homepage/images/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0VYv;%9JgXou7y;t2jQ4pQV~LN z+R|c`l#(PNgis;3=c~?h&htFydH(;sUcYU>@8|OUe(vw@ISVr*5ux2e5C}xX#MrDLzyN!ky|x z^VgA`Zfcc9&^&Zx?bS)DB>EAmH_iB$Agc8*W;T>xd??x;vU<8g1STFR@S`%w2&SK} ze=we@Bl}%19{gWlM$00;voL&gWF1Hrh$8_(RD`;Ux{9i-t`LF{Zt_VL%P01kvaW zT7W-dT_@Q+AcUbKD+}m|Ka?|Qo_}fg5B|e^;0W|O1&vWrMgJ>1l}Y;_?CX@jvD3W+ z7y-fF0rWo&__rznixbMG_t6J_4i_U>&R-V{s+OH=CQu6jr(hTU6F6d zdL(T9X<%#YUnGaWXh0VhH_n z8XC%2l^<$A(C|Q(<{554W&kd%Di))RQB}rh*a@#;(ap5F+>_bB7Zly$G`$kKxXJVGc` zkMCvybw8-V0iKL7au8MD3j|n4R^QW;2I3QruvpJr1V#m;`iF6UN`!e+fwuo`8~Trv zq1P+!pGPC0|8{u7cZPo{Q6TqY4U|6UA?QDw2zdFk4N?6;?+F4;#=_*XJOr{Kjt0W= zw{Sop3Kv2y3@F7}!nt}HvN!fS-=<&31z~23B{Uz(J$st1*xvbds=xGWSKpG^3IB^u zhUcVORTj40wynA-YZX-HET;M4%blET5B``oe>9RGp5GNNs#WA@s8$i7&l^s8zw(KrX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kFCTLThUJJdw1(%G>RIiBpT>JCS_kE-TUYVmv=4LC zee7re`MPLHtE`$)&y(c9fSLeDV6CiUSCWdAPRm7iT{{fx(YR3Qo literal 0 HcmV?d00001 diff --git a/scripts/spectrogram.php b/scripts/spectrogram.php new file mode 100644 index 0000000..6b43be7 --- /dev/null +++ b/scripts/spectrogram.php @@ -0,0 +1,5 @@ +"; +echo ""; +?> From 96ece50eea662f2250fdcd75f5b85659d061da76 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 20 Oct 2021 20:49:39 -0400 Subject: [PATCH 43/77] fixed typo --- homepage/footer.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/homepage/footer.html b/homepage/footer.html index 8e0dd3a..04cd255 100644 --- a/homepage/footer.html +++ b/homepage/footer.html @@ -16,13 +16,12 @@ a {

External Services

-

Project Page | - Wiki Help Page | +

Wiki Help Page | Live Audio Stream | Realtime Spectrogram | Links to External Pages | Weather | - The Cornell Lab of Ornitology + The Cornell Lab of Ornithology

From 1d207a5dcb4e2c46c788f6b8707f6c56b00c50e7 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 21 Oct 2021 14:23:48 +0200 Subject: [PATCH 44/77] fixing public link editing --- scripts/install_services.sh | 1 + scripts/update_services.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index d534172..ced88a3 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -110,6 +110,7 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/* if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* diff --git a/scripts/update_services.sh b/scripts/update_services.sh index b48c502..266902b 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -110,6 +110,7 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/* if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* From e366c890080e061998e876b17f0451bf4686e2b0 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 21 Oct 2021 14:29:30 +0200 Subject: [PATCH 45/77] fixed images_dir sed error --- scripts/install_services.sh | 2 +- scripts/update_services.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index ced88a3..077d978 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -110,7 +110,7 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/* + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/index.html if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 266902b..e50743b 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -110,7 +110,7 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/* + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/index.html if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* From 837388a69bc4846950d0ecb48b097f65e6e1d448 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 21 Oct 2021 09:25:02 -0400 Subject: [PATCH 46/77] fixing sed replacement (again) --- scripts/install_services.sh | 6 +++--- scripts/update_services.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 077d978..c0644f3 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -110,14 +110,14 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/index.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html fi if [ ! -z ${EXTRACTIONLOG_URL} ];then EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/homepage/* + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html fi sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} diff --git a/scripts/update_services.sh b/scripts/update_services.sh index e50743b..5694c1c 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -110,14 +110,14 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/index.html + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/* + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html fi if [ ! -z ${EXTRACTIONLOG_URL} ];then EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/homepage/* + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html fi sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} From ef738c398d63b41dd61cd9afc4b1e21ff43ca5b0 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 21 Oct 2021 15:34:37 +0200 Subject: [PATCH 47/77] moved sed replacement to after slah escapes --- scripts/install_services.sh | 2 +- scripts/update_services.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index c0644f3..73fbc05 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -110,9 +110,9 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html fi if [ ! -z ${EXTRACTIONLOG_URL} ];then diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 5694c1c..e30436e 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -110,9 +110,9 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html fi if [ ! -z ${EXTRACTIONLOG_URL} ];then From 40c32fbe33c5beb1bbd083aa9b262f35521f44a6 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 21 Oct 2021 15:42:01 +0200 Subject: [PATCH 48/77] testing updaer --- scripts/install_services.sh | 2 +- scripts/update_services.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 73fbc05..845e16c 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -112,7 +112,6 @@ create_necessary_dirs() { sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html fi if [ ! -z ${EXTRACTIONLOG_URL} ];then @@ -123,6 +122,7 @@ create_necessary_dirs() { sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} if [ ! -z ${BIRDNETPI_URL} ];then BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" for i in "${phpfiles[@]}";do sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" ${i} diff --git a/scripts/update_services.sh b/scripts/update_services.sh index e30436e..7d4b7b0 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -110,11 +110,12 @@ create_necessary_dirs() { [ -d ${PROCESSED} ] || sudo -u ${USER} mkdir -p ${PROCESSED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} + set -x if [ ! -z ${BIRDNETLOG_URL} ];then BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')" - sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/"${BIRDNETLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html fi + set +x if [ ! -z ${EXTRACTIONLOG_URL} ];then EXTRACTIONLOG_URL="$(echo ${EXTRACTIONLOG_URL} | sed 's/\/\//\\\/\\\//g')" sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/"${EXTRACTIONLOG_URL}"/g" $(dirname ${my_dir})/homepage/*.html @@ -123,6 +124,7 @@ create_necessary_dirs() { sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} if [ ! -z ${BIRDNETPI_URL} ];then BIRDNETPI_URL="$(echo ${BIRDNETPI_URL} | sed 's/\/\//\\\/\\\//g')" + sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" $(dirname ${my_dir})/homepage/*.html phpfiles="$(grep -l birdnetpi.local ${my_dir}/*.php)" for i in "${phpfiles[@]}";do sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/"${BIRDNETPI_URL}"/g" ${i} From faf1d16a867c76bb2569bbc001113b484c65be6b Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 21 Oct 2021 12:12:36 -0400 Subject: [PATCH 49/77] adding data backup button -- restore button coming soon edited php headers for new homepage layout --- homepage/index.html | 2 +- scripts/clear_all_data.php | 2 +- scripts/index.html | 4 ++++ scripts/reboot_system.php | 1 - scripts/restart_birdnet_analysis.php | 2 +- scripts/restart_birdnet_recording.php | 2 +- scripts/restart_caddy.php | 2 +- scripts/restart_extraction.php | 2 +- scripts/restart_services.php | 2 +- scripts/shutdown_system.php | 1 - 10 files changed, 11 insertions(+), 9 deletions(-) diff --git a/homepage/index.html b/homepage/index.html index 5c6892a..580efa5 100644 --- a/homepage/index.html +++ b/homepage/index.html @@ -24,7 +24,7 @@ Note the following: - + diff --git a/scripts/clear_all_data.php b/scripts/clear_all_data.php index 4a187de..b0be43d 100644 --- a/scripts/clear_all_data.php +++ b/scripts/clear_all_data.php @@ -1,4 +1,4 @@ diff --git a/scripts/index.html b/scripts/index.html index 9690b51..be41683 100644 --- a/scripts/index.html +++ b/scripts/index.html @@ -27,6 +27,10 @@ +
+ +
+
diff --git a/scripts/reboot_system.php b/scripts/reboot_system.php index df7c8d0..e7f56d8 100644 --- a/scripts/reboot_system.php +++ b/scripts/reboot_system.php @@ -1,4 +1,3 @@ diff --git a/scripts/restart_birdnet_analysis.php b/scripts/restart_birdnet_analysis.php index d495ba9..f99e013 100644 --- a/scripts/restart_birdnet_analysis.php +++ b/scripts/restart_birdnet_analysis.php @@ -1,4 +1,4 @@ diff --git a/scripts/restart_birdnet_recording.php b/scripts/restart_birdnet_recording.php index b3a5a6e..1712058 100644 --- a/scripts/restart_birdnet_recording.php +++ b/scripts/restart_birdnet_recording.php @@ -1,4 +1,4 @@ diff --git a/scripts/restart_caddy.php b/scripts/restart_caddy.php index 80b539f..fa9f6d2 100644 --- a/scripts/restart_caddy.php +++ b/scripts/restart_caddy.php @@ -1,4 +1,4 @@ diff --git a/scripts/restart_extraction.php b/scripts/restart_extraction.php index 83af548..f52aa58 100644 --- a/scripts/restart_extraction.php +++ b/scripts/restart_extraction.php @@ -1,4 +1,4 @@ diff --git a/scripts/restart_services.php b/scripts/restart_services.php index 2f9caf4..c1e7b55 100644 --- a/scripts/restart_services.php +++ b/scripts/restart_services.php @@ -1,4 +1,4 @@ diff --git a/scripts/shutdown_system.php b/scripts/shutdown_system.php index f344edc..74ce980 100644 --- a/scripts/shutdown_system.php +++ b/scripts/shutdown_system.php @@ -1,4 +1,3 @@ From dbd5fd95bf763e81f6d5aadef4f50d70adc26cb2 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 21 Oct 2021 12:26:00 -0400 Subject: [PATCH 50/77] adding the new button --- scripts/backup_data.php | 4 ++++ scripts/backup_data.sh | 5 +++++ scripts/backup_inprogress.html | 12 ++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 scripts/backup_data.php create mode 100755 scripts/backup_data.sh create mode 100644 scripts/backup_inprogress.html diff --git a/scripts/backup_data.php b/scripts/backup_data.php new file mode 100644 index 0000000..c6587be --- /dev/null +++ b/scripts/backup_data.php @@ -0,0 +1,4 @@ + /tmp/birdnetbackup.log 2&>1"); +header('Location: /backup_inprogress.html'); +?> diff --git a/scripts/backup_data.sh b/scripts/backup_data.sh new file mode 100755 index 0000000..2379fde --- /dev/null +++ b/scripts/backup_data.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Tar and compress all data +source /etc/birdnet/birdnet.conf + +tar -czvf /home/pi/BirdNET-Pi/BirdNET-Pi_Data_Dump_$(date +%F).tar.gz ${EXTRACTED} /home/pi/BirdNET-Pi/BirdDB.txt diff --git a/scripts/backup_inprogress.html b/scripts/backup_inprogress.html new file mode 100644 index 0000000..f671163 --- /dev/null +++ b/scripts/backup_inprogress.html @@ -0,0 +1,12 @@ + + + + + + + A backup is being made that includes all of
+ your extractions and the BirdDB.txt
+

+ The backup is in /home/pi/BirdNET-Pi + + From b1552530c94d73fd9242f6cf87eae859178573b5 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 21 Oct 2021 13:07:39 -0400 Subject: [PATCH 51/77] more homepage edits -- trying new looks and layouts --- homepage/footer.html | 8 +------- homepage/index.html | 6 +++--- homepage/menu.html | 17 +++++++++++++---- homepage/top.html | 10 ++++------ 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/homepage/footer.html b/homepage/footer.html index 04cd255..006d624 100644 --- a/homepage/footer.html +++ b/homepage/footer.html @@ -15,13 +15,7 @@ a { -

External Services

-

Wiki Help Page | - Live Audio Stream | - Realtime Spectrogram | - Links to External Pages | - Weather | - The Cornell Lab of Ornithology +

Play Live Audio Stream

diff --git a/homepage/index.html b/homepage/index.html index 580efa5..12bf60c 100644 --- a/homepage/index.html +++ b/homepage/index.html @@ -20,14 +20,14 @@ Note the following: } - + - + - + <p>This section (everything between the 'noframes' tags) will only be displayed if the users' browser doesn't support frames. You can provide a link to a non-frames version of the website here. Feel free to use HTML tags within this section.</p> diff --git a/homepage/menu.html b/homepage/menu.html index 52de33d..de060fd 100644 --- a/homepage/menu.html +++ b/homepage/menu.html @@ -16,13 +16,22 @@ body { </head> <body> <h4>Extractions</h4> -<a href="http://birdnetpi.local/By_Common_Name/" target="content">By Common Name</a><br/> -<a href="http://birdnetpi.local/By_Date/" target="content">By Date</a><br/> -<a href="http://birdnetpi.local/By_Scientific_Name/" target="content">By Scientiffic Name</a><br/> -<a href="http://birdnetpi.local/Processed/" target="content">Processed</a><br/> +<a href="http://birdnetpi.local/By_Common_Name/" target="content">- By Common Name</a><br/> +<a href="http://birdnetpi.local/By_Date/" target="content">- By Date</a><br/> +<a href="http://birdnetpi.local/By_Scientific_Name/" target="content">- By Scientiffic Name</a><br/> +<a href="http://birdnetpi.local/Processed/" target="content">- Processed</a><br/> +<h4>Views</h4> +<a href="/viewdb.php" target="content">Database</a><br/> +<a href="/spectrogram.php" target="content">Spectrogram</a><br/> +<a href="http://birdnetpi.local:8080" target="content">BirdNET-Lite Log</a><br/> +<a href="http://birdnetpi.local:8888" target="content">Extraction Log</a><br/> <h4>GitHub</h4> <a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content">Repository</a><br/> <a href="https://github.com/mcguirepr89/BirdNET-Pi/discussions" target="_content">Discussions</a><br/> <a href="https://github.com/mcguirepr89/BirdNET-Pi/issues" target="_content">Issues</a><br/> +<h4>External Links</h4> +<a href="https://birdnetwiki.pmcgui.xyz" target="_content">- Wiki Help Page</a><br/> +<a href="https://www.accuweather.com" target="content">- Weather</a><br/> +<a href="https://www.birds.cornell.edu" target="_content">- The Cornell Lab of Ornithology</a><br/> </body> </html> diff --git a/homepage/top.html b/homepage/top.html index 5f9eaae..760af51 100644 --- a/homepage/top.html +++ b/homepage/top.html @@ -3,6 +3,7 @@ <title>BirdNET-Pi</title> <style type="text/css"> body { + text-align:center; font-family:verdana,arial,sans-serif; font-size:medium; margin:10px; @@ -15,7 +16,7 @@ body { #content img { position: absolute; top: 0px; - right: 0px; + left: 0px; } </style> @@ -26,11 +27,8 @@ body { </div> <h2>BirdNET-Pi</h2> <p> - <a href="http://birdnetpi.local/viewdb.php" target="content"><b>Recognized Birds Library</b></a> | - <a href="http://birdnetpi.local:8080" target="content">Deep Learning Analysis</a> | - <a href="http://birdnetpi.local:8888" target="content">Audio Extraction</a> | - <a href="http://birdnetpi.local/phpsysinfo" target="content">Hardware</a> | - <a href="http://birdnetpi.local/scripts/" target="content">System</a> + <a href="http://birdnetpi.local/phpsysinfo" target="content">System Info</a> | + <a href="http://birdnetpi.local/scripts/" target="content">Tools</a> </p> </body> </html> From b6279c32e27d1a7e66a674caaf4884a60dd9eee6 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Thu, 21 Oct 2021 13:35:49 -0400 Subject: [PATCH 52/77] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 81a6a96..8b9f433 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ A realtime acoustic bird classification system for the Raspberry Pi 4B ## Introduction The BirdNET-Pi project is built on the [TFLite version of BirdNET](https://github.com/kahst/BirdNET-Lite). It is able to recognize bird sounds from a USB sound card in realtime. +[Check out my live system](https://birdnetpi.pmcgui.xyz)<br> +[and NatureStation.net](https://birds.naturestation.net) + ## Features * 24/7 recording and BirdNET-Lite analysis * Web interface access to all data and logs From eecaca6ed7f556829f013179b8246d2413c04c38 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Thu, 21 Oct 2021 14:39:05 -0400 Subject: [PATCH 53/77] homepage adjustments --- homepage/footer.html | 3 ++- homepage/menu.html | 25 ++++++++++--------------- homepage/top.html | 5 ++++- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/homepage/footer.html b/homepage/footer.html index 006d624..e7314c6 100644 --- a/homepage/footer.html +++ b/homepage/footer.html @@ -5,7 +5,8 @@ body { font-family:verdana,arial,sans-serif; font-size:medium; - margin:10px; + margin:25px; + text-align:center; background-color:black; color:white; } diff --git a/homepage/menu.html b/homepage/menu.html index de060fd..cb052f7 100644 --- a/homepage/menu.html +++ b/homepage/menu.html @@ -16,22 +16,17 @@ body { </head> <body> <h4>Extractions</h4> -<a href="http://birdnetpi.local/By_Common_Name/" target="content">- By Common Name</a><br/> -<a href="http://birdnetpi.local/By_Date/" target="content">- By Date</a><br/> -<a href="http://birdnetpi.local/By_Scientific_Name/" target="content">- By Scientiffic Name</a><br/> -<a href="http://birdnetpi.local/Processed/" target="content">- Processed</a><br/> -<h4>Views</h4> -<a href="/viewdb.php" target="content">Database</a><br/> -<a href="/spectrogram.php" target="content">Spectrogram</a><br/> -<a href="http://birdnetpi.local:8080" target="content">BirdNET-Lite Log</a><br/> -<a href="http://birdnetpi.local:8888" target="content">Extraction Log</a><br/> +<a href="http://birdnetpi.local/By_Common_Name/" target="content"><h5>By Common Name</h5></a> +<a href="http://birdnetpi.local/By_Date/" target="content"><h5>By Date</h5></a> +<a href="http://birdnetpi.local/By_Scientific_Name/" target="content"><h5>By Scientiffic Name</h5></a> +<a href="http://birdnetpi.local/Processed/" target="content"><h5>Processed</h5></a> <h4>GitHub</h4> -<a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content">Repository</a><br/> -<a href="https://github.com/mcguirepr89/BirdNET-Pi/discussions" target="_content">Discussions</a><br/> -<a href="https://github.com/mcguirepr89/BirdNET-Pi/issues" target="_content">Issues</a><br/> +<a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content"><h5>Repository</h5></a> +<a href="https://github.com/mcguirepr89/BirdNET-Pi/discussions" target="_content"><h5>Discussions</h5></a> +<a href="https://github.com/mcguirepr89/BirdNET-Pi/issues" target="_content"><h5>Issues</h5></a> <h4>External Links</h4> -<a href="https://birdnetwiki.pmcgui.xyz" target="_content">- Wiki Help Page</a><br/> -<a href="https://www.accuweather.com" target="content">- Weather</a><br/> -<a href="https://www.birds.cornell.edu" target="_content">- The Cornell Lab of Ornithology</a><br/> +<a href="https://birdnetwiki.pmcgui.xyz" target="_content"><h5>Wiki Help Page</h5></a> +<a href="https://www.accuweather.com" target="content"><h5>Weather</h5></a> +<a href="https://www.birds.cornell.edu" target="_content"><h5>The Cornell Lab of Ornithology</h5></a> </body> </html> diff --git a/homepage/top.html b/homepage/top.html index 760af51..ff5626b 100644 --- a/homepage/top.html +++ b/homepage/top.html @@ -8,7 +8,6 @@ body { font-size:medium; margin:10px; background-color: rgb(119, 196, 135); - background-image: linear-gradient(to top, rgb(119, 196, 135), rgb(149, 226, 165)); } #content { position: relative; @@ -27,6 +26,10 @@ body { </div> <h2>BirdNET-Pi</h2> <p> + <a href="/viewdb.php" target="content">Database View</a> | + <a href="/spectrogram.php" target="content">Spectrogram View</a> | + <a href="http://birdnetpi.local:8080" target="content">BirdNET-Lite Log</a> | + <a href="http://birdnetpi.local:8888" target="content">Extraction Log</a> | <a href="http://birdnetpi.local/phpsysinfo" target="content">System Info</a> | <a href="http://birdnetpi.local/scripts/" target="content">Tools</a> </p> From 93b86cca5a671e66a6cda82b39929afb2bf53d2a Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Thu, 21 Oct 2021 15:11:54 -0400 Subject: [PATCH 54/77] editing menu --- homepage/menu.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/homepage/menu.html b/homepage/menu.html index cb052f7..2782aa5 100644 --- a/homepage/menu.html +++ b/homepage/menu.html @@ -20,11 +20,8 @@ body { <a href="http://birdnetpi.local/By_Date/" target="content"><h5>By Date</h5></a> <a href="http://birdnetpi.local/By_Scientific_Name/" target="content"><h5>By Scientiffic Name</h5></a> <a href="http://birdnetpi.local/Processed/" target="content"><h5>Processed</h5></a> -<h4>GitHub</h4> -<a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content"><h5>Repository</h5></a> -<a href="https://github.com/mcguirepr89/BirdNET-Pi/discussions" target="_content"><h5>Discussions</h5></a> -<a href="https://github.com/mcguirepr89/BirdNET-Pi/issues" target="_content"><h5>Issues</h5></a> <h4>External Links</h4> +<a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content"><h5>BirdNET-Pi Repository</h5></a> <a href="https://birdnetwiki.pmcgui.xyz" target="_content"><h5>Wiki Help Page</h5></a> <a href="https://www.accuweather.com" target="content"><h5>Weather</h5></a> <a href="https://www.birds.cornell.edu" target="_content"><h5>The Cornell Lab of Ornithology</h5></a> From 69943ab685c8b766acd093e32ae1cabe07f8e8ec Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 10:07:01 -0400 Subject: [PATCH 55/77] limit database view to just today's detections --- scripts/viewdb.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 9b55c4c..1e4b94b 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -16,14 +16,14 @@ if ($mysqli->connect_error) { } // SQL query to select data from database -$sql = "SELECT * FROM detections - ORDER BY Date DESC, Time DESC"; +$sql = "SELECT * FROM detections + ORDER BY Date DESC, Time DESC"; $fulltable = $mysqli->query($sql); $totalcount=mysqli_num_rows($fulltable); $sql1 = "SELECT * FROM detections - ORDER BY Date DESC, Time DESC - LIMIT 500"; + WHERE Date = CURDATE() + ORDER BY Date DESC, Time DESC"; $mosttable = $mysqli->query($sql1); $sql2 = "SELECT * FROM detections From 1603ae7a5f184f92e2af37a6d5fb903ac2806a51 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 20:39:02 +0200 Subject: [PATCH 56/77] fixing Dennis bug --- scripts/restart_services.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/restart_services.sh b/scripts/restart_services.sh index 1cc4367..cbc5ea4 100755 --- a/scripts/restart_services.sh +++ b/scripts/restart_services.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Restarts ALL services and removes ALL unprocessed audio source /etc/birdnet/birdnet.conf +my_dir=/home/pi/BirdNET-Pi/scripts sudo systemctl stop birdnet_recording.service sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/* @@ -9,6 +10,7 @@ sudo systemctl start birdnet_recording.service services=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) for i in "${services[@]}";do - sudo systemctl restart ${i} + echo $i +# sudo systemctl restart ${i} done From 666e5c361b1a8ca29f541a45080db785531a76fc Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 20:40:51 +0200 Subject: [PATCH 57/77] really doing it this time --- scripts/restart_services.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/restart_services.sh b/scripts/restart_services.sh index cbc5ea4..061f5c2 100755 --- a/scripts/restart_services.sh +++ b/scripts/restart_services.sh @@ -10,7 +10,6 @@ sudo systemctl start birdnet_recording.service services=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) for i in "${services[@]}";do - echo $i -# sudo systemctl restart ${i} +sudo systemctl restart ${i} done From 3770e3f52ce3aff4fba0f7b631c289cb01d4ee59 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 20:58:47 +0200 Subject: [PATCH 58/77] fixed --- scripts/restart_services.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restart_services.sh b/scripts/restart_services.sh index 061f5c2..bbd5492 100755 --- a/scripts/restart_services.sh +++ b/scripts/restart_services.sh @@ -7,9 +7,9 @@ sudo systemctl stop birdnet_recording.service sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/* sudo systemctl start birdnet_recording.service -services=$(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) +services=($(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort)) for i in "${services[@]}";do -sudo systemctl restart ${i} +sudo systemctl restart "${i}" done From 5dfe54757f27b78143b5d30521f175876287c7f6 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 15:54:05 -0400 Subject: [PATCH 59/77] flop bird --- homepage/images/bird.png | Bin 5937 -> 2830 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/homepage/images/bird.png b/homepage/images/bird.png index 2ceb08f90e38b43d1546a84ca184b1bf8baf0b9e..807ea723b688b6b3249a62f17f635e9f7e3d8df3 100644 GIT binary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}f}|}kFCTLThUJJdw1(%G>RIiBpT>JCS_kE-TUYVmv=4LC zee7re`MPLHtE`$)&y(c9fSLe<m|FcJ;@8`^7oKd{Cc%7O<r2Xin-G!G_;qAtgm&T4 dW(Z_$+x0!-1J>DV6CiUSCWdAPRm7iT{{fx(YR3Qo From 0bf306c4530c491c155740dd38c2a88abe0f3942 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 16:32:18 -0400 Subject: [PATCH 60/77] shallow git clone to save space and time --- Birders_Guide_Installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Birders_Guide_Installer.sh b/Birders_Guide_Installer.sh index c32069b..eec2292 100755 --- a/Birders_Guide_Installer.sh +++ b/Birders_Guide_Installer.sh @@ -108,7 +108,7 @@ stage_2() { if [ ! -d ${my_dir} ];then cd ~ || exit 1 echo "Cloning the BirdNET-Pi repository $branch branch into your home directory" - git clone -b ${branch} https://github.com/mcguirepr89/BirdNET-Pi.git ~/BirdNET-Pi + git clone --depth 1 -b ${branch} https://github.com/mcguirepr89/BirdNET-Pi.git ~/BirdNET-Pi else cd ${my_dir} && git checkout ${branch} fi From 055f9dc0ed23815c1f176512a196599b66bdb659 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 16:37:22 -0400 Subject: [PATCH 61/77] better database table view --- scripts/viewdb.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 1e4b94b..d607905 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -231,11 +231,10 @@ while($rows=$speciestally ->fetch_assoc()) </table> </div> </div> - <h1>BirdsDB Detections Table</h1> + <h2>Today's Detections</h2> <!-- TABLE CONSTRUCTION--> <table> <tr> - <th>Date</th> <th>Time</th> <th>Sci_Name</th> <th>Com_Name</th> @@ -255,7 +254,6 @@ while($rows=$mosttable ->fetch_assoc()) <tr> <!--FETCHING DATA FROM EACH ROW OF EVERY COLUMN--> - <td><?php echo $rows['Date'];?></td> <td><?php echo $rows['Time'];?></td> <td><?php echo $rows['Sci_Name'];?></td> <td><?php echo $rows['Com_Name'];?></td> From df44475b2b62aa9494ced02ad906991ab2701934 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 16:52:16 -0400 Subject: [PATCH 62/77] slightly cleaner layout --- homepage/footer.html | 4 ++-- homepage/index.html | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homepage/footer.html b/homepage/footer.html index e7314c6..902e3aa 100644 --- a/homepage/footer.html +++ b/homepage/footer.html @@ -5,7 +5,7 @@ body { font-family:verdana,arial,sans-serif; font-size:medium; - margin:25px; + margin:10px; text-align:center; background-color:black; color:white; @@ -16,7 +16,7 @@ a { </style> </head> <body> - <a href="http://birdnetpi.local/stream" target="footer"><h4>Play Live Audio Stream</h4></a> + <a href="https://birdnetpi.pmcgui.xyz/stream" target="footer"><h4>Play Live Audio Stream</h4></a> </p> </body> </html> diff --git a/homepage/index.html b/homepage/index.html index 12bf60c..d0e9455 100644 --- a/homepage/index.html +++ b/homepage/index.html @@ -20,14 +20,17 @@ Note the following: } </script> -<frameset rows="100,*,70" frameborder="0" border="0" framespacing="0"> +<frameset rows="100,*" frameborder="0" border="0" framespacing="0"> <frame name="topNav" src="top.html" scrolling="off"> <frameset cols="150,*" frameborder="0" border="0" framespacing="0"> + <frameset rows="*,70" frameborder="0" border="0" framespacing="0"> <frame name="menu" src="menu.html" marginheight="0" marginwidth="0" scrolling="off" noresize> + <frame name="footer" src="footer.html" scrolling="off"> + </frameset> <frame name="content" src="/viewdb.php" marginheight="0" marginwidth="0" scrolling="auto" noresize> </frameset> -<frame name="footer" src="footer.html" scrolling="off"> +<! -- <frame name="footer" src="footer.html" scrolling="off"> --> <noframes> <p>This section (everything between the 'noframes' tags) will only be displayed if the users' browser doesn't support frames. You can provide a link to a non-frames version of the website here. Feel free to use HTML tags within this section.</p> From ebbcca027dfde22a88d30a56629e6bef4ec73966 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 16:59:09 -0400 Subject: [PATCH 63/77] typo --- homepage/menu.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homepage/menu.html b/homepage/menu.html index 2782aa5..1217297 100644 --- a/homepage/menu.html +++ b/homepage/menu.html @@ -16,10 +16,10 @@ body { </head> <body> <h4>Extractions</h4> -<a href="http://birdnetpi.local/By_Common_Name/" target="content"><h5>By Common Name</h5></a> -<a href="http://birdnetpi.local/By_Date/" target="content"><h5>By Date</h5></a> -<a href="http://birdnetpi.local/By_Scientific_Name/" target="content"><h5>By Scientiffic Name</h5></a> -<a href="http://birdnetpi.local/Processed/" target="content"><h5>Processed</h5></a> +<a href="https://birdnetpi.pmcgui.xyz/By_Common_Name/" target="content"><h5>By Common Name</h5></a> +<a href="https://birdnetpi.pmcgui.xyz/By_Date/" target="content"><h5>By Date</h5></a> +<a href="https://birdnetpi.pmcgui.xyz/By_Scientific_Name/" target="content"><h5>By Scientific Name</h5></a> +<a href="https://birdnetpi.pmcgui.xyz/Processed/" target="content"><h5>Processed</h5></a> <h4>External Links</h4> <a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content"><h5>BirdNET-Pi Repository</h5></a> <a href="https://birdnetwiki.pmcgui.xyz" target="_content"><h5>Wiki Help Page</h5></a> From 464dd646af7362b0fe64f9fc9fbbb6063272c614 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 17:16:52 -0400 Subject: [PATCH 64/77] removed ugly link stuff --- homepage/menu.html | 13 ++++++++++--- homepage/top.html | 17 +++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/homepage/menu.html b/homepage/menu.html index 1217297..9a8604d 100644 --- a/homepage/menu.html +++ b/homepage/menu.html @@ -2,16 +2,23 @@ <head> <title>HTML Frames Example - Menu</title> <style type="text/css"> +a { + text-decoration:none; + color:black; +} body { font-family:verdana,arial,sans-serif; font-size:medium; margin:10px; margin-bottom:50px; background-color: rgb(119, 196, 135); - } - h4 { +} +h4 { + text-decoration:underline; +} +h4,h5 { margin: 15px 0px 0px 0px; - } +} </style> </head> <body> diff --git a/homepage/top.html b/homepage/top.html index ff5626b..ba03bcb 100644 --- a/homepage/top.html +++ b/homepage/top.html @@ -2,6 +2,12 @@ <head> <title>BirdNET-Pi</title> <style type="text/css"> +a { + font-weight:bold; + text-decoration:none; + color:black; +} + body { text-align:center; font-family:verdana,arial,sans-serif; @@ -17,21 +23,20 @@ body { top: 0px; left: 0px; } - </style> </head> <body> <div id="content"> <img src="images/bird.png" class="ribbon"/> </div> - <h2>BirdNET-Pi</h2> + <h1><em>BirdNET</em>-Pi</h1> <p> <a href="/viewdb.php" target="content">Database View</a> | <a href="/spectrogram.php" target="content">Spectrogram View</a> | - <a href="http://birdnetpi.local:8080" target="content">BirdNET-Lite Log</a> | - <a href="http://birdnetpi.local:8888" target="content">Extraction Log</a> | - <a href="http://birdnetpi.local/phpsysinfo" target="content">System Info</a> | - <a href="http://birdnetpi.local/scripts/" target="content">Tools</a> + <a href="https://birdnetlog.pmcgui.xyz" target="content">BirdNET-Lite Log</a> | + <a href="https://extractionlog.pmcgui.xyz" target="content">Extraction Log</a> | + <a href="https://birdnetpi.pmcgui.xyz/phpsysinfo" target="content">System Info</a> | + <a href="https://birdnetpi.pmcgui.xyz/scripts/" target="content">Tools</a> </p> </body> </html> From a171e6a8eb46c99babffa77e79f24e524a1b19e3 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Fri, 22 Oct 2021 17:57:39 -0400 Subject: [PATCH 65/77] Hide scroll bar --- scripts/viewdb.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/viewdb.php b/scripts/viewdb.php index d607905..0ab33de 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -163,9 +163,11 @@ $mysqli->close(); td { font-weight: lighter; } +body::-webkit-scrollbar { + display:none +} </style> </head> - <body style="background-color: rgb(119, 196, 135);background-image: linear-gradient(to top, rgb(119, 196, 135),black;"> <section> @@ -215,7 +217,7 @@ while($rows=$specieslist ->fetch_assoc()) <table> <tr> <th>Species</th> - <th>Number of Detections</th> + <th>Detections</th> </tr> <?php // LOOP TILL END OF DATA while($rows=$speciestally ->fetch_assoc()) @@ -236,8 +238,8 @@ while($rows=$speciestally ->fetch_assoc()) <table> <tr> <th>Time</th> - <th>Sci_Name</th> - <th>Com_Name</th> + <th>Scientific Name</th> + <th>Common Name</th> <th>Confidence</th> <th>Lat</th> <th>Lon</th> @@ -270,7 +272,6 @@ while($rows=$mosttable ->fetch_assoc()) ?> </table> </section> -</body> - +</div> </html> From 49932a0561762564ff67b64dd975b55812737af0 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Sat, 23 Oct 2021 07:55:29 -0400 Subject: [PATCH 66/77] removing my urls --- homepage/footer.html | 2 +- homepage/menu.html | 8 ++++---- homepage/top.html | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/homepage/footer.html b/homepage/footer.html index 902e3aa..86b361f 100644 --- a/homepage/footer.html +++ b/homepage/footer.html @@ -16,7 +16,7 @@ a { </style> </head> <body> - <a href="https://birdnetpi.pmcgui.xyz/stream" target="footer"><h4>Play Live Audio Stream</h4></a> + <a href="http://birdnetpi.local/stream" target="footer"><h4>Play Live Audio Stream</h4></a> </p> </body> </html> diff --git a/homepage/menu.html b/homepage/menu.html index 9a8604d..9de1d4e 100644 --- a/homepage/menu.html +++ b/homepage/menu.html @@ -23,10 +23,10 @@ h4,h5 { </head> <body> <h4>Extractions</h4> -<a href="https://birdnetpi.pmcgui.xyz/By_Common_Name/" target="content"><h5>By Common Name</h5></a> -<a href="https://birdnetpi.pmcgui.xyz/By_Date/" target="content"><h5>By Date</h5></a> -<a href="https://birdnetpi.pmcgui.xyz/By_Scientific_Name/" target="content"><h5>By Scientific Name</h5></a> -<a href="https://birdnetpi.pmcgui.xyz/Processed/" target="content"><h5>Processed</h5></a> +<a href="http://birdnetpi.local/By_Common_Name/" target="content"><h5>By Common Name</h5></a> +<a href="http://birdnetpi.local/By_Date/" target="content"><h5>By Date</h5></a> +<a href="http://birdnetpi.local/By_Scientific_Name/" target="content"><h5>By Scientific Name</h5></a> +<a href="http://birdnetpi.local/Processed/" target="content"><h5>Processed</h5></a> <h4>External Links</h4> <a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content"><h5>BirdNET-Pi Repository</h5></a> <a href="https://birdnetwiki.pmcgui.xyz" target="_content"><h5>Wiki Help Page</h5></a> diff --git a/homepage/top.html b/homepage/top.html index ba03bcb..b084234 100644 --- a/homepage/top.html +++ b/homepage/top.html @@ -33,10 +33,10 @@ body { <p> <a href="/viewdb.php" target="content">Database View</a> | <a href="/spectrogram.php" target="content">Spectrogram View</a> | - <a href="https://birdnetlog.pmcgui.xyz" target="content">BirdNET-Lite Log</a> | - <a href="https://extractionlog.pmcgui.xyz" target="content">Extraction Log</a> | - <a href="https://birdnetpi.pmcgui.xyz/phpsysinfo" target="content">System Info</a> | - <a href="https://birdnetpi.pmcgui.xyz/scripts/" target="content">Tools</a> + <a href="http://birdnetpi.local" target="content">BirdNET-Lite Log</a> | + <a href="http://birdnetpi.local" target="content">Extraction Log</a> | + <a href="http://birdnetpi.local/phpsysinfo" target="content">System Info</a> | + <a href="http://birdnetpi.local/scripts/" target="content">Tools</a> </p> </body> </html> From 325aec05f41826f34ba35398a5b75435fbad498f Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Sat, 23 Oct 2021 08:28:23 -0400 Subject: [PATCH 67/77] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b9f433..e3e016d 100644 --- a/README.md +++ b/README.md @@ -68,4 +68,4 @@ You can try to overclock your Pi by placing the following in your `/boot/config. over_voltage=6 arm_freq=1750 ``` -Be sure the Pi is adequately cooled and powered. Check http://birdnetpi.local:9090 for CPU temperature and over-volatage warnings (anything other than "throttled:0x0" is bad). +Be sure the Pi is adequately cooled and powered. From a1bc23971517854c170a0de58866c700e2521d16 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Sun, 24 Oct 2021 07:54:49 -0400 Subject: [PATCH 68/77] Update top.html --- homepage/top.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homepage/top.html b/homepage/top.html index b084234..f56035e 100644 --- a/homepage/top.html +++ b/homepage/top.html @@ -33,8 +33,8 @@ body { <p> <a href="/viewdb.php" target="content">Database View</a> | <a href="/spectrogram.php" target="content">Spectrogram View</a> | - <a href="http://birdnetpi.local" target="content">BirdNET-Lite Log</a> | - <a href="http://birdnetpi.local" target="content">Extraction Log</a> | + <a href="http://birdnetpi.local:8080" target="content">BirdNET-Lite Log</a> | + <a href="http://birdnetpi.local:8888" target="content">Extraction Log</a> | <a href="http://birdnetpi.local/phpsysinfo" target="content">System Info</a> | <a href="http://birdnetpi.local/scripts/" target="content">Tools</a> </p> From 463190f0fb7cc2b7c11851bfb491f4cf2177669f Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Sun, 24 Oct 2021 10:18:19 -0400 Subject: [PATCH 69/77] added headless installation link --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e3e016d..7ff375f 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ The BirdNET-Pi project is built on the [TFLite version of BirdNET](https://githu * A USB Microphone or Sound Card ## Installation +[Headless installation guide available here](https://github.com/mcguirepr89/BirdNET-Pi/wiki/%22Headless%22-installation-using-VNC) + The system can be installed with: ``` curl -s https://raw.githubusercontent.com/mcguirepr89/BirdNET-Pi/main/Birders_Guide_Installer.sh | bash From 9579dd86d87ffd05897f572c420a037fc2785fef Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Sun, 24 Oct 2021 12:02:46 -0400 Subject: [PATCH 70/77] adding localhost to Caddyfile --- scripts/install_services.sh | 2 +- scripts/update_services.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 845e16c..b73ffed 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -198,7 +198,7 @@ install_Caddyfile() { fi HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) cat << EOF > /etc/caddy/Caddyfile -http://birdnetpi.local ${BIRDNETPI_URL} { +http://localhost http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth /Processed* { diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 7d4b7b0..e05c1f8 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -200,7 +200,7 @@ install_Caddyfile() { fi HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) cat << EOF > /etc/caddy/Caddyfile -http://birdnetpi.local ${BIRDNETPI_URL} { +http://localhost http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} file_server browse basicauth /Processed* { From abeca0e8a02b0e4a2bcaa24d3b9d16c38e1fcac4 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Tue, 26 Oct 2021 19:05:18 -0400 Subject: [PATCH 71/77] not ready for testing, but close --- scripts/birdnet-pi-config | 872 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 872 insertions(+) create mode 100644 scripts/birdnet-pi-config diff --git a/scripts/birdnet-pi-config b/scripts/birdnet-pi-config new file mode 100644 index 0000000..02eb48f --- /dev/null +++ b/scripts/birdnet-pi-config @@ -0,0 +1,872 @@ +#!/bin/sh +# Altered from birdnetpi-config tool below +# https://github.com/RPi-Distro/birdnetpi-config +# +# See LICENSE file for copyright and license details +# Copyright (c) 2012 Alex Bradbury <asb@asbradbury.org> + +my_dir=$(realpath $(dirname $0)) +INTERACTIVE=True +ASK_TO_REBOOT=0 +BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf +CONFIG=/boot/config.txt + +USER=${SUDO_USER:-$(who -m | awk '{ print $1 }')} + +is_pi () { + ARCH=$(dpkg --print-architecture) + if [ "$ARCH" = "armhf" ] || [ "$ARCH" = "arm64" ] ; then + return 0 + else + return 1 + fi +} + +if is_pi ; then + CMDLINE=/boot/cmdline.txt +else + CMDLINE=/proc/cmdline +fi + +is_pione() { + if grep -q "^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo; then + return 0 + elif grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[0-36][0-9a-fA-F]$" /proc/cpuinfo ; then + return 0 + else + return 1 + fi +} + +is_pitwo() { + grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]04[0-9a-fA-F]$" /proc/cpuinfo + return $? +} + +is_pizero() { + grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[9cC][0-9a-fA-F]$" /proc/cpuinfo + return $? +} + +is_pifour() { + grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F]3[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo + return $? +} + +get_pi_type() { + if is_pione; then + echo 1 + elif is_pitwo; then + echo 2 + else + echo 0 + fi +} + +is_live() { + grep -q "boot=live" $CMDLINE + return $? +} + +is_ssh() { + if pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then + return 0 + else + return 1 + fi +} + +is_fkms() { + if grep -s -q okay /proc/device-tree/soc/v3d@7ec00000/status \ + /proc/device-tree/soc/firmwarekms@7e600000/status \ + /proc/device-tree/v3dbus/v3d@7ec04000/status; then + return 0 + else + return 1 + fi +} + +is_pulseaudio() { + PS=$(ps ax) + echo "$PS" | grep -q pulseaudio + return $? +} + +has_analog() { + if [ $(get_leds) -eq -1 ] ; then + return 0 + else + return 1 + fi +} + +is_installed() { + if [ "$(dpkg -l "$1" 2> /dev/null | tail -n 1 | cut -d ' ' -f 1)" != "ii" ]; then + return 1 + else + return 0 + fi +} + +deb_ver () { + ver=`cat /etc/debian_version | cut -d . -f 1` + echo $ver +} + +calc_wt_size() { + # NOTE: it's tempting to redirect stderr to /dev/null, so supress error + # output from tput. However in this case, tput detects neither stdout or + # stderr is a tty and so only gives default 80, 24 values + WT_HEIGHT=18 + WT_WIDTH=$(tput cols) + + if [ -z "$WT_WIDTH" ] || [ "$WT_WIDTH" -lt 60 ]; then + WT_WIDTH=80 + fi + if [ "$WT_WIDTH" -gt 178 ]; then + WT_WIDTH=120 + fi + WT_MENU_HEIGHT=$(($WT_HEIGHT-7)) +} + +set_config_var() { + lua - "$1" "$2" "$3" <<EOF > "$3.bak" +local key=assert(arg[1]) +local value=assert(arg[2]) +local fn=assert(arg[3]) +local file=assert(io.open(fn)) +local made_change=false +for line in file:lines() do + if line:match("^#?%s*"..key.."=.*$") then + line=key.."="..value + made_change=true + end + print(line) +end + +if not made_change then + print(key.."="..value) +end +EOF +mv "$3.bak" "$3" +} + +clear_config_var() { + lua - "$1" "$2" <<EOF > "$2.bak" +local key=assert(arg[1]) +local fn=assert(arg[2]) +local file=assert(io.open(fn)) +for line in file:lines() do + if line:match("^%s*"..key.."=.*$") then + line="#"..line + end + print(line) +end +EOF +mv "$2.bak" "$2" +} + +get_config_var() { + lua - "$1" "$2" <<EOF +local key=assert(arg[1]) +local fn=assert(arg[2]) +local file=assert(io.open(fn)) +local found=false +for line in file:lines() do + local val = line:match("^%s*"..key.."=(.*)$") + if (val ~= nil) then + print(val) + found=true + break + end +end +if not found then + print(0) +end +EOF +} + +is_number() { + case $1 in + ''|*[!0-9]*) return 0 ;; + *) return 1 ;; + esac +} + +do_change_pass() { + whiptail --msgbox "You will now be asked to enter a new password for the $USER user" 20 60 1 + passwd $USER && + whiptail --msgbox "Password changed successfully" 20 60 1 +} + +do_configure_keyboard() { + printf "Reloading keymap. This may take a short while\n" + if [ "$INTERACTIVE" = True ]; then + dpkg-reconfigure keyboard-configuration + else + local KEYMAP="$1" + sed -i /etc/default/keyboard -e "s/^XKBLAYOUT.*/XKBLAYOUT=\"$KEYMAP\"/" + dpkg-reconfigure -f noninteractive keyboard-configuration + fi + invoke-rc.d keyboard-setup start + setsid sh -c 'exec setupcon -k --force <> /dev/tty1 >&0 2>&1' + udevadm trigger --subsystem-match=input --action=change + return 0 +} + +do_change_locale() { + if [ "$INTERACTIVE" = True ]; then + dpkg-reconfigure locales + else + local LOCALE="$1" + if ! LOCALE_LINE="$(grep "^$LOCALE " /usr/share/i18n/SUPPORTED)"; then + return 1 + fi + local ENCODING="$(echo $LOCALE_LINE | cut -f2 -d " ")" + echo "$LOCALE $ENCODING" > /etc/locale.gen + sed -i "s/^\s*LANG=\S*/LANG=$LOCALE/" /etc/default/locale + dpkg-reconfigure -f noninteractive locales + fi +} + +do_change_timezone() { + if [ "$INTERACTIVE" = True ]; then + dpkg-reconfigure tzdata + else + local TIMEZONE="$1" + if [ ! -f "/usr/share/zoneinfo/$TIMEZONE" ]; then + return 1; + fi + rm /etc/localtime + echo "$TIMEZONE" > /etc/timezone + dpkg-reconfigure -f noninteractive tzdata + fi +} + +get_wifi_country() { + CODE=${1:-0} + IFACE="$(list_wlan_interfaces | head -n 1)" + if [ -z "$IFACE" ]; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "No wireless interface found" 20 60 + fi + return 1 + fi + if ! wpa_cli -i "$IFACE" status > /dev/null 2>&1; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Could not communicate with wpa_supplicant" 20 60 + fi + return 1 + fi + wpa_cli -i "$IFACE" save_config > /dev/null 2>&1 + COUNTRY="$(wpa_cli -i "$IFACE" get country)" + if [ "$COUNTRY" = "FAIL" ]; then + return 1 + fi + if [ $CODE = 0 ]; then + echo "$COUNTRY" + fi + return 0 +} + +do_wifi_country() { + IFACE="$(list_wlan_interfaces | head -n 1)" + if [ -z "$IFACE" ]; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "No wireless interface found" 20 60 + fi + return 1 + fi + + if ! wpa_cli -i "$IFACE" status > /dev/null 2>&1; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Could not communicate with wpa_supplicant" 20 60 + fi + return 1 + fi + + oIFS="$IFS" + if [ "$INTERACTIVE" = True ]; then + value=$(cat /usr/share/zoneinfo/iso3166.tab | tail -n +26 | tr '\t' '/' | tr '\n' '/') + IFS="/" + COUNTRY=$(whiptail --menu "Select the country in which the Pi is to be used" 20 60 10 ${value} 3>&1 1>&2 2>&3) + else + COUNTRY=$1 + true + fi + if [ $? -eq 0 ];then + wpa_cli -i "$IFACE" set country "$COUNTRY" + wpa_cli -i "$IFACE" save_config > /dev/null 2>&1 + if iw reg set "$COUNTRY" 2> /dev/null; then + ASK_TO_REBOOT=1 + fi + if hash rfkill 2> /dev/null; then + rfkill unblock wifi + if is_pi ; then + for filename in /var/lib/systemd/rfkill/*:wlan ; do + echo 0 > $filename + done + fi + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Wireless LAN country set to $COUNTRY" 20 60 1 + fi + fi + IFS=$oIFS +} + +get_ssh() { + if service ssh status | grep -q inactive; then + echo 1 + else + echo 0 + fi +} + +do_ssh() { + if [ -e /var/log/regen_ssh_keys.log ] && ! grep -q "^finished" /var/log/regen_ssh_keys.log; then + whiptail --msgbox "Initial ssh key generation still running. Please wait and try again." 20 60 2 + return 1 + fi + DEFAULT=--defaultno + if [ $(get_ssh) -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno \ + "Would you like the SSH server to be enabled?\n\nCaution: Default and weak passwords are a security risk when SSH is enabled!" \ + $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + ssh-keygen -A && + update-rc.d ssh enable && + invoke-rc.d ssh start && + STATUS=enabled + elif [ $RET -eq 1 ]; then + update-rc.d ssh disable && + invoke-rc.d ssh stop && + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The SSH server is $STATUS" 20 60 1 + fi +} + +get_vnc() { + if systemctl status vncserver-x11-serviced.service | grep -q -w active; then + echo 0 + else + echo 1 + fi +} + +do_vnc() { + DEFAULT=--defaultno + if [ $(get_vnc) -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the VNC Server to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + if is_installed realvnc-vnc-server || apt-get install realvnc-vnc-server; then + systemctl enable vncserver-x11-serviced.service && + systemctl start vncserver-x11-serviced.service && + STATUS=enabled + else + return 1 + fi + elif [ $RET -eq 1 ]; then + if is_installed realvnc-vnc-server; then + systemctl disable vncserver-x11-serviced.service + systemctl stop vncserver-x11-serviced.service + fi + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The VNC Server is $STATUS" 20 60 1 + fi +} + +disable_raspi_config_at_boot() { + if [ -e /etc/profile.d/birdnetpi-config.sh ]; then + rm -f /etc/profile.d/birdnetpi-config.sh + if [ -e /etc/systemd/system/getty@tty1.service.d/birdnetpi-config-override.conf ]; then + rm /etc/systemd/system/getty@tty1.service.d/birdnetpi-config-override.conf + fi + telinit q + fi +} + +get_boot_cli() { + if systemctl get-default | grep -q multi-user ; then + echo 0 + else + echo 1 + fi +} + +get_autologin() { + if [ $(get_boot_cli) -eq 0 ]; then + # booting to CLI + # stretch or buster - is there an autologin conf file? + if [ -e /etc/systemd/system/getty@tty1.service.d/autologin.conf ] ; then + echo 0 + else + # stretch or earlier - check the getty service symlink for autologin + if [ $(deb_ver) -le 9 ] && grep -q autologin /etc/systemd/system/getty.target.wants/getty@tty1.service ; then + echo 0 + else + echo 1 + fi + fi + else + # booting to desktop - check the autologin for lightdm + if grep -q "^autologin-user=" /etc/lightdm/lightdm.conf ; then + echo 0 + else + echo 1 + fi + fi +} + +do_update() { + apt-get update && + apt-get install birdnetpi-config && + printf "Sleeping 5 seconds before reloading birdnetpi-config\n" && + sleep 5 && + exec birdnetpi-config +} + +do_audio() { + if is_pulseaudio ; then + oIFS="$IFS" + if [ "$INTERACTIVE" = True ]; then + list=$(sudo -u $SUDO_USER XDG_RUNTIME_DIR=/run/user/$SUDO_UID pacmd list-sinks | grep -e index -e alsa.name | sed s/*//g | sed s/^[' '\\t]*//g | sed s/'index: '//g | sed s/'alsa.name = '//g | sed s/'bcm2835 '//g | sed s/\"//g | tr '\n' '/') + if ! [ -z "$list" ] ; then + IFS="/" + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 ${list} 3>&1 1>&2 2>&3) + else + whiptail --msgbox "No internal audio devices found" 20 60 1 + return 1 + fi + else + AUDIO_OUT=$1 + true + fi + if [ $? -eq 0 ]; then + sudo -u $SUDO_USER XDG_RUNTIME_DIR=/run/user/$SUDO_UID pactl set-default-sink $AUDIO_OUT + fi + IFS=$oIFS + else + if aplay -l | grep -q "bcm2835 ALSA"; then + if [ "$INTERACTIVE" = True ]; then + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \ + "0" "Auto" \ + "1" "Force 3.5mm ('headphone') jack" \ + "2" "Force HDMI" \ + 3>&1 1>&2 2>&3) + else + AUDIO_OUT=$1 + fi + if [ $? -eq 0 ]; then + amixer cset numid=3 "$AUDIO_OUT" + fi + else + ASPATH=$(getent passwd $USER | cut -d : -f 6)/.asoundrc + if [ "$INTERACTIVE" = True ]; then + CARD0=$(LC_ALL=C aplay -l | grep bcm2835 | grep "card 0" | cut -d [ -f 3 | cut -d ] -f 1 | cut -d ' ' -f 2-) + CARD1=$(LC_ALL=C aplay -l | grep bcm2835 | grep "card 1" | cut -d [ -f 3 | cut -d ] -f 1 | cut -d ' ' -f 2-) + CARD2=$(LC_ALL=C aplay -l | grep bcm2835 | grep "card 2" | cut -d [ -f 3 | cut -d ] -f 1 | cut -d ' ' -f 2-) + if ! [ -z "$CARD2" ]; then + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \ + "0" "$CARD0" \ + "1" "$CARD1" \ + "2" "$CARD2" \ + 3>&1 1>&2 2>&3) + elif ! [ -z "$CARD1" ]; then + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \ + "0" "$CARD0" \ + "1" "$CARD1" \ + 3>&1 1>&2 2>&3) + elif ! [ -z "$CARD0" ]; then + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \ + "0" "$CARD0" \ + 3>&1 1>&2 2>&3) + else + whiptail --msgbox "No internal audio devices found" 20 60 1 + false + fi + else + AUDIO_OUT=$1 + fi + if [ $? -eq 0 ]; then + cat << EOF > $ASPATH +pcm.!default { + type asym + playback.pcm { + type plug + slave.pcm "output" + } + capture.pcm { + type plug + slave.pcm "input" + } +} + +pcm.output { + type hw + card $AUDIO_OUT +} + +ctl.!default { + type hw + card $AUDIO_OUT +} +EOF + fi + fi + fi +} + +do_resolution() { + if [ "$INTERACTIVE" = True ]; then + CMODE=$(get_config_var hdmi_mode $CONFIG) + CGROUP=$(get_config_var hdmi_group $CONFIG) + if [ $CMODE -eq 0 ] ; then + CSET="Default" + elif [ $CGROUP -eq 2 ] ; then + CSET="DMT Mode "$CMODE + else + CSET="CEA Mode "$CMODE + fi + oIFS="$IFS" + IFS="/" + if tvservice -d /dev/null | grep -q Nothing ; then + value="Default/720x480/DMT Mode 4/640x480 60Hz 4:3/DMT Mode 9/800x600 60Hz 4:3/DMT Mode 16/1024x768 60Hz 4:3/DMT Mode 85/1280x720 60Hz 16:9/DMT Mode 35/1280x1024 60Hz 5:4/DMT Mode 51/1600x1200 60Hz 4:3/DMT Mode 82/1920x1080 60Hz 16:9/" + else + value="Default/Monitor preferred resolution/" + value=$value$(tvservice -m CEA | grep progressive | cut -b 12- | sed 's/mode \([0-9]\+\): \([0-9]\+\)x\([0-9]\+\) @ \([0-9]\+\)Hz \([0-9]\+\):\([0-9]\+\), clock:[0-9]\+MHz progressive/CEA Mode \1\/\2x\3 \4Hz \5:\6/' | tr '\n' '/') + value=$value$(tvservice -m DMT | grep progressive | cut -b 12- | sed 's/mode \([0-9]\+\): \([0-9]\+\)x\([0-9]\+\) @ \([0-9]\+\)Hz \([0-9]\+\):\([0-9]\+\), clock:[0-9]\+MHz progressive/DMT Mode \1\/\2x\3 \4Hz \5:\6/' | tr '\n' '/') + fi + RES=$(whiptail --default-item $CSET --menu "Choose screen resolution" 20 60 10 ${value} 3>&1 1>&2 2>&3) + STATUS=$? + IFS=$oIFS + if [ $STATUS -eq 0 ] ; then + GRS=$(echo "$RES" | cut -d ' ' -f 1) + MODE=$(echo "$RES" | cut -d ' ' -f 3) + if [ $GRS = "Default" ] ; then + MODE=0 + elif [ $GRS = "DMT" ] ; then + GROUP=2 + else + GROUP=1 + fi + fi + else + GROUP=$1 + MODE=$2 + STATUS=0 + fi + if [ $STATUS -eq 0 ]; then + if [ $MODE -eq 0 ]; then + clear_config_var hdmi_force_hotplug $CONFIG + clear_config_var hdmi_group $CONFIG + clear_config_var hdmi_mode $CONFIG + else + set_config_var hdmi_force_hotplug 1 $CONFIG + set_config_var hdmi_group $GROUP $CONFIG + set_config_var hdmi_mode $MODE $CONFIG + fi + if [ "$INTERACTIVE" = True ]; then + if [ $MODE -eq 0 ] ; then + whiptail --msgbox "The resolution is set to default" 20 60 1 + else + whiptail --msgbox "The resolution is set to $GRS mode $MODE" 20 60 1 + fi + fi + if [ $MODE -eq 0 ] ; then + TSET="Default" + elif [ $GROUP -eq 2 ] ; then + TSET="DMT Mode "$MODE + else + TSET="CEA Mode "$MODE + fi + if [ "$TSET" != "$CSET" ] ; then + ASK_TO_REBOOT=1 + fi + fi +} + +list_wlan_interfaces() { + for dir in /sys/class/net/*/wireless; do + if [ -d "$dir" ]; then + basename "$(dirname "$dir")" + fi + done +} + +do_wifi_ssid_passphrase() { + RET=0 + IFACE_LIST="$(list_wlan_interfaces)" + IFACE="$(echo "$IFACE_LIST" | head -n 1)" + + if [ -z "$IFACE" ]; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "No wireless interface found" 20 60 + fi + return 1 + fi + + if ! wpa_cli -i "$IFACE" status > /dev/null 2>&1; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Could not communicate with wpa_supplicant" 20 60 + fi + return 1 + fi + + if [ "$INTERACTIVE" = True ] && [ -z "$(get_wifi_country)" ]; then + do_wifi_country + fi + + SSID="$1" + while [ -z "$SSID" ] && [ "$INTERACTIVE" = True ]; do + SSID=$(whiptail --inputbox "Please enter SSID" 20 60 3>&1 1>&2 2>&3) + if [ $? -ne 0 ]; then + return 0 + elif [ -z "$SSID" ]; then + whiptail --msgbox "SSID cannot be empty. Please try again." 20 60 + fi + done + + PASSPHRASE="$2" + while [ "$INTERACTIVE" = True ]; do + PASSPHRASE=$(whiptail --passwordbox "Please enter passphrase. Leave it empty if none." 20 60 3>&1 1>&2 2>&3) + if [ $? -ne 0 ]; then + return 0 + else + break + fi + done + + # Escape special characters for embedding in regex below + local ssid="$(echo "$SSID" \ + | sed 's;\\;\\\\;g' \ + | sed -e 's;\.;\\\.;g' \ + -e 's;\*;\\\*;g' \ + -e 's;\+;\\\+;g' \ + -e 's;\?;\\\?;g' \ + -e 's;\^;\\\^;g' \ + -e 's;\$;\\\$;g' \ + -e 's;\/;\\\/;g' \ + -e 's;\[;\\\[;g' \ + -e 's;\];\\\];g' \ + -e 's;{;\\{;g' \ + -e 's;};\\};g' \ + -e 's;(;\\(;g' \ + -e 's;);\\);g' \ + -e 's;";\\\\\";g')" + + wpa_cli -i "$IFACE" list_networks \ + | tail -n +2 | cut -f -2 | grep -P "\t$ssid$" | cut -f1 \ + | while read ID; do + wpa_cli -i "$IFACE" remove_network "$ID" > /dev/null 2>&1 + done + + ID="$(wpa_cli -i "$IFACE" add_network)" + wpa_cli -i "$IFACE" set_network "$ID" ssid "\"$SSID\"" 2>&1 | grep -q "OK" + RET=$((RET + $?)) + + if [ -z "$PASSPHRASE" ]; then + wpa_cli -i "$IFACE" set_network "$ID" key_mgmt NONE 2>&1 | grep -q "OK" + RET=$((RET + $?)) + else + wpa_cli -i "$IFACE" set_network "$ID" psk "\"$PASSPHRASE\"" 2>&1 | grep -q "OK" + RET=$((RET + $?)) + fi + + if [ $RET -eq 0 ]; then + wpa_cli -i "$IFACE" enable_network "$ID" > /dev/null 2>&1 + else + wpa_cli -i "$IFACE" remove_network "$ID" > /dev/null 2>&1 + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Failed to set SSID or passphrase" 20 60 + fi + fi + wpa_cli -i "$IFACE" save_config > /dev/null 2>&1 + + echo "$IFACE_LIST" | while read IFACE; do + wpa_cli -i "$IFACE" reconfigure > /dev/null 2>&1 + done + + return $RET +} + +do_update() { + apt update && apt -y full-upgrade + ASK_TO_REBOOT=1 +} + +do_install_birdnet() { + ${my_dir}/Birders_Guide_Installer.sh + ASK_TO_REBOOT=1 +} + +do_finish() { + disable_raspi_config_at_boot + if [ $ASK_TO_REBOOT -eq 1 ]; then + whiptail --yesno "Would you like to reboot now?" 20 60 2 + if [ $? -eq 0 ]; then # yes + sync + reboot + fi + fi + exit 0 +} +# Everything else needs to be run as root +if [ $(id -u) -ne 0 ]; then + printf "Script must be run as root. Try 'sudo birdnetpi-config'\n" + exit 1 +fi + +if [ -n "${OPT_MEMORY_SPLIT:-}" ]; then + set -e # Fail when a command errors + set_memory_split "${OPT_MEMORY_SPLIT}" + exit 0 +fi + +do_system_menu() { + if is_pi ; then + FUN=$(whiptail --title "BirdNET-Pi Software Configuration Tool (birdnetpi-config)" --menu "System Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "Password" "Change password for the '$USER' user" \ + "Audio" "Select audio device you'd like BirdNET-Pi to use" \ + "Wireless LAN" "Enter SSID and passphrase" \ + 3>&1 1>&2 2>&3) + else + exit + fi + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + Password*) do_change_pass ;; + Audio*) do_audio ;; + Wireless*) do_wifi_ssid_passphrase ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_display_menu() { + if is_pi ; then + FUN=$(whiptail --title "BirdNET-Pi Software Configuration Tool (birdnetpi-config)" --menu "Display Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "Resolution" "Set a specific screen resolution" \ + 3>&1 1>&2 2>&3) + else + exit + fi + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + Resolution*) do_resolution ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_interface_menu() { + if is_pi ; then + FUN=$(whiptail --title "BirdNET-Pi Software Configuration Tool (birdnetpi-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "SSH" "Enable/disable remote command line access using SSH" \ + "VNC" "Enable/disable graphical remote access using RealVNC" \ + 3>&1 1>&2 2>&3) + else + exit + fi + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + SSH*) do_ssh ;; + VNC*) do_vnc ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_internationalisation_menu() { + FUN=$(whiptail --title "BirdNET-Pi Software Configuration Tool (birdnetpi-config)" --menu "Localisation Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "Locale" "Configure language and regional settings" \ + "Timezone" "Configure time zone" \ + "Keyboard" "Set keyboard layout to match your keyboard" \ + "WLAN Country" "Set legal wireless channels for your country" \ + 3>&1 1>&2 2>&3) + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + Locale*) do_change_locale ;; + Time*) do_change_timezone ;; + Key*) do_configure_keyboard ;; + WLAN*) do_wifi_country ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} +# +# Interactive use loop +# +if [ "$INTERACTIVE" = True ]; then + [ -e $CONFIG ] || touch $CONFIG + calc_wt_size + while [ "$USER" = "root" ] || [ -z "$USER" ]; do + if ! USER=$(whiptail --inputbox "birdnetpi-config could not determine the default user.\\n\\nWhat user should these settings apply to?" 20 60 pi 3>&1 1>&2 2>&3); then + return 0 + fi + done + while true; do + if is_pi ; then + FUN=$(whiptail --title "BirdNET-Pi Software Configuration Tool (birdnetpi-config)" --backtitle "$(cat /proc/device-tree/model)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \ + "System Options" "Configure system settings" \ + "Display Options" "Configure display settings" \ + "Interface Options" "Configure connections to peripherals" \ + "Localisation Options" "Configure language and regional settings" \ + "Update the OS" "Update the underlying operating system" \ + "Install BirdNET-PI" "Install BirdNET-Pi" \ + 3>&1 1>&2 2>&3) + else + exit + fi + RET=$? + if [ $RET -eq 1 ]; then + do_finish + elif [ $RET -eq 0 ]; then + case "$FUN" in + System*) do_system_menu ;; + Display*) do_display_menu ;; + Interface*) do_interface_menu ;; + Localisation*) do_internationalisation_menu ;; + Update*) do_update;; + Install*) do_install_birdnet;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + else + exit 1 + fi + done +fi From f66a7b98735550618501590f0471c7384343a592 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Tue, 26 Oct 2021 19:05:46 -0400 Subject: [PATCH 72/77] Update birdnet-pi-config --- scripts/birdnet-pi-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/birdnet-pi-config b/scripts/birdnet-pi-config index 02eb48f..b6e5a9c 100644 --- a/scripts/birdnet-pi-config +++ b/scripts/birdnet-pi-config @@ -1,5 +1,5 @@ #!/bin/sh -# Altered from birdnetpi-config tool below +# Altered from raspi-config tool below # https://github.com/RPi-Distro/birdnetpi-config # # See LICENSE file for copyright and license details From 9bdbe71c26dd65e1a31f45ed9cb6f2ec73731410 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Tue, 26 Oct 2021 19:09:50 -0400 Subject: [PATCH 73/77] made executable --- scripts/birdnet-pi-config | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/birdnet-pi-config diff --git a/scripts/birdnet-pi-config b/scripts/birdnet-pi-config old mode 100644 new mode 100755 From f6d2c076e661c3e80f451c23227073976d8f47c2 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Wed, 27 Oct 2021 10:46:38 -0400 Subject: [PATCH 74/77] changing margins --- scripts/viewdb.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 0ab33de..189b866 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -65,7 +65,6 @@ $mysqli->close(); <style> * { box-sizing: border-box; - padding: 5px; } .row { @@ -74,7 +73,7 @@ $mysqli->close(); .column { flex: 50%; - padding: 5px; + padding-right: 5px; } table { From 2c44c87a0e1e75bbca045ec986edc93f60959be8 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <mcguirepr89@gmail.com> Date: Wed, 27 Oct 2021 10:49:44 -0400 Subject: [PATCH 75/77] changed "stats" to "Statistics" --- scripts/viewdb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 189b866..4f85d38 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -212,7 +212,7 @@ while($rows=$specieslist ->fetch_assoc()) </table> </div> <div class="column"> - <h2>Species stats</h2> + <h2>Species Statistics</h2> <table> <tr> <th>Species</th> From 1132a15280029301e05f46c21775158a3226231d Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Thu, 28 Oct 2021 09:17:03 -0400 Subject: [PATCH 76/77] Update restart_services.sh --- scripts/restart_services.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restart_services.sh b/scripts/restart_services.sh index bbd5492..8bd1064 100755 --- a/scripts/restart_services.sh +++ b/scripts/restart_services.sh @@ -12,4 +12,4 @@ services=($(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/instal for i in "${services[@]}";do sudo systemctl restart "${i}" done - +sudo systemctl restart extraction.timer From 071453914ad1c19df4fd9a08f8f38e428ab47768 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Thu, 28 Oct 2021 09:18:17 -0400 Subject: [PATCH 77/77] Update update_birdnet2.sh --- scripts/update_birdnet2.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update_birdnet2.sh b/scripts/update_birdnet2.sh index cede40e..a0a5a89 100755 --- a/scripts/update_birdnet2.sh +++ b/scripts/update_birdnet2.sh @@ -24,3 +24,4 @@ restart_newservices() { } restart_newservices +sudo systemctl restart extraction.timer