Skip to content

A live bird collage card for your Home Assistant dashboard.

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

Patrick McGuire73417ee3afdf
diff --git a/Testing_UPDATER b/Testing_UPDATER
deleted file mode 100644
index 1f7ec480..00000000
--- 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 00000000..ec8343d1
--- /dev/null
+++ b/homepage/external.html
@@ -0,0 +1,60 @@
+<html>
+<head>
+<title>HTML Frames Example - Content</title>
+<style type="text/css">
+body {
+ font-family:verdana,arial,sans-serif;
+ font-size:10pt;
+ margin:30px;
+ background-color:#ffcc00;
+ }
+</style>
+</head>
+<body>
+tbc....
+<h1>Thanks</h1>
+stefan kahl
+patrick mcguire
+<h1>Similar Systems</h1>
+<h1>Technical Details</h1>
+machine learning
+deep learning
+<h1>Used Tools</h1>
+SoX
+ffmpeg
+Python
+Tensorfflow (Lite)
+Rasberian OS
+<h1>Disclaimer</h1>
+<h1>Other Systems</h1>
+links to other systems
+
+
+
+<h1>Content</h1>
+<h2>Replacing the Contents of the Current Frame</h2>
+<p>Clicking on these links will open the new page within the current frame.</p>
+<ul>
+ <li><a href="white.html" target="content">Load white page</a></li>
+ <li><a href="green.html" target="content">Load green page</a></li>
+</ul>
+
+<h2>Replacing the Whole Frameset</h2>
+<p>When you click on any of the following links, the whole frameset is replaced with the new website. This is because we're using <code>target="_top"</code> in the anchor links.</p>
+<ul>
+ <li><a href="http://www.quackit.com" target="_top">Quackit</a></li>
+ <li><a href="http://www.quackit.com/html/templates/frames/" target="_top">HTML Frames Templates</a></li>
+ <li>Learn more about frames with the <a href="http://www.quackit.com/html/tutorial/html_frames.cfm" target="_top">frames tutorial</a><//li>
+</ul>
+
+<h2>Open a New Window</h2>
+<p>These links open in a new browser window. This is because we use <code>target="_blank"</code>.</p>
+<ul>
+ <li><a href="http://www.code-generator.net" target="_blank">Code Generator</a></li>
+ <li><a href="http://www.zappyhost.com" target="_blank">ZappyHost</a></li>
+ <li><a href="http://www.natural-environment.com" target="_blank">Natural Environment</a></li>
+ <li><a href="http://www.great-workout.com" target="_blank">Great Workout</a></li>
+</ul>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/homepage/footer.html b/homepage/footer.html
new file mode 100644
index 00000000..0afb85be
--- /dev/null
+++ b/homepage/footer.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+<title>HTML Frames Example - Footer</title>
+<style type="text/css">
+body {
+ font-family:verdana,arial,sans-serif;
+ font-size:medium;
+ margin:10px;
+ background-color:black;
+ color:white;
+ }
+a {
+ color:white;
+ }
+</style>
+</head>
+<body>
+<h3>External Services</h3>
+<p> <a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_top">Project Page</a> |
+ <a href="https://birdnetwiki.pmcgui.xyz" target="content">Wiki Help Page</a> |
+ <a href="http://birdnetpi.local/stream" target="footer">Live Audio Stream</a> |
+ <a href="http://birdnetpi.local/spectrogram.png" target="content">Realtime Spectrogram</a> |
+ <a href="external.html" target="content">Links to External Pages</a> |
+ <a href="https://www.accuweather.com" target="content">Weather</a> |
+ <a href="https://www.birds.cornell.edu" target="_content">The Cornell Lab of Ornitology</a>
+</p>
+</body>
+</html>
diff --git a/homepage/index.html b/homepage/index.html
new file mode 100644
index 00000000..5c6892a8
--- /dev/null
+++ b/homepage/index.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>BirdNET-Pi</title>
+</head>
+<!--
+Note the following:
+1. Each frame has it's own 'frame' tag.
+2. Each frame has a name (eg, name="menu"). This is used for when you need to load one frame from another. For example, your left frame might have links that, when clicked on, loads a new page in the right frame. This is acheived by using 'target="content"' within your links/anchor tags.
+3. Each 'frame' tag has a 'src' attribute. This is where you specify the name of the file to be loaded into that frame when the page first loads.
+4. You can change the size of the frames by changing the value of the 'cols' and/or 'rows' attribute. A value of "200" sets the frame at 200 pixels. An asterisk (*) specifies that the frame should use up whatever space is left over from the other frames. You can also use percentage values if desired (i.e. 20%,80%)
+5. To specify a border, set 'frameborder' and 'border' to "1". I included both attributes for maximum browser compatibility.
+6. The 'framespacing' attribute doesn't work in all browsers, but you can set any numeric value you like here.
+7. To learn more about HTML frames, check out: http://www.quackit.com/html/tutorial/html_frames.cfm
+-->
+<script type="text/javascript">
+ if (screen.width <= 699) {
+ document.location = "/mobile.html";
+ }
+</script>
+
+<frameset rows="100,*,100" frameborder="0" border="0" framespacing="0">
+ <frame name="topNav" src="top.html" scrolling="off">
+<frameset cols="150,*" frameborder="0" border="0" framespacing="0">
+ <frame name="menu" src="menu.html" marginheight="0" marginwidth="0" scrolling="auto" noresize>
+ <frame name="content" src="http://birdnetpi.local/viewdb.php" marginheight="0" marginwidth="0" scrolling="auto" noresize>
+</frameset>
+
+ <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>
+</noframes>
+
+</frameset>
+</html>
diff --git a/homepage/menu.html b/homepage/menu.html
new file mode 100644
index 00000000..52de33d3
--- /dev/null
+++ b/homepage/menu.html
@@ -0,0 +1,28 @@
+<html>
+<head>
+<title>HTML Frames Example - Menu</title>
+<style type="text/css">
+body {
+ font-family:verdana,arial,sans-serif;
+ font-size:medium;
+ margin:10px;
+ margin-bottom:50px;
+ background-color: rgb(119, 196, 135);
+ }
+ h4 {
+ margin: 15px 0px 0px 0px;
+ }
+</style>
+</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>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/>
+</body>
+</html>
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 00000000..5f9eaaea
--- /dev/null
+++ b/homepage/top.html
@@ -0,0 +1,36 @@
+<html>
+ <head>
+ <title>BirdNET-Pi</title>
+ <style type="text/css">
+body {
+ font-family:verdana,arial,sans-serif;
+ 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;
+ }
+ #content img {
+ position: absolute;
+ top: 0px;
+ right: 0px;
+ }
+
+ </style>
+ </head>
+ <body>
+ <div id="content">
+ <img src="images/bird.png" class="ribbon"/>
+ </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>
+ </p>
+ </body>
+</html>
diff --git a/scripts/dump_logs.sh b/scripts/dump_logs.sh
index 101e9676..bc11c8be 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"
-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 7dab9c0b..ffa83032 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 49512aff..00000000
--- 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 [email protected]
- sudo systemctl restart caddy
-}
-install_tmux
-install_web_terminal
diff --git a/scripts/restart_services.sh b/scripts/restart_services.sh
index f7677767..1cc4367a 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
-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 ed8fc6cb..9cd8ce50 100755
--- a/scripts/uninstall.sh
+++ b/scripts/uninstall.sh
@@ -45,30 +45,10 @@ uninstall.sh
update_species.sh
${HOME}/.gotty)
-
-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 708334aa..9ebbb43c 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 41075cfa..9b55c4c6 100644
--- a/scripts/viewdb.php
+++ b/scripts/viewdb.php
@@ -59,18 +59,17 @@ $mysqli->close();
<head>
<meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
<title>BirdNET-Pi DB</title>
<!-- CSS FOR STYLING THE PAGE -->
<style>
* {
box-sizing: border-box;
+ padding: 5px;
}
.row {
display: flex;
- margin-left:-5px;
- margin-right:-5px;
}
.column {
@@ -114,6 +113,7 @@ $mysqli->close();
border: 1px solid black;
padding: 10px;
text-align: center;
+ background-color: rgb(219, 296, 235);
}
@media screen and (max-width: 800px) {
@@ -166,7 +166,8 @@ $mysqli->close();
</style>
</head>
-<body>
+<body style="background-color: rgb(119, 196, 135);background-image: linear-gradient(to top, rgb(119, 196, 135),black;">
+
<section>
<h2>Number of Detections</h2>
<table>