Error when trying to run two python programs simultaneously

Hi All,

I have 2 (two) USRP1 and 2 (two) RFX2400 connected to each USRP1.

What I want to do is to have communication between the devices and scan
for
the spectrum simultaneously.

If running programs one by one, all works great.
Running both at the same time, gives me an error saying that the USB
port is
already being used.

Running: uses RFX2400 on port A
/usr/share/gnuradio/examples/digital/tunnel.py --freq 2.422G

Trying to start: uses RFX2400 on port B
/usr/share/gnuradio/examples/usrp/usrp_spectrum_sense.py -R B 2.4095G
2.4625G

Error after trying to start usrp_spectrum_sense.py:

/usr/share/gnuradio/examples/usrp$ sudo ./usrp_spectrum_sense.py -R B
2.4095G 2.4625G

usrp_open_interface:usb_claim_interface: failed interface 2
could not claim interface 2: Device or resource busy
usrp_basic_rx: can’t open rx interface
Traceback (most recent call last):
File “./usrp_spectrum_sense.py”, line 344, in
tb = my_top_block()
File “./usrp_spectrum_sense.py”, line 169, in init
fusb_nblocks=options.fusb_nblocks)
File “/usr/lib/python2.6/dist-packages/gnuradio/usrp/usrp_swig.py”,
line
1646, in source_c
return _usrp_swig.source_c(*args, **kwargs)
RuntimeError: can’t open usrp

From my understanding, it cannot start since top_block is already being
used
by tunnel.py.

Is there a way I can run both programs simultaneously? Thus the reason
of
why I have 2 (two) RFX2400 on each USRP1.

Any ideas on a workaround if that is not possible?

Tried merging the programs into one but was not successful in doing so.
I
have modified both of the files a little for my own convenience, so
files
are also posted over here.

http://old.nabble.com/file/p27958715/tunnel.py tunnel.py
http://old.nabble.com/file/p27958715/usrp_spectrum_sense.py
usrp_spectrum_sense.py

Thanks!!

David Cabrejos

View this message in context:
http://old.nabble.com/Error-when-trying-to-run-two-python-programs-simultaneously-tp27958715p27958715.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On 03/23/2010 07:46 AM, drcabrejos wrote:

already being used.

Running: uses RFX2400 on port A
/usr/share/gnuradio/examples/digital/tunnel.py --freq 2.422G

Trying to start: uses RFX2400 on port B
/usr/share/gnuradio/examples/usrp/usrp_spectrum_sense.py -R B 2.4095G
2.4625G

When you have multiple usrps, you need to differentiate them by using
the “which” parameter:

tunnel.py has this option on the command line:
-w WHICH, --which=WHICH
select USRP board [default=0]

try ./tunnel.py -w1

spectrum_sense.py does not have this option, so it will have to be the 0
by default or you will have to modify the script to pass which= into
the usrp contructor.

-josh

Josh,

Thanks for the prompt reply.

I tried using this command, but this command seems to be applied if I
have 2
USRPs connected to a single computer.

On my case, I have 2 computers and 1 USRP connected to each computer.

Each USRP have 2 RFX2400 daughterboards.

I’m trying to run both programs “tunnel.py” and “usrp_spectrum_sense.py”
at
the same time, each one using a different daughterboard.

tunnel.py would use side A while usrp_spectrum_sense.py would use side
B.

Then I got the error saying that the USB port was already in use and
would
not be able to run the second program.

Would it be possible to run both programs simultaneously in 1 USRP. This
is
because on both sides I’d be doing the same thing. Spectrum sensing and
continuous communication.

Thanks!

David Cabrejos

Josh B.-2 wrote:

for

 -w WHICH, --which=WHICH

Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/Error-when-trying-to-run-two-python-programs-simultaneously-tp27958715p28003759.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Ahh I see. The rule is, one process per usrp. Only one process can have
the usb handle, send/recv, and handle control per usrp device.
Therefore, you will have to make a custom app that combines the
utilities of tunnel.py and spectrum_sense.py

-Josh

Thanks!

I’ll try to make a custom app and see if I can get this working.

David Cabrejos

Josh B.-2 wrote:

Each USRP have 2 RFX2400 daughterboards.

Josh B.-2 wrote:

for
/usr/share/gnuradio/examples/digital/tunnel.py --freq 2.422G
tunnel.py has this option on the command line:


Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


View this message in context:
http://old.nabble.com/Error-when-trying-to-run-two-python-programs-simultaneously-tp27958715p28004972.html
Sent from the GnuRadio mailing list archive at Nabble.com.