Stopping the UHD

Hello,

I’m having a problem, where I want to receive data from a specified
amount of time/samples and then stop. I’m using a USRP2 with the UHD.
So far, everything works fine, except for when I try to stop. My
script exits ok, but the usrp2 keeps sending data over the ethernet
bus. The ‘C’ led is remains illuminated as well, indicating that the
usrp2 is still receiving.

My code looks like this

self.ipAddr = '192.168.10.2'
self.bufSize = '60e6'
self.u = uhd.single_usrp_source('addr=' + self.ipAddr + ',

recv_buff_size=’ + self.bufSize, uhd.io_type_t.COMPLEX_FLOAT32)

 ...

if tb.u.stop() is False:
   print 'tb.u.stop() failed'
if tb.stop() is False:
   print 'tb.stop() failed'
sys.exit()

tb.u.stop() and tb.stop() both return true. Is there something else I
need to do stop my usrp2? So far the only way I’ve found to stop it
is to do a hard reset.

Also, I’ve looked over the next branch and the gnu radio mailing list,
but I haven’t really found anything.
Thanks for any help!
Devin

The gnuradio wrappers for uhd (single usrp source) is currently setup to
perform continuous streaming. It starts continuous streaming at the
first call to work() and stops continuous streaming at destruction time.

I can imagine future “stream modes” that can be passed into the block
for streaming x number of samples, then return -1 in work() for done.
Also, a method to start/stop streaming manually would be very useful.

The quickest thing to do for now would be to disconnect the block and
delete it or let it go out of scope. The deconstructor will stop
streaming for you.

-Josh

On Mon, Oct 04, 2010 at 01:27:48PM -0400, devin kelly wrote:

   print 'tb.stop() failed'
sys.exit()

tb.u.stop() and tb.stop() both return true. Is there something else I
need to do stop my usrp2? So far the only way I’ve found to stop it
is to do a hard reset.

Try stopping the flow graph:

tb.stop();

Eric