On Thu, Mar 28, 2013 at 8:45 PM, sumitstop
<[hidden email]> wrote:
> How can I terminate benchmark_rx.py after a certain number of TIMEOUTS.
> I have observed two things
> 1. When I dump Tx data using --to-file option and then demod them using
> benchmark_rx , benchmark_rx terminates after demod. No waiting !
I haven't used benchmark with file io yet, but it's probably just
reading from the file until the end of the file then quitting; that is
unless you use the repeat=True option.
> 2. When I use benchmark_rx for OTA reception with USRP, and once the Tx
> stops sending data, it keeps waiting for data and give TIMEOUTS but never
> My application wants to get it terminated automatically after a certain
> number of timeouts. I tried digging a lot about where this TIMEOUT is coming
> from but no help so far.
> Any pointers.
I've never seen benchmark give a timeout, when I use it the receive
chain just hangs waiting for packets. You can change this by doing
some carrier sensing. There's a function in receive_path called
carrier_sensed(). It returns true or false if the received power is
above some threshold. You can change the threshold, or even access the
probe yourself. it's defined (in receive_path.py) as
79 # Carrier Sensing Blocks
80 alpha = 0.001
81 thresh = 30 # in dB, will have to adjust
82 self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha)
I'm able to make benchmark_rx stop on its own by going into a loop
after the flowgraph starts. When the carrier is sensed exit the loop
and go in to another one. In the second loop exiit when the carrier is
not sensed anymore. Note that for discontinuous option you'd have to
do something a little bit tricker. Kind of a very simple state
machine. I used this the probe.level might be useful for determining
where to set the threshold (30 won't work) I usually fare well around
-60 in my lab:
tb.start() # start flow graph
carrier_sense = tb.rxpath.carrier_sensed
while not carrier_sense():
tb.stop() # wait for it to finish
You might also want to sleep less alot than .1 so you don't miss the
Is that along the lines of what you were looking for?
If you are running ofdm benchmark_rx, then the TIMEOUT
comes from digital_ofdm_sampler.cc. I think the timeout
occurs, if the sampler does not get another preamble even after
1000 (this is the value set currently) symbols, then it declares
TIMEOUT and enters STATE_PREAMBLE.
thanks and regards
Advanced Network Technology Div.
National Institute of Standards and Technology (NIST)
100 Bureau Drive,
Gaithersburg, MD - 20878
Room - B230, bldg.- 222
From: discuss-gnuradio-bounces+anirudha.sahoo=[hidden email] [mailto:discuss-gnuradio-bounces+anirudha.sahoo=[hidden email]] On Behalf Of sumitstop
Sent: Thursday, March 28, 2013 9:45 PM
To: [hidden email] Subject: [Discuss-gnuradio] terminating benckmark_rx.py after TIMEOUT
How can I terminate benchmark_rx.py after a certain number of TIMEOUTS.
I have observed two things
1. When I dump Tx data using --to-file option and then demod them using benchmark_rx , benchmark_rx terminates after demod. No waiting !
2. When I use benchmark_rx for OTA reception with USRP, and once the Tx stops sending data, it keeps waiting for data and give TIMEOUTS but never stops.
My application wants to get it terminated automatically after a certain number of timeouts. I tried digging a lot about where this TIMEOUT is coming from but no help so far.
But if I modify here, I have to recompile the whole code again .. meanwhile I worked around a process which kills this receiver with the PID I am writing the packet no in a file, another script checks for content of the file, if it is empty , it kills the receiver... working smooth so far !!
I am going to recompile and test for sure once my thesis is done.