# Cannot transmit (USRP2+xcvr2450)

**URL:** <https://www.ruby-forum.com/t/cannot-transmit-usrp2-xcvr2450/161290>\
**Category:** GNU Radio\
**Created:** [February 25, 2009, 2:42am UTC](https://www.ruby-forum.com/t/cannot-transmit-usrp2-xcvr2450/161290 "2009-02-25T02:42:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xiaolong\_Li](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/8c91f0/32.png) [@Xiaolong\_Li](https://www.ruby-forum.com/u/Xiaolong_Li)\
**Post date:** [February 25, 2009, 2:42am UTC](https://www.ruby-forum.com/t/cannot-transmit-usrp2-xcvr2450/161290/1 "2009-02-25T02:42:57Z")

</div>

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
