Quantcast

Run GRC flow graphs using python from command line

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Run GRC flow graphs using python from command line

Vishwesh Rege
Hi,

Is there any way to run GNU Radio flow graphs using python from the command line?

I have built the flow graph for a FM Receiver in GRC and have generated the .py file. Executing the flow graph in GRC works fine. However when I run using python:
python WBFM_Rx.py
I get an error saying "ImportError: No module named osmosdr"

Can I expect to have a working FM Receiver by running from the command line using the auto generated python script?

Appreciate any pointers.

Thanks.



_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run GRC flow graphs using python from command line

Moritz Luca Schmid
Hey,



> Hi,
>
> Is there any way to run GNU Radio flow graphs using python from the
> command line?
You can usually run your GRC generated python script from command line.
The execution of the flow graph in GRC is the same operation like
running the generated python file manually over the command line.

>
> I have built the flow graph for a FM Receiver in GRC and have
> generated the .py file. Executing the flow graph in GRC works fine.
> However when I run using python:
> python WBFM_Rx.py
> I get an error saying "ImportError: No module named osmosdr"
I don't know why this error occurs, but maybe you can see, if the
osmosdr module is imported in the auto generated python file. If not -
you can import it manually to solve this issue. But usually it should be
imported automatically.


Best

Luca

_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run GRC flow graphs using python from command line

Vishwesh Rege
Hi,

The error was due to gr-osmosdr not being installed.
Resolved after sudo apt-get install gr-osmosdr



On Sat, May 13, 2017 at 3:36 PM, Moritz Luca Schmid <[hidden email]> wrote:
Hey,



Hi,

Is there any way to run GNU Radio flow graphs using python from the command line?
You can usually run your GRC generated python script from command line. The execution of the flow graph in GRC is the same operation like running the generated python file manually over the command line.


I have built the flow graph for a FM Receiver in GRC and have generated the .py file. Executing the flow graph in GRC works fine. However when I run using python:
python WBFM_Rx.py
I get an error saying "ImportError: No module named osmosdr"
I don't know why this error occurs, but maybe you can see, if the osmosdr module is imported in the auto generated python file. If not - you can import it manually to solve this issue. But usually it should be imported automatically.


Best

Luca


_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run GRC flow graphs using python from command line

Moritz Luca Schmid


The error was due to gr-osmosdr not being installed.
Resolved after sudo apt-get install gr-osmosdr

I am glad you found the issue.

One thing that is worth mentioning: GR will support python 3 only from GR 3.8 and currently runs with python2.

I therefore recommend you to use the command "python2" in case you have python3 installed to avoid issues.


Best

Luca






On Sat, May 13, 2017 at 3:36 PM, Moritz Luca Schmid <[hidden email]> wrote:
Hey,



Hi,

Is there any way to run GNU Radio flow graphs using python from the command line?
You can usually run your GRC generated python script from command line. The execution of the flow graph in GRC is the same operation like running the generated python file manually over the command line.


I have built the flow graph for a FM Receiver in GRC and have generated the .py file. Executing the flow graph in GRC works fine. However when I run using python:
python WBFM_Rx.py
I get an error saying "ImportError: No module named osmosdr"
I don't know why this error occurs, but maybe you can see, if the osmosdr module is imported in the auto generated python file. If not - you can import it manually to solve this issue. But usually it should be imported automatically.


Best

Luca



_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Loading...