Merge branch 'mcguirepr89:main' into main
This commit is contained in:
+2
-2
@@ -8,9 +8,9 @@ pytz
|
|||||||
tzlocal
|
tzlocal
|
||||||
pandas
|
pandas
|
||||||
seaborn
|
seaborn
|
||||||
streamlit
|
streamlit==1.11.1
|
||||||
plotly
|
plotly
|
||||||
apprise
|
apprise==1.2.1
|
||||||
paho-mqtt
|
paho-mqtt
|
||||||
pytest==7.1.2
|
pytest==7.1.2
|
||||||
pytest-mock==3.7.0
|
pytest-mock==3.7.0
|
||||||
|
|||||||
@@ -7,6 +7,20 @@ trap 'exit 1' SIGINT SIGHUP
|
|||||||
echo "Beginning $0"
|
echo "Beginning $0"
|
||||||
birdnet_conf=$my_dir/birdnet.conf
|
birdnet_conf=$my_dir/birdnet.conf
|
||||||
|
|
||||||
|
# Retrieve latitude and longitude from web
|
||||||
|
LATITUDE=$(curl -s4 http://ip-api.com/json?fields=lat,lon | jq .lat)
|
||||||
|
LONGITUDE=$(curl -s4 http://ip-api.com/json?fields=lat,lon | jq .lon)
|
||||||
|
|
||||||
|
# Define regular expression pattern
|
||||||
|
pattern='^[+-]?[0-9]{2}\.[0-9]{4}$'
|
||||||
|
|
||||||
|
# Check if latitude and longitude match the pattern
|
||||||
|
if ! [[ $LATITUDE =~ $pattern ]] || ! [[ $LONGITUDE =~ $pattern ]]; then
|
||||||
|
echo -e "\033[33mCouldn't set latitude and longitude automatically, you will need to do this manually from the web interface by navigating to Tools -> Settings -> Location.\033[0m"
|
||||||
|
LATITUDE=0.0000
|
||||||
|
LONGITUDE=0.0000
|
||||||
|
fi
|
||||||
|
|
||||||
install_config() {
|
install_config() {
|
||||||
cat << EOF > $birdnet_conf
|
cat << EOF > $birdnet_conf
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -24,8 +38,8 @@ SITE_NAME="$HOSTNAME"
|
|||||||
## Please only go to 4 decimal places. Example:43.3984
|
## Please only go to 4 decimal places. Example:43.3984
|
||||||
|
|
||||||
|
|
||||||
LATITUDE=$(curl -s4 ifconfig.co/json | jq .latitude)
|
LATITUDE=$LATITUDE
|
||||||
LONGITUDE=$(curl -s4 ifconfig.co/json | jq .longitude)
|
LONGITUDE=$LONGITUDE
|
||||||
|
|
||||||
#--------------------------------- Model --------------------------------------#
|
#--------------------------------- Model --------------------------------------#
|
||||||
#_____________The variable below configures which BirdNET model is_____________#
|
#_____________The variable below configures which BirdNET model is_____________#
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ CREATE INDEX IF NOT EXISTS "detections_Date_Time" ON "detections" ("Date" DESC,
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
$HOME/BirdNET-Pi/birdnet/bin/pip3 install apprise==1.2.1 >/dev/null
|
$HOME/BirdNET-Pi/birdnet/bin/pip3 install apprise==1.2.1 >/dev/null
|
||||||
|
$HOME/BirdNET-Pi/birdnet/bin/pip3 install streamlit==1.11.1 >/dev/null
|
||||||
|
|
||||||
if ! grep -q 'RuntimeMaxSec=' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"&>/dev/null; then
|
if ! grep -q 'RuntimeMaxSec=' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"&>/dev/null; then
|
||||||
sudo -E sed -i '/\[Service\]/a RuntimeMaxSec=3600' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"
|
sudo -E sed -i '/\[Service\]/a RuntimeMaxSec=3600' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ if(isset($_GET['ascii'])) {
|
|||||||
$priorweekcount = $totalcount['COUNT(*)'];
|
$priorweekcount = $totalcount['COUNT(*)'];
|
||||||
|
|
||||||
// really percent changed
|
// really percent changed
|
||||||
|
if($priorweekcount > 0){
|
||||||
$percentagediff = round( (($scount - $priorweekcount) / $priorweekcount) * 100 );
|
$percentagediff = round( (($scount - $priorweekcount) / $priorweekcount) * 100 );
|
||||||
|
|
||||||
if($percentagediff > 0) {
|
if($percentagediff > 0) {
|
||||||
@@ -109,6 +110,9 @@ if(isset($_GET['ascii'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo $com_name." - ".$scount." (".$percentagediff.")<br>";
|
echo $com_name." - ".$scount." (".$percentagediff.")<br>";
|
||||||
|
} else {
|
||||||
|
echo $com_name." - ".$scount ."<br>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user