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
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
fi
cd $HOME/hydrophonitor/audio-logger && cargo build --release

View File

@ -3,12 +3,17 @@
set -ex
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
# to a log file in $BOOT_DIR_PATH
# to $LOG_FILE
{
DIR_PATH=$HOME
echo
echo "Starting setup, writing logs to $LOG_FILE"
echo
echo
echo "### Update file paths in config and start script files"
echo
@ -80,9 +85,9 @@ echo
echo "### Set up a cron job to start the recordings at boot"
echo
# USER=$(whoami)
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
if ! grep -q "$CRON_COMMAND" "$CRON_FILE"; then
@ -93,4 +98,4 @@ fi
echo
echo "### Setup ready, run 'sudo reboot' to apply all changes"
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
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
@ -20,4 +21,4 @@ mkdir -p "$OUTPUT_DIR"/audio
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
} 2>&1 | tee $BOOT_DIR_PATH/$(date +"%Y-%m-%dT%H-%M-%S")-startup-log.txt
} 2>&1 | tee $LOG_FILE