Fri Dec 21 00:22:01 2018 options author Handiko window_size category [GRC Hier Blocks] comment description www.github.com/handiko/gr-APRS _enabled True _coordinate (8, 8) _rotation 0 generate_options qt_gui hier_block_src_path .: id APRS_WAV max_nouts 0 qt_qss_theme realtime_scheduling run_command {python} -u {filename} run_options prompt run True sizing_mode fixed thread_safe_setters title APRS - WAV placement (0,0) variable comment _enabled True _coordinate (268, 7) _rotation 0 id baud value 1200 variable comment _enabled True _coordinate (556, 7) _rotation 0 id gmu value 0.1 variable comment _enabled True _coordinate (339, 7) _rotation 0 id mark value 1200 variable comment _enabled True _coordinate (480, 7) _rotation 0 id mu value 0.5 variable comment _enabled True _coordinate (185, 7) _rotation 0 id samp_rate value 24e3 variable comment _enabled True _coordinate (409, 7) _rotation 0 id space value 2400 APRS_Rx baud baud alias comment affinity _enabled True _coordinate (501, 110) _rotation 0 gmu gmu id APRS_Rx_0 mark mark maxoutbuf 0 minoutbuf 0 mu mu samp_rate samp_rate space space audio_sink alias comment affinity device_name _enabled 1 _coordinate (483, 420) _rotation 0 id audio_sink_0 num_inputs 1 ok_to_block True samp_rate int(samp_rate) blocks_socket_pdu alias comment affinity _enabled True _coordinate (919, 83) _rotation 0 host id blocks_socket_pdu_0 mtu 10000 maxoutbuf 0 minoutbuf 0 port 52001 tcp_no_delay False type "TCP_SERVER" blocks_wavfile_source alias comment File : gr-APRS/WAV/aprs.wav sample rate : 24 kHz bit depth : 16 bits affinity _enabled True file /home/mineo/gr-APRS/gr-APRS-master/WAV/aprs_random.wav _coordinate (9, 133) _rotation 0 id blocks_wavfile_source_0 maxoutbuf 0 minoutbuf 0 nchan 1 repeat True epy_block alias _io_cache ('HDLC to AX.25', 'blk', [], [('hdlc in', 'message', 1)], [('ax25 out', 'message', 1)], '\n Converts an array of bytes into a AX25Packet object.\n\n Connect to the "HDLC Deframer", or a block which emits a PMT tuple of\n (None, bytearray)\n ', []) _source_code """ Embedded Python Blocks: Each time this file is saved, GRC will instantiate the first class it finds to get ports and parameters of your block. The arguments to __init__ will be the parameters. All of them are required to have default values! """ import os, pty import struct import pmt import numpy as np from gnuradio import gr import packet class blk(gr.sync_block): # other base classes are basic_block, decim_block, interp_block """ Converts an array of bytes into a AX25Packet object. Connect to the "HDLC Deframer", or a block which emits a PMT tuple of (None, bytearray) """ def __init__(self): gr.sync_block.__init__(self, name="HDLC to AX.25", in_sig=None, out_sig=None) self.message_port_register_in(pmt.intern('hdlc in')) self.message_port_register_out(pmt.intern('ax25 out')) self.set_msg_handler(pmt.intern('hdlc in'), self.handle_msg) def handle_msg(self, msg_pmt): msg_pmt = pmt.pmt_to_python.pmt_to_python(msg_pmt) msg = bytearray(msg_pmt[1]) try: pkt = packet.from_bytes(msg) self.message_port_pub(pmt.intern('ax25 out'), pmt.cons(pmt.make_dict(), pmt.pmt_to_python.numpy_to_uvector(np.array([ord(c) for c in (packet.dump(pkt) + '\n')], np.uint8)))) except ValueError as e: print e def stop(self): gr.sync_block.stop(self) def work(self, input_items, output_items): in0 = input_items[0] # <+signal processing here+> return len(input_items[0]) comment Pyhton module which required to run this script (gr-APRS/Module/packet.py) need to be copied to the /usr/lib/python2.7 directory _enabled True _coordinate (742, 115) _rotation 0 id epy_block_0 fft_filter_xxx alias comment affinity decim 1 _enabled True _coordinate (238, 134) _rotation 0 id fft_filter_xxx_0 maxoutbuf 0 minoutbuf 0 nthreads 1 samp_delay 0 taps firdes.band_pass(1,samp_rate,1e3,2.6e3,100,firdes.WIN_BLACKMAN) type fff qtgui_freq_sink_x autoscale False average 1.0 axislabels True bw samp_rate alias fc 0 comment ctrlpanel False affinity _enabled True fftsize 4096 _coordinate (484, 329) gui_hint tab@0:1,0,1,1 _rotation 0 grid True id qtgui_freq_sink_x_0 legend False alpha1 1.0 color1 "blue" label1 width1 2 alpha10 1.0 color10 "dark blue" label10 width10 1 alpha2 1.0 color2 "red" label2 width2 1 alpha3 1.0 color3 "green" label3 width3 1 alpha4 1.0 color4 "black" label4 width4 1 alpha5 1.0 color5 "cyan" label5 width5 1 alpha6 1.0 color6 "magenta" label6 width6 1 alpha7 1.0 color7 "yellow" label7 width7 1 alpha8 1.0 color8 "dark red" label8 width8 1 alpha9 1.0 color9 "dark green" label9 width9 1 maxoutbuf 0 minoutbuf 0 name Input Spectrum nconnections 1 showports True freqhalf False tr_chan 0 tr_level 0.0 tr_mode qtgui.TRIG_MODE_FREE tr_tag "" type float update_time 0.10 wintype firdes.WIN_BLACKMAN_hARRIS label Relative Gain ymax -20 ymin -120 units dB qtgui_time_sink_x autoscale False axislabels True alias comment ctrlpanel False affinity entags True _enabled True _coordinate (483, 237) gui_hint tab@0:0,0,1,1 _rotation 0 grid True id qtgui_time_sink_x_0 legend False alpha1 1.0 color1 "blue" label1 marker1 -1 style1 1 width1 2 alpha10 1.0 color10 "blue" label10 marker10 -1 style10 1 width10 1 alpha2 1.0 color2 "red" label2 marker2 -1 style2 1 width2 1 alpha3 1.0 color3 "green" label3 marker3 -1 style3 1 width3 1 alpha4 1.0 color4 "black" label4 marker4 -1 style4 1 width4 1 alpha5 1.0 color5 "cyan" label5 marker5 -1 style5 1 width5 1 alpha6 1.0 color6 "magenta" label6 marker6 -1 style6 1 width6 1 alpha7 1.0 color7 "yellow" label7 marker7 -1 style7 1 width7 1 alpha8 1.0 color8 "dark red" label8 marker8 -1 style8 1 width8 1 alpha9 1.0 color9 "dark green" label9 marker9 -1 style9 1 width9 1 name Input Waveform nconnections 1 size 1024 srate samp_rate stemplot False tr_chan 0 tr_delay 0 tr_level 0.0 tr_mode qtgui.TRIG_MODE_FREE tr_slope qtgui.TRIG_SLOPE_POS tr_tag "" type float update_time 0.10 ylabel Amplitude yunit "" ymax 1 ymin -1 qtgui_time_sink_x autoscale False axislabels True alias comment ctrlpanel False affinity entags True _enabled True _coordinate (725, 330) gui_hint tab@1:0,0,1,1 _rotation 0 grid True id qtgui_time_sink_x_0_0 legend False alpha1 1.0 color1 "blue" label1 marker1 -1 style1 1 width1 2 alpha10 1.0 color10 "blue" label10 marker10 -1 style10 1 width10 1 alpha2 1.0 color2 "red" label2 marker2 -1 style2 1 width2 1 alpha3 1.0 color3 "green" label3 marker3 -1 style3 1 width3 1 alpha4 1.0 color4 "black" label4 marker4 -1 style4 1 width4 1 alpha5 1.0 color5 "cyan" label5 marker5 -1 style5 1 width5 1 alpha6 1.0 color6 "magenta" label6 marker6 -1 style6 1 width6 1 alpha7 1.0 color7 "yellow" label7 marker7 -1 style7 1 width7 1 alpha8 1.0 color8 "dark red" label8 marker8 -1 style8 1 width8 1 alpha9 1.0 color9 "dark green" label9 marker9 -1 style9 1 width9 1 name Demodulator Output nconnections 1 size 512 srate baud*2 stemplot False tr_chan 0 tr_delay 0 tr_level 0.0 tr_mode qtgui.TRIG_MODE_FREE tr_slope qtgui.TRIG_SLOPE_POS tr_tag "" type float update_time 0.10 ylabel Amplitude yunit "" ymax 5 ymin -5 qtgui_time_sink_x autoscale False axislabels True alias comment ctrlpanel False affinity entags True _enabled True _coordinate (725, 237) gui_hint tab@1:1,0,1,1 _rotation 0 grid True id qtgui_time_sink_x_0_0_0 legend False alpha1 1.0 color1 "red" label1 marker1 -1 style1 1 width1 2 alpha10 1.0 color10 "blue" label10 marker10 -1 style10 1 width10 1 alpha2 1.0 color2 "red" label2 marker2 -1 style2 1 width2 1 alpha3 1.0 color3 "green" label3 marker3 -1 style3 1 width3 1 alpha4 1.0 color4 "black" label4 marker4 -1 style4 1 width4 1 alpha5 1.0 color5 "cyan" label5 marker5 -1 style5 1 width5 1 alpha6 1.0 color6 "magenta" label6 marker6 -1 style6 1 width6 1 alpha7 1.0 color7 "yellow" label7 marker7 -1 style7 1 width7 1 alpha8 1.0 color8 "dark red" label8 marker8 -1 style8 1 width8 1 alpha9 1.0 color9 "dark green" label9 marker9 -1 style9 1 width9 1 name Clock Sync Output nconnections 1 size 256 srate baud stemplot False tr_chan 0 tr_delay 0 tr_level 0.0 tr_mode qtgui.TRIG_MODE_FREE tr_slope qtgui.TRIG_SLOPE_POS tr_tag "" type float update_time 0.10 ylabel Amplitude yunit "" ymax 5 ymin -5 qtgui_tab_widget alias comment _enabled True _coordinate (655, 8) gui_hint _rotation 0 id tab label0 Input Signal label1 Demodulator Output label10 Tab 10 label11 Tab 11 label12 Tab 12 label13 Tab 13 label14 Tab 14 label15 Tab 15 label16 Tab 16 label17 Tab 17 label18 Tab 18 label19 Tab 19 label2 Tab 2 label3 Tab 3 label4 Tab 4 label5 Tab 5 label6 Tab 6 label7 Tab 7 label8 Tab 8 label9 Tab 9 num_tabs 2 APRS_Rx_0 qtgui_time_sink_x_0_0_0 0 0 APRS_Rx_0 qtgui_time_sink_x_0_0 1 0 APRS_Rx_0 epy_block_0 HDLC hdlc in blocks_wavfile_source_0 fft_filter_xxx_0 0 0 epy_block_0 blocks_socket_pdu_0 ax25 out pdus fft_filter_xxx_0 APRS_Rx_0 0 0 fft_filter_xxx_0 audio_sink_0 0 0 fft_filter_xxx_0 qtgui_freq_sink_x_0 0 0 fft_filter_xxx_0 qtgui_time_sink_x_0 0 0