discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] multiple antennas and multiple usrps


From: Dan Halperin
Subject: Re: [Discuss-gnuradio] multiple antennas and multiple usrps
Date: Thu, 26 Jun 2008 14:25:05 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jun 25, 2008, at 4:28 PM, Eric Blossom wrote:
2) I have a transmitter USRP and a receiver USRP attached to the same
machine. I use usrp.serial_number() as suggested by Eric in many
previous mails to distinguish between them. I have a code loop like
this:

Are you loading a different fpga image into the different USRPs?

Yes, one is (was, I guess?) using std_4rx_0tx.rbf (see 1) and the
other was using the default.
Thanks,

Dan

That would do it :-)

Please let me know if the (untested) code fragment I sent works out.

I ended up using the following code:

from usrpm import usrp_prims

def find_serial_number(serial):
    which = 0
    d = usrp_prims.usrp_find_device(which)
    while True:
        if not d:   # No USRP connected
raise RuntimeError, "Unable to find USRP with Serial # %s" %(serial) if usrp_prims.usrp_unconfigured_usrp_p(d): # Needs firmware/ FPGA image
            usrp_prims.usrp_load_standard_bits(which, False)
        # Turn the usb_device into a usb_device_handle
        handle = usrp_prims.usrp_open_cmd_interface(d)
        # Get the Serial # (SN) out, then close device handle
        SN = usrp_prims.usrp_serial_number(handle)
        usrp_prims.usrp_close_interface(handle)
        # Compare to desired
        if SN == serial:
            return which
        # Next USRP
        which += 1
        d = usrp_prims.usrp_find_device(which)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkhkCTEACgkQy9GYuuMoUJ64sgCeJXZQqCWsG5lJQNSWkL6KnWw0
6k8AoIf++crasusKNHC0BPlq2l9OjZBC
=SSyF
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]