diff --git a/Birders_Guide_Installer.sh b/Birders_Guide_Installer.sh index 6d102db..a50a378 100755 --- a/Birders_Guide_Installer.sh +++ b/Birders_Guide_Installer.sh @@ -3,7 +3,7 @@ set -e USER=pi HOME=/home/pi my_dir=${HOME}/BirdNET-Pi -branch=main +branch=bullseye trap '${my_dir}/scripts/dump_logs.sh && exit' EXIT SIGHUP SIGINT if [ "$(uname -m)" != "aarch64" ];then diff --git a/newinstaller.sh b/newinstaller.sh index 81adc8c..945ff7f 100644 --- a/newinstaller.sh +++ b/newinstaller.sh @@ -2,7 +2,7 @@ # Simple new installer HOME=/home/pi USER=pi -branch=main +branch=bullseye sudo apt update if ! which git &> /dev/null;then sudo apt -y install git @@ -10,6 +10,6 @@ fi git clone -b ${branch} https://github.com/mcguirepr89/BirdNET-Pi.git ${HOME}/BirdNET-Pi echo 'Now, run the following script - sudo -E ${HOME}/BirdNET-Pi/scripts/birdnet-pi-config + /home/pi/BirdNET-Pi/scripts/birdnet-pi-config ' diff --git a/scripts/birdnet-pi-config b/scripts/birdnet-pi-config index 2560b51..dd0720f 100755 --- a/scripts/birdnet-pi-config +++ b/scripts/birdnet-pi-config @@ -7,7 +7,7 @@ #set -x birdnetpi_dir=/home/pi/BirdNET-Pi birders_config=${birdnetpi_dir}/Birders_Guide_Installer_Configuration.txt -branch=main +branch=bullseye INTERACTIVE=True ASK_TO_REBOOT=0 BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf diff --git a/scripts/install_birdnet.sh b/scripts/install_birdnet.sh index ef1af1f..d4624d6 100755 --- a/scripts/install_birdnet.sh +++ b/scripts/install_birdnet.sh @@ -52,16 +52,21 @@ install_birdnet() { source ./birdnet/bin/activate echo "Upgrading pip, wheel, and setuptools" pip3 install --upgrade pip wheel setuptools - if [ ! -f $(dirname ${my_dir})/tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl ];then - echo "Fetching the TFLite pre-built binaries" - TFLITE_URL="https://drive.google.com/uc?export=download&id=1dlEbugFDJXs-YDBCUC6WjADVtIttWxZA" - curl -c /tmp/cookie ${TFLITE_URL} - CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)" - TF_COOKIE="https://drive.google.com/uc?export=download&confirm=${CODE}&id=1dlEbugFDJXs-YDBCUC6WjADVtIttWxZA" - curl -Lb /tmp/cookie ${TF_COOKIE} -o tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl - fi + + python_version="$(awk -F. '{print $2}' <(ls -l $(which python3)))" + # TFLite Pre-built binaires from https://github.com/PINTO0309/TensorflowLite-bin + # Python 3.7 + if [ "$python_version" -eq 7 ];then echo "Installing the TFLite bin wheel" pip3 install --upgrade tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl + fi + + # Python 3.9 + if [ "$python_version" -eq 9 ];then + echo "Installing the TFLite bin wheel" + pip3 install --upgrade tflite_runtime-2.6.0-cp39-none-linux_aarch64.whl + fi + echo "Installing colorama==0.4.4" pip3 install colorama==0.4.4 echo "Installing librosa" diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 0797bd2..7d7609e 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -210,6 +210,7 @@ install_Caddyfile() { cp /etc/caddy/Caddyfile{,.original} fi HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD}) + php_version="$(awk -F. '{print $2}' <(ls -l $(which /etc/alternatives/php)))" cat << EOF > /etc/caddy/Caddyfile http://localhost http://birdnetpi.local ${BIRDNETPI_URL} { root * ${EXTRACTED} @@ -227,7 +228,7 @@ http://localhost http://birdnetpi.local ${BIRDNETPI_URL} { birdnet ${HASHWORD} } reverse_proxy /stream localhost:8000 - php_fastcgi unix//run/php/php7.3-fpm.sock + php_fastcgi unix//run/php/php7.${php_version}-fpm.sock } EOF if [ ! -z ${EXTRACTIONLOG_URL} ];then @@ -352,16 +353,16 @@ install_sox() { } install_php() { - if ! which php &> /dev/null || ! which php-fpm7.3 || ! apt list --installed | grep php-xml;then + if ! which php &> /dev/null || ! which php-fpm || ! apt list --installed | grep php-xml;then echo "Installing PHP modules" apt -qq update - apt install -qqy php php-fpm php7.3-mysql php-xml + apt install -qqy php php-fpm php-mysql php-xml else echo "PHP and PHP-FPM installed" fi echo "Configuring PHP for Caddy" - sed -i 's/www-data/caddy/g' /etc/php/7.3/fpm/pool.d/www.conf - systemctl restart php7.3-fpm.service + sed -i 's/www-data/caddy/g' /etc/php/*/fpm/pool.d/www.conf + systemctl restart php7\*-fpm.service echo "Adding Caddy sudoers rule" cat << EOF > /etc/sudoers.d/010_caddy-nopasswd caddy ALL=(ALL) NOPASSWD: ALL diff --git a/tflite_runtime-2.6.0-cp39-none-linux_aarch64.whl b/tflite_runtime-2.6.0-cp39-none-linux_aarch64.whl new file mode 100644 index 0000000..cec87e2 Binary files /dev/null and b/tflite_runtime-2.6.0-cp39-none-linux_aarch64.whl differ