diff --git a/apps/rx_agc_demo.sh b/apps/rx_agc_demo.sh new file mode 100755 index 0000000..e92d5aa --- /dev/null +++ b/apps/rx_agc_demo.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +FILE="/tmp/ofdm.pcap" +FLOWGRAPH="rx_agc_demo.py" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +### create fifo +if [ -e ${FILE} ] +then + echo "${FILE}: file already exists" + if ! [ -p ${FILE} ] + then + echo "ERROR: ${FILE} exists and is not a FIFO" + exit 1 + fi +else + echo "creating fifo: ${FILE}" + mkfifo ${FILE} +fi + + +### create tap interface +if [[ `ifconfig -a | grep tap0 | wc -l` -eq 0 ]] +then + sudo ip tuntap add dev tap0 user ${USER} mode tap +fi + +### reconfigure it in any case, just to be sure it's up +sudo ifconfig tap0 down +sudo ifconfig tap0 hw ether 12:34:56:78:90:ab +sudo ifconfig tap0 up +sudo ifconfig tap0 192.168.123.1 + + +### start transceiver +cd ${DIR} +cd ../examples/ +./${FLOWGRAPH} & +sleep 1 + + +### start wireshark +wireshark -k -i ${FILE} & +sleep 1 + + +### start netcat +echo "##########################################################################" +echo "### starting netcat. Just type and the lines will be send to the flowgraph" +echo "##########################################################################" +sleep 2 + +#echo | nc -u localhost 52001 +cat + + diff --git a/examples/rx_agc_demo.grc b/examples/rx_agc_demo.grc new file mode 100644 index 0000000..6c644e5 --- /dev/null +++ b/examples/rx_agc_demo.grc @@ -0,0 +1,2442 @@ + + + Wed Jun 25 16:22:20 2014 + + variable + + id + window_size + + + _enabled + True + + + value + 48 + + + alias + + + + _coordinate + (704, 18) + + + _rotation + 0 + + + + variable + + id + sync_length + + + _enabled + True + + + value + 320 + + + alias + + + + _coordinate + (601, 15) + + + _rotation + 0 + + + + ieee802_11_ofdm_equalize_symbols + + id + ieee802_11_ofdm_equalize_symbols_0 + + + _enabled + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (389, 720) + + + _rotation + 0 + + + + blocks_delay + + id + blocks_delay_0 + + + _enabled + True + + + type + complex + + + delay + sync_length + + + num_ports + 1 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (483, 567) + + + _rotation + 0 + + + + ieee802_11_ofdm_sync_long + + id + ieee802_11_ofdm_sync_long_0 + + + _enabled + True + + + log + False + + + debug + False + + + sync_length + sync_length + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (684, 534) + + + _rotation + 0 + + + + blocks_stream_to_vector + + id + blocks_stream_to_vector_0 + + + _enabled + True + + + type + complex + + + num_items + 64 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (913, 550) + + + _rotation + 0 + + + + ieee802_11_ofdm_decode_signal + + id + ieee802_11_ofdm_decode_signal_0 + + + _enabled + True + + + log + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (656, 712) + + + _rotation + 0 + + + + blocks_divide_xx + + id + blocks_divide_xx_0 + + + _enabled + True + + + type + float + + + vlen + 1 + + + num_inputs + 2 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1193, 412) + + + _rotation + 270 + + + + blocks_conjugate_cc + + id + blocks_conjugate_cc_0 + + + _enabled + True + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (421, 348) + + + _rotation + 0 + + + + blocks_delay + + id + blocks_delay_0_0 + + + _enabled + True + + + type + complex + + + delay + 16 + + + num_ports + 1 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (259, 344) + + + _rotation + 0 + + + + blocks_multiply_xx + + id + blocks_multiply_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (662, 314) + + + _rotation + 0 + + + + blocks_complex_to_mag + + id + blocks_complex_to_mag_0 + + + _enabled + True + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1038, 331) + + + _rotation + 0 + + + + ieee802_11_moving_average_xx + + id + ieee802_11_moving_average_xx_0 + + + _enabled + True + + + type + complex + + + length + window_size + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (819, 327) + + + _rotation + 0 + + + + blocks_file_sink + + id + blocks_file_sink_0 + + + _enabled + True + + + file + /tmp/ofdm.pcap + + + type + byte + + + vlen + 1 + + + unbuffered + True + + + append + True + + + alias + + + + affinity + + + + _coordinate + (721, 1043) + + + _rotation + 180 + + + + blocks_complex_to_mag_squared + + id + blocks_complex_to_mag_squared_0 + + + _enabled + True + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (461, 227) + + + _rotation + 0 + + + + ieee802_11_moving_average_xx + + id + ieee802_11_moving_average_xx_1 + + + _enabled + True + + + type + float + + + length + window_size + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (782, 223) + + + _rotation + 0 + + + + blocks_vector_to_stream + + id + blocks_vector_to_stream_0 + + + _enabled + True + + + type + complex + + + num_items + 48 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (576, 846) + + + _rotation + 180 + + + + fft_vxx + + id + fft_vxx_0 + + + _enabled + True + + + type + complex + + + fft_size + 64 + + + forward + True + + + window + window.rectangular(64) + + + shift + True + + + nthreads + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (138, 688) + + + _rotation + 0 + + + + wxgui_scopesink2 + + id + wxgui_scopesink1 + + + _enabled + True + + + type + complex + + + title + Scope Plot + + + samp_rate + 12500 + + + v_scale + 0 + + + v_offset + 0 + + + t_scale + 0 + + + ac_couple + False + + + xy_mode + True + + + num_inputs + 1 + + + win_size + + + + grid_pos + (1,0,1,1) + + + notebook + + + + trig_mode + wxgui.TRIG_MODE_AUTO + + + y_axis_label + Counts + + + alias + + + + affinity + + + + _coordinate + (349, 806) + + + _rotation + 180 + + + + variable_chooser + + id + lo_offset + + + _enabled + True + + + label + LO Offset + + + value + 0 + + + choices + [0, 6e9, 11e9] + + + labels + ['0 MHz', '6 MHz', '11 MHz'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (254, 12) + + + _rotation + 0 + + + + ieee802_11_ofdm_parse_mac + + id + ieee802_11_ofdm_parse_mac_0 + + + _enabled + True + + + log + False + + + debug + True + + + alias + + + + affinity + + + + _coordinate + (969, 820) + + + _rotation + 180 + + + + blocks_tuntap_pdu + + id + blocks_tuntap_pdu_0 + + + _enabled + True + + + ifn + tap0 + + + mtu + 10000 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (663, 942) + + + _rotation + 180 + + + + foo_wireshark_connector + + id + foo_wireshark_connector_0 + + + _enabled + True + + + tech + 127 + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (947, 1051) + + + _rotation + 180 + + + + ieee802_11_ofdm_decode_mac + + id + ieee802_11_ofdm_decode_mac_0 + + + _enabled + True + + + log + False + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (930, 712) + + + _rotation + 0 + + + + ieee802_11_ether_encap + + id + ieee802_11_ether_encap_0 + + + _enabled + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (904, 920) + + + _rotation + 180 + + + + ieee802_11_ofdm_sync_short + + id + ieee802_11_ofdm_sync_short_0 + + + _enabled + True + + + log + False + + + debug + False + + + threshold + 0.85 + + + max_samples + 80 * 160 + + + min_plateau + 2 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (212, 501) + + + _rotation + 0 + + + + variable_slider + + id + gain + + + _enabled + True + + + label + + + + value + 20 + + + min + 0 + + + max + 100 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (808, 19) + + + _rotation + 0 + + + + variable_chooser + + id + freq + + + _enabled + True + + + label + Channel + + + value + 5.89e9 + + + choices + [2412000000.0, 2417000000.0, 2422000000.0, 2427000000.0, 2432000000.0, 2437000000.0, 2442000000.0, 2447000000.0, 2452000000.0, 2457000000.0, 2462000000.0, 2467000000.0, 2472000000.0, 2484000000.0, 5170000000.0, 5180000000.0, 5190000000.0, 5200000000.0, 5210000000.0, 5220000000.0, 5230000000.0, 5240000000.0, 5260000000.0, 5280000000.0, 5300000000.0, 5320000000.0, 5500000000.0, 5520000000.0, 5540000000.0, 5560000000.0, 5580000000.0, 5600000000.0, 5620000000.0, 5640000000.0, 5660000000.0, 5680000000.0, 5700000000.0, 5745000000.0, 5765000000.0, 5785000000.0, 5805000000.0, 5825000000.0, 5860000000.0, 5870000000.0, 5880000000.0, 5890000000.0, 5900000000.0, 5910000000.0, 5920000000.0] + + + labels + [' 1 | 2412.0 | 11g', ' 2 | 2417.0 | 11g', ' 3 | 2422.0 | 11g', ' 4 | 2427.0 | 11g', ' 5 | 2432.0 | 11g', ' 6 | 2437.0 | 11g', ' 7 | 2442.0 | 11g', ' 8 | 2447.0 | 11g', ' 9 | 2452.0 | 11g', ' 10 | 2457.0 | 11g', ' 11 | 2462.0 | 11g', ' 12 | 2467.0 | 11g', ' 13 | 2472.0 | 11g', ' 14 | 2484.0 | 11g', ' 34 | 5170.0 | 11a', ' 36 | 5180.0 | 11a', ' 38 | 5190.0 | 11a', ' 40 | 5200.0 | 11a', ' 42 | 5210.0 | 11a', ' 44 | 5220.0 | 11a', ' 46 | 5230.0 | 11a', ' 48 | 5240.0 | 11a', ' 52 | 5260.0 | 11a', ' 56 | 5280.0 | 11a', ' 58 | 5300.0 | 11a', ' 60 | 5320.0 | 11a', '100 | 5500.0 | 11a', '104 | 5520.0 | 11a', '108 | 5540.0 | 11a', '112 | 5560.0 | 11a', '116 | 5580.0 | 11a', '120 | 5600.0 | 11a', '124 | 5620.0 | 11a', '128 | 5640.0 | 11a', '132 | 5660.0 | 11a', '136 | 5680.0 | 11a', '140 | 5700.0 | 11a', '149 | 5745.0 | 11a', '153 | 5765.0 | 11a', '157 | 5785.0 | 11a', '161 | 5805.0 | 11a', '165 | 5825.0 | 11a', '172 | 5860.0 | 11p', '174 | 5870.0 | 11p', '176 | 5880.0 | 11p', '178 | 5890.0 | 11p', '180 | 5900.0 | 11p', '182 | 5910.0 | 11p', '184 | 5920.0 | 11p'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (929, 21) + + + _rotation + 0 + + + + variable_chooser + + id + samp_rate + + + _enabled + True + + + label + Sample Rate + + + value + 10e6 + + + choices + [10e6, 20e6] + + + labels + ["10 Mhz", "20 Mhz"] + + + type + radio_buttons + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (1107, 20) + + + _rotation + 0 + + + + variable_chooser + + id + agc + + + _enabled + True + + + label + AGC + + + value + False + + + choices + [False, True] + + + labels + ["disable", "enable"] + + + type + radio_buttons + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (446, 80) + + + _rotation + 0 + + + + uhd_usrp_source + + id + uhd_usrp_source_0 + + + _enabled + True + + + type + fc32 + + + otw + + + + stream_args + + + + stream_chans + [] + + + dev_addr + + + + dev_args + "" + + + sync + + + + clock_rate + 0.0 + + + num_mboards + 1 + + + clock_source0 + + + + time_source0 + + + + sd_spec0 + + + + clock_source1 + + + + time_source1 + + + + sd_spec1 + + + + clock_source2 + + + + time_source2 + + + + sd_spec2 + + + + clock_source3 + + + + time_source3 + + + + sd_spec3 + + + + clock_source4 + + + + time_source4 + + + + sd_spec4 + + + + clock_source5 + + + + time_source5 + + + + sd_spec5 + + + + clock_source6 + + + + time_source6 + + + + sd_spec6 + + + + clock_source7 + + + + time_source7 + + + + sd_spec7 + + + + nchan + 1 + + + samp_rate + samp_rate + + + center_freq0 + uhd.tune_request(freq - lo_offset, lo_offset) + + + gain0 + gain + + + agc0 + agc + + + ant0 + + + + bw0 + 0 + + + center_freq1 + 0 + + + gain1 + 0 + + + agc1 + False + + + ant1 + + + + bw1 + 0 + + + center_freq2 + 0 + + + gain2 + 0 + + + agc2 + False + + + ant2 + + + + bw2 + 0 + + + center_freq3 + 0 + + + gain3 + 0 + + + agc3 + False + + + ant3 + + + + bw3 + 0 + + + center_freq4 + 0 + + + gain4 + 0 + + + agc4 + False + + + ant4 + + + + bw4 + 0 + + + center_freq5 + 0 + + + gain5 + 0 + + + agc5 + False + + + ant5 + + + + bw5 + 0 + + + center_freq6 + 0 + + + gain6 + 0 + + + agc6 + False + + + ant6 + + + + bw6 + 0 + + + center_freq7 + 0 + + + gain7 + 0 + + + agc7 + False + + + ant7 + + + + bw7 + 0 + + + center_freq8 + 0 + + + gain8 + 0 + + + agc8 + False + + + ant8 + + + + bw8 + 0 + + + center_freq9 + 0 + + + gain9 + 0 + + + agc9 + False + + + ant9 + + + + bw9 + 0 + + + center_freq10 + 0 + + + gain10 + 0 + + + agc10 + False + + + ant10 + + + + bw10 + 0 + + + center_freq11 + 0 + + + gain11 + 0 + + + agc11 + False + + + ant11 + + + + bw11 + 0 + + + center_freq12 + 0 + + + gain12 + 0 + + + agc12 + False + + + ant12 + + + + bw12 + 0 + + + center_freq13 + 0 + + + gain13 + 0 + + + agc13 + False + + + ant13 + + + + bw13 + 0 + + + center_freq14 + 0 + + + gain14 + 0 + + + agc14 + False + + + ant14 + + + + bw14 + 0 + + + center_freq15 + 0 + + + gain15 + 0 + + + agc15 + False + + + ant15 + + + + bw15 + 0 + + + center_freq16 + 0 + + + gain16 + 0 + + + agc16 + False + + + ant16 + + + + bw16 + 0 + + + center_freq17 + 0 + + + gain17 + 0 + + + agc17 + False + + + ant17 + + + + bw17 + 0 + + + center_freq18 + 0 + + + gain18 + 0 + + + agc18 + False + + + ant18 + + + + bw18 + 0 + + + center_freq19 + 0 + + + gain19 + 0 + + + agc19 + False + + + ant19 + + + + bw19 + 0 + + + center_freq20 + 0 + + + gain20 + 0 + + + agc20 + False + + + ant20 + + + + bw20 + 0 + + + center_freq21 + 0 + + + gain21 + 0 + + + agc21 + False + + + ant21 + + + + bw21 + 0 + + + center_freq22 + 0 + + + gain22 + 0 + + + agc22 + False + + + ant22 + + + + bw22 + 0 + + + center_freq23 + 0 + + + gain23 + 0 + + + agc23 + False + + + ant23 + + + + bw23 + 0 + + + center_freq24 + 0 + + + gain24 + 0 + + + agc24 + False + + + ant24 + + + + bw24 + 0 + + + center_freq25 + 0 + + + gain25 + 0 + + + agc25 + False + + + ant25 + + + + bw25 + 0 + + + center_freq26 + 0 + + + gain26 + 0 + + + agc26 + False + + + ant26 + + + + bw26 + 0 + + + center_freq27 + 0 + + + gain27 + 0 + + + agc27 + False + + + ant27 + + + + bw27 + 0 + + + center_freq28 + 0 + + + gain28 + 0 + + + agc28 + False + + + ant28 + + + + bw28 + 0 + + + center_freq29 + 0 + + + gain29 + 0 + + + agc29 + False + + + ant29 + + + + bw29 + 0 + + + center_freq30 + 0 + + + gain30 + 0 + + + agc30 + False + + + ant30 + + + + bw30 + 0 + + + center_freq31 + 0 + + + gain31 + 0 + + + agc31 + False + + + ant31 + + + + bw31 + 0 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (6, 199) + + + _rotation + 0 + + + + options + + id + rx_agc_demo + + + _enabled + True + + + title + + + + author + + + + description + + + + window_size + 1280, 2048 + + + generate_options + wx_gui + + + category + Custom + + + run_options + prompt + + + run + True + + + max_nouts + 0 + + + realtime_scheduling + + + + alias + + + + _coordinate + (434, 15) + + + _rotation + 0 + + + + blocks_stream_to_vector_0 + fft_vxx_0 + 0 + 0 + + + uhd_usrp_source_0 + blocks_delay_0_0 + 0 + 0 + + + ieee802_11_ofdm_sync_short_0 + ieee802_11_ofdm_sync_long_0 + 0 + 0 + + + blocks_delay_0 + ieee802_11_ofdm_sync_long_0 + 0 + 1 + + + ieee802_11_ofdm_sync_short_0 + blocks_delay_0 + 0 + 0 + + + ieee802_11_ofdm_sync_long_0 + blocks_stream_to_vector_0 + 0 + 0 + + + blocks_divide_xx_0 + ieee802_11_ofdm_sync_short_0 + 0 + 1 + + + ieee802_11_ofdm_equalize_symbols_0 + ieee802_11_ofdm_decode_signal_0 + 0 + 0 + + + ieee802_11_ofdm_decode_signal_0 + ieee802_11_ofdm_decode_mac_0 + 0 + 0 + + + fft_vxx_0 + ieee802_11_ofdm_equalize_symbols_0 + 0 + 0 + + + ieee802_11_ofdm_decode_signal_0 + blocks_vector_to_stream_0 + 0 + 0 + + + blocks_vector_to_stream_0 + wxgui_scopesink1 + 0 + 0 + + + blocks_complex_to_mag_0 + blocks_divide_xx_0 + 0 + 0 + + + ieee802_11_moving_average_xx_1 + blocks_divide_xx_0 + 0 + 1 + + + blocks_multiply_xx_0 + ieee802_11_moving_average_xx_0 + 0 + 0 + + + ieee802_11_moving_average_xx_0 + blocks_complex_to_mag_0 + 0 + 0 + + + blocks_complex_to_mag_squared_0 + ieee802_11_moving_average_xx_1 + 0 + 0 + + + blocks_delay_0_0 + ieee802_11_ofdm_sync_short_0 + 0 + 0 + + + uhd_usrp_source_0 + blocks_multiply_xx_0 + 0 + 0 + + + uhd_usrp_source_0 + blocks_complex_to_mag_squared_0 + 0 + 0 + + + blocks_conjugate_cc_0 + blocks_multiply_xx_0 + 0 + 1 + + + blocks_delay_0_0 + blocks_conjugate_cc_0 + 0 + 0 + + + foo_wireshark_connector_0 + blocks_file_sink_0 + 0 + 0 + + + ieee802_11_ofdm_decode_mac_0 + ieee802_11_ofdm_parse_mac_0 + out + in + + + ieee802_11_ether_encap_0 + blocks_tuntap_pdu_0 + to tap + pdus + + + ieee802_11_ofdm_decode_mac_0 + foo_wireshark_connector_0 + out + in + + + ieee802_11_ofdm_decode_mac_0 + ieee802_11_ether_encap_0 + out + from wifi + +