[Top][All Lists]

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

Re: [Discuss-gnuradio] adding python block to gnuradio

From: Mike Jameson
Subject: Re: [Discuss-gnuradio] adding python block to gnuradio
Date: Wed, 13 Mar 2013 11:29:04 +0000

Hi Mohammed,

Nathan just beat me to it and as he said, this link explains more about gr_modtool:


gr_modtool makes the template for you to paste your code into.

Here's my methodology on how I do it:

1) $ gr_modtool newmod
(type in your project name)

2) $ cd gr-<project name>

3) $ gr_modtool add
(you need to make a dummy c++ block before you can build the project and therefore to make a python template. pick 'sync' without any qa files. see: http://gnuradio.org/redmine/issues/522 for explanation)

4) $ gr_modtool add -l python
(this is where you make the python template, if in doubt pick the 'sync' block)

5) $ mkdir build && cd build && cmake ../ && make
(look at the errors and you will see that the '<+' and '+>' need to be removed from the files in order for it to compile. When make works, 'sudo make install' will put your new project into action. don't forget to reload GRC or hit the blue refresh button at the top.  the GRC templates need to be edited too in order for them to turn into GRC icons)

Once you can compile the templates successfully, modify the files that gr_modtool created by pasting in your code. Good luck :)


Mike Jameson M0MIK BSc
Radio Communications Technology Specialist
Email: address@hidden
Web: http://www.scanoo.com

On 13 March 2013 10:57, Mohammed Ramadan <address@hidden> wrote:
i made python block and want to add it to module in gnuradio, i open the directory of the module and use gr_motool add -t source filename.py. the tool created the .cc file and .h but as templates no processing done in the files.
so can anyone advise me to add python block?

Discuss-gnuradio mailing list

reply via email to

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