#!/bin/bash # ".txt" extension was added to avoid possible security issues with downloading scripts. # Remove it before using. $ Run script with sh ./Sample-Test-Script-for-Los-Angeles.sh or by script name directly after # setting it to executable. # Simple script to grab signal level and SNR data from Hauppauge winTV dualHD for multiple stations # Each reading is saved in a time stamped file for additional processing by a Python program to # consolidate data into a csv file. Time stamp can be used to find location by logging GPS # coordinates and time using a smartphone GPS app to save waypoints or track location. # A dvb_channel.conf file created by dvbv5-scan is required. You can enter a stream name from the # file (must match exactly including trailing spaces) or just enter the RF channel # frequency matching a frequency in the dvb_channel.conf file. # Created by dlung@transmitter.com # Tune and grab tuner data then exit # Get date, time and time zone from system DT=$( date +'%Y%m%d.%H%M%S.%Z') # Set time in seconds for readings - default 4 seconds, increase if readings missed (slow tuner response) RT=4 # Duplicate and edit the four lines below here to add additional stations echo "Begin readings for KPXN" (dvbsnoop -s signal 2>&1 | tee $DT.kpxn-snr.txt) & (dvbv5-zap -I zap -c dvb_channel.conf "ION" -m -t $RT 2>&1 | tee $DT.kpxn-dBm.txt) echo "Readings for KPXN" sleep $RT kill -s kill $(ps aux | grep '[d]vbsnoop' | awk '{print $2}') echo -e "\n End KPXN readings" echo "Begin readings for KVEA" (dvbsnoop -s signal 2>&1 | tee $DT.kvea-snr.txt) & (dvbv5-zap -I zap -c dvb_channel.conf "KVEA" -m -t $RT 2>&1 | tee $DT.kvea-dBm.txt) echo "Readings for KVEA" sleep $RT kill -s kill $(ps aux | grep '[d]vbsnoop' | awk '{print $2}') echo -e "\n End KVEA25 readings" echo "Begin readings for KCET" (dvbsnoop -s signal 2>&1 | tee $DT.kcet-snr.txt) & (dvbv5-zap -I zap -c dvb_channel.conf "KCET HD" -m -t $RT 2>&1 | tee $DT.kcet-dBm.txt) echo "Readings for KCET" sleep $RT kill -s kill $(ps aux | grep '[d]vbsnoop' | awk '{print $2}') echo -e "\n End KCET readings" echo "Begin readings for KNBC" (dvbsnoop -s signal 2>&1 | tee $DT.knbc-snr.txt) & (dvbv5-zap -I zap -c dvb_channel.conf "NBC4-LA" -m -t $RT 2>&1 | tee $DT.knbc-dBm.txt) echo "Readings for KNBC" sleep $RT kill -s kill $(ps aux | grep '[d]vbsnoop' | awk '{print $2}') echo -e "\n End KNBC readings" # Add additional stations above this line # echo "Stop" # Play a tune to let the user know readings are finished (won't work on Raspberry Pi without a speaker) # paplay /usr/share/sounds/KDE-Sys-App-Message.ogg # Works for kubuntu # paplay /usr/share/sounds/Oxygen-Sys-App-Negative.ogg # Works for Arch exit