diff --git a/receive.sh b/receive.sh index 752b518..084e581 100755 --- a/receive.sh +++ b/receive.sh @@ -25,6 +25,7 @@ fi # $6 = Time to capture # $7 = Satellite max elevation +log "Starting rtl_fm record" "INFO" timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -f "${2}"M -s 60k -g 50 -p 55 -E wav -E deemp -F 9 - | /usr/bin/sox -t raw -e signed -c 1 -b 16 -r 60000 - "${NOAA_AUDIO}/audio/${3}.wav" rate 11025 if [ ! -d "{NOAA_OUTPUT}/image/${FOLDER_DATE}" ]; then @@ -37,12 +38,15 @@ else ENHANCEMENTS="ZA MCIR MCIR-precip" fi +log "Bulding pass map" "INFO" /usr/local/bin/wxmap -T "${1}" -H "${4}" -p 0 -l 0 -o "${PASS_START}" "${NOAA_HOME}/map/${3}-map.png" for i in $ENHANCEMENTS; do + log "Decoding image" "INFO" /usr/local/bin/wxtoimg -o -m "${NOAA_HOME}/map/${3}-map.png" -e "$i" "${NOAA_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-$i.jpg" /usr/bin/convert -quality 90 -format jpg "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-$i.jpg" -undercolor black -fill yellow -pointsize 18 -annotate +20+20 "${1} $i ${START_DATE}" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-$i.jpg" done if [ -n "$CONSUMER_KEY" ]; then + log "Posting to Twitter" "INFO" if [ "${SUN_ELEV}" -gt "${SUN_MIN_ELEV}" ]; then python3 "${NOAA_HOME}/post.py" "$1 ${START_DATE}" "$7" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-MCIR-precip.jpg" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-MSA-precip.jpg" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-HVC-precip.jpg" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/$3-HVCT-precip.jpg" else @@ -51,8 +55,9 @@ if [ -n "$CONSUMER_KEY" ]; then fi if [ "$DELETE_AUDIO" = true ]; then + log "Deleting audio files" "INFO" rm "${NOAA_AUDIO}/audio/${3}.wav" else - # Move the audio from the ram fs to the SD Card - mv "${NOAA_AUDIO}/audio/${3}.wav ${NOAA_OUTPUT}/audio/${3}.wav" + log "Moving audio files out of the SD card" "INFO" + mv "${NOAA_AUDIO}/audio/${3}.wav" "${NOAA_OUTPUT}/audio/${3}.wav" fi diff --git a/receive_meteor.sh b/receive_meteor.sh index 93031a8..f7a8cf9 100755 --- a/receive_meteor.sh +++ b/receive_meteor.sh @@ -34,11 +34,11 @@ timeout "${6}" /usr/local/bin/rtl_fm ${BIAS_TEE} -M raw -f "${2}"M -s 288k -g 48 log "Normalization in progress" "INFO" sox "${METEOR_OUTPUT}/audio/${3}.wav" "${METEOR_OUTPUT}/${3}.wav" gain -n - log "Demodulation in progress (QPSK)" "INFO" meteor_demod -B -o "${METEOR_OUTPUT}/${3}.qpsk" "${METEOR_OUTPUT}/${3}.wav" if [ "$DELETE_AUDIO" = true ]; then + log "Deleting audio files" "INFO" rm "${METEOR_OUTPUT}/audio/${3}.wav" rm "${METEOR_OUTPUT}/${3}.wav" fi @@ -55,6 +55,7 @@ if [ -f "${METEOR_OUTPUT}/${3}.dec" ]; then log "Rectifying image to adjust aspect ratio" "INFO" python3 "${NOAA_HOME}/rectify.py" "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-122.jpg" convert "${NOAA_OUTPUT}/image/${3}-122-rectified.jpg" -channel rgb -normalize "${NOAA_OUTPUT}/image/${3}-122-rectified.jpg" + log "Deleting base image files" "INFO" rm "${METEOR_OUTPUT}/${3}-122.bmp" rm "${METEOR_OUTPUT}/${3}.bmp" rm "${NOAA_OUTPUT}/image/${FOLDER_DATE}/${3}-122.jpg"