Problem with 3.3.0 howto-write-a-block

Hi all,
I am new to gnuradio and studying the “How to write a block” article
written by Eric B. in 2004. However, I am using the latest version
3.3.0 of the source code of howto-write-a-block and find differences in
codes and article.

When the article says the qa_howto.py would fail for no module named
howto, my version of qa_howto.py runs correctly.

I find instead of importing howto module, the 3.3.0 version imports
howto_swig. Is this the cause of the problem? Is the article still valid
for 3.3.0 version?

I will really appreciate any help. Thank you.

On Thu, Mar 24, 2011 at 05:21:11PM +0800, honglonglong wrote:

howto_swig. Is this the cause of the problem? Is the article still valid
for 3.3.0 version?

Hi honglonglong,

quite a bit has changed from when that article was written. Most
concepts are still valid (e.g. QA test code, and the idea of
sync-blocks),
but a lot of the details have changed.

First of all, remember that gr-howto-write-a-block is more than just an
example, you can use it as a template for writing your own out-of-tree
modules. So you can immediately start writing code and using it with
your GNU Radio installation. So perhaps it isn’t really necessary to
understand all of the details.

I recommend startіng like this:

  • Create your own module using the create-gnuradio-out-of-tree-project
    command. This will rename the module from ‘howto’ to something else.
  • Give it a try, compile the entire thing and run the qa code.
  • Add a block of your own. You can use gr_modtool.py from
    https://www.cgran.org/wiki/devtools, which automatically updates your
    Makefiles and creates skeleton code for a new block.
    If you’re completely new to all of this, start with a sync_block. This
    means you produce as many output items as you have input items.
  • Write some QA code, then write some signal processing code. Start with
    something simple.
  • This seems weird, but don’t install anything (run ‘sudo make install’)
    until you’re absolutely sure your stuff is correct.

Once you’ve got that working, the rest will follow quite easily.

Cheers
MB


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

First of all, thank you for such detailed instruction. However I am
confused at some of this (I am really a starter):

On Thu, 2011-03-24 at 10:50 +0100, Martin B. wrote:

I find instead of importing howto module, the 3.3.0 version imports
example, you can use it as a template for writing your own out-of-tree
Makefiles and creates skeleton code for a new block.
Can I still follow the tutorial howto to add this block? I also try the
gr_modtool.py. I copy it to the system’s search path /usr/lib64 but when
I run the command it says command not found. Is it anything wrong?
If you’re completely new to all of this, start with a sync_block. This
means you produce as many output items as you have input items.

Thanks again, Martin.

On Fri, 2011-03-25 at 09:11 +0100, Martin B. wrote:

I run the command it says command not found. Is it anything wrong?

You can still follow the tutorial, but remember that some things have
changed (e.g. paths). The ideas are still the same.

I doubt that /usr/lib64 is your search path.
More likely /usr/local/bin, or, better still, ~/bin.
Try the command ‘echo $PATH’.

Glad you help. However, I moved it to my search path (which displayed in
echo $PATH) later, it still cannot work.

Am I typing right?
I tried both “sudo gr_modtool.py help” and “sudo ./gr_modtool.py help”
as the wiki says.
It still says “sudo:gr_modtool.py:command not found.”

I find no similar case on the internet :frowning:

cheers,
honglonglong

On Fri, Mar 25, 2011 at 09:44:31AM +0800, honglonglong wrote:

I recommend startіng like this:

  • Create your own module using the create-gnuradio-out-of-tree-project
    command. This will rename the module from ‘howto’ to something else.
  • Give it a try, compile the entire thing and run the qa code.
  • Add a block of your own. You can use gr_modtool.py from
    https://www.cgran.org/wiki/devtools, which automatically updates your
    Makefiles and creates skeleton code for a new block.
    Can I still follow the tutorial howto to add this block? I also try the
    gr_modtool.py. I copy it to the system’s search path /usr/lib64 but when
    I run the command it says command not found. Is it anything wrong?

You can still follow the tutorial, but remember that some things have
changed (e.g. paths). The ideas are still the same.

I doubt that /usr/lib64 is your search path.
More likely /usr/local/bin, or, better still, ~/bin.
Try the command ‘echo $PATH’.

MB

Cheers
MB


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page

Thanks again, Martin.


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association