Merge branch 'main' into ui-tweaks

This commit is contained in:
ehpersonal38
2022-05-16 13:33:06 -04:00
10 changed files with 71 additions and 21 deletions
+2 -2
View File
@@ -713,7 +713,7 @@ consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. Public License instead of this License.
============================================================================= =============================================================================
Caddy, ,Streamlit, and Adminer use the Apache License Version 2.0 Caddy, WiFi-Connect,Streamlit, and Adminer use the Apache License Version 2.0
============================================================================= =============================================================================
Apache License Apache License
Version 2.0, January 2004 Version 2.0, January 2004
@@ -918,7 +918,7 @@ Caddy, ,Streamlit, and Adminer use the Apache License Version 2.0
limitations under the License. limitations under the License.
============================================================================= =============================================================================
GoTTY and autoAP scripts use the MIT License GoTTY and Apprise Notifications use the MIT License
============================================================================= =============================================================================
MIT License MIT License
+9 -6
View File
@@ -21,6 +21,7 @@ Check out birds from around the world
- [Private Nature Garden, Grevenbroich, Germany](http://grevenbroich-elsen.birdnetpi.com)<br> - [Private Nature Garden, Grevenbroich, Germany](http://grevenbroich-elsen.birdnetpi.com)<br>
- [Norman, Oklahoma, United States](https://normanok.birdnetpi.com)<br> - [Norman, Oklahoma, United States](https://normanok.birdnetpi.com)<br>
- [Nijmegen, the Netherlands](https://nijmegen.birdnetpi.com)<br> - [Nijmegen, the Netherlands](https://nijmegen.birdnetpi.com)<br>
- [Murrysville, Pennsylvania, United States](https://murrysvillepa.birdnetpi.com/)
[Share your installation!!](https://github.com/mcguirepr89/BirdNET-Pi/wiki/Sharing-Your-BirdNET-Pi) [Share your installation!!](https://github.com/mcguirepr89/BirdNET-Pi/wiki/Sharing-Your-BirdNET-Pi)
@@ -53,7 +54,7 @@ Currently listening in these countries . . . that I know of . . .
* SQLite3 Database * SQLite3 Database
* Adminer database maintenance * Adminer database maintenance
* [phpSysInfo](https://github.com/phpsysinfo/phpsysinfo) * [phpSysInfo](https://github.com/phpsysinfo/phpsysinfo)
* New species mobile notifications from [Pushed.co](https://pushed.co/quick-start-guide) (for iOS users only) * [Apprise Notifications](https://github.com/caronc/apprise) supporting 70+ notification platforms
* Localization supported * Localization supported
## Requirements ## Requirements
@@ -90,10 +91,7 @@ Please take a look at the [wiki](https://github.com/mcguirepr89/BirdNET-Pi/wiki)
## Updating ## Updating
Since the change in RaspiOS that has discontinued the default `pi` user, the recommended update instructions for installations that _do_ have the default `pi` user: Use the web interface and go to "Tools" > "System Controls" > "Update." If you encounter any issues with that, or suspect that the update did not work for some reason, please save its output and post it in an issue where we can help.
1. Go to "Tools" > "Web Terminal"
2. Type ```git pull```
3. Go to "Tools" > "System Controls" > "Update" > "OK"
## Uninstallation ## Uninstallation
``` ```
@@ -107,7 +105,12 @@ Submit an issue or discussion.
Please join a Discussion!! and please join [BirdWeather!!](https://app.birdweather.com) Please join a Discussion!! and please join [BirdWeather!!](https://app.birdweather.com)
I hope that if you find BirdNET-Pi has been worth your time, you will share your setup, results, customizations, etc. [HERE](https://github.com/mcguirepr89/BirdNET-Pi/discussions/69) and will consider [making your installation public](https://github.com/mcguirepr89/BirdNET-Pi/wiki/Sharing-Your-BirdNET-Pi). I hope that if you find BirdNET-Pi has been worth your time, you will share your setup, results, customizations, etc. [HERE](https://github.com/mcguirepr89/BirdNET-Pi/discussions/69) and will consider [making your installation public](https://github.com/mcguirepr89/BirdNET-Pi/wiki/Sharing-Your-BirdNET-Pi).
## ToDo, Notes, and Coming Soon ## Project Links
- [Marie Lelouche's <i>Out of Spaces</i>](https://www.lestanneries.fr/exposition/marie-lelouche-out-of-spaces/) using BirdNET-Pi in post-sculpture VR! [Press Kit](https://github.com/mcguirepr89/BirdNET-Pi-assets/blob/main/dp_out_of_spaces_marie_lelouche_digital_05_01_22.pdf)
- [Research on noded BirdNET-Pi networks for farming](https://github.com/mcguirepr89/BirdNET-Pi-assets/blob/main/G23_Report_ModelBasedSysEngineering_FarmMarkBirdDetector_V1__Copy_.pdf)
- <ins>[Core-Electronics](https://core-electronics.com.au/projects/bird-calls-raspberry-pi)</ins> Build Article
### Internationalization: ### Internationalization:
The bird names are in English by default, but other localized versions are available thanks to the wonderful efforts of [@patlevin](https://github.com/patlevin). Use the web interface's "Tools" > "Settings" and select your "Database Language" to have the detections in your language. The bird names are in English by default, but other localized versions are available thanks to the wonderful efforts of [@patlevin](https://github.com/patlevin). Use the web interface's "Tools" > "Settings" and select your "Database Language" to have the detections in your language.
+3 -3
View File
@@ -33,8 +33,8 @@ if(isset($_GET['submit'])) {
if(isset($_GET["caddy_pwd"])) { if(isset($_GET["caddy_pwd"])) {
$caddy_pwd = $_GET["caddy_pwd"]; $caddy_pwd = $_GET["caddy_pwd"];
if(strcmp($caddy_pwd,$config['CADDY_PWD']) !== 0) { if(strcmp($caddy_pwd,$config['CADDY_PWD']) !== 0) {
$contents = preg_replace("/CADDY_PWD=.*/", "CADDY_PWD=$caddy_pwd", $contents); $contents = preg_replace("/CADDY_PWD=.*/", "CADDY_PWD=\"$caddy_pwd\"", $contents);
$contents2 = preg_replace("/CADDY_PWD=.*/", "CADDY_PWD=$caddy_pwd", $contents2); $contents2 = preg_replace("/CADDY_PWD=.*/", "CADDY_PWD=\"$caddy_pwd\"", $contents2);
$fh = fopen('/etc/birdnet/birdnet.conf', "w"); $fh = fopen('/etc/birdnet/birdnet.conf', "w");
$fh2 = fopen("./scripts/thisrun.txt", "w"); $fh2 = fopen("./scripts/thisrun.txt", "w");
fwrite($fh, $contents); fwrite($fh, $contents);
@@ -235,7 +235,7 @@ foreach($formats as $format){
<label for="caddy_pwd">Password: </label> <label for="caddy_pwd">Password: </label>
<input name="caddy_pwd" type="text" value="<?php print($newconfig['CADDY_PWD']);?>" /><br> <input name="caddy_pwd" type="text" value="<?php print($newconfig['CADDY_PWD']);?>" /><br>
<h3>Custom URL</h3> <h3>Custom URL</h3>
<p><a href="mailto:@gmail.com?subject=Request%20BirdNET-Pi%20Subdomain&body=<?php include('birdnetpi_request.php'); ?>" target="_blank">Email Me</a> if you would like a BirdNETPi.com subdomain. This would be, <i>https://YourLocation.birdnetpi.com</i></p> <p><a href="mailto:mcguirepr89@gmail.com?subject=Request%20BirdNET-Pi%20Subdomain&body=<?php include('birdnetpi_request.php'); ?>" target="_blank">Email Me</a> if you would like a BirdNETPi.com subdomain. This would be, <i>https://YourLocation.birdnetpi.com</i></p>
<p>When you update the URL below, the web server will reload, so be sure to wait at least 30 seconds and then go to your new URL.</p> <p>When you update the URL below, the web server will reload, so be sure to wait at least 30 seconds and then go to your new URL.</p>
<label for="birdnetpi_url">BirdNET-Pi URL: </label> <label for="birdnetpi_url">BirdNET-Pi URL: </label>
<input name="birdnetpi_url" type="url" value="<?php print($newconfig['BIRDNETPI_URL']);?>" /><br> <input name="birdnetpi_url" type="url" value="<?php print($newconfig['BIRDNETPI_URL']);?>" /><br>
+49 -2
View File
@@ -1,5 +1,5 @@
<?php <?php
error_reporting(E_ALL); error_reporting(E_ERROR);
ini_set('display_errors',1); ini_set('display_errors',1);
# Basic Settings # Basic Settings
@@ -21,6 +21,21 @@ if(isset($_GET['apprise_notify_each_species'])) {
exec('sudo systemctl stop pushed_notifications.service'); exec('sudo systemctl stop pushed_notifications.service');
} }
// logic for setting the date and time based on user inputs from the form below
if(isset($_GET['date']) && isset($_GET['time'])) {
// can't set the date manually if it's getting it from the internet, disable ntp
exec("sudo timedatectl set-ntp false");
exec("sudo date -s '".$_GET['date']." ".$_GET['time']."'");
} else {
// user checked 'use time from internet if available,' so make sure that's on
if(strlen(trim(exec("sudo timedatectl | grep \"NTP service: active\""))) == 0){
exec("sudo timedatectl set-ntp true");
sleep(3);
}
}
$contents = file_get_contents("/etc/birdnet/birdnet.conf"); $contents = file_get_contents("/etc/birdnet/birdnet.conf");
@@ -164,9 +179,41 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}
<option value="labels_uk.txt">Ukrainian</option> <option value="labels_uk.txt">Ukrainian</option>
</select> </select>
<br><br> <br><br>
<script>
function handleChange(checkbox) {
// this disables the input of manual date and time if the user wants to use the internet time
var date=document.getElementById("date");
var time=document.getElementById("time");
if(checkbox.checked) {
date.setAttribute("disabled", "disabled");
time.setAttribute("disabled", "disabled");
} else {
date.removeAttribute("disabled");
time.removeAttribute("disabled");
}
}
</script>
<?php
// if NTP service is active, show the checkboxes as checked, and disable the manual input
$tdc = trim(exec("sudo timedatectl | grep \"NTP service: active\""));
if (strlen($tdc) > 0) {
$checkedvalue = "checked";
$disabledvalue = "disabled";
} else {
$checkedvalue = "";
$disabledvalue = "";
}
?>
<label for="appt">Select a Date and Time:</label><br>
<span>If connected to the internet, retrieve time automatically?</span>
<input type="checkbox" onchange='handleChange(this)' name="apprise_notify_each_detection" <?php echo $checkedvalue; ?> ><br>
<input onclick="this.showPicker()" type="date" id="date" name="date" value="<?php echo date('Y-m-d') ?>" <?php echo $disabledvalue; ?>>
<input onclick="this.showPicker()" type="time" id="time" name="time" value="<?php echo date('H:i') ?>" <?php echo $disabledvalue; ?>>
<br><br><br>
<input type="hidden" name="status" value="success"> <input type="hidden" name="status" value="success">
<input type="hidden" name="submit" value="settings"> <input type="hidden" name="submit" value="settings">
<button onclick="if(Boolean(Number(<?php print($config['APPRISE_NOTIFY_EACH_DETECTION']); ?>)) != document.getElementsByName('apprise_notify_each_detection')[0].checked) type="submit" name="view" value="Settings"> <button type="submit" name="view" value="Settings">
<?php <?php
if(isset($_GET['status'])){ if(isset($_GET['status'])){
echo "Success!"; echo "Success!";
+3 -3
View File
@@ -116,11 +116,11 @@ for h in "${SCAN_DIRS[@]}";do
END=${RECORDING_LENGTH} END=${RECORDING_LENGTH}
fi fi
sox "${h}/${OLDFILE}" "${NEWSPECIES_BYDATE}/${NEWFILE}" \ sox -V1 "${h}/${OLDFILE}" "${NEWSPECIES_BYDATE}/${NEWFILE}" \
trim "${START}" "${END}" trim ="${START}" ="${END}"
# Create spectrogram for extraction # Create spectrogram for extraction
sox "${NEWSPECIES_BYDATE}/${NEWFILE}" -n remix 1 rate 24k spectrogram \ sox -V1 "${NEWSPECIES_BYDATE}/${NEWFILE}" -n remix 1 rate 24k spectrogram \
-t "${COMMON_NAME}" \ -t "${COMMON_NAME}" \
-c "${NEWSPECIES_BYDATE//$HOME\/}/${NEWFILE}" \ -c "${NEWSPECIES_BYDATE//$HOME\/}/${NEWFILE}" \
-o "${NEWSPECIES_BYDATE}/${NEWFILE}.png" -o "${NEWSPECIES_BYDATE}/${NEWFILE}.png"
+1 -1
View File
@@ -212,7 +212,7 @@ http://localhost http://$(hostname).local ${BIRDNETPI_URL} {
handle /Charts/* { handle /Charts/* {
file_server browse file_server browse
} }
basicauth views.php?view=File* { basicauth /views.php?view=File* {
birdnet ${HASHWORD} birdnet ${HASHWORD}
} }
basicauth /Processed* { basicauth /Processed* {
-1
View File
@@ -7,7 +7,6 @@ my_dir=$HOME/BirdNET-Pi/scripts
sudo systemctl stop birdnet_server.service sudo systemctl stop birdnet_server.service
sudo pkill server.py sudo pkill server.py
sudo systemctl stop birdnet_recording.service sudo systemctl stop birdnet_recording.service
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
services=(web_terminal.service services=(web_terminal.service
spectrogram_viewer.service spectrogram_viewer.service
pushed_notifications.service pushed_notifications.service
+1 -1
View File
@@ -3,4 +3,4 @@
source /etc/birdnet/birdnet.conf source /etc/birdnet/birdnet.conf
analyzing_now="$(cat $HOME/BirdNET-Pi/analyzing_now.txt)" analyzing_now="$(cat $HOME/BirdNET-Pi/analyzing_now.txt)"
spectrogram_png=${EXTRACTED}/spectrogram.png spectrogram_png=${EXTRACTED}/spectrogram.png
sox "${analyzing_now}" -n remix 1 rate 24k spectrogram -c "${analyzing_now//$HOME\/}" -o "${spectrogram_png}" sox -V1 "${analyzing_now}" -n remix 1 rate 24k spectrogram -c "${analyzing_now//$HOME\/}" -o "${spectrogram_png}"
+2 -1
View File
@@ -6,6 +6,7 @@ USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd) HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
my_dir=$HOME/BirdNET-Pi/scripts my_dir=$HOME/BirdNET-Pi/scripts
sudo -u$USER git -C $my_dir rm privacy_server.py
sudo -u${USER} git -C $my_dir stash sudo -u${USER} git -C $my_dir stash
sudo -u${USER} git -C $my_dir pull -f sudo -u${USER} git -C $my_dir pull -f
sudo systemctl daemon-reload sudo systemctl daemon-reload
@@ -14,4 +15,4 @@ sudo ln -sf $my_dir/* /usr/local/bin/
# The script below handles changes to the host system # The script below handles changes to the host system
# Any additions to the updater should be placed in that file. # Any additions to the updater should be placed in that file.
sudo $my_dir/update_birdnet_snippets.sh sudo $my_dir/update_birdnet_snippets.sh
+1 -1
View File
@@ -18,7 +18,7 @@ http://localhost http://$(hostname).local ${BIRDNETPI_URL} {
handle /Charts/* { handle /Charts/* {
file_server browse file_server browse
} }
basicauth views.php?view=File* { basicauth /views.php?view=File* {
birdnet ${HASHWORD} birdnet ${HASHWORD}
} }
basicauth /Processed* { basicauth /Processed* {