From 0493286d2ad9570e34bc30d665fa248d437bf15c Mon Sep 17 00:00:00 2001 From: Pascal Date: Fri, 5 Feb 2021 10:01:04 +0100 Subject: [PATCH] Another fix --- receive_meteor.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/receive_meteor.sh b/receive_meteor.sh index 89ea35f..f9553c2 100755 --- a/receive_meteor.sh +++ b/receive_meteor.sh @@ -1,4 +1,4 @@ - #!/bin/bash +#!/bin/bash ### Run as a normal user if [ $EUID -eq 0 ]; then @@ -11,6 +11,8 @@ fi . "$HOME/.tweepy.conf" . "$NOAA_HOME/common.sh" +log "starting $0" DEBUG + SYSTEM_MEMORY=$(free -m | awk '/^Mem:/{print $2}') if [ "$SYSTEM_MEMORY" -lt 2000 ]; then log "The system doesn't have enough space to store a Meteor pass on RAM" "INFO" @@ -48,7 +50,7 @@ log "Starting rtl_fm record for $1 at $2 to $3 at epoch $5" "INFO" log "timeout \"${6}\" /usr/local/bin/rtl_fm ${BIAS_TEE} -p $PPM_ERROR -M raw -f \"${2}\"M -E dc -s $pre_rate $GAIN | sox -t raw -r $pre_rate -c 2 -b 16 -e s - -t wav \"${RAMFS_AUDIO}/audio/${3}.wav\"" DEBUG timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -p $PPM_ERROR -M raw -f "${2}"M -E dc -s $pre_rate $GAIN | sox -t raw -r $pre_rate -c 2 -b 16 -e s - -t wav "${RAMFS_AUDIO}/audio/${3}.wav" #rate 96k -[ $1 = "METEOR-M2 2"] && demod_extra="-m opsk" +[[ $1 == "METEOR-M22" ]] && demod_extra="-m opsk" log "Demodulation in progress (QPSK) $demod_extra" "INFO" meteor_demod $demod_extra -B -o "${METEOR_OUTPUT}/${3}.qpsk" "${RAMFS_AUDIO}/audio/${3}.wav" 2>> $NOAA_LOG @@ -62,8 +64,8 @@ else rm "${RAMFS_AUDIO}/audio/${3}.wav" fi -log "Decoding in progress (QPSK to BMP)" "INFO" -[ $1 = "METEOR-M2 2"] && medet_extra="-diff" +log "Decoding in progress (QPSK to BMP)" INFO +[[ $1 == "METEOR-M22" ]] && medet_extra="-diff" medet $medet_extra "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}" -cd rm "${METEOR_OUTPUT}/${3}.qpsk"