Remove led display script, clean up scripts, fix gitignore

This commit is contained in:
Satu Koskinen 2023-02-21 18:51:14 +02:00
parent 296e8c245b
commit 84caea8a96
7 changed files with 14 additions and 22 deletions

View File

@ -1,3 +1,3 @@
taget target
*.wav *.wav
recordings recordings

View File

@ -1,13 +0,0 @@
from rpi_lcd import LCD
from time import sleep
lcd = LCD(bus=2)
lcd.text('Hello World!', 1)
lcd.text('Raspberry Pi', 2)
lcd.text('is really', 3, 'center')
lcd.text('awesome', 4, 'right')
sleep(5)
lcd.clear()

View File

@ -29,5 +29,4 @@ if ! grep -q "$config" /etc/asound.conf; then
echo "$config" | sudo tee -a /etc/asound.conf echo "$config" | sudo tee -a /etc/asound.conf
fi fi
cd $HOME/hydrophonitor/audio-logger && cargo build --release cd $HOME/hydrophonitor/audio-logger && cargo build --release

View File

@ -3,12 +3,17 @@
set -ex set -ex
BOOT_DIR_PATH=/boot/hydrophonitor BOOT_DIR_PATH=/boot/hydrophonitor
LOG_FILE=$BOOT_DIR_PATH/$(date +"%Y-%m-%dT%H-%M-%S")-setup-log.txt
# Output from commands within the curly braces is written # Output from commands within the curly braces is written
# to a log file in $BOOT_DIR_PATH # to $LOG_FILE
{ {
DIR_PATH=$HOME DIR_PATH=$HOME
echo
echo "Starting setup, writing logs to $LOG_FILE"
echo
echo echo
echo "### Update file paths in config and start script files" echo "### Update file paths in config and start script files"
echo echo
@ -80,9 +85,9 @@ echo
echo "### Set up a cron job to start the recordings at boot" echo "### Set up a cron job to start the recordings at boot"
echo echo
# USER=$(whoami)
CRON_FILE=/etc/crontab CRON_FILE=/etc/crontab
CRON_COMMAND="@reboot root $DIR_PATH/hydrophonitor/scripts/start-all.sh 2>&1 > $BOOT_DIR_PATH/$(date +"%Y-%m-%dT%H-%M-%S")-log.txt" CRON_LOG_FILE="$BOOT_DIR_PATH/\$(date +\"%Y-%m-%dT%H-%M-%S\")-cron-log.txt"
CRON_COMMAND="@reboot root $DIR_PATH/hydrophonitor/scripts/start-all.sh 2>&1 > $CRON_LOG_FILE"
# Append command to cron file only if it's not there yet # Append command to cron file only if it's not there yet
if ! grep -q "$CRON_COMMAND" "$CRON_FILE"; then if ! grep -q "$CRON_COMMAND" "$CRON_FILE"; then
@ -93,4 +98,4 @@ fi
echo echo
echo "### Setup ready, run 'sudo reboot' to apply all changes" echo "### Setup ready, run 'sudo reboot' to apply all changes"
echo echo
} 2>&1 | sudo tee $BOOT_DIR_PATH/$(date +"%Y-%m-%dT%H-%M-%S")-setup-log.txt } 2>&1 | sudo tee $LOG_FILE

View File

@ -4,6 +4,7 @@
set -x set -x
BOOT_DIR_PATH=/boot/hydrophonitor BOOT_DIR_PATH=/boot/hydrophonitor
LOG_FILE=$BOOT_DIR_PATH/$(date +"%Y-%m-%dT%H-%M-%S")-startup-log.txt
{ {
SCRIPT_PATH=/home/pi/hydrophonitor/scripts SCRIPT_PATH=/home/pi/hydrophonitor/scripts
@ -20,4 +21,4 @@ mkdir -p "$OUTPUT_DIR"/audio
sleep 10 sleep 10
(export OUTPUT_DIR=$OUTPUT_DIR; $SCRIPT_PATH/start-audio.sh & $SCRIPT_PATH/start-gps.sh & $SCRIPT_PATH/start-pressure-depth.sh) 2>&1 | tee "$OUTPUT_DIR"/log.txt (export OUTPUT_DIR=$OUTPUT_DIR; $SCRIPT_PATH/start-audio.sh & $SCRIPT_PATH/start-gps.sh & $SCRIPT_PATH/start-pressure-depth.sh) 2>&1 | tee "$OUTPUT_DIR"/log.txt
} 2>&1 | tee $BOOT_DIR_PATH/$(date +"%Y-%m-%dT%H-%M-%S")-startup-log.txt } 2>&1 | tee $LOG_FILE