discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] [USRP-users] How to stop "usrp_spectrum_sense.py"


From: Martin Braun
Subject: Re: [Discuss-gnuradio] [USRP-users] How to stop "usrp_spectrum_sense.py"?
Date: Fri, 04 Apr 2014 09:30:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/04/2014 04:33 AM, Syed Aqeel Raza wrote:
> Hi Martin, 
> 
> Thanks for your email. Basically I want to program the usrp N200 in a
> way that it should switch in between of relay mode and scanning mode
> with respect to time. For that purpose, following are the tasks:
> 
> 1. Integrate the two programs (i.e. tx_rx.py (relay mode) and
> usrp_spectrum_sense.py) as an object into a new program.
> 
> 2. Define the time frame for switching between the two objects program.
> 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

> 
> Regards,
> Syed Aqeel Raza 
> 
> 
>     ----------------------------------------------------------------------
> 
>     Message: 1
>     Date: Mon, 31 Mar 2014 18:03:38 +0200
>     From: Martin Braun <address@hidden
>     <mailto:address@hidden>>
>     To: address@hidden <mailto:address@hidden>
>     Subject: Re: [USRP-users] How to stop "usrp_spectrum_sense.py"?
>     Message-ID: <address@hidden
>     <mailto:address@hidden>>
>     Content-Type: text/plain; charset=ISO-8859-1
> 
>     Syed,
> 
>     It looks like you're not shutting down the receiver thread correctly.
>     Also, remember the the delete_head() call blocks.
> 
>     What are you trying to achieve? Do you want to switch off the rx
>     completely? Maybe for half duplex?
> 
>     If not, I suggest you continue emptying the rx queue, and simply discard
>     the information.
> 
>     Martin
> 
>     On 03/30/2014 10:25 AM, Syed Aqeel Raza wrote:
>     > 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 Raza
>     >
>     >
>     > _______________________________________________
>     > USRP-users mailing list
>     > address@hidden <mailto:address@hidden>
>     > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
> 
> 
> 
> 
> _______________________________________________
> USRP-users mailing list
> address@hidden
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]