Cannot transmit (USRP2+xcvr2450)


#1

Hello all,

I am using a USRP2+xcvr2450 with the latest trunk of GNU Radio (just
compiled/update the firmware and updated FPGA code to the latest
release),
and FC 10 as the OS. I tried to use TCP/IP statck over USRP2 with
modified
tunnel.py, transmit_path.py and receive_path.py. I used one USRP2 and
one
USRP1 and ping USRP2 from USRP1. The USRP2 can receive the packets from
USRP1, but the USRP1 cannot receive anything from USRP2. On USRP2 side,
I
can see packets going back and forth over the ethernet link via
wireshark. I
noticed that USRP1 code uses “set_auto_tr” to enable auto switching
between
tx and rx. however, no such function available for USRP2. I am wondering
if
this causes the problem and how to fix it. Below is my code for transmit
path. Thanks.

class transmit_path_usrp2(gr.hier_block2):
def init(self, modulator_class, options):
‘’’
See below for what options should hold
‘’’
gr.hier_block2.init(self, “transmit_path”,
gr.io_signature(0, 0, 0), # Input
signature
gr.io_signature(0, 0, 0)) # Output
signature

    options = copy.copy(options)    # make a copy so we can

destructively modify

    self._which              = options.which           # the USRP 

board
attached
self._verbose = options.verbose
self._tx_freq = options.tx_freq #
tranmitter’s
center frequency
self._tx_amplitude = options.tx_amplitude # digital
amplitude sent to USRP
self._tx_subdev_spec = options.tx_subdev_spec #
daughterboard
to use
self._bitrate = options.bitrate # desired bit
rate
self._interp = options.interp #
interpolating
rate for the USRP (prelim)
self._samples_per_symbol = options.samples_per_symbol # desired
samples/baud
self._fusb_block_size = options.fusb_block_size # usb info
for
USRP
self._fusb_nblocks = options.fusb_nblocks # usb info
for
USRP
self._use_whitener_offset = options.use_whitener_offset #
increment
start of whitener XOR data

    self._interface = options.interface
    self._mac_addr = options.mac_addr

    self._modulator_class = modulator_class         # the

modulator_class we are using

    if self._tx_freq is None:
        sys.stderr.write("-f FREQ or --freq FREQ or --tx-freq FREQ 

must
be specified\n")
raise SystemExit

    # Set up USRP sink; also adjusts interp, samples_per_symbol, and

bitrate
# self._setup_usrp_sink()

    self.u = usrp2.sink_32fc(self._interface, self._mac_addr)

    dac_rate = self.u.dac_rate();

    # derive values of bitrate, samples_per_symbol, and interp from

desired info
(self._bitrate, self._samples_per_symbol, self._interp) =
pick_tx_bitrate(self._bitrate,
self._modulator_class.bits_per_symbol(),
self._samples_per_symbol, self._interp,
dac_rate)

    self.u.set_interp(self._interp)

    # copy the final answers back into options for use by modulator
    options.samples_per_symbol = self._samples_per_symbol
    options.bitrate = self._bitrate
    options.interp = self._interp

    # Get mod_kwargs
    mod_kwargs =

self._modulator_class.extract_kwargs_from_options(options)

    # Set center frequency of USRP2
    #ok = self.set_freq(self._tx_freq)
    #if not ok:
    #    print "Failed to set Tx frequency to %s" %

(eng_notation.num_to_str(self._tx_freq),)
# raise ValueError

    # Tune the USRP2 FPGA and daughterboard to the requested center

frequency
# and LO offset
if options.lo_offset is not None:
self.u.set_lo_offset(options.lo_offset)
print options.tx_freq
tr = self.u.set_center_freq(options.tx_freq)
if tr == None:
sys.stderr.write(‘Failed to set center frequency\n’)
raise SystemExit, 1

    # transmitter
    self.packet_transmitter = \
        blks2.mod_pkts(self._modulator_class(**mod_kwargs),
                       access_code=None,
                       msgq_limit=4,
                       pad_for_usrp=True,
                       use_whitener_offset=options.use_whitener_offset)

    # Set the Tx daughterboard gain as requested
    if options.gain is None:
        g = self.u.gain_range()
        options.gain = float(g[0]+g[1])/2
     self.u.set_gain(options.gain)

    # Set the USRP for maximum transmit gain
    # (Note that on the RFX cards this is a nop.)
    #self.set_gain(self.subdev.gain_range()[1])

    self.amp = gr.multiply_const_cc(1)
    self.set_tx_amplitude(self._tx_amplitude)
    # enable Auto Transmit/Receive switching
    #self.set_auto_tr(True)

    # Display some information about the setup
    if self._verbose:
        self._print_verbage()

    # Create and setup transmit path flow graph
    self.connect(self.packet_transmitter, self.amp, self.u)

Best regards
Sean