Problems regarding using UHD Digital-bert codes

Hi ,
I have been trying to use the examples given in
/home/aravind/gnuradio/gnuradio-examples/python/digital-bert . esp the
uhd_benchmark_tx.py . here are a few changes that i made to the existing
code …
__________________________________________________________________________________________________________________________________-
#setup usrp
self._setup_usrp(options.ip,
interp,
options.gain,
options.freq)

self.connect(self._transmitter, self._usrp)


def _setup_usrp(self, ip, interp, gain, freq):
    # Setup single usrp sink
    self._uhd = uhd.single_usrp_sink(device_addr="",
                               io_type=uhd.io_type.COMPLEX_FLOAT32,
                               num_channels=1
                              )


    # Tune to center frequency
    tr = self._usrp.set_center_freq(freq,0)
    if not (tr):
       print "Failed to tune to center frequency!"
    else:
        print "Actual Intermediate frequency:",

n2s(self._usrp.get_center_freq())

    # Set Tx Gain

    self._uhd.set_gain(gain,1)
    print "Gain d'board: ",n2s(self._usrp.get_gain()), "dB"

but i am getting error as mentioned : -

Traceback (most recent call last):
File “./uhd_benchmark_tx.py”, line 113, in
tb = tx_bpsk_block(options)
File “./uhd_benchmark_tx.py”, line 56, in init
options.freq)
File “./uhd_benchmark_tx.py”, line 70, in _setup_usrp
tr = self._usrp.set_center_freq(freq,0)
File
“/usr/local/lib/python2.6/dist-packages/gnuradio/gr/top_block.py”,
line 94, in getattr
return getattr(self._tb, name)
AttributeError: ‘gr_top_block_sptr’ object has no attribute ‘_usrp’
aravind@COE-2X85V91:~/gnuradio/gnuradio-examples/python/uhd-digital-bert$

Attached here is a copy of my digital bert codes …
Sincerely
Bonee soibam
---------- Forwarded message ----------
From: Bonee S. [email protected]
Date: Sat, Sep 10, 2011 at 5:16 PM
Subject: Problems regarding using UHD Digital-bert codes
To: [email protected]

Hi ,
I have been trying to use the examples given in
/home/aravind/gnuradio/gnuradio-examples/python/digital-bert . esp the
uhd_benchmark_tx.py . here are a few changes that i made to the existing
code …
__________________________________________________________________________________________________________________________________-
#setup usrp
self._setup_usrp(options.ip,
interp,
options.gain,
options.freq)

self.connect(self._transmitter, self._usrp)


def _setup_usrp(self, ip, interp, gain, freq):
    # Setup single usrp sink
    self._uhd = uhd.single_usrp_sink(device_addr="",
                               io_type=uhd.io_type.COMPLEX_FLOAT32,
                               num_channels=1
                              )


    # Tune to center frequency
    tr = self._usrp.set_center_freq(freq,0)
    if not (tr):
       print "Failed to tune to center frequency!"
    else:
        print "Actual Intermediate frequency:",

n2s(self._usrp.get_center_freq())

    # Set Tx Gain

    self._uhd.set_gain(gain,1)
    print "Gain d'board: ",n2s(self._usrp.get_gain()), "dB"

but i am getting error as mentioned : -

Traceback (most recent call last):
File “./uhd_benchmark_tx.py”, line 113, in
tb = tx_bpsk_block(options)
File “./uhd_benchmark_tx.py”, line 56, in init
options.freq)
File “./uhd_benchmark_tx.py”, line 70, in _setup_usrp
tr = self._usrp.set_center_freq(freq,0)
File
“/usr/local/lib/python2.6/dist-packages/gnuradio/gr/top_block.py”,
line 94, in getattr
return getattr(self._tb, name)
AttributeError: ‘gr_top_block_sptr’ object has no attribute ‘_usrp’
aravind@COE-2X85V91:~/gnuradio/gnuradio-examples/python/uhd-digital-bert$

Can someone help me out on this error … Appreciate your help.

---------- Forwarded message ----------
From: Bonee S. [email protected]
Date: Sat, Sep 10, 2011 at 5:16 PM
Subject: Problems regarding using UHD Digital-bert codes
To: [email protected]

Hi ,
I have been trying to use the examples given in
/home/aravind/gnuradio/gnuradio-examples/python/digital-bert . esp the
uhd_benchmark_tx.py . here are a few changes that i made to the existing
code …
__________________________________________________________________________________________________________________________________-
#setup usrp
self._setup_usrp(options.ip,
interp,
options.gain,
options.freq)

self.connect(self._transmitter, self._usrp)


def _setup_usrp(self, ip, interp, gain, freq):
    # Setup single usrp sink
    self._uhd = uhd.single_usrp_sink(device_addr="",
                               io_type=uhd.io_type.COMPLEX_FLOAT32,
                               num_channels=1
                              )


    # Tune to center frequency
    tr = self._usrp.set_center_freq(freq,0)
    if not (tr):
       print "Failed to tune to center frequency!"
    else:
        print "Actual Intermediate frequency:",

n2s(self._usrp.get_center_freq())

    # Set Tx Gain

    self._uhd.set_gain(gain,1)
    print "Gain d'board: ",n2s(self._usrp.get_gain()), "dB"

but i am getting error as mentioned : -

Traceback (most recent call last):
File “./uhd_benchmark_tx.py”, line 113, in
tb = tx_bpsk_block(options)
File “./uhd_benchmark_tx.py”, line 56, in init
options.freq)
File “./uhd_benchmark_tx.py”, line 70, in _setup_usrp
tr = self._usrp.set_center_freq(freq,0)
File
“/usr/local/lib/python2.6/dist-packages/gnuradio/gr/top_block.py”,
line 94, in getattr
return getattr(self._tb, name)
AttributeError: ‘gr_top_block_sptr’ object has no attribute ‘_usrp’
aravind@COE-2X85V91:~/gnuradio/gnuradio-examples/python/uhd-digital-bert$

On 11/09/11 10:46 AM, Bonee S. wrote:

I have been trying to use the examples given in
self.connect(self._transmitter, self._usrp)
# Tune to center frequency
print "Gain d’board: ",n2s(self._usrp.get_gain()), “dB”
File
Yours sincerely
Bonee S.

So, generally, the error messages produced by a programming language are
intended to give you a
clue as to what’s wrong. Granted, you kind of have to understand the
programming language
to some extent to make sense of them.

In line 94, you call self._usrp.set_center_freq(…)

But in fact, there is no object “_usrp” defined in your code, although
there is a “_uhd” defined that is
probably what was intended.

In line 94, I’d change self._usrp.set_center_freq(…) to
self._uhd.set_center_freq(…)