I got it working (lights now turn on), see the below code: not sure exactly why this one works but hopefully someone will find it useful.
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Rfnoc Rxtx Nogui # Generated: Thu Dec 14 14:28:12 2017 ################################################## from gnuradio import eng_notation from gnuradio import gr from gnuradio import uhd from gnuradio.eng_option import eng_option from gnuradio.filter import firdes from optparse import OptionParser import ettus class rfnoc_rxtx_nogui(gr.top_block): def __init__(self): gr.top_block.__init__(self, "Rfnoc Rxtx Nogui") ################################################## # Variables ################################################## self.device3 = variable_uhd_device3_0 = ettus.device3(uhd.device_addr_t( ",".join(('', "")) )) self.samp_rate = samp_rate = 8e6 self.master_clock_rate = master_clock_rate = 8e6 ################################################## # Blocks ################################################## self.uhd_rfnoc_streamer_radio_1 = ettus.rfnoc_radio( self.device3, uhd.stream_args( # Tx Stream Args cpu_format="fc32", otw_format="sc16", args="", # empty ), uhd.stream_args( # Rx Stream Args cpu_format="fc32", otw_format="sc16", args='', ), 0, -1 ) self.uhd_rfnoc_streamer_radio_1.set_rate(master_clock_rate) for i in xrange(1): self.uhd_rfnoc_streamer_radio_1.set_rx_freq(2e9, i) self.uhd_rfnoc_streamer_radio_1.set_rx_gain(60, i) self.uhd_rfnoc_streamer_radio_1.set_rx_dc_offset(True, i) self.uhd_rfnoc_streamer_radio_1.set_rx_bandwidth(56e6, 0) self.uhd_rfnoc_streamer_radio_1.set_rx_antenna("TX/RX", 0) self.uhd_rfnoc_streamer_radio_0 = ettus.rfnoc_radio( self.device3, uhd.stream_args( # Tx Stream Args cpu_format="fc32", otw_format="sc16", args='', ), uhd.stream_args( # Rx Stream Args cpu_format="fc32", otw_format="sc16", args="", # empty ), 0, -1 ) self.uhd_rfnoc_streamer_radio_0.set_rate(master_clock_rate) for i in xrange(1): self.uhd_rfnoc_streamer_radio_0.set_tx_freq(2.4e9, i) self.uhd_rfnoc_streamer_radio_0.set_tx_gain(40, i) self.uhd_rfnoc_streamer_radio_0.set_tx_dc_offset(True, i) self.uhd_rfnoc_streamer_radio_0.set_tx_antenna("TX/RX", 0) ################################################## # Connections ################################################## self.device3.connect(self.uhd_rfnoc_streamer_radio_1.get_block_id(), 0, self.uhd_rfnoc_streamer_radio_0.get_block_id(), 0) stream_cmd=uhd.stream_cmd_t(uhd.stream_cmd_t.STREAM_MODE_START_CONTINUOUS) #self.uhd_rfnoc_streamer_radio_0.issue_stream_cmd(stream_cmd) self.uhd_rfnoc_streamer_radio_1.issue_stream_cmd(stream_cmd) self.uhd_rfnoc_streamer_radio_0.set_tx_streamer(True,0) self.uhd_rfnoc_streamer_radio_1.set_rx_streamer(True,0) def get_variable_uhd_device3_0(self): return self.variable_uhd_device3_0 def set_variable_uhd_device3_0(self, variable_uhd_device3_0): self.variable_uhd_device3_0 = variable_uhd_device3_0 def get_samp_rate(self): return self.samp_rate def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate def get_master_clock_rate(self): return self.master_clock_rate def set_master_clock_rate(self, master_clock_rate): self.master_clock_rate = master_clock_rate self.uhd_rfnoc_streamer_radio_1.set_rate(self.master_clock_rate) self.uhd_rfnoc_streamer_radio_0.set_rate(self.master_clock_rate) def main(top_block_cls=rfnoc_rxtx_nogui, options=None): tb = top_block_cls() tb.start() stream_cmd=uhd.stream_cmd_t(uhd.stream_cmd_t.STREAM_MODE_START_CONTINUOUS) tb.uhd_rfnoc_streamer_radio_0.issue_stream_cmd(stream_cmd) tb.uhd_rfnoc_streamer_radio_1.issue_stream_cmd(stream_cmd) tb.uhd_rfnoc_streamer_radio_0.set_tx_streamer(True,0) tb.uhd_rfnoc_streamer_radio_1.set_rx_streamer(True,0) try: raw_input('Press Enter to quit: ') except EOFError: pass tb.stop() tb.wait() if __name__ == '__main__': main() On Thu, Dec 14, 2017 at 12:30 PM, Jack Ziegler <jacka...@gmail.com> wrote: > actually try this one. > > I think I had the tx and rx mixed up. Neither still work though. > > #!/usr/bin/env python2 > # -*- coding: utf-8 -*- > ################################################## > # GNU Radio Python Flow Graph > # Title: Rfnoc Sin Radio E310 > # Generated: Thu Sep 21 14:12:08 2017 > ################################################## > > from gnuradio import eng_notation > from gnuradio import gr > from gnuradio import uhd > from gnuradio.eng_option import eng_option > from gnuradio.filter import firdes > from optparse import OptionParser > import ettus > > > class RFNoc_Radio_Radio_e310(gr.top_block): > > def __init__(self): > gr.top_block.__init__(self, "Rfnoc Radio Radio E310") > > ################################################## > # Variables > ################################################## > self.samp_rate = samp_rate = 2e6 > self.device3 = variable_uhd_device3_0 = > ettus.device3(uhd.device_addr_t( ",".join(('type=e3x0', > "fpga=/home/root/e300_siggen_ddc.bit")) )) > self.up_rate = up_rate = 12e6 > self.freq = freq = samp_rate/10 > > ################################################## > # Blocks > ################################################## > > > > self.uhd_rfnoc_streamer_radio_0 = ettus.rfnoc_radio( > self.device3, > uhd.stream_args( # Tx Stream Args > cpu_format="fc32", > otw_format="sc16", > args='', > ), > uhd.stream_args( # Rx Stream Args > cpu_format="fc32", > otw_format="sc16", > args="", # empty > ), > 0, -1 > ) > self.uhd_rfnoc_streamer_radio_0.set_rate(up_rate) > for i in xrange(1): > self.uhd_rfnoc_streamer_radio_0.set_tx_freq(1.0e9, i) > self.uhd_rfnoc_streamer_radio_0.set_tx_gain(20, i) > self.uhd_rfnoc_streamer_radio_0.set_tx_dc_offset(True, i) > > self.uhd_rfnoc_streamer_radio_0.set_tx_antenna("TX/RX", 0) > > self.uhd_rfnoc_streamer_radio_1 = ettus.rfnoc_radio( > self.device3, > uhd.stream_args( # Tx Stream Args > cpu_format="fc32", > otw_format="sc16", > args="", # empty > ), > uhd.stream_args( # Rx Stream Args > cpu_format="fc32", > otw_format="sc16", > args='', > ), > 0, -1 > ) > self.uhd_rfnoc_streamer_radio_1.set_rate(samp_rate) > for i in xrange(1): > self.uhd_rfnoc_streamer_radio_1.set_rx_freq(2.4e9, i) > self.uhd_rfnoc_streamer_radio_1.set_rx_gain(40, i) > self.uhd_rfnoc_streamer_radio_1.set_rx_dc_offset(True, i) > > self.uhd_rfnoc_streamer_radio_1.set_rx_bandwidth(56e6, 0) > > self.uhd_rfnoc_streamer_radio_1.set_rx_antenna("RX2", 0) > > > ################################################## > # Connections > ################################################## > > > self.device3.connect(self.uhd_rfnoc_streamer_radio_1.get_block_id(), > 0, self.uhd_rfnoc_streamer_radio_0.get_block_id(), 0) > > stream_cmd=uhd.stream_cmd_t(uhd.stream_cmd_t.STREAM_MODE_ > START_CONTINUOUS) > #self.uhd_rfnoc_streamer_radio_0.issue_stream_cmd(stream_cmd) > self.uhd_rfnoc_streamer_radio_1.issue_stream_cmd(stream_cmd) > > self.uhd_rfnoc_streamer_radio_0.set_tx_streamer(True,0) > self.uhd_rfnoc_streamer_radio_1.set_rx_streamer(True,0) > > > def get_samp_rate(self): > return self.samp_rate > > def set_samp_rate(self, samp_rate): > self.samp_rate = samp_rate > self.set_freq(self.samp_rate/10) > > > > def get_variable_uhd_device3_0(self): > return self.variable_uhd_device3_0 > > def set_variable_uhd_device3_0(self, variable_uhd_device3_0): > self.variable_uhd_device3_0 = variable_uhd_device3_0 > > def get_up_rate(self): > return self.up_rate > > def set_up_rate(self, up_rate): > self.up_rate = up_rate > self.uhd_rfnoc_streamer_radio_0.set_rate(self.up_rate) > > > > > > > > > > > def main(top_block_cls=RFNoc_Radio_Radio_e310, options=None): > > tb = top_block_cls() > #tb.uhd_rfnoc_streamer_radio_0.set_tx_streamer(True,0) > #tb.uhd_rfnoc_streamer_radio_1.set_rx_streamer(True,0) > tb.start() > #tb.uhd_rfnoc_streamer_radio_0.set_tx_streamer(True,0) > #tb.uhd_rfnoc_streamer_radio_1.set_rx_streamer(True,0) > > try: > raw_input('Press Enter to quit: ') > except EOFError: > pass > tb.stop() > tb.wait() > > > if __name__ == '__main__': > main() > > On Thu, Dec 14, 2017 at 11:41 AM, Nick Foster <bistrom...@gmail.com> > wrote: > >> Thanks. At first blush this looks like it should work to me. I'll try it >> out here. >> >> Nick >> >> On Thu, Dec 14, 2017 at 11:37 AM Jack Ziegler <jacka...@gmail.com> wrote: >> >>> *Trying to do loopback with a rfnoc rx radio connect to a rfnoc tx >>> radio. (running at 56e6 Msps with the E310/E312). This is with no host >>> connections >>> *third gen E310 >>> * [UHDlinux; GNU C++ version 4.9.2; Boost_105700; >>> UHD_4.0.0.rfnoc-devel-369-g1908672f] >>> , with modifications from the "stupid rfnoc tricks webpage" >>> *python is listed below, note the typed in changes (extra from the grc >>> generation) as reccomended by the "stupid rfnoc tricks webpage" >>> >>> stream_cmd = uhd.stream_cmd_t(uhd.stream_cm >>> d_t.STREAM_MODE_START_CONTINUOUS) >>> self.uhd_rfnoc_streamer_radio_0_0.issue_stream_cmd(stream_cmd) >>> self.uhd_rfnoc_streamer_radio_0_0.set_tx_streamer(True,0) >>> >>> *expect to see both the rx2 and trx lights on and the signal being >>> transmitted >>> *The flowgraph runs with output in the terminal as one would expect, but >>> there are no lights on the rx2 and trx and no signal transmitted >>> >>> Also note that I have tried rebuilding the bitstream file with this >>> change making .at_reset(1'b1) now 1'b0 >>> >>> setting_reg #(.my_addr(SR_RX_CTRL_OUTPUT_FORMAT), .width(1), >>> .at_reset(1'b0)) sr_output_format ( >>> .clk(clk),.rst(reset),.strobe(set_stb),.addr(set_addr), >>> .in(set_data),.out(use_timestamps),.changed()); >>> >>> and get the same result (otherwise I don't specify the fpga image and >>> use the default one) >>> >>> this is the output >>> " >>> [INFO] [UHDlinux; GNU C++ version 4.9.2; Boost_105700; >>> UHD_4.0.0.rfnoc-devel-369-g1908672f] >>> [INFO] [E300] Loading FPGA image: /home/root/e300_thres_0time.bit... >>> [INFO] [E300] FPGA image loaded >>> [INFO] [E300] Initializing core control (global registers)... >>> >>> [INFO] [E300] Performing register loopback test... >>> [INFO] [E300] Register loopback test passed >>> [INFO] [RFNOC RADIO] Register loopback test passed >>> [INFO] [RFNOC RADIO] Register loopback test passed >>> [INFO] [AD936X] Performing CODEC loopback test... >>> [INFO] [AD936X] CODEC loopback test passed >>> [INFO] [AD936X] Performing CODEC loopback test... >>> [INFO] [AD936X] CODEC loopback test passed >>> [INFO] [CORES] Performing timer loopback test... >>> [INFO] [CORES] Timer loopback test passed >>> [INFO] [CORES] Performing timer loopback test... >>> [INFO] [CORES] Timer loopback test passed >>> [INFO] [CORES] Performing timer loopback test... >>> [INFO] [CORES] Timer loopback test passed >>> [INFO] [RFNOC] Assuming max packet size for 0/Radio_0 >>> >>> " >>> And the lights on e310 don't turn on.... >>> >>> >>> >>> >>> Thanks >>> >>> Jack >>> >>> #!/usr/bin/env python2 >>> # -*- coding: utf-8 -*- >>> ################################################## >>> # GNU Radio Python Flow Graph >>> # Title: Radioradioonly >>> # Generated: Tue Dec 5 13:40:36 2017 >>> ################################################## >>> >>> if __name__ == '__main__': >>> import ctypes >>> import sys >>> if sys.platform.startswith('linux'): >>> try: >>> x11 = ctypes.cdll.LoadLibrary('libX11.so') >>> x11.XInitThreads() >>> except: >>> print "Warning: failed to XInitThreads()" >>> >>> from PyQt4 import Qt >>> from gnuradio import eng_notation >>> from gnuradio import gr >>> from gnuradio import uhd >>> from gnuradio.eng_option import eng_option >>> from gnuradio.filter import firdes >>> from gnuradio.qtgui import Range, RangeWidget >>> from optparse import OptionParser >>> import ettus >>> import sys >>> from gnuradio import qtgui >>> >>> >>> class radioradioonly(gr.top_block, Qt.QWidget): >>> >>> def __init__(self): >>> gr.top_block.__init__(self, "Radioradioonly") >>> Qt.QWidget.__init__(self) >>> self.setWindowTitle("Radioradioonly") >>> qtgui.util.check_set_qss() >>> try: >>> self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) >>> except: >>> pass >>> self.top_scroll_layout = Qt.QVBoxLayout() >>> self.setLayout(self.top_scroll_layout) >>> self.top_scroll = Qt.QScrollArea() >>> self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) >>> self.top_scroll_layout.addWidget(self.top_scroll) >>> self.top_scroll.setWidgetResizable(True) >>> self.top_widget = Qt.QWidget() >>> self.top_scroll.setWidget(self.top_widget) >>> self.top_layout = Qt.QVBoxLayout(self.top_widget) >>> self.top_grid_layout = Qt.QGridLayout() >>> self.top_layout.addLayout(self.top_grid_layout) >>> >>> self.settings = Qt.QSettings("GNU Radio", "radioradioonly") >>> self.restoreGeometry(self.settings.value("geometry").toByteA >>> rray()) >>> >>> >>> ################################################## >>> # Variables >>> ################################################## >>> self.device3 = variable_uhd_device3_0 = >>> ettus.device3(uhd.device_addr_t( ",".join(('', >>> "fpga=/home/root/e300_thres_0time.bit")) )) >>> self.txgain = txgain = 40 >>> self.samp_rate = samp_rate = 8e6 >>> self.rxgain = rxgain = 80 >>> self.center_f = center_f = 2.4e9 >>> >>> ################################################## >>> # Blocks >>> ################################################## >>> self._rxgain_range = Range(1., 85, .0001, 40, 200) >>> self._rxgain_win = RangeWidget(self._rxgain_range, >>> self.set_rxgain, 'rxgain', "counter_slider", float) >>> self.top_layout.addWidget(self._rxgain_win) >>> self._center_f_range = Range(2.4e9, 2.55e9, 1e4, 2.4e9, 200) >>> self._center_f_win = RangeWidget(self._center_f_range, >>> self.set_center_f, 'center_f', "counter_slider", float) >>> self.top_layout.addWidget(self._center_f_win) >>> self.uhd_rfnoc_streamer_radio_0_0 = ettus.rfnoc_radio( >>> self.device3, >>> uhd.stream_args( # Tx Stream Args >>> cpu_format="fc32", >>> otw_format="sc16", >>> args='', >>> ), >>> uhd.stream_args( # Rx Stream Args >>> cpu_format="fc32", >>> otw_format="sc16", >>> args="", # empty >>> ), >>> 0, -1 >>> ) >>> self.uhd_rfnoc_streamer_radio_0_0.set_rate(samp_rate) >>> for i in xrange(1): >>> self.uhd_rfnoc_streamer_radio_0_0.set_tx_freq(center_f, i) >>> self.uhd_rfnoc_streamer_radio_0_0.set_tx_gain(rxgain, i) >>> self.uhd_rfnoc_streamer_radio_0_0.set_tx_dc_offset(True, i) >>> >>> self.uhd_rfnoc_streamer_radio_0_0.set_tx_antenna("TX/RX", 0) >>> >>> self.uhd_rfnoc_streamer_radio_0 = ettus.rfnoc_radio( >>> self.device3, >>> uhd.stream_args( # Tx Stream Args >>> cpu_format="fc32", >>> otw_format="sc16", >>> args="", # empty >>> ), >>> uhd.stream_args( # Rx Stream Args >>> cpu_format="fc32", >>> otw_format="sc16", >>> args='', >>> ), >>> 0, -1 >>> ) >>> self.uhd_rfnoc_streamer_radio_0.set_rate(samp_rate) >>> for i in xrange(1): >>> self.uhd_rfnoc_streamer_radio_0.set_rx_freq(2.4e9, i) >>> self.uhd_rfnoc_streamer_radio_0.set_rx_gain(rxgain, i) >>> self.uhd_rfnoc_streamer_radio_0.set_rx_dc_offset(True, i) >>> >>> self.uhd_rfnoc_streamer_radio_0.set_rx_bandwidth(56e6, 0) >>> >>> self.uhd_rfnoc_streamer_radio_0.set_rx_antenna("RX2", 0) >>> >>> self._txgain_range = Range(1., 85, .0001, 40, 200) >>> self._txgain_win = RangeWidget(self._txgain_range, >>> self.set_txgain, 'txgain', "counter_slider", float) >>> self.top_layout.addWidget(self._txgain_win) >>> self._thres_range = Range(.0001, 33000., .0001, 1., 200) >>> self.top_layout.addWidget(self._thres_win) >>> >>> >>> >>> ################################################## >>> # Connections >>> ################################################## >>> self.device3.connect(self.uhd_rfnoc_streamer_radio_0.get_block_id(), >>> 0, self.uhd_rfnoc_streamer_radio_0_0.get_block_id(), 0) >>> >>> stream_cmd = uhd.stream_cmd_t(uhd.stream_cm >>> d_t.STREAM_MODE_START_CONTINUOUS) >>> self.uhd_rfnoc_streamer_radio_0_0.issue_stream_cmd(stream_cmd) >>> self.uhd_rfnoc_streamer_radio_0_0.set_tx_streamer(True,0) >>> >>> >>> def closeEvent(self, event): >>> self.settings = Qt.QSettings("GNU Radio", "radioradioonly") >>> self.settings.setValue("geometry", self.saveGeometry()) >>> event.accept() >>> >>> def get_variable_uhd_device3_0(self): >>> return self.variable_uhd_device3_0 >>> >>> def set_variable_uhd_device3_0(self, variable_uhd_device3_0): >>> self.variable_uhd_device3_0 = variable_uhd_device3_0 >>> >>> def get_txgain(self): >>> return self.txgain >>> >>> def set_txgain(self, txgain): >>> self.txgain = txgain >>> >>> def get_thres(self): >>> return self.thres >>> >>> def set_thres(self, thres): >>> self.thres = thres >>> >>> def get_samp_rate(self): >>> return self.samp_rate >>> >>> def set_samp_rate(self, samp_rate): >>> self.samp_rate = samp_rate >>> self.uhd_rfnoc_streamer_radio_0_0.set_rate(self.samp_rate) >>> self.uhd_rfnoc_streamer_radio_0.set_rate(self.samp_rate) >>> >>> def get_rxgain(self): >>> return self.rxgain >>> >>> def set_rxgain(self, rxgain): >>> self.rxgain = rxgain >>> for i in xrange(1): >>> self.uhd_rfnoc_streamer_radio_0_0.set_tx_gain(self.rxgain, >>> i) >>> for i in xrange(1): >>> self.uhd_rfnoc_streamer_radio_0.set_rx_gain(self.rxgain, i) >>> >>> def get_center_f(self): >>> return self.center_f >>> >>> def set_center_f(self, center_f): >>> self.center_f = center_f >>> for i in xrange(1): >>> self.uhd_rfnoc_streamer_radio_0_0.set_tx_freq(self.center_f, >>> i) >>> >>> >>> def main(top_block_cls=radioradioonly, options=None): >>> >>> from distutils.version import StrictVersion >>> if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"): >>> style = gr.prefs().get_string('qtgui', 'style', 'raster') >>> Qt.QApplication.setGraphicsSystem(style) >>> qapp = Qt.QApplication(sys.argv) >>> >>> tb = top_block_cls() >>> tb.start() >>> tb.show() >>> >>> def quitting(): >>> tb.stop() >>> tb.wait() >>> qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) >>> qapp.exec_() >>> >>> >>> if __name__ == '__main__': >>> main() >>> >>> On Thu, Nov 30, 2017 at 5:23 PM, Nick Foster <bistrom...@gmail.com> >>> wrote: >>> >>>> You need to help us before we can help you. Can you tell me: >>>> >>>> * What you're actually trying to do >>>> * Your hardware setup >>>> * Your UHD version >>>> * Your flowgraph >>>> * The results you expect >>>> * The results you actually observe >>>> >>>> Then maybe we can help. >>>> >>>> Nick >>>> >>>> On Thu, Nov 30, 2017 at 4:44 PM Jack Ziegler <jacka...@gmail.com> >>>> wrote: >>>> >>>>> I tried doing the changes in uhd, and gr-ettus. I also tried changing >>>>> that register value to 0 for the fpga and making a new e300.bit file. >>>>> Any recommendations on how to troubleshoot? Also as I referenced, >>>>> I'm doing this on a new e312 usrp. >>>>> >>>>> Thanks, >>>>> Jack >>>>> >>>>> On Wed, Nov 29, 2017 at 10:36 PM, Nick Foster <bistrom...@gmail.com> >>>>> wrote: >>>>> >>>>>> It should still apply. Is there something specific you're having >>>>>> trouble with? >>>>>> >>>>>> On Wed, Nov 29, 2017, 10:06 PM Jack Ziegler via USRP-users < >>>>>> usrp-users@lists.ettus.com> wrote: >>>>>> >>>>>>> Has anyone recently tried rfnoc loopback? >>>>>>> I tried following these directions: https://corvid.io/ >>>>>>> 2017/04/22/stupid-rfnoc-tricks-loopback/ >>>>>>> they are dated from last April. Not sure if I missed a step or >>>>>>> maybe there is something new in gr-ettus and uhd-devel? >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Jack Ziegler >>>>>>> _______________________________________________ >>>>>>> USRP-users mailing list >>>>>>> USRP-users@lists.ettus.com >>>>>>> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com >>>>>>> >>>>>> >>>>> >>> >
_______________________________________________ USRP-users mailing list USRP-users@lists.ettus.com http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com