A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Latest News and Discussion about the use of the DATV transponder on Es'hail-2
Post Reply
AdrianH
Posts: 87
Joined: Thu Jul 18, 2019 2:46 pm

A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Post by AdrianH » Wed Apr 08, 2020 3:42 pm

I run Rob's M0DTS Live tune under 'mono' in Ubuntu 18.04 Linux to control a Win10 laptop running Minitioune. So I was very grateful for longmynd software as it gives me the possibility of keeping away from Windows when ever possible.

Further to this I have been looking at John's scripts published in CQ-TV266.
I initially had a lot of issues trying to copy the text from the pdf as it was transposed to the wrong characters, but eventually started to get it to work as I worked through the script with examples from the net.

Some of the options however I could never get top work properly, some packages on John's Jetson I did not have on mine such as xterm to allow for resizing of screens xdotool etc but installing was not a big thing.

I set about trying to understand and learn from the scripts and change things, then see what happened etc. I now have it such that a click on live tune sends longmynd to the correct frequency decodes it and displays a picture in totem, single click on another signal and it resets it all moves to the next frequency and displays that. There is no longer a reset option just an option to quit.

A few notes totem relies on codecs already installed on the pc, so if it does not decode everything you could try to install ubuntu-restricted-extras. Or, change the line from totem to vlc with a corresponding change in the quit script.

I have posted the two scripts below I could not attach them as files. 'auto' goes into home directory and 'quit' into the longmynd directory, You will need to run sudo chmod +x auto and sudo chmod +X quit to make them executable for them to run.

Thanks again to John for his work, have fun playing with the scripts and changing them to suit your own method of working, normally I have the line with totem rem'd out and the video streams are picked up by OBS top allow use in my transmit stream.

If you do not require the status from longmynd the use the line 'cat longmynd_main_status > /dev/null &' by removing the # and add # before the ./fake_read to stop that. I also run my streams to computer IP's to save flooding the home network with broadcasts.

Start with ./auto

auto:-

Code: Select all

#!/bin/bash
# Auto entry Freq & SR
clear
resize -s 12 80 # resize the screen to take up less space
cd ~/longmynd
gnome-terminal --geometry 31x6+0+0 -- ./quit & # Start routine to kill all
# Routine to read Live-tune
echo "Listening port 6789"
netcat -ul 6789 | while read line
do
killall -q longmynd fake_read totem
#cat longmynd_main_status > /dev/null &
echo “$line”
freq=$( awk -F "," '{print $2}' <<< $line | awk -F "=" '{print $2}' )
sr=$( awk -F "," '{print $5}' <<< $line | awk -F "=" '{print $2}' )
lnb_offset=$( awk -F "," '{print $3}' <<< $line | awk -F "=" '{print $2}' )
#echo “$freq”
#echo “$sr”
#echo “$lnb_offset”
# set frequency and symbolrate
freq2=$((freq - lnb_offset))
echo “Rx $freq with a symbolrate of $sr”
#sleep 0.5
# Start Rx process
./longmynd -i 192.168.1.40 20000 $freq2 $sr & # Start LongMynd
# cat longmynd_main_status > /dev/null &
./fake_read &
totem udp://0.0.0.0:20000/live &
clear
done

quit:-

Code: Select all

#!/bin/bash
while true; do
echo “Press Q to quit ? “ ;
read -n1 input;
if [ $input = q ] || [ $input = Q ]
then killall -q longmynd fake_read netcat auto totem # kill processes
printf "\n"
exit #close all terminal and end
else
echo “Invalid Option”
fi
printf "\n"
done
exit
These are just things to play with have fun.

Adrian

AdrianH
Posts: 87
Joined: Thu Jul 18, 2019 2:46 pm

Re: A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Post by AdrianH » Wed Aug 05, 2020 1:31 pm

Hello all.

I posted a recent question on the forum asking if anyone had a program to display the status messages from Longmynd. I was very pleased to get two responses from members. Brian G4EWJ and David G6GZH both offered solutions to the scrolling display of the ./fake_read.
Both are written in C.
Even though I am sure they wrote their software for their own computers and personal use, with help I was able to get them working on my own Ubuntu system with my limited knowledge. Therefore believe that either package could be incorporated in other Linux based DATV stations.

So this simple update to the scripts may help other Linux users (Ubuntu in my case) if they want to try something similar.

