From 01b56db38deb9326ed3143a8bc1af6b56679a9a5 Mon Sep 17 00:00:00 2001 From: Manolis Surligas Date: Wed, 1 Nov 2017 19:16:25 +0200 Subject: [PATCH] Fix inconsistencies between the command line arguments of the flowgraphs * Set the default USRP RX and TX port to the TX/RX * All flowgraphs follow the same command line arguments scheme --- apps/flowgraphs/apt_demod.grc | 6 +- apps/flowgraphs/bpsk_demod.grc | 6 +- apps/flowgraphs/cw_demod.grc | 38 +- apps/flowgraphs/fm_demod.grc | 10 +- apps/flowgraphs/fsk9600_ax25.grc | 353 ++++++++++++++++-- apps/flowgraphs/fsk9600_g3ruh_ax25.grc | 70 ++-- apps/flowgraphs/satnogs_apt_demod.py | 8 +- apps/flowgraphs/satnogs_bpsk_demod.py | 8 +- apps/flowgraphs/satnogs_cw_demod.py | 8 +- apps/flowgraphs/satnogs_fm_demod.py | 32 +- apps/flowgraphs/satnogs_fsk9600_ax25.py | 198 +++++++--- apps/flowgraphs/satnogs_fsk9600_g3ruh_ax25.py | 192 +++++----- python/hw_settings.py | 4 +- 13 files changed, 656 insertions(+), 277 deletions(-) diff --git a/apps/flowgraphs/apt_demod.grc b/apps/flowgraphs/apt_demod.grc index 0fb2094..f73de96 100644 --- a/apps/flowgraphs/apt_demod.grc +++ b/apps/flowgraphs/apt_demod.grc @@ -749,7 +749,7 @@ TX sampling rate value - test.wav + test.ogg @@ -2865,8 +2865,8 @@ we shift the LO a little further 1 - pps - 8 + rps + 10 samp_rate diff --git a/apps/flowgraphs/bpsk_demod.grc b/apps/flowgraphs/bpsk_demod.grc index 87022c4..8ea53cd 100644 --- a/apps/flowgraphs/bpsk_demod.grc +++ b/apps/flowgraphs/bpsk_demod.grc @@ -971,7 +971,7 @@ tone. This tone is typically 500-800 Hz. value - test.wav + test.ogg @@ -3154,8 +3154,8 @@ we shift the LO a little further 1 - pps - 8 + rps + 10 samp_rate diff --git a/apps/flowgraphs/cw_demod.grc b/apps/flowgraphs/cw_demod.grc index 02450da..87f3797 100644 --- a/apps/flowgraphs/cw_demod.grc +++ b/apps/flowgraphs/cw_demod.grc @@ -178,7 +178,7 @@ SDR received samples _coordinate - (805, 985) + (789, 857) _rotation @@ -491,7 +491,7 @@ TX sampling rate _coordinate - (398, 1081) + (382, 953) _rotation @@ -534,7 +534,7 @@ TX sampling rate _coordinate - (311, 1081) + (295, 953) _rotation @@ -775,7 +775,7 @@ tone. This tone is typically 500-800 Hz. _coordinate - (704, 1084) + (686, 953) _rotation @@ -818,7 +818,7 @@ tone. This tone is typically 500-800 Hz. _coordinate - (63, 1081) + (47, 953) _rotation @@ -861,7 +861,7 @@ tone. This tone is typically 500-800 Hz. _coordinate - (64, 984) + (47, 857) _rotation @@ -904,7 +904,7 @@ tone. This tone is typically 500-800 Hz. _coordinate - (480, 1084) + (462, 953) _rotation @@ -947,7 +947,7 @@ tone. This tone is typically 500-800 Hz. _coordinate - (494, 985) + (478, 857) _rotation @@ -971,7 +971,7 @@ tone. This tone is typically 500-800 Hz. value - test.wav + test.ogg @@ -1049,7 +1049,7 @@ tone. This tone is typically 500-800 Hz. _coordinate - (231, 1081) + (215, 953) _rotation @@ -1092,7 +1092,7 @@ tone. This tone is typically 500-800 Hz. _coordinate - (600, 1084) + (582, 953) _rotation @@ -2661,7 +2661,7 @@ we shift the LO a little further _coordinate - (726, 985) + (710, 857) _rotation @@ -2704,7 +2704,7 @@ we shift the LO a little further _coordinate - (159, 1081) + (143, 953) _rotation @@ -2747,7 +2747,7 @@ we shift the LO a little further _coordinate - (327, 985) + (311, 857) _rotation @@ -2790,7 +2790,7 @@ we shift the LO a little further _coordinate - (414, 985) + (398, 857) _rotation @@ -2833,7 +2833,7 @@ we shift the LO a little further _coordinate - (223, 985) + (207, 857) _rotation @@ -3154,8 +3154,8 @@ we shift the LO a little further 1 - pps - 8 + rps + 10 samp_rate @@ -3178,7 +3178,7 @@ we shift the LO a little further _coordinate - (590, 985) + (574, 857) _rotation diff --git a/apps/flowgraphs/fm_demod.grc b/apps/flowgraphs/fm_demod.grc index e215a9e..f6ce9a2 100644 --- a/apps/flowgraphs/fm_demod.grc +++ b/apps/flowgraphs/fm_demod.grc @@ -1,5 +1,5 @@ - + Thu May 5 00:22:45 2016 @@ -95,7 +95,7 @@ SDR received samples _coordinate - (1069, 865) + (1061, 865) _rotation @@ -776,7 +776,7 @@ TX sampling rate value - test.wav + test.ogg @@ -2911,8 +2911,8 @@ max_modulation_freq = 3000 1 - pps - 8 + rps + 10 samp_rate diff --git a/apps/flowgraphs/fsk9600_ax25.grc b/apps/flowgraphs/fsk9600_ax25.grc index eaf8dad..51e4c77 100644 --- a/apps/flowgraphs/fsk9600_ax25.grc +++ b/apps/flowgraphs/fsk9600_ax25.grc @@ -95,7 +95,7 @@ SDR received samples _coordinate - (911, 1034) + (590, 761) _rotation @@ -122,7 +122,7 @@ SDR received samples _coordinate - (743, 971) + (462, 546) _rotation @@ -149,7 +149,7 @@ SDR received samples _coordinate - (823, 1034) + (111, 769) _rotation @@ -176,7 +176,7 @@ SDR received samples _coordinate - (743, 1034) + (31, 769) _rotation @@ -203,7 +203,7 @@ SDR received samples _coordinate - (1014, 971) + (750, 706) _rotation @@ -230,7 +230,7 @@ SDR received samples _coordinate - (1014, 1034) + (207, 769) _rotation @@ -258,7 +258,7 @@ TX sampling rate _coordinate - (743, 843) + (351, 546) _rotation @@ -293,7 +293,7 @@ TX sampling rate _coordinate - (48, 716) + (31, 542) _rotation @@ -332,7 +332,7 @@ TX sampling rate _coordinate - (863, 971) + (590, 698) _rotation @@ -390,6 +390,92 @@ TX sampling rate 0 + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (263, 865) + + + _rotation + 0 + + + id + antenna + + + label + + + + short_id + + + + type + string + + + value + satnogs.not_set_antenna + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (175, 865) + + + _rotation + 0 + + + id + bb_gain + + + label + + + + short_id + + + + type + eng_float + + + value + satnogs.not_set_rx_bb_gain + + rational_resampler_xxx @@ -500,6 +586,92 @@ TX sampling rate ff + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (199, 546) + + + _rotation + 0 + + + id + decoded_data_file_path + + + label + + + + short_id + + + + type + string + + + value + /tmp/.satnogs/data/data + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (470, 690) + + + _rotation + 0 + + + id + dev_args + + + label + + + + short_id + + + + type + string + + + value + satnogs.not_set_dev_args + + digital_binary_slicer_fb @@ -669,7 +841,7 @@ TX sampling rate _coordinate - (64, 984) + (31, 690) _rotation @@ -712,7 +884,7 @@ TX sampling rate _coordinate - (1110, 843) + (343, 865) _rotation @@ -755,7 +927,7 @@ TX sampling rate _coordinate - (743, 755) + (167, 945) _rotation @@ -841,6 +1013,92 @@ TX sampling rate ccc + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (95, 865) + + + _rotation + 0 + + + id + if_gain + + + label + + + + short_id + + + + type + eng_float + + + value + satnogs.not_set_rx_if_gain + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (470, 865) + + + _rotation + 0 + + + id + iq_file_path + + + label + + + + short_id + + + + type + string + + + value + /tmp/iq.dat + + parameter @@ -858,7 +1116,7 @@ we shift the LO a little further _coordinate - (863, 843) + (263, 945) _rotation @@ -968,11 +1226,11 @@ we shift the LO a little further ant0 - satnogs.hw_rx_settings[rx_sdr_device]['antenna'] + satnogs.handle_rx_antenna(rx_sdr_device, antenna) bb_gain0 - satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'] + satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain) bw0 @@ -996,7 +1254,7 @@ we shift the LO a little further if_gain0 - satnogs.hw_rx_settings[rx_sdr_device]['if_gain'] + satnogs.handle_rx_if_gain(rx_sdr_device, if_gain) iq_balance_mode0 @@ -1004,7 +1262,7 @@ we shift the LO a little further gain0 - satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'] + satnogs.handle_rx_rf_gain(rx_sdr_device, rf_gain) ant10 @@ -2256,7 +2514,7 @@ we shift the LO a little further args - satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] + satnogs.handle_rx_dev_args(rx_sdr_device, dev_args) _enabled @@ -2264,7 +2522,7 @@ we shift the LO a little further _coordinate - (16, 376) + (15, 319) _rotation @@ -2383,7 +2641,7 @@ we shift the LO a little further _coordinate - (975, 755) + (470, 945) _rotation @@ -2426,7 +2684,50 @@ we shift the LO a little further _coordinate - (1054, 755) + (23, 865) + + + _rotation + 0 + + + id + rf_gain + + + label + + + + short_id + + + + type + eng_float + + + value + satnogs.not_set_rx_rf_gain + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (382, 690) _rotation @@ -2469,7 +2770,7 @@ we shift the LO a little further _coordinate - (959, 843) + (303, 690) _rotation @@ -2512,7 +2813,7 @@ we shift the LO a little further _coordinate - (312, 984) + (191, 690) _rotation @@ -3001,8 +3302,8 @@ we shift the LO a little further 1 - pps - 8 + rps + 10 samp_rate @@ -3025,7 +3326,7 @@ we shift the LO a little further _coordinate - (839, 755) + (23, 945) _rotation diff --git a/apps/flowgraphs/fsk9600_g3ruh_ax25.grc b/apps/flowgraphs/fsk9600_g3ruh_ax25.grc index c8a9165..b240004 100644 --- a/apps/flowgraphs/fsk9600_g3ruh_ax25.grc +++ b/apps/flowgraphs/fsk9600_g3ruh_ax25.grc @@ -1,5 +1,5 @@ - + Thu May 5 00:22:45 2016 @@ -95,7 +95,7 @@ SDR received samples _coordinate - (1128, 948) + (574, 801) _rotation @@ -122,7 +122,7 @@ SDR received samples _coordinate - (960, 884) + (446, 586) _rotation @@ -149,7 +149,7 @@ SDR received samples _coordinate - (1040, 948) + (95, 809) _rotation @@ -176,7 +176,7 @@ SDR received samples _coordinate - (960, 948) + (15, 809) _rotation @@ -203,7 +203,7 @@ SDR received samples _coordinate - (1232, 884) + (734, 746) _rotation @@ -230,7 +230,7 @@ SDR received samples _coordinate - (1232, 948) + (191, 809) _rotation @@ -258,7 +258,7 @@ TX sampling rate _coordinate - (960, 756) + (335, 586) _rotation @@ -293,7 +293,7 @@ TX sampling rate _coordinate - (48, 716) + (15, 590) _rotation @@ -332,7 +332,7 @@ TX sampling rate _coordinate - (1080, 876) + (574, 738) _rotation @@ -406,7 +406,7 @@ TX sampling rate _coordinate - (376, 1116) + (247, 905) _rotation @@ -430,7 +430,7 @@ TX sampling rate value - + satnogs.not_set_antenna @@ -449,7 +449,7 @@ TX sampling rate _coordinate - (224, 1104) + (159, 905) _rotation @@ -602,7 +602,7 @@ TX sampling rate _coordinate - (432, 776) + (183, 586) _rotation @@ -645,7 +645,7 @@ TX sampling rate _coordinate - (744, 992) + (454, 730) _rotation @@ -841,7 +841,7 @@ TX sampling rate _coordinate - (64, 984) + (15, 730) _rotation @@ -884,7 +884,7 @@ TX sampling rate _coordinate - (512, 1112) + (327, 905) _rotation @@ -927,7 +927,7 @@ TX sampling rate _coordinate - (272, 1216) + (151, 985) _rotation @@ -1029,7 +1029,7 @@ TX sampling rate _coordinate - (144, 1104) + (79, 905) _rotation @@ -1072,7 +1072,7 @@ TX sampling rate _coordinate - (720, 1112) + (454, 905) _rotation @@ -1116,7 +1116,7 @@ we shift the LO a little further _coordinate - (432, 1224) + (247, 985) _rotation @@ -1226,11 +1226,11 @@ we shift the LO a little further ant0 - antenna + satnogs.handle_rx_antenna(rx_sdr_device, antenna) bb_gain0 - bb_gain + satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain) bw0 @@ -1254,7 +1254,7 @@ we shift the LO a little further if_gain0 - if_gain + satnogs.handle_rx_if_gain(rx_sdr_device, if_gain) iq_balance_mode0 @@ -1262,7 +1262,7 @@ we shift the LO a little further gain0 - rf_gain + satnogs.handle_rx_rf_gain(rx_sdr_device, rf_gain) ant10 @@ -2514,7 +2514,7 @@ we shift the LO a little further args - dev_args + satnogs.handle_rx_dev_args(rx_sdr_device, dev_args) _enabled @@ -2522,7 +2522,7 @@ we shift the LO a little further _coordinate - (16, 376) + (15, 311) _rotation @@ -2641,7 +2641,7 @@ we shift the LO a little further _coordinate - (568, 1224) + (454, 985) _rotation @@ -2684,7 +2684,7 @@ we shift the LO a little further _coordinate - (72, 1104) + (7, 905) _rotation @@ -2727,7 +2727,7 @@ we shift the LO a little further _coordinate - (600, 984) + (367, 730) _rotation @@ -2770,7 +2770,7 @@ we shift the LO a little further _coordinate - (464, 992) + (287, 730) _rotation @@ -2813,7 +2813,7 @@ we shift the LO a little further _coordinate - (312, 984) + (175, 730) _rotation @@ -3302,8 +3302,8 @@ we shift the LO a little further 1 - pps - 8 + rps + 10 samp_rate @@ -3326,7 +3326,7 @@ we shift the LO a little further _coordinate - (56, 1216) + (7, 985) _rotation diff --git a/apps/flowgraphs/satnogs_apt_demod.py b/apps/flowgraphs/satnogs_apt_demod.py index 13c2d36..939d574 100755 --- a/apps/flowgraphs/satnogs_apt_demod.py +++ b/apps/flowgraphs/satnogs_apt_demod.py @@ -5,7 +5,7 @@ # Title: APT Generic Demodulation # Author: Manolis Surligas (surligas@gmail.com) # Description: A generic APT demodulation block -# Generated: Wed Aug 9 13:40:42 2017 +# Generated: Wed Nov 1 13:04:36 2017 ################################################## from gnuradio import analog @@ -23,7 +23,7 @@ import time class satnogs_apt_demod(gr.top_block): - def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=20, enable_iq_dump=0, file_path='test.wav', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): + def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=20, enable_iq_dump=0, file_path='test.ogg', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "APT Generic Demodulation") ################################################## @@ -62,7 +62,7 @@ class satnogs_apt_demod(gr.top_block): ################################################## # Blocks ################################################## - self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate*2, 0.0, 8, 1024, waterfall_file_path, 1) + self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate*2, 0.0, 10, 1024, waterfall_file_path, 1) self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000/doppler_correction_per_sec, 1500) self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) self.satnogs_iq_sink_0 = satnogs.iq_sink(32767, iq_file_path, False, enable_iq_dump) @@ -289,7 +289,7 @@ def argument_parser(): "", "--enable-iq-dump", dest="enable_iq_dump", type="intx", default=0, help="Set enable_iq_dump [default=%default]") parser.add_option( - "", "--file-path", dest="file_path", type="string", default='test.wav', + "", "--file-path", dest="file_path", type="string", default='test.ogg', help="Set file_path [default=%default]") parser.add_option( "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain), diff --git a/apps/flowgraphs/satnogs_bpsk_demod.py b/apps/flowgraphs/satnogs_bpsk_demod.py index 1415443..9381c93 100755 --- a/apps/flowgraphs/satnogs_bpsk_demod.py +++ b/apps/flowgraphs/satnogs_bpsk_demod.py @@ -5,7 +5,7 @@ # Title: BPSK Generic Demodulation # Author: surligas, cshields, csete # Description: A generic BPSK demodulation block -# Generated: Wed Aug 9 13:40:52 2017 +# Generated: Wed Nov 1 14:52:53 2017 ################################################## from gnuradio import analog @@ -23,7 +23,7 @@ import time class satnogs_bpsk_demod(gr.top_block): - def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, cw_offset=1500, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=20, enable_iq_dump=0, file_path='test.wav', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): + def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, cw_offset=1500, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=20, enable_iq_dump=0, file_path='test.ogg', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "BPSK Generic Demodulation") ################################################## @@ -63,7 +63,7 @@ class satnogs_bpsk_demod(gr.top_block): ################################################## # Blocks ################################################## - self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 8, 1024, waterfall_file_path, 1) + self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000/doppler_correction_per_sec, 1500) self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) self.satnogs_iq_sink_0 = satnogs.iq_sink(32767, iq_file_path, False, enable_iq_dump) @@ -304,7 +304,7 @@ def argument_parser(): "", "--enable-iq-dump", dest="enable_iq_dump", type="intx", default=0, help="Set enable_iq_dump [default=%default]") parser.add_option( - "", "--file-path", dest="file_path", type="string", default='test.wav', + "", "--file-path", dest="file_path", type="string", default='test.ogg', help="Set file_path [default=%default]") parser.add_option( "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain), diff --git a/apps/flowgraphs/satnogs_cw_demod.py b/apps/flowgraphs/satnogs_cw_demod.py index b917638..98f2866 100755 --- a/apps/flowgraphs/satnogs_cw_demod.py +++ b/apps/flowgraphs/satnogs_cw_demod.py @@ -5,7 +5,7 @@ # Title: FM Generic Demodulation # Author: surligas, cshields, csete # Description: A generic CW demodulation block -# Generated: Wed Aug 9 13:41:00 2017 +# Generated: Wed Nov 1 13:13:56 2017 ################################################## from gnuradio import analog @@ -23,7 +23,7 @@ import time class satnogs_cw_demod(gr.top_block): - def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, cw_offset=700, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=20, enable_iq_dump=0, file_path='test.wav', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): + def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, cw_offset=700, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=20, enable_iq_dump=0, file_path='test.ogg', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "FM Generic Demodulation") ################################################## @@ -63,7 +63,7 @@ class satnogs_cw_demod(gr.top_block): ################################################## # Blocks ################################################## - self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 8, 1024, waterfall_file_path, 1) + self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000/doppler_correction_per_sec, 1500) self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) self.satnogs_iq_sink_0 = satnogs.iq_sink(32767, iq_file_path, False, enable_iq_dump) @@ -304,7 +304,7 @@ def argument_parser(): "", "--enable-iq-dump", dest="enable_iq_dump", type="intx", default=0, help="Set enable_iq_dump [default=%default]") parser.add_option( - "", "--file-path", dest="file_path", type="string", default='test.wav', + "", "--file-path", dest="file_path", type="string", default='test.ogg', help="Set file_path [default=%default]") parser.add_option( "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain), diff --git a/apps/flowgraphs/satnogs_fm_demod.py b/apps/flowgraphs/satnogs_fm_demod.py index 0b6ef0b..7ef6b68 100755 --- a/apps/flowgraphs/satnogs_fm_demod.py +++ b/apps/flowgraphs/satnogs_fm_demod.py @@ -5,7 +5,7 @@ # Title: FM Generic Demodulation # Author: Manolis Surligas (surligas@gmail.com) # Description: A generic FM demodulation block -# Generated: Thu Sep 21 10:50:12 2017 +# Generated: Wed Nov 1 13:04:41 2017 ################################################## from gnuradio import analog @@ -23,7 +23,7 @@ import time class satnogs_fm_demod(gr.top_block): - def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=20, enable_iq_dump=0, file_path='test.wav', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): + def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=20, enable_iq_dump=0, file_path='test.ogg', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "FM Generic Demodulation") ################################################## @@ -51,9 +51,9 @@ class satnogs_fm_demod(gr.top_block): ################################################## self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] self.xlate_filter_taps = xlate_filter_taps = firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) - + self.taps = taps = firdes.low_pass(12.0, samp_rate_rx, 100e3, 60000, firdes.WIN_HAMMING, 6.76) - + self.max_modulation_freq = max_modulation_freq = 3000 self.filter_rate = filter_rate = 250000 self.deviation = deviation = 5000 @@ -63,7 +63,7 @@ class satnogs_fm_demod(gr.top_block): ################################################## # Blocks ################################################## - self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 8, 1024, waterfall_file_path, 1) + self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000/doppler_correction_per_sec, 1500) self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) self.satnogs_iq_sink_0 = satnogs.iq_sink(32767, iq_file_path, False, enable_iq_dump) @@ -80,7 +80,7 @@ class satnogs_fm_demod(gr.top_block): self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain), 0) self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0) self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) - + self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass( 1, audio_samp_rate, deviation+max_modulation_freq, 3000, firdes.WIN_HAMMING, 6.76)) self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(int(samp_rate_rx/filter_rate), (xlate_filter_taps), lo_offset, samp_rate_rx) @@ -95,15 +95,15 @@ class satnogs_fm_demod(gr.top_block): ################################################## # Connections ################################################## - self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) - self.connect((self.analog_quadrature_demod_cf_0, 0), (self.satnogs_ogg_encoder_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.low_pass_filter_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_iq_sink_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_waterfall_sink_0, 0)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blks2_rational_resampler_xxx_1, 0)) - self.connect((self.low_pass_filter_0, 0), (self.analog_quadrature_demod_cf_0, 0)) - self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) - self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) + self.connect((self.analog_quadrature_demod_cf_0, 0), (self.satnogs_ogg_encoder_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.low_pass_filter_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_iq_sink_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_waterfall_sink_0, 0)) + self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blks2_rational_resampler_xxx_1, 0)) + self.connect((self.low_pass_filter_0, 0), (self.analog_quadrature_demod_cf_0, 0)) + self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) + self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) def get_antenna(self): return self.antenna @@ -296,7 +296,7 @@ def argument_parser(): "", "--enable-iq-dump", dest="enable_iq_dump", type="intx", default=0, help="Set enable_iq_dump [default=%default]") parser.add_option( - "", "--file-path", dest="file_path", type="string", default='test.wav', + "", "--file-path", dest="file_path", type="string", default='test.ogg', help="Set file_path [default=%default]") parser.add_option( "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain), diff --git a/apps/flowgraphs/satnogs_fsk9600_ax25.py b/apps/flowgraphs/satnogs_fsk9600_ax25.py index 1b6e63b..37d4556 100755 --- a/apps/flowgraphs/satnogs_fsk9600_ax25.py +++ b/apps/flowgraphs/satnogs_fsk9600_ax25.py @@ -5,7 +5,7 @@ # Title: FSK9600 AX.25 decoder # Author: Manolis Surligas (surligas@gmail.com) # Description: FSK9600 AX.25 decoder -# Generated: Tue Aug 8 23:36:43 2017 +# Generated: Wed Nov 1 14:52:56 2017 ################################################## from gnuradio import analog @@ -24,21 +24,28 @@ import time class satnogs_fsk9600_ax25(gr.top_block): - def __init__(self, doppler_correction_per_sec=1000, enable_iq_dump=0, file_path='test.wav', lo_offset=100e3, ppm=0, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): + def __init__(self, rigctl_port=4532, waterfall_file_path='/tmp/waterfall.dat', dev_args=satnogs.not_set_dev_args, ppm=0, file_path='test.wav', antenna=satnogs.not_set_antenna, doppler_correction_per_sec=1000, rf_gain=satnogs.not_set_rx_rf_gain, lo_offset=100e3, decoded_data_file_path='/tmp/.satnogs/data/data', iq_file_path='/tmp/iq.dat', rx_sdr_device='usrpb200', if_gain=satnogs.not_set_rx_if_gain, rx_freq=100e6, bb_gain=satnogs.not_set_rx_bb_gain, enable_iq_dump=0): gr.top_block.__init__(self, "FSK9600 AX.25 decoder ") ################################################## # Parameters ################################################## - self.doppler_correction_per_sec = doppler_correction_per_sec - self.enable_iq_dump = enable_iq_dump - self.file_path = file_path - self.lo_offset = lo_offset - self.ppm = ppm self.rigctl_port = rigctl_port - self.rx_freq = rx_freq - self.rx_sdr_device = rx_sdr_device self.waterfall_file_path = waterfall_file_path + self.dev_args = dev_args + self.ppm = ppm + self.file_path = file_path + self.antenna = antenna + self.doppler_correction_per_sec = doppler_correction_per_sec + self.rf_gain = rf_gain + self.lo_offset = lo_offset + self.decoded_data_file_path = decoded_data_file_path + self.iq_file_path = iq_file_path + self.rx_sdr_device = rx_sdr_device + self.if_gain = if_gain + self.rx_freq = rx_freq + self.bb_gain = bb_gain + self.enable_iq_dump = enable_iq_dump ################################################## # Variables @@ -58,7 +65,7 @@ class satnogs_fsk9600_ax25(gr.top_block): ################################################## # Blocks ################################################## - self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 8, 1024, waterfall_file_path, 1) + self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000, 1500) self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) self.satnogs_iq_sink_0 = satnogs.iq_sink(16768, '/tmp/iq.bin', False, enable_iq_dump) @@ -68,17 +75,17 @@ class satnogs_fsk9600_ax25(gr.top_block): self.satnogs_frame_file_sink_0 = satnogs.frame_file_sink('/tmp/fsk9600_crc_failed', 0) self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx) self.satnogs_ax25_decoder_bm_0 = satnogs.ax25_decoder_bm('GND', 0, True, False, 1024, 3) - self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] ) + self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.handle_rx_dev_args(rx_sdr_device, dev_args) ) self.osmosdr_source_0.set_sample_rate(samp_rate_rx) self.osmosdr_source_0.set_center_freq(rx_freq - lo_offset, 0) self.osmosdr_source_0.set_freq_corr(ppm, 0) self.osmosdr_source_0.set_dc_offset_mode(2, 0) self.osmosdr_source_0.set_iq_balance_mode(0, 0) self.osmosdr_source_0.set_gain_mode(False, 0) - self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'], 0) - self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[rx_sdr_device]['if_gain'], 0) - self.osmosdr_source_0.set_bb_gain(satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'], 0) - self.osmosdr_source_0.set_antenna(satnogs.hw_rx_settings[rx_sdr_device]['antenna'], 0) + self.osmosdr_source_0.set_gain(satnogs.handle_rx_rf_gain(rx_sdr_device, rf_gain), 0) + self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(rx_sdr_device, if_gain), 0) + self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain), 0) + self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0) self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) self.low_pass_filter_0 = filter.fir_filter_fff(1, firdes.low_pass( @@ -118,17 +125,30 @@ class satnogs_fsk9600_ax25(gr.top_block): self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) - def get_doppler_correction_per_sec(self): - return self.doppler_correction_per_sec + def get_rigctl_port(self): + return self.rigctl_port - def set_doppler_correction_per_sec(self, doppler_correction_per_sec): - self.doppler_correction_per_sec = doppler_correction_per_sec + def set_rigctl_port(self, rigctl_port): + self.rigctl_port = rigctl_port - def get_enable_iq_dump(self): - return self.enable_iq_dump + def get_waterfall_file_path(self): + return self.waterfall_file_path - def set_enable_iq_dump(self, enable_iq_dump): - self.enable_iq_dump = enable_iq_dump + def set_waterfall_file_path(self, waterfall_file_path): + self.waterfall_file_path = waterfall_file_path + + def get_dev_args(self): + return self.dev_args + + def set_dev_args(self, dev_args): + self.dev_args = dev_args + + def get_ppm(self): + return self.ppm + + def set_ppm(self, ppm): + self.ppm = ppm + self.osmosdr_source_0.set_freq_corr(self.ppm, 0) def get_file_path(self): return self.file_path @@ -136,6 +156,26 @@ class satnogs_fsk9600_ax25(gr.top_block): def set_file_path(self, file_path): self.file_path = file_path + def get_antenna(self): + return self.antenna + + def set_antenna(self, antenna): + self.antenna = antenna + self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(self.rx_sdr_device, self.antenna), 0) + + def get_doppler_correction_per_sec(self): + return self.doppler_correction_per_sec + + def set_doppler_correction_per_sec(self, doppler_correction_per_sec): + self.doppler_correction_per_sec = doppler_correction_per_sec + + def get_rf_gain(self): + return self.rf_gain + + def set_rf_gain(self, rf_gain): + self.rf_gain = rf_gain + self.osmosdr_source_0.set_gain(satnogs.handle_rx_rf_gain(self.rx_sdr_device, self.rf_gain), 0) + def get_lo_offset(self): return self.lo_offset @@ -144,18 +184,36 @@ class satnogs_fsk9600_ax25(gr.top_block): self.osmosdr_source_0.set_center_freq(self.rx_freq - self.lo_offset, 0) self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset) - def get_ppm(self): - return self.ppm + def get_decoded_data_file_path(self): + return self.decoded_data_file_path - def set_ppm(self, ppm): - self.ppm = ppm - self.osmosdr_source_0.set_freq_corr(self.ppm, 0) + def set_decoded_data_file_path(self, decoded_data_file_path): + self.decoded_data_file_path = decoded_data_file_path - def get_rigctl_port(self): - return self.rigctl_port + def get_iq_file_path(self): + return self.iq_file_path - def set_rigctl_port(self, rigctl_port): - self.rigctl_port = rigctl_port + def set_iq_file_path(self, iq_file_path): + self.iq_file_path = iq_file_path + + def get_rx_sdr_device(self): + return self.rx_sdr_device + + def set_rx_sdr_device(self, rx_sdr_device): + self.rx_sdr_device = rx_sdr_device + self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) + self.osmosdr_source_0.set_gain(satnogs.handle_rx_rf_gain(self.rx_sdr_device, self.rf_gain), 0) + self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(self.rx_sdr_device, self.if_gain), 0) + self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(self.rx_sdr_device, self.bb_gain), 0) + self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(self.rx_sdr_device, self.antenna), 0) + self.set_audio_gain(satnogs.fm_demod_settings[self.rx_sdr_device]['audio_gain']) + + def get_if_gain(self): + return self.if_gain + + def set_if_gain(self, if_gain): + self.if_gain = if_gain + self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(self.rx_sdr_device, self.if_gain), 0) def get_rx_freq(self): return self.rx_freq @@ -165,23 +223,18 @@ class satnogs_fsk9600_ax25(gr.top_block): self.satnogs_coarse_doppler_correction_cc_0.set_new_freq_locked(self.rx_freq) self.osmosdr_source_0.set_center_freq(self.rx_freq - self.lo_offset, 0) - def get_rx_sdr_device(self): - return self.rx_sdr_device + def get_bb_gain(self): + return self.bb_gain - def set_rx_sdr_device(self, rx_sdr_device): - self.rx_sdr_device = rx_sdr_device - self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) - self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['rf_gain'], 0) - self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['if_gain'], 0) - self.osmosdr_source_0.set_bb_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['bb_gain'], 0) - self.osmosdr_source_0.set_antenna(satnogs.hw_rx_settings[self.rx_sdr_device]['antenna'], 0) - self.set_audio_gain(satnogs.fm_demod_settings[self.rx_sdr_device]['audio_gain']) + def set_bb_gain(self, bb_gain): + self.bb_gain = bb_gain + self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(self.rx_sdr_device, self.bb_gain), 0) - def get_waterfall_file_path(self): - return self.waterfall_file_path + def get_enable_iq_dump(self): + return self.enable_iq_dump - def set_waterfall_file_path(self, waterfall_file_path): - self.waterfall_file_path = waterfall_file_path + def set_enable_iq_dump(self, enable_iq_dump): + self.enable_iq_dump = enable_iq_dump def get_samp_rate_rx(self): return self.samp_rate_rx @@ -252,32 +305,53 @@ def argument_parser(): description = 'FSK9600 AX.25 decoder' parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description) parser.add_option( - "", "--doppler-correction-per-sec", dest="doppler_correction_per_sec", type="intx", default=1000, - help="Set doppler_correction_per_sec [default=%default]") + "", "--rigctl-port", dest="rigctl_port", type="intx", default=4532, + help="Set rigctl_port [default=%default]") parser.add_option( - "", "--enable-iq-dump", dest="enable_iq_dump", type="intx", default=0, - help="Set enable_iq_dump [default=%default]") + "", "--waterfall-file-path", dest="waterfall_file_path", type="string", default='/tmp/waterfall.dat', + help="Set waterfall_file_path [default=%default]") parser.add_option( - "", "--file-path", dest="file_path", type="string", default='test.wav', - help="Set file_path [default=%default]") - parser.add_option( - "", "--lo-offset", dest="lo_offset", type="eng_float", default=eng_notation.num_to_str(100e3), - help="Set lo_offset [default=%default]") + "", "--dev-args", dest="dev_args", type="string", default=satnogs.not_set_dev_args, + help="Set dev_args [default=%default]") parser.add_option( "", "--ppm", dest="ppm", type="intx", default=0, help="Set ppm [default=%default]") parser.add_option( - "", "--rigctl-port", dest="rigctl_port", type="intx", default=4532, - help="Set rigctl_port [default=%default]") + "", "--file-path", dest="file_path", type="string", default='test.wav', + help="Set file_path [default=%default]") parser.add_option( - "", "--rx-freq", dest="rx_freq", type="eng_float", default=eng_notation.num_to_str(100e6), - help="Set rx_freq [default=%default]") + "", "--antenna", dest="antenna", type="string", default=satnogs.not_set_antenna, + help="Set antenna [default=%default]") + parser.add_option( + "", "--doppler-correction-per-sec", dest="doppler_correction_per_sec", type="intx", default=1000, + help="Set doppler_correction_per_sec [default=%default]") + parser.add_option( + "", "--rf-gain", dest="rf_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_rf_gain), + help="Set rf_gain [default=%default]") + parser.add_option( + "", "--lo-offset", dest="lo_offset", type="eng_float", default=eng_notation.num_to_str(100e3), + help="Set lo_offset [default=%default]") + parser.add_option( + "", "--decoded-data-file-path", dest="decoded_data_file_path", type="string", default='/tmp/.satnogs/data/data', + help="Set decoded_data_file_path [default=%default]") + parser.add_option( + "", "--iq-file-path", dest="iq_file_path", type="string", default='/tmp/iq.dat', + help="Set iq_file_path [default=%default]") parser.add_option( "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200', help="Set rx_sdr_device [default=%default]") parser.add_option( - "", "--waterfall-file-path", dest="waterfall_file_path", type="string", default='/tmp/waterfall.dat', - help="Set waterfall_file_path [default=%default]") + "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain), + help="Set if_gain [default=%default]") + parser.add_option( + "", "--rx-freq", dest="rx_freq", type="eng_float", default=eng_notation.num_to_str(100e6), + help="Set rx_freq [default=%default]") + parser.add_option( + "", "--bb-gain", dest="bb_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_bb_gain), + help="Set bb_gain [default=%default]") + parser.add_option( + "", "--enable-iq-dump", dest="enable_iq_dump", type="intx", default=0, + help="Set enable_iq_dump [default=%default]") return parser @@ -285,7 +359,7 @@ def main(top_block_cls=satnogs_fsk9600_ax25, options=None): if options is None: options, _ = argument_parser().parse_args() - tb = top_block_cls(doppler_correction_per_sec=options.doppler_correction_per_sec, enable_iq_dump=options.enable_iq_dump, file_path=options.file_path, lo_offset=options.lo_offset, ppm=options.ppm, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, waterfall_file_path=options.waterfall_file_path) + tb = top_block_cls(rigctl_port=options.rigctl_port, waterfall_file_path=options.waterfall_file_path, dev_args=options.dev_args, ppm=options.ppm, file_path=options.file_path, antenna=options.antenna, doppler_correction_per_sec=options.doppler_correction_per_sec, rf_gain=options.rf_gain, lo_offset=options.lo_offset, decoded_data_file_path=options.decoded_data_file_path, iq_file_path=options.iq_file_path, rx_sdr_device=options.rx_sdr_device, if_gain=options.if_gain, rx_freq=options.rx_freq, bb_gain=options.bb_gain, enable_iq_dump=options.enable_iq_dump) tb.start() tb.wait() diff --git a/apps/flowgraphs/satnogs_fsk9600_g3ruh_ax25.py b/apps/flowgraphs/satnogs_fsk9600_g3ruh_ax25.py index 740cf4d..a69c7bc 100755 --- a/apps/flowgraphs/satnogs_fsk9600_g3ruh_ax25.py +++ b/apps/flowgraphs/satnogs_fsk9600_g3ruh_ax25.py @@ -5,7 +5,7 @@ # Title: FSK9600 AX.25 decoder with G3RUH support # Author: Manolis Surligas (surligas@gmail.com) # Description: FSK9600 AX.25 decoder with G3RUH support -# Generated: Fri Oct 6 16:51:49 2017 +# Generated: Wed Nov 1 13:04:00 2017 ################################################## from gnuradio import analog @@ -24,28 +24,28 @@ import time class satnogs_fsk9600_g3ruh_ax25(gr.top_block): - def __init__(self, decoded_data_file_path='/tmp/.satnogs/data/data', doppler_correction_per_sec=1000, enable_iq_dump=0, file_path='test.wav', lo_offset=100e3, ppm=0, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat', rf_gain=satnogs.not_set_rx_rf_gain, if_gain=satnogs.not_set_rx_if_gain, bb_gain=satnogs.not_set_rx_bb_gain, antenna='', dev_args=satnogs.not_set_dev_args, iq_file_path='/tmp/iq.dat'): + def __init__(self, antenna=satnogs.not_set_antenna, bb_gain=satnogs.not_set_rx_bb_gain, decoded_data_file_path='/tmp/.satnogs/data/data', dev_args=satnogs.not_set_dev_args, doppler_correction_per_sec=1000, enable_iq_dump=0, file_path='test.wav', if_gain=satnogs.not_set_rx_if_gain, iq_file_path='/tmp/iq.dat', lo_offset=100e3, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "FSK9600 AX.25 decoder with G3RUH support") ################################################## # Parameters ################################################## + self.antenna = antenna + self.bb_gain = bb_gain self.decoded_data_file_path = decoded_data_file_path + self.dev_args = dev_args self.doppler_correction_per_sec = doppler_correction_per_sec self.enable_iq_dump = enable_iq_dump self.file_path = file_path + self.if_gain = if_gain + self.iq_file_path = iq_file_path self.lo_offset = lo_offset self.ppm = ppm + self.rf_gain = rf_gain self.rigctl_port = rigctl_port self.rx_freq = rx_freq self.rx_sdr_device = rx_sdr_device self.waterfall_file_path = waterfall_file_path - self.rf_gain = rf_gain - self.if_gain = if_gain - self.bb_gain = bb_gain - self.antenna = antenna - self.dev_args = dev_args - self.iq_file_path = iq_file_path ################################################## # Variables @@ -54,9 +54,9 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): self.deviation = deviation = 5000 self.baud_rate = baud_rate = 9600 self.xlate_filter_taps = xlate_filter_taps = firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) - + self.taps = taps = firdes.low_pass(12.0, samp_rate_rx, 100e3, 60000, firdes.WIN_HAMMING, 6.76) - + self.modulation_index = modulation_index = deviation / (baud_rate / 2.0) self.filter_rate = filter_rate = 250000 self.audio_samp_rate = audio_samp_rate = 48000 @@ -65,7 +65,7 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): ################################################## # Blocks ################################################## - self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 8, 1024, waterfall_file_path, 1) + self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000, 1500) self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) self.satnogs_iq_sink_0 = satnogs.iq_sink(16768, iq_file_path, False, enable_iq_dump) @@ -75,19 +75,19 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): self.satnogs_frame_file_sink_0 = satnogs.frame_file_sink('/tmp/fsk9600_crc_failed', 0) self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx) self.satnogs_ax25_decoder_bm_0 = satnogs.ax25_decoder_bm('GND', 0, True, True, 1024, 3) - self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + dev_args ) + self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.handle_rx_dev_args(rx_sdr_device, dev_args) ) self.osmosdr_source_0.set_sample_rate(samp_rate_rx) self.osmosdr_source_0.set_center_freq(rx_freq - lo_offset, 0) self.osmosdr_source_0.set_freq_corr(ppm, 0) self.osmosdr_source_0.set_dc_offset_mode(2, 0) self.osmosdr_source_0.set_iq_balance_mode(0, 0) self.osmosdr_source_0.set_gain_mode(False, 0) - self.osmosdr_source_0.set_gain(rf_gain, 0) - self.osmosdr_source_0.set_if_gain(if_gain, 0) - self.osmosdr_source_0.set_bb_gain(bb_gain, 0) - self.osmosdr_source_0.set_antenna(antenna, 0) + self.osmosdr_source_0.set_gain(satnogs.handle_rx_rf_gain(rx_sdr_device, rf_gain), 0) + self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(rx_sdr_device, if_gain), 0) + self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain), 0) + self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0) self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) - + self.low_pass_filter_0 = filter.fir_filter_fff(1, firdes.low_pass( 1, audio_samp_rate, 7850, audio_samp_rate * 0.15, firdes.WIN_HAMMING, 6.76)) self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(int(samp_rate_rx/filter_rate), (xlate_filter_taps), lo_offset, samp_rate_rx) @@ -106,24 +106,38 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): ################################################## # Connections ################################################## - self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'failed_pdu'), (self.satnogs_frame_file_sink_0, 'frame')) - self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_frame_file_sink_0_0, 'frame')) - self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'failed_pdu'), (self.satnogs_frame_file_sink_0_1, 'frame')) - self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_frame_file_sink_0_1_0, 'frame')) - self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) - self.connect((self.analog_quadrature_demod_cf_0_0, 0), (self.dc_blocker_xx_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.analog_quadrature_demod_cf_0_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_iq_sink_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_waterfall_sink_0, 0)) - self.connect((self.dc_blocker_xx_0, 0), (self.low_pass_filter_0, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.satnogs_ax25_decoder_bm_0, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.digital_costas_loop_cc_0, 0), (self.blks2_rational_resampler_xxx_1, 0)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.digital_costas_loop_cc_0, 0)) - self.connect((self.low_pass_filter_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.low_pass_filter_0, 0), (self.satnogs_ogg_encoder_0, 0)) - self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) - self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'failed_pdu'), (self.satnogs_frame_file_sink_0, 'frame')) + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_frame_file_sink_0_0, 'frame')) + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'failed_pdu'), (self.satnogs_frame_file_sink_0_1, 'frame')) + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_frame_file_sink_0_1_0, 'frame')) + self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) + self.connect((self.analog_quadrature_demod_cf_0_0, 0), (self.dc_blocker_xx_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.analog_quadrature_demod_cf_0_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_iq_sink_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_waterfall_sink_0, 0)) + self.connect((self.dc_blocker_xx_0, 0), (self.low_pass_filter_0, 0)) + self.connect((self.digital_binary_slicer_fb_0, 0), (self.satnogs_ax25_decoder_bm_0, 0)) + self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) + self.connect((self.digital_costas_loop_cc_0, 0), (self.blks2_rational_resampler_xxx_1, 0)) + self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.digital_costas_loop_cc_0, 0)) + self.connect((self.low_pass_filter_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) + self.connect((self.low_pass_filter_0, 0), (self.satnogs_ogg_encoder_0, 0)) + self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) + self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + + def get_antenna(self): + return self.antenna + + def set_antenna(self, antenna): + self.antenna = antenna + self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(self.rx_sdr_device, self.antenna), 0) + + def get_bb_gain(self): + return self.bb_gain + + def set_bb_gain(self, bb_gain): + self.bb_gain = bb_gain + self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(self.rx_sdr_device, self.bb_gain), 0) def get_decoded_data_file_path(self): return self.decoded_data_file_path @@ -131,6 +145,12 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): def set_decoded_data_file_path(self, decoded_data_file_path): self.decoded_data_file_path = decoded_data_file_path + def get_dev_args(self): + return self.dev_args + + def set_dev_args(self, dev_args): + self.dev_args = dev_args + def get_doppler_correction_per_sec(self): return self.doppler_correction_per_sec @@ -149,6 +169,19 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): def set_file_path(self, file_path): self.file_path = file_path + def get_if_gain(self): + return self.if_gain + + def set_if_gain(self, if_gain): + self.if_gain = if_gain + self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(self.rx_sdr_device, self.if_gain), 0) + + def get_iq_file_path(self): + return self.iq_file_path + + def set_iq_file_path(self, iq_file_path): + self.iq_file_path = iq_file_path + def get_lo_offset(self): return self.lo_offset @@ -164,6 +197,13 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): self.ppm = ppm self.osmosdr_source_0.set_freq_corr(self.ppm, 0) + def get_rf_gain(self): + return self.rf_gain + + def set_rf_gain(self, rf_gain): + self.rf_gain = rf_gain + self.osmosdr_source_0.set_gain(satnogs.handle_rx_rf_gain(self.rx_sdr_device, self.rf_gain), 0) + def get_rigctl_port(self): return self.rigctl_port @@ -184,6 +224,10 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): def set_rx_sdr_device(self, rx_sdr_device): self.rx_sdr_device = rx_sdr_device self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) + self.osmosdr_source_0.set_gain(satnogs.handle_rx_rf_gain(self.rx_sdr_device, self.rf_gain), 0) + self.osmosdr_source_0.set_if_gain(satnogs.handle_rx_if_gain(self.rx_sdr_device, self.if_gain), 0) + self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(self.rx_sdr_device, self.bb_gain), 0) + self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(self.rx_sdr_device, self.antenna), 0) self.set_audio_gain(satnogs.fm_demod_settings[self.rx_sdr_device]['audio_gain']) def get_waterfall_file_path(self): @@ -192,46 +236,6 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): def set_waterfall_file_path(self, waterfall_file_path): self.waterfall_file_path = waterfall_file_path - def get_rf_gain(self): - return self.rf_gain - - def set_rf_gain(self, rf_gain): - self.rf_gain = rf_gain - self.osmosdr_source_0.set_gain(self.rf_gain, 0) - - def get_if_gain(self): - return self.if_gain - - def set_if_gain(self, if_gain): - self.if_gain = if_gain - self.osmosdr_source_0.set_if_gain(self.if_gain, 0) - - def get_bb_gain(self): - return self.bb_gain - - def set_bb_gain(self, bb_gain): - self.bb_gain = bb_gain - self.osmosdr_source_0.set_bb_gain(self.bb_gain, 0) - - def get_antenna(self): - return self.antenna - - def set_antenna(self, antenna): - self.antenna = antenna - self.osmosdr_source_0.set_antenna(self.antenna, 0) - - def get_dev_args(self): - return self.dev_args - - def set_dev_args(self, dev_args): - self.dev_args = dev_args - - def get_iq_file_path(self): - return self.iq_file_path - - def set_iq_file_path(self, iq_file_path): - self.iq_file_path = iq_file_path - def get_samp_rate_rx(self): return self.samp_rate_rx @@ -300,9 +304,18 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): def argument_parser(): description = 'FSK9600 AX.25 decoder with G3RUH support' parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description) + parser.add_option( + "", "--antenna", dest="antenna", type="string", default=satnogs.not_set_antenna, + help="Set antenna [default=%default]") + parser.add_option( + "", "--bb-gain", dest="bb_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_bb_gain), + help="Set bb_gain [default=%default]") parser.add_option( "", "--decoded-data-file-path", dest="decoded_data_file_path", type="string", default='/tmp/.satnogs/data/data', help="Set decoded_data_file_path [default=%default]") + parser.add_option( + "", "--dev-args", dest="dev_args", type="string", default=satnogs.not_set_dev_args, + help="Set dev_args [default=%default]") parser.add_option( "", "--doppler-correction-per-sec", dest="doppler_correction_per_sec", type="intx", default=1000, help="Set doppler_correction_per_sec [default=%default]") @@ -312,12 +325,21 @@ def argument_parser(): parser.add_option( "", "--file-path", dest="file_path", type="string", default='test.wav', help="Set file_path [default=%default]") + parser.add_option( + "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain), + help="Set if_gain [default=%default]") + parser.add_option( + "", "--iq-file-path", dest="iq_file_path", type="string", default='/tmp/iq.dat', + help="Set iq_file_path [default=%default]") parser.add_option( "", "--lo-offset", dest="lo_offset", type="eng_float", default=eng_notation.num_to_str(100e3), help="Set lo_offset [default=%default]") parser.add_option( "", "--ppm", dest="ppm", type="intx", default=0, help="Set ppm [default=%default]") + parser.add_option( + "", "--rf-gain", dest="rf_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_rf_gain), + help="Set rf_gain [default=%default]") parser.add_option( "", "--rigctl-port", dest="rigctl_port", type="intx", default=4532, help="Set rigctl_port [default=%default]") @@ -330,24 +352,6 @@ def argument_parser(): parser.add_option( "", "--waterfall-file-path", dest="waterfall_file_path", type="string", default='/tmp/waterfall.dat', help="Set waterfall_file_path [default=%default]") - parser.add_option( - "", "--rf-gain", dest="rf_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_rf_gain), - help="Set rf_gain [default=%default]") - parser.add_option( - "", "--if-gain", dest="if_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_if_gain), - help="Set if_gain [default=%default]") - parser.add_option( - "", "--bb-gain", dest="bb_gain", type="eng_float", default=eng_notation.num_to_str(satnogs.not_set_rx_bb_gain), - help="Set bb_gain [default=%default]") - parser.add_option( - "", "--antenna", dest="antenna", type="string", default='', - help="Set antenna [default=%default]") - parser.add_option( - "", "--dev-args", dest="dev_args", type="string", default=satnogs.not_set_dev_args, - help="Set dev_args [default=%default]") - parser.add_option( - "", "--iq-file-path", dest="iq_file_path", type="string", default='/tmp/iq.dat', - help="Set iq_file_path [default=%default]") return parser @@ -355,7 +359,7 @@ def main(top_block_cls=satnogs_fsk9600_g3ruh_ax25, options=None): if options is None: options, _ = argument_parser().parse_args() - tb = top_block_cls(decoded_data_file_path=options.decoded_data_file_path, doppler_correction_per_sec=options.doppler_correction_per_sec, enable_iq_dump=options.enable_iq_dump, file_path=options.file_path, lo_offset=options.lo_offset, ppm=options.ppm, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, waterfall_file_path=options.waterfall_file_path, rf_gain=options.rf_gain, if_gain=options.if_gain, bb_gain=options.bb_gain, antenna=options.antenna, dev_args=options.dev_args, iq_file_path=options.iq_file_path) + tb = top_block_cls(antenna=options.antenna, bb_gain=options.bb_gain, decoded_data_file_path=options.decoded_data_file_path, dev_args=options.dev_args, doppler_correction_per_sec=options.doppler_correction_per_sec, enable_iq_dump=options.enable_iq_dump, file_path=options.file_path, if_gain=options.if_gain, iq_file_path=options.iq_file_path, lo_offset=options.lo_offset, ppm=options.ppm, rf_gain=options.rf_gain, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, waterfall_file_path=options.waterfall_file_path) tb.start() tb.wait() diff --git a/python/hw_settings.py b/python/hw_settings.py index dca1ae1..edac105 100644 --- a/python/hw_settings.py +++ b/python/hw_settings.py @@ -36,10 +36,10 @@ hw_tx_settings = {'usrpb200' : {'rf_gain' : 60.0, 'if_gain' : 0.0, hw_rx_settings = {'usrpb200' : {'rf_gain' : 50.0, 'if_gain' : 0.0, 'bb_gain' : 0.0, 'samp_rate' : 5e5, - 'antenna' : 'RX2', 'dev_arg': 'uhd'}, + 'antenna' : 'TX/RX', 'dev_arg': 'uhd'}, 'usrp2' : {'rf_gain' : 50.0, 'if_gain' : 0.0, 'bb_gain' : 0.0, 'samp_rate' : 5e5, - 'antenna' : 'RX2', 'dev_arg': 'uhd'}, + 'antenna' : 'TX/RX', 'dev_arg': 'uhd'}, 'airspy' : {'rf_gain' : 30.0, 'if_gain' : 0.0, 'bb_gain' : 0.0, 'samp_rate' : 10e6, 'antenna' : '', 'dev_arg': 'airspy'},