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.

Any pointers.


View this message in context:
http://gnuradio.4.n7.nabble.com/terminating-benckmark-rx-py-after-TIMEOUT-tp40406.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Thu, Mar 28, 2013 at 8:45 PM, sumitstop
[email protected] 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.

  1. 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.

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():
    print tb.rxpath.probe.level()
    sleep(.1)
while carrier_sense():
    print carrier_sense()
    sleep(.5)
tb.stop()         # wait for it to finish

You might also want to sleep less alot than .1 so you don’t miss the
first packet(s).

Is that along the lines of what you were looking for?

-Nathan

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

–Anirudh Sahoo
Advanced Network Technology Div.
National Institute of Standards and Technology (NIST)
100 Bureau Drive,
Gaithersburg, MD - 20878
Room - B230, bldg.- 222
Phone- 301-975-4439

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.


View this message in context:
http://gnuradio.4.n7.nabble.com/terminating-benckmark-rx-py-after-TIMEOUT-tp40406p40526.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Nathan … having some problem with my gnuradio installation. Once
solved,
will try the method you told and get back to you.


View this message in context:
http://gnuradio.4.n7.nabble.com/terminating-benckmark-rx-py-after-TIMEOUT-tp40406p40411.html
Sent from the GnuRadio mailing list archive at Nabble.com.