I still have in my home folder the script to start everything off './auto', and the longmynd directory the './quit' script both as mentioned in the previous post, but these are now modified as follows:-

This is the auto script in home directory

Code: Select all

#!/bin/bash
# Auto entry Freq & SR
resize -s 33 50 # resise the screen to take up less space
cd ~/longmynd
gnome-terminal --geometry 31x6+0+0 -- ./quit & # Start routine to kill all
clear
# Routine to read Quicktune
echo "Listening port 6789"

netcat -ul 6789 | while read line
do

killall -q longmynd fake_read totem	# standard killall rem out what is not used in the next few lines
killall -q lmdisplay-v1		# Brians C prog
killall -q status 		# Davids C prog
echo “$line”
freq=$( awk -F "," '{print $2}' <<< $line | awk -F "=" '{print $2}' )
sr=$( awk -F "," '{print $5}' <<< $line | awk -F "=" '{print $2}' )
lnb_offset=$( awk -F "," '{print $3}' <<< $line | awk -F "=" '{print $2}' )
#echo “$freq”		# Remove #'s to see frequencies from quicktune
#echo “$sr”
#echo “$lnb_offset”
# set frequency and symbolrate
freq2=$((freq - lnb_offset))
echo “Rx $freq with a symbolrate of $sr”
# Start Rx process
./longmynd -i 192.168.1.40 20000 $freq2 $sr & # Start LongMynd stream to pc port 20000

#  Options to be set.  Remove the leading # to activate 
# ----------------------------------------
#./fake_read &			          # The normal scrolling status display
# ----------------------------------------
#cat longmynd_main_status > /dev/null &   # This gives no status whatever
# ----------------------------------------
# This is for  Brians lmstatus-v1
#setterm -cursor off 			  # turn the curser off if wanted
#fifofile=longmynd_main_status
#if ! test -p $fifofile 
#then
#mkfifo $fifofile
#chmod 666 $fifofile
#fi
#./lmdisplay-v1 & 
# ----------------------------------------
# This is to use Davids status
~/longmynd-status-curses/status &
# ----------------------------------------
# Diplay option. Remove the leading # to activate, add # to 'rem' out if using as OBS media input
totem udp://0.0.0.0:20000/Dell &	  # This gives a local display could also use vlc
done
And this is the quit script in the longmynd directory:-

Code: Select all

#!/bin/bash
while true; do
echo “Press Q to quit ? “ ;
read -n1 input;
if [ $input = q ] || [ $input = Q ]
then killall -q longmynd fake_read netcat auto totem lmdisplay-v1 status # kill processes
printf "\n"
exit #close all terminal and end
else
echo “Invalid Option”
fi
printf "\n"
done
exit
A few things to remember. make sure that the scripts are executable by using chmod +x

You may need to install extra packages in Ubuntu if not already installed, for example:-
sudo apt install gnome-terminal
sudo apt install libncuses5-dev This is required for Davids software.

This is an example of Brian's status output:-
Brians.png
Brians.png (424.83 KiB) Viewed 8059 times
This is an example of Davids status output:-
Davids.png
Davids.png (236.94 KiB) Viewed 8059 times
Both pictures are using output from Totem a Linux based video player, it could be set to VLC by changing the totem line to vlc udp://@0.0.0.0:2000 also assuming you have the extra codecs installed in Linux to display some video formats. Timing for me is typically less than 4 seconds from clicking on a signal in Quicktune to a picture being displayed on screen.

Remember to edit the auto files as required depending on which package you prefer. Note that as it is, the quit file will kill all.

Davids software can be found at https://github.com/dbrooke/longmynd-status-curses.git

Brian has said he will post his software on the site if there is interest

Lastly please note, I am not a programmer, but a poke and hope merchant, I keep trying until stuff works, so the script is probably not very elegant and could be greatly improved and I am very grateful to all that has helped my get my station working.

Thanks to :-
Heather M0HMO for the Longmynd software.
Phil Crump M0DNY for assisting me with the rules under Linux.
Rob M0DTS for Quicktune.
John G7JTT for the scripts to set me on this route.
Brian G4EWJ and David G6GZH for these status routines.
and many others I am sure I would have forgotten to mention.

Have fun, be safe.

Adrian

G7JTT
Posts: 338
Joined: Fri Jun 10, 2016 5:05 pm

