From 05f9e4115807ea6bdfe752fba4f032cd59ad4d5f Mon Sep 17 00:00:00 2001 From: Nikos Karamolegkos Date: Fri, 23 Feb 2018 21:38:35 +0200 Subject: [PATCH] Add UDP sink for real time propagation of frames --- apps/flowgraphs/afsk1200_ax25.grc | 135 +++++++++++++++++ apps/flowgraphs/ax25_transceiver_qt.grc | 112 +++++++++++++- apps/flowgraphs/cw_decoder.grc | 135 +++++++++++++++++ apps/flowgraphs/fsk9600_ax25.grc | 137 +++++++++++++++++- apps/flowgraphs/fsk9600_g3ruh_ax25.grc | 137 +++++++++++++++++- apps/flowgraphs/satnogs_afsk1200_ax25.py | 28 +++- apps/flowgraphs/satnogs_cw_decoder.py | 28 +++- apps/flowgraphs/satnogs_fsk9600_ax25.py | 28 +++- apps/flowgraphs/satnogs_fsk9600_g3ruh_ax25.py | 28 +++- 9 files changed, 751 insertions(+), 17 deletions(-) diff --git a/apps/flowgraphs/afsk1200_ax25.grc b/apps/flowgraphs/afsk1200_ax25.grc index 3691c63..3412d9d 100644 --- a/apps/flowgraphs/afsk1200_ax25.grc +++ b/apps/flowgraphs/afsk1200_ax25.grc @@ -3408,6 +3408,49 @@ max_modulation_freq = 3000 1000 + + satnogs_udp_msg_sink + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (1364, 801) + + + _rotation + 180 + + + id + satnogs_udp_msg_sink_0_0 + + + addr + udp_IP + + + mtu + 1500 + + + port + udp_port + + satnogs_waterfall_sink @@ -3506,6 +3549,92 @@ max_modulation_freq = 3000 1200.0 + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (821, 873) + + + _rotation + 0 + + + id + udp_IP + + + label + + + + short_id + + + + type + string + + + value + 127.0.0.1 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (933, 873) + + + _rotation + 0 + + + id + udp_port + + + label + + + + short_id + + + + type + intx + + + value + 16887 + + parameter @@ -3651,6 +3780,12 @@ max_modulation_freq = 3000 pdu frame + + satnogs_ax25_decoder_bm_0 + satnogs_udp_msg_sink_0_0 + pdu + in + satnogs_coarse_doppler_correction_cc_0 freq_xlating_fir_filter_xxx_0 diff --git a/apps/flowgraphs/ax25_transceiver_qt.grc b/apps/flowgraphs/ax25_transceiver_qt.grc index 4bdea7d..f7d2129 100644 --- a/apps/flowgraphs/ax25_transceiver_qt.grc +++ b/apps/flowgraphs/ax25_transceiver_qt.grc @@ -1,5 +1,5 @@ - + Fri Jul 1 17:53:00 2016 @@ -3953,6 +3953,10 @@ is too great and becomes a bottlneck. satnogs_ax25_decoder_bm + + n_sync_flags + 2 + alias @@ -4146,6 +4150,10 @@ is too great and becomes a bottlneck. _enabled 1 + + filename + + _coordinate (928, 860) @@ -4158,6 +4166,14 @@ is too great and becomes a bottlneck. id satnogs_multi_format_msg_sink_0_0 + + outstream + True + + + timestamp + False + format 0 @@ -4195,7 +4211,7 @@ is too great and becomes a bottlneck. addr - "127.0.0.1" + udp_IP mtu @@ -4203,7 +4219,7 @@ is too great and becomes a bottlneck. port - 16887 + udp_port @@ -4250,6 +4266,10 @@ similar to produce dynamic payloads. maxoutbuf 0 + + msg_type + 0 + minoutbuf 0 @@ -4259,6 +4279,92 @@ similar to produce dynamic payloads. 16886 + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (87, 937) + + + _rotation + 0 + + + id + udp_IP + + + label + + + + short_id + + + + type + string + + + value + 127.0.0.1 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (207, 937) + + + _rotation + 0 + + + id + udp_port + + + label + + + + short_id + + + + type + intx + + + value + 16887 + + analog_frequency_modulator_fc_0 pfb_arb_resampler_xxx_0 diff --git a/apps/flowgraphs/cw_decoder.grc b/apps/flowgraphs/cw_decoder.grc index 9dc45ae..b7845b7 100644 --- a/apps/flowgraphs/cw_decoder.grc +++ b/apps/flowgraphs/cw_decoder.grc @@ -3070,6 +3070,49 @@ we shift the LO a little further 1000 + + satnogs_udp_msg_sink + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (933, 490) + + + _rotation + 180 + + + id + satnogs_udp_msg_sink_0_0 + + + addr + udp_IP + + + mtu + 1500 + + + port + udp_port + + satnogs_waterfall_sink @@ -3125,6 +3168,92 @@ we shift the LO a little further (samp_rate_rx/xlating_decimation) + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (949, 690) + + + _rotation + 0 + + + id + udp_IP + + + label + + + + short_id + + + + type + string + + + value + 127.0.0.1 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (1069, 690) + + + _rotation + 0 + + + id + udp_port + + + label + + + + short_id + + + + type + intx + + + value + 16887 + + parameter @@ -3295,6 +3424,12 @@ we shift the LO a little further out frame + + satnogs_morse_decoder_0 + satnogs_udp_msg_sink_0_0 + out + in + satnogs_tcp_rigctl_msg_source_0 satnogs_coarse_doppler_correction_cc_0 diff --git a/apps/flowgraphs/fsk9600_ax25.grc b/apps/flowgraphs/fsk9600_ax25.grc index db15ece..098cb79 100644 --- a/apps/flowgraphs/fsk9600_ax25.grc +++ b/apps/flowgraphs/fsk9600_ax25.grc @@ -2970,7 +2970,7 @@ we shift the LO a little further _coordinate - (1136, 588) + (1148, 546) _rotation @@ -3138,6 +3138,49 @@ we shift the LO a little further 1000 + + satnogs_udp_msg_sink + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (1180, 650) + + + _rotation + 180 + + + id + satnogs_udp_msg_sink_0_0 + + + addr + udp_IP + + + mtu + 1500 + + + port + udp_port + + satnogs_waterfall_sink @@ -3193,6 +3236,92 @@ we shift the LO a little further audio_samp_rate + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (837, 706) + + + _rotation + 0 + + + id + udp_IP + + + label + + + + short_id + + + + type + string + + + value + 127.0.0.1 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (949, 706) + + + _rotation + 0 + + + id + udp_port + + + label + + + + short_id + + + + type + intx + + + value + 16887 + + parameter @@ -3314,6 +3443,12 @@ we shift the LO a little further pdu frame + + satnogs_ax25_decoder_bm_0 + satnogs_udp_msg_sink_0_0 + pdu + in + satnogs_coarse_doppler_correction_cc_0 freq_xlating_fir_filter_xxx_0 diff --git a/apps/flowgraphs/fsk9600_g3ruh_ax25.grc b/apps/flowgraphs/fsk9600_g3ruh_ax25.grc index 429c8a0..99bfadd 100644 --- a/apps/flowgraphs/fsk9600_g3ruh_ax25.grc +++ b/apps/flowgraphs/fsk9600_g3ruh_ax25.grc @@ -2970,7 +2970,7 @@ we shift the LO a little further _coordinate - (1176, 604) + (1156, 602) _rotation @@ -3138,6 +3138,49 @@ we shift the LO a little further 1000 + + satnogs_udp_msg_sink + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (1188, 690) + + + _rotation + 180 + + + id + satnogs_udp_msg_sink_0_0 + + + addr + udp_IP + + + mtu + 1500 + + + port + udp_port + + satnogs_waterfall_sink @@ -3193,6 +3236,92 @@ we shift the LO a little further audio_samp_rate + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (837, 746) + + + _rotation + 0 + + + id + udp_IP + + + label + + + + short_id + + + + type + string + + + value + 127.0.0.1 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (949, 746) + + + _rotation + 0 + + + id + udp_port + + + label + + + + short_id + + + + type + intx + + + value + 16887 + + parameter @@ -3314,6 +3443,12 @@ we shift the LO a little further pdu frame + + satnogs_ax25_decoder_bm_0 + satnogs_udp_msg_sink_0_0 + pdu + in + satnogs_coarse_doppler_correction_cc_0 freq_xlating_fir_filter_xxx_0 diff --git a/apps/flowgraphs/satnogs_afsk1200_ax25.py b/apps/flowgraphs/satnogs_afsk1200_ax25.py index 3f49666..289841c 100755 --- a/apps/flowgraphs/satnogs_afsk1200_ax25.py +++ b/apps/flowgraphs/satnogs_afsk1200_ax25.py @@ -5,7 +5,7 @@ # Title: AFSK1200 AX.25 decoder # Author: Manolis Surligas (surligas@gmail.com), Vardakis Giorgos (vardakis.grg@gmail.com) # Description: AFSK1200 AX.25 decoder -# Generated: Sat Dec 9 19:39:06 2017 +# Generated: Fri Feb 23 21:34:11 2018 ################################################## from gnuradio import analog @@ -25,7 +25,7 @@ import time class satnogs_afsk1200_ax25(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=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, mark_frequency=2200.0, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', space_frequency=1200.0, 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=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, mark_frequency=2200.0, ppm=0, rf_gain=satnogs.not_set_rx_rf_gain, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', space_frequency=1200.0, udp_IP='127.0.0.1', udp_port=16887, waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "AFSK1200 AX.25 decoder ") ################################################## @@ -48,6 +48,8 @@ class satnogs_afsk1200_ax25(gr.top_block): self.rx_freq = rx_freq self.rx_sdr_device = rx_sdr_device self.space_frequency = space_frequency + self.udp_IP = udp_IP + self.udp_port = udp_port self.waterfall_file_path = waterfall_file_path ################################################## @@ -69,6 +71,7 @@ class satnogs_afsk1200_ax25(gr.top_block): # Blocks ################################################## self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) + self.satnogs_udp_msg_sink_0_0 = satnogs.udp_msg_sink(udp_IP, udp_port, 1500) 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) @@ -112,6 +115,7 @@ class satnogs_afsk1200_ax25(gr.top_block): # Connections ################################################## self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_frame_file_sink_0_1_0, 'frame')) + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_udp_msg_sink_0_0, 'in')) 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.digital_clock_recovery_mm_xx_0, 0)) self.connect((self.analog_quadrature_demod_cf_0_0, 0), (self.dc_blocker_xx_0, 0)) @@ -250,6 +254,18 @@ class satnogs_afsk1200_ax25(gr.top_block): self.space_frequency = space_frequency self.low_pass_filter_1.set_taps(firdes.low_pass(10, self.audio_samp_rate, (self.mark_frequency - self.space_frequency)/2.0, 1000, firdes.WIN_HAMMING, 6.76)) + def get_udp_IP(self): + return self.udp_IP + + def set_udp_IP(self, udp_IP): + self.udp_IP = udp_IP + + def get_udp_port(self): + return self.udp_port + + def set_udp_port(self, udp_port): + self.udp_port = udp_port + def get_waterfall_file_path(self): return self.waterfall_file_path @@ -379,6 +395,12 @@ def argument_parser(): parser.add_option( "", "--space-frequency", dest="space_frequency", type="eng_float", default=eng_notation.num_to_str(1200.0), help="Set space_frequency [default=%default]") + parser.add_option( + "", "--udp-IP", dest="udp_IP", type="string", default='127.0.0.1', + help="Set udp_IP [default=%default]") + parser.add_option( + "", "--udp-port", dest="udp_port", type="intx", default=16887, + help="Set udp_port [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]") @@ -389,7 +411,7 @@ def main(top_block_cls=satnogs_afsk1200_ax25, options=None): if options is None: options, _ = argument_parser().parse_args() - 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, mark_frequency=options.mark_frequency, 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, space_frequency=options.space_frequency, waterfall_file_path=options.waterfall_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, mark_frequency=options.mark_frequency, 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, space_frequency=options.space_frequency, udp_IP=options.udp_IP, udp_port=options.udp_port, waterfall_file_path=options.waterfall_file_path) tb.start() tb.wait() diff --git a/apps/flowgraphs/satnogs_cw_decoder.py b/apps/flowgraphs/satnogs_cw_decoder.py index 9edd95e..3d11a05 100755 --- a/apps/flowgraphs/satnogs_cw_decoder.py +++ b/apps/flowgraphs/satnogs_cw_decoder.py @@ -5,7 +5,7 @@ # Title: CW Decoder # Author: Manolis Surligas (surligas@gmail.com) # Description: A CW (Morse) Decoder -# Generated: Fri Jan 5 22:45:33 2018 +# Generated: Fri Feb 23 21:35:24 2018 ################################################## from gnuradio import analog @@ -24,7 +24,7 @@ import time class satnogs_cw_decoder(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=1000, enable_iq_dump=0, file_path='test.txt', 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', wpm=20): + 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.txt', 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', udp_IP='127.0.0.1', udp_port=16887, waterfall_file_path='/tmp/waterfall.dat', wpm=20): gr.top_block.__init__(self, "CW Decoder") ################################################## @@ -45,6 +45,8 @@ class satnogs_cw_decoder(gr.top_block): self.rigctl_port = rigctl_port self.rx_freq = rx_freq self.rx_sdr_device = rx_sdr_device + self.udp_IP = udp_IP + self.udp_port = udp_port self.waterfall_file_path = waterfall_file_path self.wpm = wpm @@ -61,6 +63,7 @@ class satnogs_cw_decoder(gr.top_block): # Blocks ################################################## self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink((samp_rate_rx/xlating_decimation), 0.0, 10, 1024, waterfall_file_path, 1) + self.satnogs_udp_msg_sink_0_0 = satnogs.udp_msg_sink(udp_IP, udp_port, 1500) 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_morse_decoder_0 = satnogs.morse_decoder(ord('#')) @@ -101,6 +104,7 @@ class satnogs_cw_decoder(gr.top_block): ################################################## self.msg_connect((self.satnogs_cw_to_symbol_0, 'out'), (self.satnogs_morse_decoder_0, 'in')) self.msg_connect((self.satnogs_morse_decoder_0, 'out'), (self.satnogs_frame_file_sink_0_0, 'frame')) + self.msg_connect((self.satnogs_morse_decoder_0, 'out'), (self.satnogs_udp_msg_sink_0_0, 'in')) self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) self.connect((self.analog_pll_carriertracking_cc_0, 0), (self.low_pass_filter_0_0, 0)) self.connect((self.blocks_complex_to_mag_squared_0, 0), (self.satnogs_cw_to_symbol_0, 0)) @@ -219,6 +223,18 @@ class satnogs_cw_decoder(gr.top_block): 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) + def get_udp_IP(self): + return self.udp_IP + + def set_udp_IP(self, udp_IP): + self.udp_IP = udp_IP + + def get_udp_port(self): + return self.udp_port + + def set_udp_port(self, udp_port): + self.udp_port = udp_port + def get_waterfall_file_path(self): return self.waterfall_file_path @@ -326,6 +342,12 @@ def argument_parser(): parser.add_option( "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200', help="Set rx_sdr_device [default=%default]") + parser.add_option( + "", "--udp-IP", dest="udp_IP", type="string", default='127.0.0.1', + help="Set udp_IP [default=%default]") + parser.add_option( + "", "--udp-port", dest="udp_port", type="intx", default=16887, + help="Set udp_port [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]") @@ -339,7 +361,7 @@ def main(top_block_cls=satnogs_cw_decoder, options=None): if options is None: options, _ = argument_parser().parse_args() - 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, wpm=options.wpm) + 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, udp_IP=options.udp_IP, udp_port=options.udp_port, waterfall_file_path=options.waterfall_file_path, wpm=options.wpm) tb.start() tb.wait() diff --git a/apps/flowgraphs/satnogs_fsk9600_ax25.py b/apps/flowgraphs/satnogs_fsk9600_ax25.py index 41d299f..4c214ed 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: Sat Dec 9 19:38:11 2017 +# Generated: Fri Feb 23 21:35:41 2018 ################################################## from gnuradio import analog @@ -24,7 +24,7 @@ import time class satnogs_fsk9600_ax25(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=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'): + 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', udp_IP='127.0.0.1', udp_port=16887, waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "FSK9600 AX.25 decoder ") ################################################## @@ -45,6 +45,8 @@ class satnogs_fsk9600_ax25(gr.top_block): self.rigctl_port = rigctl_port self.rx_freq = rx_freq self.rx_sdr_device = rx_sdr_device + self.udp_IP = udp_IP + self.udp_port = udp_port self.waterfall_file_path = waterfall_file_path ################################################## @@ -66,6 +68,7 @@ class satnogs_fsk9600_ax25(gr.top_block): # Blocks ################################################## self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) + self.satnogs_udp_msg_sink_0_0 = satnogs.udp_msg_sink(udp_IP, udp_port, 1500) 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) @@ -104,6 +107,7 @@ class satnogs_fsk9600_ax25(gr.top_block): # Connections ################################################## self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_frame_file_sink_0_1_0, 'frame')) + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_udp_msg_sink_0_0, 'in')) 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)) @@ -224,6 +228,18 @@ class satnogs_fsk9600_ax25(gr.top_block): 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_udp_IP(self): + return self.udp_IP + + def set_udp_IP(self, udp_IP): + self.udp_IP = udp_IP + + def get_udp_port(self): + return self.udp_port + + def set_udp_port(self, udp_port): + self.udp_port = udp_port + def get_waterfall_file_path(self): return self.waterfall_file_path @@ -343,6 +359,12 @@ def argument_parser(): parser.add_option( "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200', help="Set rx_sdr_device [default=%default]") + parser.add_option( + "", "--udp-IP", dest="udp_IP", type="string", default='127.0.0.1', + help="Set udp_IP [default=%default]") + parser.add_option( + "", "--udp-port", dest="udp_port", type="intx", default=16887, + help="Set udp_port [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]") @@ -353,7 +375,7 @@ def main(top_block_cls=satnogs_fsk9600_ax25, options=None): if options is None: options, _ = argument_parser().parse_args() - 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 = 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, udp_IP=options.udp_IP, udp_port=options.udp_port, waterfall_file_path=options.waterfall_file_path) tb.start() tb.wait() diff --git a/apps/flowgraphs/satnogs_fsk9600_g3ruh_ax25.py b/apps/flowgraphs/satnogs_fsk9600_g3ruh_ax25.py index a94d2b0..bd70d13 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: Sat Dec 9 19:37:01 2017 +# Generated: Fri Feb 23 21:35:47 2018 ################################################## from gnuradio import analog @@ -24,7 +24,7 @@ import time class satnogs_fsk9600_g3ruh_ax25(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=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'): + 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', udp_IP='127.0.0.1', udp_port=16887, waterfall_file_path='/tmp/waterfall.dat'): gr.top_block.__init__(self, "FSK9600 AX.25 decoder with G3RUH support") ################################################## @@ -45,6 +45,8 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): self.rigctl_port = rigctl_port self.rx_freq = rx_freq self.rx_sdr_device = rx_sdr_device + self.udp_IP = udp_IP + self.udp_port = udp_port self.waterfall_file_path = waterfall_file_path ################################################## @@ -66,6 +68,7 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): # Blocks ################################################## self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) + self.satnogs_udp_msg_sink_0_0 = satnogs.udp_msg_sink(udp_IP, udp_port, 1500) 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) @@ -104,6 +107,7 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): # Connections ################################################## self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_frame_file_sink_0_1_0, 'frame')) + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_udp_msg_sink_0_0, 'in')) 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)) @@ -224,6 +228,18 @@ class satnogs_fsk9600_g3ruh_ax25(gr.top_block): 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_udp_IP(self): + return self.udp_IP + + def set_udp_IP(self, udp_IP): + self.udp_IP = udp_IP + + def get_udp_port(self): + return self.udp_port + + def set_udp_port(self, udp_port): + self.udp_port = udp_port + def get_waterfall_file_path(self): return self.waterfall_file_path @@ -343,6 +359,12 @@ def argument_parser(): parser.add_option( "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200', help="Set rx_sdr_device [default=%default]") + parser.add_option( + "", "--udp-IP", dest="udp_IP", type="string", default='127.0.0.1', + help="Set udp_IP [default=%default]") + parser.add_option( + "", "--udp-port", dest="udp_port", type="intx", default=16887, + help="Set udp_port [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]") @@ -353,7 +375,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(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 = 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, udp_IP=options.udp_IP, udp_port=options.udp_port, waterfall_file_path=options.waterfall_file_path) tb.start() tb.wait()