How to stop "usrp_spectrum_sense.py"?

Hi Everyone,

The “usrp_spectrum_sense.py” program is used to sense the defined
spectrum
range. Now, I want to stop it for a period of five second time (e.g.
from
55 to 59 seconds). For that purpose, I wrote the following lines in
python.

================================================
import usrp_spectrum_sense_updated

import time

class main_class():

calling the ‘usrp_spectrum_sense.py’ program

def relay_func(self, tb):

while 1:

curr_time = time.strftime('%S',time.localtime())


if int(curr_time)>=55:

print 'Hello World"

else:

t = usrp_spectrum_sense_updated.ThreadClass()

        t.start()


        tb = usrp_spectrum_sense_updated.my_top_block()

        try:

        tb.start()

        usrp_spectrum_sense_updated.main_loop(tb)


        except KeyboardInterrupt:

        pass

if name == ‘main’:

tb = main_class()

tb.relay_func(tb)

================================================

In the above program, I tried to stop sensing for the duration of 5
seconds
(i.e. 55 ---- 59 seconds). The program works fine whenever I execute it
in
between of the mentioned time and it shift automatically to the sensing
mode at time=0 second; but once it start sensing then it never be
returned
to the print message ‘hello world’ even when the condition is matched.

Earliest and kind response is highly appreciated. Thanks.

Regards,
Syed Aqeel R.

On 04/04/2014 04:33 AM, Syed Aqeel R. wrote:

For example, in a minute 50 seconds are reserved for relaying mode while
the remaining 10 seconds for sensing mode.

These are the two most important tasks out of many others. Right now, I
am able to switch from relay mode to sensing mode but once the program
start with the sensing mode then it won’t be returned to relay mode.

You might want to write a block that outputs data on two different
paths, instead of reconnecting blocks or using message queues.

Yes, the delete_head() call block is remain a mystery for me yet. I am
trying to resolve the issue but if anyone has any suggestions then let
me know. Waiting for positive response.

I recommend not to use it at all (see comment above).

Also, you might get more results for these GNU Radio-specific questions
on the GNU Radio mailing list.

Cheers,
Martin

On 04/07/2014 04:51 AM, Syed Aqeel R. wrote:

“RuntimeError: boost::thread_resource_error: Resource temporarily
unavailable”

For detailed information about this error message, see the attached
file. Waiting for your reply, thanks.

Syed,

at this point, it’s impossible to help you any further without seeing
the code. Also, you would probably get more responses on the GNU Radio
mailing list, which I’ve added.

Another note: It’s usually better to post the error message (if short,
in an email, if long, on a pasting service such as pastebin) than to
post a screenshot.

Martin