Search code examples
gnuradiognuradio-companion

Why doesn't my OOT block appear in the GNU Radio Companion block list?


Context:

I'm getting into custom block development with GNU Radio. I've implemented a simple block called trivial_adder_ii with 1 int input and 1 int output which produces values simply multiplied by 2. The point of the exercise is to get a sense of code structure, tools and procedures.

I've used gr_modtool to create the module and the block, have updated the work method in trivial_adder_ii_impl.cc to produce the expected output and implemented a python unit test which passes. So far, so good.

The problem:

I can't get my new block to show up in the GRC block list. This is what I do (as per various tutorials):

cd build
cmake ..
make
sudo make install
sudo ldconfig

I've also created this conf. file with the following content, again, as described e.g. here and under this question:

$ cat ~/.gnuradio/config.conf 
[grc]
local_block_path=/usr/local/share/gnuradio/grc/blocks

I can see the XML file seemingly properly deployed:

$ cat /usr/local/share/gnuradio/grc/blocks/testmodule_trivial_adder_ii.xml 
<?xml version="1.0"?>
<block>
  <name>trivial_adder_ii</name>
  <key>testmodule_trivial_adder_ii</key>
  <category>testmodule</category>
  <import>import testmodule</import>
  <make>testmodule.trivial_adder_ii()</make>
  <sink>
    <name>in</name>
    <type>int</type>
  </sink>

  <source>
    <name>out</name>
    <type>int</type>
  </source>
</block>

However, my module doesn't show up in GRC, regardless of triggering "reload blocks" or restarting GRC after deploying the module XML. What am I doing wrong?

Environment: Ubuntu 14.04.1, x86_64, GNU Radio Companion 3.7.2.1.


Solution

  • It's probably listed in the (no module specified) category. To have it appear under TestModule, for example, change the XML block definition to:

    <category>[TestModule]</category>
    

    Update: correct answer provided in my comment below: it's "blocks" (plural), not "block".