discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: Watchdog for GNU Radio


From: Kevin Reid
Subject: Re: Watchdog for GNU Radio
Date: Sat, 7 Nov 2020 11:52:21 -0800

On Sat, Nov 7, 2020 at 8:03 AM Kopa Rebu <koparebu@yandex.com> wrote:
My understanding is that I've to shut down the flowgraph when the failure situation is detected, and after that, I have to relaunch it using some OS provided facility, right?

There are several options:

First, you can call
    top_block.stop()
    top_block.wait() # every stop() needs a wait()
    top_block.start()
For some source/sink blocks, this will cause them to usefully reinitialize, but I don't think gr-osmosdr is one of them (if that's what you're using to access your RTL-SDR devices).

Second, you can remove the source block from the flow graph (using disconnect() to reverse the connect() operations), construct a new one, and connect that one in place of the old one. This must be done either between stop() and start() or between lock() and unlock()  (these have almost the same effects). Also, if the device requires exclusive access (which is true of RTL-SDR and HackRF), you must make sure the old source block is destroyed before the new one is created — which can take some careful dropping of references, if you're working in Python. I believe this option should be sufficient for your problem.

Third, you can restart the process as you propose. This is the most thorough and simple solution, but of course means that everything else you might be doing in that process is reset.

reply via email to

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