Usrp_multi.py and hier_block2

Here’s a patch to make usrp_multi.py work with hier_block2 (and thus
work with the latest release). I also corrected what I believe to be a
bug with the default selection of which USRP as master, and added the
ability to set the rbf filename to load in the fpga. If you want those
broken out into separate patches let me know - but I figured this was
small enough as it was.

I also have locally change the BBN 802.11b demodulator to use
hier_block2, I’m going to try to organize those edits together to post a
patch somewhere (Someone on the list had asked for them?). I expect to
send them back to the BBN folks, but if anyone else wants it, let me
know.

Doug

Index: gr-usrp/src/usrp_multi.py

— gr-usrp/src/usrp_multi.py (revision 9002)
+++ gr-usrp/src/usrp_multi.py (working copy)
@@ -21,16 +21,16 @@

import math
from gnuradio import gr, gru
-from gnuradio.gr import hier_block_base
+from gnuradio.gr import hier_block2
from gnuradio import usrp
-from gnuradio import usrp1 # usrp Rev 1 and later
-from gnuradio import blks
+#from gnuradio import usrp1 # usrp Rev 1 and later
+#from gnuradio import blks2
from usrpm import usrp_prims
import sys

class multi_source_align(object):

  • def init(self, fg,
    master_serialno,decim,nchan=2,pga_gain=0.0,cordic_freq=0.0,mux=None,align_interval=-1):
  • def init(self, fg,
    master_serialno,decim,nchan=2,pga_gain=0.0,cordic_freq=0.0,mux=None,align_interval=-1,fpga_filename=“multi_2rxhb_2tx.rbf”):
    “”"
    Align multiple sources (usrps) using samplenumbers in the first
    channel.

@@ -59,8 +59,8 @@
if mux is None:
mux=self.get_default_mux() #Note that all channels have
shifted left because of the added 32 bit counter channel

  •    u1 = usrp.source_s (1, decim, nchan, gru.hexint(mux),
    

mode,fpga_filename=“multi_2rxhb_2tx.rbf” )

  •    u0 = usrp.source_s (0, decim, nchan, gru.hexint(mux),
    

mode,fpga_filename=“multi_2rxhb_2tx.rbf” )

  •    u1 = usrp.source_s (1, decim, nchan, gru.hexint(mux),
    

mode,fpga_filename=fpga_filename )

  •    u0 = usrp.source_s (0, decim, nchan, gru.hexint(mux),
    

mode,fpga_filename=fpga_filename )
print ‘usrp[0] serial’,u0.serial_number()
print ‘usrp[1] serial’,u1.serial_number()
#default, choose the second found usrp as master (which is
usually the usrp which was first plugged in)
@@ -82,10 +82,10 @@
print errorstring
raise ValueError, errorstring
else: #default, just choose the first found usrp as master

  •        um_index=0
    
  •        um=u0
    
  •        us_index=1
    
  •        us=u1
    
  •        um_index=1
    
  •        um=u1
    
  •        us_index=0
    
  •        us=u0
    
       self.usrp_master=um
       self.usrp_slave=us
    


Doug G.
Research Assistant
Communications and Signal Processing Lab
Oklahoma State University
http://cspl.okstate.edu
[email protected]
[email protected]

On Thu, Sep 18, 2008 at 02:39:05PM -0500, Douglas G. wrote:

Here’s a patch to make usrp_multi.py work with hier_block2 (and thus
work with the latest release). I also corrected what I believe to
be a bug with the default selection of which USRP as master, and
added the ability to set the rbf filename to load in the fpga. If
you want those broken out into separate patches let me know - but I
figured this was small enough as it was.

Thanks! Have you tested this on hardware?

I also have locally change the BBN 802.11b demodulator to use
hier_block2, I’m going to try to organize those edits together to
post a patch somewhere (Someone on the list had asked for them?). I
expect to send them back to the BBN folks, but if anyone else wants
it, let me know.

We should import the BBN code into our repository, then get it working
with your patches. That was the plan all along, it just never got
finished. With the USRP2 just around the corner, 802.11 looks more
interesting :slight_smile:

Please send the BBN patch to the patch list, and I’ll get it all into
the tree.

Thanks!
Eric

Eric B. wrote:

Thanks! Have you tested this on hardware?

Tested yes - it works with two USRP’s. My next goal is to combine the
usrp_multi fpga changes with the despreading code from the University of
Utah folks to be able to look at 802.11b (1 and 2Mbps anyway) - until
we’re able to get some USRP2’s.

interesting :slight_smile:

Please send the BBN patch to the patch list, and I’ll get it all into
the tree.

Thanks!
Eric

Will do.

Doug


Doug G.
Research Assistant
Communications and Signal Processing Lab
Oklahoma State University
http://cspl.okstate.edu
[email protected]
[email protected]