Re: A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Post by G7JTT » Wed Aug 05, 2020 2:17 pm

Excellent work Adrian, I now have a dropdown status window that's translucent. To achieve this I use guake I'll try and post some details over the next few days. I also use an alternative to fake read that Rob M0DTS wrote. You can see how this looks In this tweet (sorry can't post pictures via my phone)

https://twitter.com/G7Jtt/status/129000 ... 65056?s=19

Ok better get back to work all best John

AdrianH
Posts: 87
Joined: Thu Jul 18, 2019 2:46 pm

Re: A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Post by AdrianH » Wed Aug 05, 2020 7:42 pm

Interesting John look forward to obtaining more information.


Adrian

AdrianH
Posts: 87
Joined: Thu Jul 18, 2019 2:46 pm

Re: A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Post by AdrianH » Wed Aug 05, 2020 8:28 pm

Just doing an update on another computer to install Ubuntu 20.04 LTS.

So I thought it worthwhile listing extra packages I had to install as well as the standard full desktop installation to get Longmynd and the above working.

Code: Select all

sudo apt install git                           # This is to copy the files and directories from github
sudo apt install libusb-1.0-0-dev       # This is already mentioned in installing Longmynd
sudo apt install libasound2-dev         # Installed to remove a compilation error ALSA
sudo apt install gnome-terminal        # Required for me in Ubuntu 18.04 but appears to be already installed in 20.04
sudo apt install xterm                       # This is to allow the resizing of the terminal window
sudo apt install libncurses5-dev         # This is required for Davids status package
To install mono, I followed the instructions on this page here:-
https://linuxize.com/post/how-to-instal ... ntu-20-04/
Mono is required so I can run Rob's Windows Quick-tune under Linux, unless someone can tell me a better way of doing it?

Adrian

AdrianH
Posts: 87
Joined: Thu Jul 18, 2019 2:46 pm

Re: A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Post by AdrianH » Thu Aug 06, 2020 7:57 pm

Just an update to say that Ubuntu 20 is a bit poorly at this end, looks like I am having an issue with ncurses displaying in console. If that is the correct term to use?

Adrian

AdrianH
Posts: 87
Joined: Thu Jul 18, 2019 2:46 pm

Re: A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Post by AdrianH » Thu Sep 10, 2020 12:05 pm

A final comment on the scripts I use, All issues are now resolved with my Ubuntu 20, it required a change in Davids status.c and this was only because I used a reduced window size for my terminal windows.

Adrian

AdrianH
Posts: 87
Joined: Thu Jul 18, 2019 2:46 pm

Re: A slight rework of Johns G7JTT scripts for longmynd (Ubuntu)

Post by AdrianH » Thu Dec 24, 2020 1:53 am

Another update to the scripts I use and again a reminder that this was all initially down to John and his hard work.

I use the Pluto SDR with F5OEO firmware to provide the transmit side of QO-100 DATV, and up to now have not been able to use the Pluto Controller spectrum display to drive the Minitiouner to the correct signal. It just would not work with the script, so I stuck with Robs excellent quick-tune.
Well after noticing anther version of F5OEO firmware today I thought I would try again and do some more digging around.

The line in the script responsible for reading the spectrum message into the variable 'line' is: -

Code: Select all

netcat -ul 6789 | while read line
So using

Code: Select all

netcat -ul 6789
in command line showed it would read once, then never again, reading the help file and going through options I tried: -

Code: Select all

netcat -ulk 6789
this kept the connection open after a message and allowed me to see more information.
Rob's software would provide me with the format of each message on a new line, where as Chris's F5UII spectrum software would put the messages one after the other without a New Line.

So a request to Chris and a patch to apply later, and it now adds a Carriage Return to the end of the message. Back to the original script and try again.

It now reads the first 'spectrum click' and shifts to a signal but would not repeat. Then in a moment of light I changed the scrip line to: -

Code: Select all

netcat -ulk 6789 | while read line
keeping the socket open between messages and it works as expected.

This is only a guess, that Rob's Quick-tune keeps the socket open for the duration of the program whilst the Pluto controller opens and closes on each message.

Whatever, it now works for me and if any other user is trying to use Longmynd under Linux on a standard PC and requires the patch it is on F5OEO's page https://www.f5uii.net/en/patch-plutodvb/ under the comments section.

Adrian

Post Reply

Return to “Es’hail-2 - DATV Transponder”