Skip to content

A live bird collage card for your Home Assistant dashboard.

avoid running out of space on Pi Zero

frederik5ef3b71d7d03
diff --git a/scripts/install_birdnet.sh b/scripts/install_birdnet.sh
index 16a97cb4..08e55878 100755
--- a/scripts/install_birdnet.sh
+++ b/scripts/install_birdnet.sh
@@ -25,6 +25,11 @@ sudo -E HOME=$HOME USER=$USER ./install_services.sh || exit 1
source /etc/birdnet/birdnet.conf
install_birdnet() {
+ TMP_SIZE=$(df --output=avail /tmp | tail -n 1)
+ if [[ $TMP_SIZE -lt 300000 ]]; then
+ mkdir -p $HOME/bird_tmp
+ export TMPDIR=$HOME/bird_tmp
+ fi
cd ~/BirdNET-Pi || exit 1
echo "Establishing a python virtual environment"
python3 -m venv birdnet
@@ -39,6 +44,7 @@ install_birdnet() {
[ $LOOP_COUNT == 0 ] && exit 1
sleep 5
done
+ [ -d $HOME/bird_tmp ] && rm -rf $HOME/bird_tmp
}
[ -d ${RECS_DIR} ] || mkdir -p ${RECS_DIR} &> /dev/null