aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapps/grgsm_livemon58
-rw-r--r--apps/grgsm_livemon.grc146
2 files changed, 155 insertions, 49 deletions
diff --git a/apps/grgsm_livemon b/apps/grgsm_livemon
index 799dd30..1ec5ecb 100755
--- a/apps/grgsm_livemon
+++ b/apps/grgsm_livemon
@@ -25,7 +25,7 @@
# Title: Gr-gsm Livemon
# Author: Piotr Krysik
# Description: Interactive monitor of a single C0 channel with analysis performed by Wireshark (command to run wireshark: sudo wireshark -k -f udp -Y gsmtap -i lo)
-# Generated: Sat Aug 26 12:54:55 2017
+# Generated: Sun Aug 27 08:34:42 2017
##################################################
if __name__ == '__main__':
@@ -58,7 +58,7 @@ import time
class grgsm_livemon(gr.top_block, Qt.QWidget):
- def __init__(self, args="", fc=941.8e6, gain=30, osr=4, ppm=0, samp_rate=2000000.052982, shiftoff=400e3, serverport="4729"):
+ def __init__(self, args="", collector="localhost", collectorport="4729", fc=941.8e6, gain=30, osr=4, ppm=0, samp_rate=2000000.052982, serverport="4729", shiftoff=400e3):
gr.top_block.__init__(self, "Gr-gsm Livemon")
Qt.QWidget.__init__(self)
self.setWindowTitle("Gr-gsm Livemon")
@@ -85,13 +85,15 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
# Parameters
##################################################
self.args = args
+ self.collector = collector
+ self.collectorport = collectorport
self.fc = fc
self.gain = gain
self.osr = osr
self.ppm = ppm
self.samp_rate = samp_rate
- self.shiftoff = shiftoff
self.serverport = serverport
+ self.shiftoff = shiftoff
##################################################
# Variables
@@ -182,23 +184,23 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.gsm_control_channels_decoder_0_0 = grgsm.control_channels_decoder()
self.gsm_control_channels_decoder_0 = grgsm.control_channels_decoder()
self.gsm_clock_offset_control_0 = grgsm.clock_offset_control(fc-shiftoff, samp_rate, osr)
- self.gsm_bcch_ccch_sdcch4_demapper_0 = grgsm.gsm_bcch_ccch_sdcch4_demapper(
+ self.gsm_bcch_ccch_demapper_0 = grgsm.gsm_bcch_ccch_demapper(
timeslot_nr=0,
)
+ self.blocks_socket_pdu_0_1 = blocks.socket_pdu("UDP_CLIENT", collector, collectorport, 1500, False)
self.blocks_socket_pdu_0_0 = blocks.socket_pdu("UDP_SERVER", "127.0.0.1", serverport, 10000, False)
- self.blocks_socket_pdu_0 = blocks.socket_pdu("UDP_CLIENT", "127.0.0.1", "4729", 10000, False)
self.blocks_rotator_cc_0 = blocks.rotator_cc(-2*pi*shiftoff/samp_rate)
##################################################
# Connections
##################################################
self.msg_connect((self.blocks_socket_pdu_0_0, 'pdus'), (self.gsm_message_printer_1, 'msgs'))
- self.msg_connect((self.gsm_bcch_ccch_sdcch4_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts'))
+ self.msg_connect((self.gsm_bcch_ccch_demapper_0, 'bursts'), (self.gsm_control_channels_decoder_0, 'bursts'))
self.msg_connect((self.gsm_clock_offset_control_0, 'ctrl'), (self.gsm_input_0, 'ctrl_in'))
- self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus'))
- self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0, 'pdus'))
+ self.msg_connect((self.gsm_control_channels_decoder_0, 'msgs'), (self.blocks_socket_pdu_0_1, 'pdus'))
+ self.msg_connect((self.gsm_control_channels_decoder_0_0, 'msgs'), (self.blocks_socket_pdu_0_1, 'pdus'))
self.msg_connect((self.gsm_decryption_0, 'bursts'), (self.gsm_control_channels_decoder_0_0, 'bursts'))
- self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_sdcch4_demapper_0, 'bursts'))
+ self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_bcch_ccch_demapper_0, 'bursts'))
self.msg_connect((self.gsm_receiver_0, 'measurements'), (self.gsm_clock_offset_control_0, 'measurements'))
self.msg_connect((self.gsm_receiver_0, 'C0'), (self.gsm_sdcch8_demapper_0, 'bursts'))
self.msg_connect((self.gsm_sdcch8_demapper_0, 'bursts'), (self.gsm_decryption_0, 'bursts'))
@@ -219,6 +221,18 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
def set_args(self, args):
self.args = args
+ def get_collector(self):
+ return self.collector
+
+ def set_collector(self, collector):
+ self.collector = collector
+
+ def get_collectorport(self):
+ return self.collectorport
+
+ def set_collectorport(self, collectorport):
+ self.collectorport = collectorport
+
def get_fc(self):
return self.fc
@@ -258,6 +272,12 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.qtgui_freq_sink_x_0.set_frequency_range(self.fc_slider, self.samp_rate)
self.rtlsdr_source_0.set_sample_rate(self.samp_rate)
+ def get_serverport(self):
+ return self.serverport
+
+ def set_serverport(self, serverport):
+ self.serverport = serverport
+
def get_shiftoff(self):
return self.shiftoff
@@ -267,12 +287,6 @@ class grgsm_livemon(gr.top_block, Qt.QWidget):
self.rtlsdr_source_0.set_center_freq(self.fc_slider-self.shiftoff, 0)
self.rtlsdr_source_0.set_bandwidth(250e3+abs(self.shiftoff), 0)
- def get_serverport(self):
- return self.serverport
-
- def set_serverport(self, serverport):
- self.serverport = serverport
-
def get_ppm_slider(self):
return self.ppm_slider
@@ -302,6 +316,12 @@ def argument_parser():
"", "--args", dest="args", type="string", default="",
help="Set Device Arguments [default=%default]")
parser.add_option(
+ "", "--collector", dest="collector", type="string", default="localhost",
+ help="Set IP or DNS name of collector point [default=%default]")
+ parser.add_option(
+ "", "--collectorport", dest="collectorport", type="string", default="4729",
+ help="Set UDP port number of collector [default=%default]")
+ parser.add_option(
"-f", "--fc", dest="fc", type="eng_float", default=eng_notation.num_to_str(941.8e6),
help="Set GSM channel's central frequency [default=%default]")
parser.add_option(
@@ -317,11 +337,11 @@ def argument_parser():
"-s", "--samp-rate", dest="samp_rate", type="eng_float", default=eng_notation.num_to_str(2000000.052982),
help="Set samp_rate [default=%default]")
parser.add_option(
- "-o", "--shiftoff", dest="shiftoff", type="eng_float", default=eng_notation.num_to_str(400e3),
- help="Set Frequency Shiftoff [default=%default]")
- parser.add_option(
"", "--serverport", dest="serverport", type="string", default="4729",
help="Set UDP server listening port [default=%default]")
+ parser.add_option(
+ "-o", "--shiftoff", dest="shiftoff", type="eng_float", default=eng_notation.num_to_str(400e3),
+ help="Set Frequency Shiftoff [default=%default]")
return parser
@@ -335,7 +355,7 @@ def main(top_block_cls=grgsm_livemon, options=None):
Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)
- tb = top_block_cls(args=options.args, fc=options.fc, gain=options.gain, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff, serverport=options.serverport)
+ tb = top_block_cls(args=options.args, collector=options.collector, collectorport=options.collectorport, fc=options.fc, gain=options.gain, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, serverport=options.serverport, shiftoff=options.shiftoff)
tb.start()
tb.show()
diff --git a/apps/grgsm_livemon.grc b/apps/grgsm_livemon.grc
index 1b21377..af6aa6e 100644
--- a/apps/grgsm_livemon.grc
+++ b/apps/grgsm_livemon.grc
@@ -376,7 +376,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1512, 363)</value>
+ <value>(1632, 295)</value>
</param>
<param>
<key>_rotation</key>
@@ -388,7 +388,7 @@
</param>
<param>
<key>id</key>
- <value>blocks_socket_pdu_0</value>
+ <value>blocks_socket_pdu_0_0</value>
</param>
<param>
<key>mtu</key>
@@ -404,7 +404,7 @@
</param>
<param>
<key>port</key>
- <value>4729</value>
+ <value>serverport</value>
</param>
<param>
<key>tcp_no_delay</key>
@@ -412,7 +412,7 @@
</param>
<param>
<key>type</key>
- <value>"UDP_CLIENT"</value>
+ <value>"UDP_SERVER"</value>
</param>
</block>
<block>
@@ -435,7 +435,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(976, 184)</value>
+ <value>(1504, 295)</value>
</param>
<param>
<key>_rotation</key>
@@ -443,15 +443,15 @@
</param>
<param>
<key>host</key>
- <value>127.0.0.1</value>
+ <value>collector</value>
</param>
<param>
<key>id</key>
- <value>blocks_socket_pdu_0_0</value>
+ <value>blocks_socket_pdu_0_1</value>
</param>
<param>
<key>mtu</key>
- <value>10000</value>
+ <value>1500</value>
</param>
<param>
<key>maxoutbuf</key>
@@ -463,7 +463,7 @@
</param>
<param>
<key>port</key>
- <value>serverport</value>
+ <value>collectorport</value>
</param>
<param>
<key>tcp_no_delay</key>
@@ -471,7 +471,93 @@
</param>
<param>
<key>type</key>
- <value>"UDP_SERVER"</value>
+ <value>"UDP_CLIENT"</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1240, 7)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>collector</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP or DNS name of collector point</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>localhost</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>alias</key>
+ <value></value>
+ </param>
+ <param>
+ <key>comment</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1240, 95)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>id</key>
+ <value>collectorport</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UDP port number of collector</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>4729</value>
</param>
</block>
<block>
@@ -561,7 +647,7 @@
</param>
</block>
<block>
- <key>gsm_bcch_ccch_sdcch4_demapper</key>
+ <key>gsm_bcch_ccch_demapper</key>
<param>
<key>alias</key>
<value></value>
@@ -580,7 +666,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(920, 284)</value>
+ <value>(896, 284)</value>
</param>
<param>
<key>_rotation</key>
@@ -588,7 +674,7 @@
</param>
<param>
<key>id</key>
- <value>gsm_bcch_ccch_sdcch4_demapper_0</value>
+ <value>gsm_bcch_ccch_demapper_0</value>
</param>
<param>
<key>maxoutbuf</key>
@@ -854,7 +940,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(1120, 188)</value>
+ <value>(1776, 302)</value>
</param>
<param>
<key>_rotation</key>
@@ -2849,7 +2935,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(784, 11)</value>
+ <value>(1400, 7)</value>
</param>
<param>
<key>_rotation</key>
@@ -2857,23 +2943,23 @@
</param>
<param>
<key>id</key>
- <value>shiftoff</value>
+ <value>serverport</value>
</param>
<param>
<key>label</key>
- <value>Frequency Shiftoff</value>
+ <value>UDP server listening port</value>
</param>
<param>
<key>short_id</key>
- <value>o</value>
+ <value></value>
</param>
<param>
<key>type</key>
- <value>eng_float</value>
+ <value>string</value>
</param>
<param>
<key>value</key>
- <value>400e3</value>
+ <value>4729</value>
</param>
</block>
<block>
@@ -2892,7 +2978,7 @@
</param>
<param>
<key>_coordinate</key>
- <value>(784, 112)</value>
+ <value>(784, 11)</value>
</param>
<param>
<key>_rotation</key>
@@ -2900,23 +2986,23 @@
</param>
<param>
<key>id</key>
- <value>serverport</value>
+ <value>shiftoff</value>
</param>
<param>
<key>label</key>
- <value>UDP server listening port</value>
+ <value>Frequency Shiftoff</value>
</param>
<param>
<key>short_id</key>
- <value></value>
+ <value>o</value>
</param>
<param>
<key>type</key>
- <value>string</value>
+ <value>eng_float</value>
</param>
<param>
<key>value</key>
- <value>4729</value>
+ <value>400e3</value>
</param>
</block>
<connection>
@@ -2938,7 +3024,7 @@
<sink_key>msgs</sink_key>
</connection>
<connection>
- <source_block_id>gsm_bcch_ccch_sdcch4_demapper_0</source_block_id>
+ <source_block_id>gsm_bcch_ccch_demapper_0</source_block_id>
<sink_block_id>gsm_control_channels_decoder_0</sink_block_id>
<source_key>bursts</source_key>
<sink_key>bursts</sink_key>
@@ -2951,13 +3037,13 @@
</connection>
<connection>
<source_block_id>gsm_control_channels_decoder_0</source_block_id>
- <sink_block_id>blocks_socket_pdu_0</sink_block_id>
+ <sink_block_id>blocks_socket_pdu_0_1</sink_block_id>
<source_key>msgs</source_key>
<sink_key>pdus</sink_key>
</connection>
<connection>
<source_block_id>gsm_control_channels_decoder_0_0</source_block_id>
- <sink_block_id>blocks_socket_pdu_0</sink_block_id>
+ <sink_block_id>blocks_socket_pdu_0_1</sink_block_id>
<source_key>msgs</source_key>
<sink_key>pdus</sink_key>
</connection>
@@ -2975,7 +3061,7 @@
</connection>
<connection>
<source_block_id>gsm_receiver_0</source_block_id>
- <sink_block_id>gsm_bcch_ccch_sdcch4_demapper_0</sink_block_id>
+ <sink_block_id>gsm_bcch_ccch_demapper_0</sink_block_id>
<source_key>C0</source_key>
<sink_key>bursts</sink_key>
</connection>