mirror of
https://github.com/ha7ilm/openwebrx.git
synced 2026-02-07 07:54:18 +01:00
Send a signal to rtl_command_proc on exit.
This commit is contained in:
parent
a0ca1361dc
commit
90399d49f1
|
|
@ -84,7 +84,7 @@ start_rtl_thread=True
|
|||
|
||||
iq_server_port = 4951
|
||||
|
||||
start_rtl_command="rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} - | ddcd -p{iq_server_port} -d1".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm, iq_server_port=iq_server_port)
|
||||
start_rtl_command="rtl_sdr -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain} - | ddcd -p{iq_server_port} -d3".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm, iq_server_port=iq_server_port)
|
||||
format_conversion="csdr convert_u8_f"
|
||||
|
||||
#start_rtl_command="hackrf_transfer -s {samp_rate} -f {center_freq} -g {rf_gain} -l16 -a0 -r hackrf_pipe & cat hackrf_pipe | nc -vvl 127.0.0.1 8888".format(rf_gain=rf_gain, center_freq=center_freq, samp_rate=samp_rate, ppm=ppm)
|
||||
|
|
|
|||
12
openwebrx.py
12
openwebrx.py
|
|
@ -74,17 +74,18 @@ class MultiThreadHTTPServer(ThreadingMixIn, HTTPServer):
|
|||
pass
|
||||
|
||||
def handle_signal(signal, frame):
|
||||
global spectrum_dsp
|
||||
global spectrum_dsp, rtl_command_proc
|
||||
print "[openwebrx] Ctrl+C: aborting."
|
||||
cleanup_clients(True)
|
||||
spectrum_dsp.stop()
|
||||
if rtl_command_proc: rtl_command_proc.kill()
|
||||
os._exit(1) #not too graceful exit
|
||||
|
||||
rtl_thread=spectrum_dsp=server_fail=None
|
||||
rtl_command_proc=rtl_thread=spectrum_dsp=server_fail=None
|
||||
|
||||
def main():
|
||||
global clients, clients_mutex, pypy, lock_try_time, avatar_ctime, cfg
|
||||
global serverfail, rtl_thread
|
||||
global serverfail, rtl_thread, rtl_command_proc
|
||||
print
|
||||
print "OpenWebRX - Open Source SDR Web App for Everyone! | for license see LICENSE file in the package"
|
||||
print "_________________________________________________________________________________________________"
|
||||
|
|
@ -117,8 +118,9 @@ def main():
|
|||
|
||||
#Start rtl thread
|
||||
if cfg.start_rtl_thread:
|
||||
rtl_thread=threading.Thread(target = lambda:subprocess.Popen(cfg.start_rtl_command, shell=True), args=())
|
||||
rtl_thread.start()
|
||||
rtl_command_proc=subprocess.Popen(cfg.start_rtl_command, shell=True)
|
||||
#rtl_thread=threading.Thread(target = lambda:subprocess.Popen(cfg.start_rtl_command, shell=True), args=())
|
||||
#rtl_thread.start()
|
||||
print "[openwebrx-main] Started rtl_thread: "+cfg.start_rtl_command
|
||||
|
||||
""" #Now we use ddcd instead of this.
|
||||
|
|
|
|||
Loading…
Reference in a new issue