Hi Fengyang - Please "reply all" to stay on the list: more eyes reading increases the chances of someone helping! I'm forwarding your email along with its attachments just for this reason. Thanks for providing those scripts & your commandlines: those will really help us in knowing what you're trying to do! - MLD
----- Original message ----- From: "Jiang, Fengyang" <fz...@psu.edu> To: Michael Dickens <michael.dick...@ettus.com> Subject: 回复: [USRP-users] A problem on transmitting data using 5GHz Date: Thursday, May 30, 2019 2:24 PM Hi Michael, Thanks for your response! I'll attach the codes for transmitter and receiver, and here are the commands: python3 benchmark_tx_copied_from_ins.py -f x.xxG --args="addr=192.168.10.3" --tx-gain=20 (for transmitter) python3 benchmark_rx_copied_from_ins.py -f x.xxG --args="addr=192.168.10.2" (for receiver) (x.xxG is the frequency) Thank you for your help! Best regards, Fengyang *发件人:* Michael Dickens <michael.dick...@ettus.com> *发送时间:* 2019年5月30日 14:01 *收件人:* Jiang, Fengyang; USRP Users *主题:* Re: [USRP-users] A problem on transmitting data using 5GHz Hi Fengyang - Since we don't know what exactly you're transmitting (meaning: the Tx flowgraph or code), there could be all sorts of issues or settings affecting the system to make it work at some frequencies and not at others. If you could share the actual Tx & Rx flowgraph or code that would be best for getting assistance. - MLD On Thu, May 30, 2019, at 1:51 PM, Jiang, Fengyang via USRP-users wrote: > Hi All, > > I'm using two usrps to transmit a preamble from one to the other. When I use > 2.437GHz, 2.45GHz and 2.5GHz, it works, but if I use 5GHz, 5.3GHz, 5.8GHz, I > will get nothing at the receiver side. What could be the problem? > > Devices being used: > USRP N210. https://www.ettus.com/all-products/UN210-KIT/ > <https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ettus.com%2Fall-products%2FUN210-KIT%2F&data=02%7C01%7Cfzj28%40psu.edu%7Cf15c94fe2b234c1b7b2e08d6e528dda4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636948361008778666&sdata=L35wGg1m1PQVjZb72WO7k8Sr%2B%2Fy1B%2B8foueEXvQ6p5c%3D&reserved=0> > CBX USRP Daughterboard (1.2GHz - 6GHz) > https://www.ettus.com/all-products/CBX/ > <https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ettus.com%2Fall-products%2FCBX%2F&data=02%7C01%7Cfzj28%40psu.edu%7Cf15c94fe2b234c1b7b2e08d6e528dda4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636948361008788670&sdata=8jAfCmLS%2BJqFHjdtfED90FoHAb%2B8mGuRTiZVyb%2B7OrE%3D&reserved=0> > VERT2450 Antenna (2.4 - 2.5GHz & 4.9 - 5.9GHz) > https://www.ettus.com/all-products/VERT2450/ > <https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ettus.com%2Fall-products%2FVERT2450%2F&data=02%7C01%7Cfzj28%40psu.edu%7Cf15c94fe2b234c1b7b2e08d6e528dda4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636948361008788670&sdata=%2Fi5HbPcb7FM2NUzny4%2FBgYFQlI45J7RmpiTYg%2FsA0PQ%3D&reserved=0> > > Really thanks for your help! > > Best regards, > Fengyang
#!/usr/bin/python2 # # Copyright 2006,2007,2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. # from gnuradio import gr from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser from gnuradio import blocks from gnuradio import digital # from current dir from receive_path import receive_path from uhd_interface import uhd_receiver import struct, sys class my_top_block(gr.top_block): def __init__(self, callback, options): gr.top_block.__init__(self) if(options.rx_freq is not None): self.source = uhd_receiver(options.args, options.bandwidth, options.rx_freq, options.lo_offset, options.rx_gain, options.spec, options.antenna, options.clock_source, options.verbose) elif(options.from_file is not None): self.source = blocks.file_source(gr.sizeof_gr_complex, options.from_file) else: self.source = blocks.null_source(gr.sizeof_gr_complex) # Set up receive path # do this after for any adjustments to the options that may # occur in the sinks (specifically the UHD sink) #self.rxpath = receive_path(callback, options) . . mkg commented #self.connect(self.source, self.rxpath) #mkg commented since ofdm_sampler was not recognized self.connect(self.source, blocks.file_sink(gr.sizeof_gr_complex, "received_data.dat")) # ///////////////////////////////////////////////////////////////////////////// # main # ///////////////////////////////////////////////////////////////////////////// def main(): global n_rcvd, n_right n_rcvd = 0 n_right = 0 def rx_callback(ok, payload): global n_rcvd, n_right n_rcvd += 1 (pktno,) = struct.unpack('!H', payload[0:2]) if ok: n_right += 1 #print "ok: %r \t pktno: %d \t n_rcvd: %d \t n_right: %d" % (ok, pktno, n_rcvd, n_right) .. mkg commented due to py3 mismatch syntax if 0: printlst = list() for x in payload[2:]: t = hex(ord(x)).replace('0x', '') if(len(t) == 1): t = '0' + t printlst.append(t) printable = ''.join(printlst) print(printable) print("\n") parser = OptionParser(option_class=eng_option, conflict_handler="resolve") expert_grp = parser.add_option_group("Expert") parser.add_option("","--discontinuous", action="store_true", default=False, help="enable discontinuous") parser.add_option("","--from-file", default=None, help="input file of samples to demod") receive_path.add_options(parser, expert_grp) uhd_receiver.add_options(parser) digital.ofdm_demod.add_options(parser, expert_grp) (options, args) = parser.parse_args () if options.from_file is None: if options.rx_freq is None: sys.stderr.write("You must specify -f FREQ or --freq FREQ\n") parser.print_help(sys.stderr) sys.exit(1) # build the graph tb = my_top_block(rx_callback, options) r = gr.enable_realtime_scheduling() if r != gr.RT_OK: print("Warning: failed to enable realtime scheduling") tb.start() # start flow graph tb.wait() # wait for it to finish if __name__ == '__main__': try: main() except KeyboardInterrupt: pass
#!/usr/bin/python2 # # Copyright 2005,2006,2011,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. # from gnuradio import gr from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser import time, struct, sys from gnuradio import digital from gnuradio import blocks # from current dir from transmit_path import transmit_path from uhd_interface import uhd_transmitter class my_top_block(gr.top_block): def __init__(self, options): gr.top_block.__init__(self) if(options.tx_freq is not None): self.sink = uhd_transmitter(options.args, options.bandwidth, options.tx_freq, options.lo_offset, options.tx_gain, options.spec, options.antenna, options.clock_source, options.verbose) elif(options.to_file is not None): self.sink = blocks.file_sink(gr.sizeof_gr_complex, options.to_file) else: self.sink = blocks.null_sink(gr.sizeof_gr_complex) # do this after for any adjustments to the options that may # occur in the sinks (specifically the UHD sink) #self.txpath = transmit_path(options) #mkg self.txpath = blocks.file_source(gr.sizeof_gr_complex, "raw_data.dat") #mkg self.connect(self.txpath, self.sink) # ///////////////////////////////////////////////////////////////////////////// # main # ///////////////////////////////////////////////////////////////////////////// def main(): def send_pkt(payload='', eof=False): return 0 # tb.txpath.send_pkt(payload, eof) mkg parser = OptionParser(option_class=eng_option, conflict_handler="resolve") expert_grp = parser.add_option_group("Expert") parser.add_option("-s", "--size", type="eng_float", default=400, help="set packet size [default=%default]") parser.add_option("-M", "--megabytes", type="eng_float", default=1.0, help="set megabytes to transmit [default=%default]") parser.add_option("","--discontinuous", action="store_true", default=False, help="enable discontinuous mode") parser.add_option("","--from-file", default=None, help="use intput file for packet contents") parser.add_option("","--to-file", default=None, help="Output file for modulated samples") transmit_path.add_options(parser, expert_grp) digital.ofdm_mod.add_options(parser, expert_grp) uhd_transmitter.add_options(parser) (options, args) = parser.parse_args () # build the graph tb = my_top_block(options) r = gr.enable_realtime_scheduling() if r != gr.RT_OK: print("Warning: failed to enable realtime scheduling") tb.start() # start flow graph # generate and send packets nbytes = 0 #int(1e6 * options.megabytes) mkg n = 0 pktno = 0 pkt_size = int(options.size) while n < nbytes: if options.from_file is None: data = (pkt_size - 2) * chr(pktno & 0xff) else: data = source_file.read(pkt_size - 2) if data == '': break; payload = struct.pack('!H', pktno & 0xffff) + data send_pkt(payload) n += len(payload) sys.stderr.write('.') if options.discontinuous and pktno % 5 == 4: time.sleep(1) pktno += 1 send_pkt(eof=True) time.sleep(2) # allow time for queued packets to be sent tb.wait() # wait for it to finish if __name__ == '__main__': try: main() except KeyboardInterrupt: pass
_______________________________________________ USRP-users mailing list USRP-users@lists.ettus.com http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com