Skip to content

Commit

Permalink
listener: check system date with NTP if old year
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow committed Jan 30, 2024
1 parent 0afc89c commit c35a35f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/porcupine/config/launcher
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ set_volume(){
done
}

check_date(){
YEAR=2024
COUNT=0
until [ "$COUNT" -ge 5 ]; do
if [ "`date +%Y`" -ge "$YEAR" ]; then
log "all good"
break
fi
log "updating time - times $COUNT"
ntpd -q -p pool.ntp.org
sleep 4
let COUNT=COUNT+1
done
}

get_stt_settings(){
#echo "start $(date)"
cleanup
Expand Down Expand Up @@ -109,11 +124,16 @@ if [ "${MODEL}" = "LX06" ]; then
RECORDING_CHANNEL=8
fi

log "check date for valid TLS"
check_date
log "getting stt settings"
get_stt_settings
log "ready"
cleanup

# clear mute LED
/bin/shut_led 7

while true; do

# program lib model keyword sensitivity ALSA_INPUT
Expand Down

0 comments on commit c35a35f

Please sign in to comment.