Usrp_nbfm_ptt.py Error: __init__() takes exactly 4 arguments (6 given)

Hi,

I’m trying to make usrp_nbfm_ptt.py to work with a N210 Rev.4. on
Ubuntu 11.10 and with Gnuradio
3.5.2.1

After my normal system info (see below), however, I get following
message:

The debugged program raised the exception unhandled TypeError
init() takes exactly 4 arguments (6 given)”
File: /home/usrp1/USRP/gnuradio/gr-uhd/examples/usrp_nbfm_ptt.py, Line:
81

I wonder if anyone has seen this error and let me know what I’m doing
wrong.

With kind regards

Mario Behn

linux; GNU C++ version 4.6.1; Boost_104601;
UHD_003.004.000-325-g7e296167

– Opening a USRP2/N-Series device…
– Current recv frame size: 1472 bytes
– Current send frame size: 1472 bytes

UHD Warning:
The hardware does not support the requested TX sample rate:
Target sample rate: 0.320000 MSps
Actual sample rate: 0.320513 MSps
PCM name: pulse
Access types:
MMAP_INTERLEAVED NO
MMAP_NONINTERLEAVED NO
MMAP_COMPLEX NO
RW_INTERLEAVED YES
RW_NONINTERLEAVED NO
Formats:
U8 YES
S16_LE YES
S16_BE YES
S32_LE YES
S32_BE YES
FLOAT_LE YES
FLOAT_BE YES
MU_LAW YES
A_LAW YES
Number of channels
min channels: 1
max channels: 32
1 channels YES
2 channels YES
3 channels YES
4 channels YES
5 channels YES
6 channels YES
7 channels YES
8 channels YES
9 channels YES
10 channels YES
11 channels YES
12 channels YES
13 channels YES
14 channels YES
15 channels YES
16 channels YES
Sample Rates:
min rate: 1 (dir = 0)
max rate: 192000 (dir = 0)
8000 YES
16000 YES
22050 YES
32000 YES
44100 YES
48000 YES
96000 YES
192000 YES
audio_alsa_source[pulse]: using S32_LE
Using Volk machine: avx_32

That sounds like the example is out-of-date. It’s calling some
function that expects a different number of arguments than it is
giving it. If you included the entire error output then we could
better see what the problem was (i.e. which function is raising this
error).

Cheers,
Ben

On Fri, Mar 23, 2012 at 5:50 PM, Ben R. [email protected] wrote:

That sounds like the example is out-of-date. It’s calling some
function that expects a different number of arguments than it is
giving it. If you included the entire error output then we could
better see what the problem was (i.e. which function is raising this
error).

Cheers,
Ben

Hi Ben,

thank you for your answer. I agree, here is the total text of the
error, eric4 gives me:

The debugged program raised the exception unhandled TypeError
init() takes exactly 4 arguments (6 given)”
File: /home/usrp1/USRP/gnuradio/gr-uhd/examples/usrp_nbfm_ptt.py, Line:
81

and highlights line 81 correspondingly:

76 self.txpath = transmit_path(options.args, options.spec,
77 options.antenna, options.tx_gain,
78 options.audio_input)
79 self.rxpath = receive_path(options.args, options.spec,
80 options.antenna, options.rx_gain,
81 options.audio_output)
82 self.connect(self.txpath)
83 self.connect(self.rxpath)

and it is actually the file available here:

http://gnuradio.org/redmine/projects/gnuradio/repository/revisions/v3.5.3git/changes/gr-uhd/examples/usrp_nbfm_ptt.py

Is there any quick fix I can apply?

Cheers

Mario Behn

I’m pretty sure this will fix it.

replace line 372:

def __init__(self, args, gain, audio_output):

with

def __init__(self, args, spec, antenna, gain, audio_output):

Yes, it does. The application is starting now without any error. Thanks.

On Fri, Mar 23, 2012 at 11:30 AM, mario behn [email protected]
wrote:

Hi Ben,
76 self.txpath = transmit_path(options.args, options.spec,

http://gnuradio.org/redmine/projects/gnuradio/repository/revisions/v3.5.3git/changes/gr-uhd/examples/usrp_nbfm_ptt.py

Is there any quick fix I can apply?

Cheers

Mario Behn

Yep, there is an error in that file. The receive_path defined on line
371 isn’t compatible with the call to receive_path on line 79.
Perhaps try removing options.spec and options.antenna from the call,
but I’m just guessing, I haven’t used this example before.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs