Script tuner snr+rssi

In this period of plenty of time, with the help of my nephew, I wrote down a very rough little script to read the snr and rssi values from the D.C. 03 tuner, I hope it helps in pointing the antenna (LNB)

The script, which I called signal.sh, can be loaded onto the D.C. knowing that if you turn off the receiver the file will be deleted. Better to put it on the secondary SD.

Copy the file from the forum ( next post), open an ssh session ( I use Putty in windows OS ) to your D.C, you need to know the IP address, authenticate and type an ls command, just to see what’s in the directory.

Type vi signal.sh and send.

paste the file, reread well that everything is correct,

press esc

then :wq ( you have saved and you have exited the vi program.)

give file permissions with chmod 711 signal.sh

Now ls -l , again to see if the file is correctly saved and got the permissions
(-rwx–x--x)

Type ./signal.sh IP

IP is 127.0.0.1 if you are running from D.C. but can be the IP of the receiver, you use in browser ,if you put this script in a different machine ( with LINUX) on the same net.

The option ./signal.sh 127.0.0.1 s ( the letter sierra, soul, S) slow the program a little bit and you can quit with “q” otherwise
use control C to end the program. ( I told was rough).

Hope everything work, now in the terminal the 2 numbers run down.

I will put some photos to explain how to change the size of the text with Putty but you can find your way if use a different terminal.

For all the folks linux addicted I beg your pardon.

#!/bin/sh

clear

curl -s -c cookie.txt -X POST http://$1/login -d ‘{username: “guest”, password: “guest”}’

while true; do
json=curl -s -b cookie.txt -X POST http://$1/API/application -d '{"application":"ApplicationTuner","path":"skylark/Tuner","method":"getOnddStatus2","arguments":null}'

snr=echo $json | awk -F: '{print $10'} | awk -F, '{print $1}'
rssi=echo $json | awk -F: '{print $11'} | awk -F, '{print $1}'

echo -en “\e[32m” $snr $rssi “\033[0K\r”

if test “$2” = ‘s’; then
sleep 0.5
else
read -n 1 -t 1 input
if test “$input” = “q”; then
break
fi
fi
done
rm -f cookie.txt

looks promising… but can you debug what I did wrong ?

try to change the echo line with:

echo -e “\033[1K”
echo $snr $rssi

./signal.sh 127.0.0.1

just to remember that if you have not signal from antenna at all, blank page on the othernet page, this will not show any numbers.
This is made to read the values once you got the satellite and have at least some indication on that page ( what I said??)

I am having issues with the keyboard characters for the single and double quote characters to make the script work… my ansi keyboard doesn’t support all of them, cut and paste is causing problems…

try only the complete command ./signal.sh 127.0.0.1

in the previus post you miss the IP address

awesome! bless you! :slight_smile:
hope i helped this along in some way…

i see the problem with a few lines: the quote chars got replaced with something UTF-8-ish which are not the plain ol’ ASCII “”" chars. every single and double quote char you see is suspect. a quick fix with vi and you’re done.

also: the variables ‘json’ ‘rssi’ and ‘snr’ do not have the proper
enclosing dollar-char lparen … rparen --> $( … )
this is the preferred construction rather than use backquote chars (which got eaten by this forum’s editor, it seems)

as in:
rssi=$(echo $json | awk -F: ‘{print $11’} | awk -F, ‘{print $1}’)

1 Like

here’s the “debugged” script:

#!/bin/sh

clear

curl -s -c cookie.txt -X POST http://$1/login -d '{username: "guest", password: "guest"}'

while true; do
json=$(curl -s -b cookie.txt -X POST http://$1/API/application -d '{"application":"ApplicationTuner","path":"skylark/Tu
ner","method":"getOnddStatus2","arguments":null}')

snr=$(echo $json | awk -F: '{print $10'} | awk -F, '{print $1}')
rssi=$(echo $json | awk -F: '{print $11'} | awk -F, '{print $1}')

echo -en "\e[32m" $snr $rssi "\033[0K\r"

if test "$2" = 's'; then
sleep 0.5
else
read -n 1 -t 1 input
if test "$input" = 'q'; then
break
fi
fi
done
rm -f cookie.txt
2 Likes

this ‘debugged’ worked for a cut and paste into the vi editor on my dreamcatcher.
(using the windows 10 default clipboard)

thanks… my ‘colors’ doesn’t seem to accept the changes on my terminal… but that is ok.
I modified the echo to display in green \033[0;32m and red \033[0;31m and reset \033[0m

echo  -n 'Type letter q to quit'
echo -en "\033[0;32m" 'SNR= ' $snr "\033[0;31m" 'RSSI= ' $rssi "\033[0m\r"

Nice, i told was rough. Thank for your time and the work on this script.
Copy and paste left always something on the ipergalattic world
Thanks , now if is possible to draw a line ( or a caracter like X) that show the number in a graphic way and find the way to put it in a stable way in the othernet directory this script can help a little bit to point lnb .
P.S. I miss a # in front at else read -n 1 ecc… was a choice to stop with q or not.

Thank for the mod. The color are not necessary , was an experiment. The idea was to change the color on a high or low level ( red work to find a better signal, green ok in the range).
Hope it help when you are near the LNB , far from D.C and show the intensity on a portable pc.

finally the numbers on a line only, no scroll. Well done.tnx