Re: [Discuss-gnuradio] GRC question
Thanks Josh! That did the trick. I actually had to change a sink too, I've attached the file for reference, and here's the diff: sc...@lab-linux-2:~/src/gnuradio/grc/src/grc_gnuradio/usrp$ diff simple_usrp.py simple_usrp.py.save 336,337c336,337 class dual_source_c(_dual_source): constructor = (usrp.source_c, ) class dual_source_s(_dual_source): constructor = (usrp.source_s, ) --- class dual_source_c(_dual_source): constructor = usrp.source_c class dual_source_s(_dual_source): constructor = usrp.source_s 377,378c377,378 class dual_sink_c(_dual_sink): constructor = (usrp.sink_c, ) class dual_sink_s(_dual_sink): constructor = (usrp.sink_s, ) --- class dual_sink_c(_dual_sink): constructor = usrp.sink_c class dual_sink_s(_dual_sink): constructor = usrp.sink_s I can build dual grc flowgraphs fine now. As soon as I decipher how to setup the RX/TX muxes, I'll be in business! The zero setting for auto does not seem to choose well for these dual cases. I've discovered that 0x32103210 allows me to build a dual Spectrum analyzer using a pair of RFX900's, although I don't know why that setting works. I can't get a dual Siggen to work yet, but I'll keep hacking --Scott PS: GRC is really awesome On Sun, Jan 25, 2009 at 1:52 AM, Josh Blum j...@joshknows.com wrote: Funny, I was working on exactly this. The usrp dual source is underutilized, and Im giving the grc/usrp api an overhaul. It will be tested and checked in on monday. The bug you are getting now is due to me forgetting to 100% fix something after the daughter board c++ switcheroo. So for now, in grc/src/grc_gnuradio/usrp/simple_usrp.py... look for constructor = usrp.source_c and replace it with constructor = (usrp.source_c, ) sudo make install Scott Bierly wrote: Has anyone successfully used GRC with USRP Dual Source and/or USRP Dual Sink blocks? The attached .grc file and .py file are my simple test case, which bombs like this: Generating: /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py Executing: /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py Traceback (most recent call last): File /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py, line 72, in module tb = Scott_Dual_FFT_RFX900() File /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py, line 45, in __init__ tx_enb_b=True, File /usr/local/lib/python2.5/site-packages/grc_gnuradio/usrp/simple_usrp.py, line 360, in __init__ gr.io_signature(2, 2, constructor_to_size[self.constructor[0]]), TypeError: 'instancemethod' object is unsubscriptable I added the Sink to see what would happen, but originally only had the USRP Dual Source as a simple diagnostic test, and that bombed this way: Generating: /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py Executing: /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py Traceback (most recent call last): File /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py, line 56, in module tb = Scott_Dual_FFT_RFX900() File /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py, line 43, in __init__ rx_ant_b=RX2, File /usr/local/lib/python2.5/site-packages/grc_gnuradio/usrp/simple_usrp.py, line 320, in __init__ gr.io_signature(2, 2, constructor_to_size[self.constructor[0]]), TypeError: 'instancemethod' object is unsubscriptable Done I'm having a hard time figuring out from this what I might have done wrong. I will confess I don't understand how to setup the mux yet, but that does not appear to be related to this problem. I'm running off the subversion gnuradio build 10260, which contains GRC version 3.1SVN. Thanks for any help. --Scott ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio # Copyright 2008 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. # import sys from gnuradio import usrp, gr # Helper Functions def _set_frequency(u, which, subdev, frequency, verbose=False
[Discuss-gnuradio] GRC question
Has anyone successfully used GRC with USRP Dual Source and/or USRP Dual Sink blocks? The attached .grc file and .py file are my simple test case, which bombs like this: Generating: /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py Executing: /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py Traceback (most recent call last): File /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py, line 72, in module tb = Scott_Dual_FFT_RFX900() File /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py, line 45, in __init__ tx_enb_b=True, File /usr/local/lib/python2.5/site-packages/grc_gnuradio/usrp/simple_usrp.py, line 360, in __init__ gr.io_signature(2, 2, constructor_to_size[self.constructor[0]]), TypeError: 'instancemethod' object is unsubscriptable I added the Sink to see what would happen, but originally only had the USRP Dual Source as a simple diagnostic test, and that bombed this way: Generating: /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py Executing: /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py Traceback (most recent call last): File /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py, line 56, in module tb = Scott_Dual_FFT_RFX900() File /home/scott/src/gnuradio/scott-grc/Scott_Dual_FFT_RFX900.py, line 43, in __init__ rx_ant_b=RX2, File /usr/local/lib/python2.5/site-packages/grc_gnuradio/usrp/simple_usrp.py, line 320, in __init__ gr.io_signature(2, 2, constructor_to_size[self.constructor[0]]), TypeError: 'instancemethod' object is unsubscriptable Done I'm having a hard time figuring out from this what I might have done wrong. I will confess I don't understand how to setup the mux yet, but that does not appear to be related to this problem. I'm running off the subversion gnuradio build 10260, which contains GRC version 3.1SVN. Thanks for any help. --Scott Scott_Dual_FFT_RFX900_test.grc Description: Binary data #!/usr/bin/env python ## # Gnuradio Python Flow Graph # Title: untitled # Author: unknown # Description: gnuradio flow graph # Generated: Sun Jan 25 00:23:24 2009 ## from gnuradio import gr from grc_gnuradio import usrp as grc_usrp from grc_gnuradio import wxgui as grc_wxgui import wx class Scott_Dual_FFT_RFX900(grc_wxgui.top_block_gui): def __init__(self): grc_wxgui.top_block_gui.__init__( self, title=GRC - Executing: untitled, ) ## # Variables ## self.samp_rate = samp_rate = 32000 ## # Blocks ## self.gr_null_sink_0 = gr.null_sink(gr.sizeof_gr_complex*1) self.gr_null_sink_1 = gr.null_sink(gr.sizeof_gr_complex*1) self.gr_null_source_0 = gr.null_source(gr.sizeof_gr_complex*1) self.gr_null_source_1 = gr.null_source(gr.sizeof_gr_complex*1) self.usrp_dual_sink_x_0 = grc_usrp.dual_sink_c( number=0, frequency_a=900e6, frequency_b=900e6, interpolation=400, gain_a=50, gain_b=50, mux=0x0, auto_tr=False, tx_enb_a=True, tx_enb_b=True, ) self.usrp_dual_source_x_0 = grc_usrp.dual_source_c( number=0, frequency_a=900e6, frequency_b=900e6, decimation=200, gain_a=50, gain_b=50, mux=0x0, auto_tr=False, rx_ant_a=RX2, rx_ant_b=RX2, ) ## # Connections ## self.connect((self.usrp_dual_source_x_0, 0), (self.gr_null_sink_1, 0)) self.connect((self.usrp_dual_source_x_0, 1), (self.gr_null_sink_0, 0)) self.connect((self.gr_null_source_0, 0), (self.usrp_dual_sink_x_0, 0)) self.connect((self.gr_null_source_1, 0), (self.usrp_dual_sink_x_0, 1)) def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate if __name__ == '__main__': tb = Scott_Dual_FFT_RFX900() tb.Run() ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio