Grafische interface voor LEANDVB
Grafische Interface voor LEANSDR V5.0
[Originele link naar LEANSDR http://www.pabr.org/radio/leandvb/leandvb.en.html]
Schermafbeelding Python Script
Update September 2019: DVBS2 added to the User-interface. LEANDVB capability to decode DVBS-2 was added and therefore the necessary changes were implemented in this latest Wrapper for LeanDVB. This python script is depending on the leandvb software which needs to be compiled first. Once succesfully compiled this script can be copied in your home directory. Also copy "logo.png" Media:Logo_lean.png (please rename the logo_lean to logon.png) and lean_stop script in your home directory. Functional description, you can start the script by typing "python lean18.py" ( without the quotes ). The script will setup default paramaters suitable for DVBS2. In the same command shell the program and also Leandvb writes messages, in case of start up problems please read the messages. First thin is to goto settings and please fill in the path where the script can find leansdr and ldcp_tool. As a start you can keep the defaults. Later you can tweak parameters for example the gain or the specific DVBS2 parameters. The purpose of these parameters can be found on the website of Leandvb. Here you find what is Inpipe, RRC reject filters and roll off factors. This script only will pass these settings on when leandvb needs to be started. Python script will write a file in your home directory called "leanlastrun" and is used to keep the configuration when the program was used. What the python script is doing is to read all the settings and create a small shell script with the parameters needed to decode DVBS or DVBS2 and then it is executed. The shell file which is created is called "runlean". It is an open file which you can investigate what parameters is being given to leandvb. Once leandvb is running and can decode the stream then is it piped to "ffplay". It is a very fast program to show the video. If you click on "stop" then the script will close ffplay and leandvb. Then you have the possibility to select other settings ( for xample another frequency ) and hit start again and so on. Prerequite is LEANDVB with DVBS2 capabilities compiled, then FFPLAY , and Python. In order to show the logo you have to run "sudo apt-get install python-imaging-tk. You can create your own logo to be displayed, just create a png file of approx 180x180 pixels and then copy the file logo.png in your home directory. The Python script is open and can be changed to your own needs. motivation to extend this python script with DVBS-2 was due to the launch of Oscar-100, a radio amateur transponder with WideBand DATV frequency space. This can be received by leandvb and an RTL dongle. Also thanks to Nico (ON7NDR) for his testing and recommendations, he tested directly with stations on Oscar-100. You can copy paste the script below in a file, then name it lean18.py , save it in your home directory. Then type "chmod +x lean18.py" (without the quotes) then you can run it from a command shell by typing ./lean18.py. Or you can type "python lean18.py". PS the name is not important, you can name it what you like. In case you would to receive a zip file with the content please let me know by mail pe2jko@pg540.org and will send you a zip file. Note : In order to install and work with leandvb and this wrapper a reasonable knowledge of Linux is required. Please see below some pictures of succesfull received stations from Eshail-2 Oscar-100. Thanks to Nico !
Uitgebreide Installatie instructies LEANDVB en LEANDVB Interface van Nico ON7NDR Hierbij de zeer uitgebreide installatie instructies inclusief illustraties en schermafbeeldingen. Prachtig stukje werk ! --> Deel 1, Leandvb installatie --> Deel 2 grafisch interface installatie
Update Oktober 2017: Toegevoegd LimeSDR frontend. Keuze nu uit RTL-SDR of LimeSDR input. Dankzij de aanpassing van de maker van LEANSDR om 16 bit int´s te ondersteunen maakt het mogelijk om ook andere SDR radios te gebruiken. In combinatie met voorbeeldsource van LimeSuite ( BasicRX.cpp ) was het makkelijk om de LimeSDR te gebruiken als front-end. Ik heb in de settings nu een keuze mogelijkheid of je met de RTL of de Lime wilt ontvangen, als je de lime kiest kun je antenne input, bandbreedte en gain instellen. De IQ samples worden naar een pipe geschreven en Leandvb neemt die pipe als input data. Source beschikbaar als je ermee wilt werken. Testen met hoge samplerates zijn nog niet gedaan, alle sample rates van 2000 KS/s tot aan 150 Ks/s werken prima. Op deze manier wordt het mogelijk om op 13cm en 9cm ook DATV te ontvangen.
Motivatie: LEANDVB is eigenlijk geschreven om de ISS te volgen en een DVB-S opname te maken zodra hij binnen bereik komt met behulp van een RTL SDR dongle. Software wordt aangestuurd door parameters op de command line. Om eenvoudiger het programma te kunnen gebruiken heb ik er een Python script omheen gemaakt waardoor de meest gebruikte parameters ingesteld kunnen worden in daarvoor gemaakte invoer velden. Ik zal het hier beschrijven en delen op deze pagina. Een aantal parameters zijn belangrijk, de ontvangst frequentie, de sample rate en de afwijking van de RTL dongel. (Erg belangrijk bij lage sample rates). Voor deze parameters zijn 3 aparte invoervelden gemaakt, daarnaast kun je opgeven of je de automatische gain aan wilt zetten en of je low sample rate gaat gebruiken, bv 250 KS/s. Script berekend de sample rate die de RTL dongel mag gebruiken. Uiteindelijk maakt dit programma een opstart bestand genaamd ¨runlean¨ en gaat dit opstarten als op button ¨execute¨ klikt. De ingestelde parameters worden ook opgeslagen in een bestand genaamd ¨leanlastrun¨, dit bestand wordt ingelezen als je het programma weer opstart, anders zou je telkens weer de parameters moeten ingeven en dat vinden wij niet zo leuk. Dit script start ook meteen leandvb op, dus je krijgt meteen wat te zien als je op ëxecute¨ klikt. Om een andere instelling te activeren moet je eerst leandvb en eventueel een schermafbeelding sluiten ( kruisje sluiten activeren in 1 van de leandvb windows). PS, als je geen ffplay hebt dan kun je dit vervangen door mplayer in het script.
Installatie tips: Zie hieronder de source, als je dit copy-paste in een bestand en in dezelfde directory zet als leandv en je geeft het bv de naam ¨leandv-gui.py¨ dan kun je dat bestand een vlag geven dat het opgestart kan worden als je er dubbel op klikt, commando = sudo chmod +x leandvb-gui.py , een andere mogelijkheid om het op te starten is het volgende commando : sudo python leandvb-gui.py . Als je een kleine jpg image van 180x180 pixels genaamd logo.jpg in dezelfde directory zet krijg je een mooi plaatje in de rechter bovenhoek. Als je het er niet inzet blijft die plek leeg.
Ontwikkeld voor Raspberry PI3 (rasbian) en UBUNTU 14.04 of hoger, kan zijn dat bepaalde modules nodig zijn, die kunnen over het algemeen dmv de bekende sudo apt-get commandoś geinstalleerd worden. In ieder geval is sudo apt-get install python-imaging-tk package noodzakelijk dit is om het logo zichtbaar te maken wat overigens zelf te bepalen is, kun je bv je call in zetten (hi)). Voor deze geweldige Software only DVB ontvanger is enige kennis van Linux noodzakelijk. Voordeel is dat je alles kunt aanpassen naar je eigen idee en smaak.
Testen: 2000 KS/s op Raspberry PI 3 is haalbaar in geval je hem op no-preprocessing zet. F4DAV heeft heel veel verbeteringen aangebracht en instelmogelijkheden. Dit geeft flexibiliteit en inzetmogelijkhden op diverse hardware platvormen. Computer systemen met veel rekenpower kunnen de functie Max Sensitivity gebruiken, Raspberry PI kun je zonder pre-processing of GUI nog een hoge sample rate zichtbaar maken. Zeer flexibel en afhankelijk van ontvangst signaal nivo en kwaliteit kun je een zo optimale instelling kiezen. Als je vragen hebt over de grafische schil, stuur een mail naar pe2jko@540.org en probeer je te helpen. Voor deze software is goede kennis van Linux noodzakelijk om op te zetten.
#!/usr/bin/env python from Tkinter import * from PIL import ImageTk, Image from os.path import expanduser home = expanduser("~") import os # Simple UI voor LEANDVB, DVBS receiver. # requires sudo apt-get install python-imaging-tk package # keep everything in your home directory # if you add a 180x180 pixels file called logo.png it will be # showed in richt corner. # Leandvb by F4DAV (github leansdr) # Wrapper by pe2jko@540.org master = Tk() master.title('LeanDVB DVBS + DVBS2 interface') parameters = "" lengte=0 parameter1_conv1=0 parameter2_conv2=0 parameter3_conv3= "" print "Home directory = " + home if os.path.isfile(home+"/leanlastrun"): file = open(home+"/leanlastrun", "r") parameter1 = file.readline() #freq parameter2 = file.readline() #samplerate parameter3 = file.readline() #fec parameter6 = file.readline() #tune parameter4 = file.readline() #fastlock parameter5 = file.readline() #lowsr parameter7 = file.readline() #viterbi parameter8 = file.readline() #Gui parameter9 = file.readline() #dvbs2 parameter10 = file.readline() #max sensitive parameter11 = file.readline() #hard-metric parameter12 = file.readline() #rtl0 parameter13 = file.readline() #rtl1 parameter14 = file.readline() #pad leandvb parameter15 = file.readline() #ppm parameter16 = file.readline() #ant parameter17 = file.readline() #gain_lime parameter18 = file.readline() #gain_lime_bandbreedte parameter19 = file.readline() #gain_rtl parameter20 = file.readline() #viewer parameter21 = file.readline() #rolloff_factor parameter22 = file.readline() #rrc_rej parameter23 = file.readline() #nhelpers parameter24 = file.readline() #inpipe parameter25 = file.readline() parameter1_conv1 = str(parameter1[:-1]) parameter2_conv2 = int(parameter2) parameter3_conv3 = str(parameter3[:3]) parameter4_conv4 = int (parameter6) parameter16_conv = str(parameter16[:-1]) parameter17_conv = str(parameter17[:-1]) parameter18_conv = str(parameter18[:-1]) parameter19_conv = str(parameter19[:-1]) parameter20_conv = str(parameter20[:-1]) parameter21_conv = str(parameter21[:-1]) parameter22_conv = str(parameter22[:-1]) parameter23_conv = str(parameter23[:-1]) parameter24_conv = str(parameter24[:-1]) file.close() else: parameter1_conv1 = 1252 parameter2_conv2 = 2000 parameter3_conv3 = "1/2" parameter4_conv4 = 0 parameter1 = "1252" parameter2 = "2000" parameter3 = 1 parameter4 = 1 parameter5 = 1 parameter6 = 0 parameter7 = 0 parameter8 = 1 parameter9 = 1 parameter10 = 0 parameter11 = 0 parameter12 = 1 parameter13 = 0 parameter14 = home+"/leansdr/src/apps/ " parameter15 = 1 parameter16_conv = 1 parameter17_conv = "0.5" parameter18_conv = "3500000" parameter19_conv = "0" parameter20_conv = "ffplay" parameter21_conv = "0.35" parameter22_conv = "20" parameter23_conv = "4" parameter24_conv = "1000000" var1 = IntVar() Checkbutton(master, font = "Verdana 13 italic", text="Fastlock", variable=var1).grid(row=5, sticky=W) var2 = IntVar() Checkbutton(master, font = "Verdana 13 italic" ,text="Low SR", variable=var2).grid(row=5, column=1, sticky=W) var3 = IntVar() Checkbutton(master, font = "Verdana 13 italic" ,text="Viterbi", variable=var3).grid(row=5, column=1, sticky=E) var4 = IntVar() #Checkbutton(master, font = "Verdana 13 italic" ,text="Hard-Metric", variable=var4).grid(row=5, column=1) Label(master,font = "Verdana 10 italic", text="-----------------------").grid(row=4,column=0) Label(master,font = "Verdana 10 italic", text="---------------------------------------------------------").grid(row=4,column=1) var5 = IntVar() Checkbutton(master, font = "Verdana 13 italic", text="Gui", variable=var5).grid(row=7, sticky=W) var6 = IntVar() Checkbutton(master, font = "Verdana 13 italic" ,text="DVBS-2", variable=var6).grid(row=7, column=1, sticky=W) var7 = IntVar() Checkbutton(master, font = "Verdana 13 italic" ,text="Max sensitive", variable=var7).grid(row=7, column=1, sticky=E) Label(master,font = "Verdana 8 italic", text="").grid(row=6,column=0) Label(master,font = "Verdana 8 italic", text="").grid(row=8,column=0) rtl0 = IntVar() rtl1 = IntVar() ppm = IntVar() padlean = StringVar() ant = StringVar() gain_rtl = StringVar() gain_lime = StringVar() viewer = StringVar() rolloff_factor = StringVar() rrc_rej_factor = StringVar() nhelpers = StringVar() inpipe = StringVar() bandbreedte_lime = StringVar() var1.set(int(parameter4)) var2.set(int(parameter5)) var3.set(int(parameter7)) var4.set(int(parameter11)) var5.set(int(parameter8)) var6.set(int(parameter9)) var7.set(int(parameter10)) rtl0.set(int(parameter12)) rtl1.set(int(parameter13)) padlean.set(str(parameter14[:-1])) ppm.set(int(parameter15)) ant.set(parameter16_conv) gain_lime.set(parameter17_conv) bandbreedte_lime.set(parameter18_conv) gain_rtl.set(parameter19_conv) viewer.set(parameter20_conv) rolloff_factor.set(parameter21_conv) rrc_rej_factor.set(parameter22_conv) nhelpers.set(parameter23_conv) inpipe.set(parameter24_conv) e = Entry(master, font = "Verdana 15 bold") f = Entry(master, font = "Verdana 15 bold") g = Entry(master, font = "Verdana 15 bold") h = Entry(master, font = "Verdana 15 bold") e.insert(0, parameter1_conv1) f.insert(0, parameter2_conv2) g.insert(0, parameter3_conv3) h.insert(0, parameter4_conv4) e.grid(row=0, column=1) f.grid(row=1, column=1) g.grid(row=2, column=1) h.grid(row=3, column=1) e.focus_set() if os.path.isfile(home+"/logo.png"): im = Image.open(home+'/logo.png') photo = ImageTk.PhotoImage(im) label = Label(image=photo) label.image = photo label.grid(row=0, column=3, columnspan=2, rowspan=3,sticky=W+E+N+S, padx=5, pady=5) def einde(): save_parms() master.destroy() def preset1(): top = Toplevel() top.title("Default Settings") top.geometry("400x400+30+30") top.transient(master) # C1 = Checkbutton(top, font = "Verdana 11 italic", text="RTL=0", variable=rtl0) # C1.pack() # C2 = Checkbutton(top, font = "Verdana 11 italic", text="LimeSDR=1", variable=rtl1) # C2.pack() kk= Label(top, font = "Verdana 10", text="Path to Leansdr :") kk.pack() i = Entry(top, font = "Verdana 10", width=35, textvariable=padlean) i.pack() # kl= Label(top, font = "Verdana 10", text="------------") # kl.pack() kk= Label(top, font = "Verdana 10", text="PPM offset RTL0") kk.pack() j = Entry(top, font = "Verdana 10", width=15, textvariable=ppm) j.pack() # kn= Label(top, font = "Verdana 10", text="Antenne Lime") # kn.pack() # k= Entry(top, font = "Verdana 10", width=15, textvariable=ant) # k.pack() # km= Label(top, font = "Verdana 10", text="Gain Lime") # km.pack() # l= Entry(top, font = "Verdana 10", width=15, textvariable=gain_lime) # l.pack() # lm= Label(top, font = "Verdana 10", text="Bandbreedte Lime") # lm.pack() # kp= Entry(top, font = "Verdana 10", width=15, textvariable=bandbreedte_lime) # kp.pack() noo= Label(top, font = "Verdana 10", text="Gain RTL (0=Auto)") noo.pack() oo= Entry(top, font = "Verdana 10", width=15, textvariable=gain_rtl) oo.pack() qoo= Label(top, font = "Verdana 10", text="Roll Off Factor (DVBS2)") qoo.pack() qp= Entry(top, font = "Verdana 10", width=15, textvariable=rolloff_factor) qp.pack() qooo= Label(top, font = "Verdana 10", text="RRC Rej Factor (DVBS2)") qooo.pack() qpp= Entry(top, font = "Verdana 10", width=15, textvariable=rrc_rej_factor) qpp.pack() qooop= Label(top, font = "Verdana 10", text="Nhelpers (DVBS2)") qooop.pack() qppp= Entry(top, font = "Verdana 10", width=15, textvariable=nhelpers) qppp.pack() oooop= Label(top, font = "Verdana 10", width=15, text="Inpipe (DVBS2)") oooop.pack() qqppp= Entry(top, font = "Verdana 10",width=15, textvariable=inpipe) qqppp.pack() # okl= Label(top, font = "Verdana 10", text="Viewer") # okl.pack() # okll= Entry(top, font = "Verdana 10", width=15, textvariable=viewer) # okll.pack() kll= Label(top, font = "Verdana 10", text="------------") kll.pack() topButton0 = Button(top, bg="yellow", text="SAVE", command = lambda:[save_parms(),top.destroy()]) topButton0.pack() # topButton = Button(top, text="CLOSE", command = top.destroy) # topButton.pack(side = BOTTOM ) def save_parms(): sub = "" samplerate = 0 freq = 0 tune = 0 fastlock = var1.get() lowsr = var2.get() viterbi = var3.get() gui = var5.get() dvbs2 = var6.get() maxprocess = var7.get() hardmetric = var4.get() rtldongle0 = rtl0.get() rtldongle1 = rtl1.get() leanpad = padlean.get() srsubstring = f.get() tunesubstring = str(1) opslaanfreq= e.get() fsubstring = float(e.get()) tunesubstring = str(1) freq = fsubstring * 1000000 freqfinal=int(freq) freq_lime=str(fsubstring)+"M" samplerate = int(srsubstring) * 1000 fec = tkvar3.get() tune = h.get() ppmwaarde = ppm.get() antennewaarde = ant.get() gain_rtlwaarde = gain_rtl.get() gain_limewaarde = gain_lime.get() viewer_waarde = viewer.get() rolloff_factorwaarde = rolloff_factor.get() rrc_rej_factorwaarde = rrc_rej_factor.get() bandbreedte_limewaarde = bandbreedte_lime.get() nhelpers_waarde = nhelpers.get() inpipe_waarde = inpipe.get() file = open(home+"/runlean", "w") file.write("#!/bin/sh \n\n") file.write(sub) file.close() file = open(home+"/leanlastrun", "w") file.write(str(opslaanfreq) + "\n") file.write(srsubstring + "\n") file.write(fec + "\n") file.write(tune + "\n") file.write(str(fastlock) + "\n") file.write(str(lowsr) + "\n") file.write(str(viterbi) + "\n") file.write(str(gui) + "\n") file.write(str(dvbs2) + "\n") file.write(str(maxprocess) + "\n") file.write(str(hardmetric) + "\n") file.write(str(rtldongle0) + "\n") file.write(str(rtldongle1) + "\n") file.write(str(leanpad) + "\n") file.write(str(ppmwaarde) + "\n") file.write(str(antennewaarde) + "\n") file.write(str(gain_limewaarde) + "\n") file.write(str(bandbreedte_limewaarde) + "\n") file.write(str(gain_rtlwaarde) + "\n") file.write(str(viewer_waarde) + "\n") file.write(str(rolloff_factorwaarde) + "\n") file.write(str(rrc_rej_factorwaarde) + "\n") file.write(str(nhelpers_waarde) + "\n") file.write(str(inpipe_waarde) + "\n") file.write(tunesubstring + "\n") file.close() def stop(): os.system(home+"/lean_stop") def callback(): ppmwaarde = ppm.get() sub = "" sub1 = "" view = "" dvbs2string = "" samplerate = 0 freq = 0 tune = 0 fastlock = var1.get() lowsr = var2.get() viterbi = var3.get() gui = var5.get() dvbs2 = var6.get() maxprocess = var7.get() hardmetric = var4.get() rtldongle0 = rtl0.get() rtldongle1 = rtl1.get() leanpad = padlean.get() antennewaarde = ant.get() gain_limewaarde = gain_lime.get() gain_rtlwaarde = gain_rtl.get() viewer_waarde = viewer.get() rolloff_factorwaarde = rolloff_factor.get() rrc_rej_factorwaarde = rrc_rej_factor.get() nhelpers_waarde = nhelpers.get() inpipe_waarde = inpipe.get() bandbreedte_limewaarde = bandbreedte_lime.get() if (viewer_waarde == "ffplay"): view = "ffplay -v 0" else: view = "mplayer" if (lowsr == 1): bandbreedte = 1800000 else: bandbreedte = 2400000 if (fastlock == 1): fastlockstring = "--fastlock" else: fastlockstring = "" if (viterbi == 1): viterbistring = "--viterbi" else: viterbistring = "" if (gui == 1): guistring = "--gui" else: guistring = "" if (dvbs2 == 1): dvbs2string = "-S2" else: dvbs2string = "-S" if (maxprocess == 1): maxprocessstring = "--hq" else: maxprocessstring = "" if (hardmetric == 1): hardmetricstring = "--hard-metric" else: hardmetricstring = "" if (rtldongle0 == 1): rtlstring = "0" else: rtlstring = "1" srsubstring = f.get() opslaanfreq= e.get() fsubstring = float(e.get()) tunesubstring = str(1) freq = fsubstring * 1000000 freqfinal=int(freq) freq_lime=str(fsubstring)+"M" samplerate = int(srsubstring) * 1000 fec = tkvar3.get() tune = h.get( ) if (rtldongle0 == 1): if (dvbs2 == 1): sub = "rtl_sdr -d " + rtlstring + " -f " + str(freqfinal) + " -g " + gain_rtlwaarde + " -s " + str(bandbreedte) + " -p " + str(ppmwaarde) + " - | " + str(leanpad) + "leandvb" + " " + guistring + " " + maxprocessstring + " " + viterbistring + " " + hardmetricstring + " " + fastlockstring + " --tune " + tune + " --standard DVB" + dvbs2string + " --ldpc-helper " + str(leanpad) + "ldpc_tool --inpipe " + str(inpipe_waarde) + " --nhelpers " +str(nhelpers_waarde) + " --sampler rrc --rrc-rej " + str(rrc_rej_factorwaarde) + " -v --roll-off " + str(rolloff_factorwaarde) + " --sr " + str(samplerate) + " -f " + str(bandbreedte) + " | ffplay -v 0 - \n" else: sub = "rtl_sdr -d " + rtlstring + " -f " + str(freqfinal) + " -g " + gain_rtlwaarde + " -s " + str(bandbreedte) + " -p " + str(ppmwaarde) + " - | " + str(leanpad) + "leandvb" + " " + guistring + " " + maxprocessstring + " " + viterbistring + " " + hardmetricstring + " " + fastlockstring + " --tune " + tune + " --cr " + str(fec) + " --standard DVB" + dvbs2string + " -v --sr " + str(samplerate) + " -f " + str(bandbreedte) + " | " + str(view) + " - \n" else: sub1 = home+"/LimeSuite/builddir/bin/basicRX -a " + antennewaarde + " -r " + bandbreedte_limewaarde + " -g " + gain_limewaarde + " -f " + freq_lime + " -o 16 -b 3000000 &" sub = "cat ~/experiment | " + str(leanpad) + " " + guistring + " " + maxprocessstring + " " + viterbistring + " " + hardmetricstring + " " + fastlockstring + " --tune " + tune + " --cr " + str(fec) + " --sr " + str(samplerate) + " -f " +bandbreedte_limewaarde + " --s16 | ffplay -v 0 - &" file = open(home+"/runlean", "w") file.write("#!/bin/sh \n\n") file.write(sub1) file.write("\n\n") file.write(sub) file.close() file = open(home+"/leanlastrun", "w") file.write(str(opslaanfreq) + "\n") file.write(srsubstring + "\n") file.write(fec + "\n") file.write(tune + "\n") file.write(str(fastlock) + "\n") file.write(str(lowsr) + "\n") file.write(str(viterbi) + "\n") file.write(str(gui) + "\n") file.write(str(dvbs2) + "\n") file.write(str(maxprocess) + "\n") file.write(str(hardmetric) + "\n") file.write(str(rtldongle0) + "\n") file.write(str(rtldongle1) + "\n") file.write(str(leanpad) + "\n") file.write(str(ppmwaarde) + "\n") file.write(str(antennewaarde) +"\n") file.write(str(gain_limewaarde) +"\n") file.write(str(bandbreedte_limewaarde) +"\n") file.write(str(gain_rtlwaarde) + "\n") file.write(str(viewer_waarde) + "\n") file.write(str(rolloff_factorwaarde) + "\n") file.write(str(rrc_rej_factorwaarde) + "\n") file.write(str(nhelpers_waarde) + "\n") file.write(str(inpipe_waarde) + "\n") file.write(tunesubstring + "\n") file.close() os.system("sh " + home + "/runlean &") Button(master,font = "Verdana 11 italic", text='EXIT', command=einde).grid(row=7, column=3,sticky=E) Button(master, font = "Verdana 11 italic",highlightbackground='red',text='START', command=callback).grid(row=7, column=3,sticky=W) Button(master, font = "Verdana 11 italic",text='STOP', command=stop).grid(row=7, column=4,sticky=W) Button(master, font = "Verdana 11 italic",fg='red',highlightbackground='blue',text=' Settings ', command=preset1).grid(row=5, column=3) #Button(master, font = "Verdana 11 italic",fg='red',highlightbackground='blue',text=' Save Settings ', command=save_parms).grid(row=5, column=3) #Button(master, font = "Verdana 9 italic",fg='red',highlightbackground='blue',text='UI options', command=preset3).grid(row=2, column=5, ipady=5,sticky=E, ipadx=5) #Button(master, font = "Verdana 9 italic",fg='red',highlightbackground='blue',text='General Options', command=preset4).grid(row=3, column=5, ipady=5,sticky=E,ipadx=5) tkvar1 = StringVar(master) # Frequency Dropdown choices1 = { '1252','1257','1260','436','437','1255','1252.600','1280','1250','1253'} tkvar1.set(parameter1[:-1]) # set the default option popupMenu = OptionMenu(master, tkvar1, *choices1) Label(master, text=" Frequency ", font = "Verdana 14 italic").grid(row = 0, column = 0) Label(master, text="MHz", font = "Verdana 14 italic").grid(row = 0, column = 2,sticky=W) popupMenu.grid(row = 0, column =1, sticky=E) # on change dropdown value def change_dropdown1(*args): print( tkvar1.get() ) e.delete(0, END) e.insert(0, tkvar1.get()) # link function to change dropdown tkvar1.trace('w', change_dropdown1) tkvar2 = StringVar(master) # SampleRate choices2 = { '33', '66','125','150','250','333','400','500','600','750','1000','1500','2000','2083','3000','4000','4340','5000'} tkvar2.set(parameter2[:-1]) # set the default option popupMenu = OptionMenu(master, tkvar2, *choices2) Label(master, text=" Samplerate ", font = "Verdana 14 italic").grid(row = 1, column = 0) Label(master, text="S/R", font = "Verdana 14 italic").grid(row = 1, column = 2,sticky=W) popupMenu.grid(row = 1, column =1, sticky=E) # on change dropdown value def change_dropdown2(*args): print( tkvar2.get() ) f.delete(0, END) f.insert(0, tkvar2.get()) # link function to change dropdown tkvar2.trace('w', change_dropdown2) tkvar3 = StringVar(master) # Fec choices3 = { '1/2','2/3','3/4','5/6','6/7','7/8' } tkvar3.set(parameter3_conv3) popupMenu = OptionMenu(master, tkvar3, *choices3) Label(master, text="FEC (auto@dvbs2)", font = "Verdana 14 italic").grid(row = 2, column = 0) Label(master, text="Div", font = "Verdana 14 italic").grid(row = 2, column = 2,sticky=W) popupMenu.grid(row = 2, column =1, sticky=E) # on change dropdown value def change_dropdown3(*args): print( tkvar3.get() ) g.delete(0, END) g.insert(0, tkvar3.get()) # link function to change dropdown tkvar3.trace('w', change_dropdown3) tkvar4 = StringVar(master) # Tune choices4 = { '100','500','1000','2000','5000','10000','-100','-500','-1000','-2000','-5000','-10000'} tkvar4.set(parameter4_conv4) # set the default option popupMenu = OptionMenu(master, tkvar4, *choices4) Label(master, text="Tune", font = "Verdana 14 italic").grid(row = 3, column = 0) Label(master, text="Hz", font = "Verdana 14 italic").grid(row = 3, column = 2,sticky=W) popupMenu.grid(row = 3, column =1, sticky=E) # on change dropdown value def change_dropdown4(*args): print( ) h.delete(0, END) h.insert(0, tkvar4.get()) # link function to change dropdown tkvar4.trace('w', change_dropdown4) mainloop()
STOP SCRIPT
Stop Script, copy past in a file, copy it in your home directory and type "chmod +x lean_stop".
#/bin/bash killall rtl_sdr killall ffplay killall leandvb killall basicRX exit 0