1

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.

Tomislav Nakic-Alfirevic
  • 10,017
  • 5
  • 38
  • 51

1 Answers1

2

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".

Tomislav Nakic-Alfirevic
  • 10,017
  • 5
  • 38
  • 51
bastibl
  • 181
  • 2
  • Thank you for the answer, but I've already specified the category: `testmodule`. I've just updated it to `[testmodule]`, in line with existing module names, but other than that, it looks fine to me. Any other ideas? – Tomislav Nakic-Alfirevic Jul 26 '17 at 13:29
  • AFAIK, it's `local_blocks_path`, i.e., plural. Are there any other modules in the same path?I tested the XML file and it works for me. The block shows up under "(no module specificed)/testmodule/trivial_adder_ii". – bastibl Jul 26 '17 at 13:53
  • I'm just going to go and throw myself off of the city walls...thanks, bastibl. Lovely that GRC didn't bring this up in any way when I ran it from the console... – Tomislav Nakic-Alfirevic Jul 26 '17 at 15:08
  • That said, I'm still puzzled by the fact that editing `/etc/gnuradio/conf.d/grc.conf` had no effect, but it's now an academic question, as opposed to a practical one. – Tomislav Nakic-Alfirevic Jul 26 '17 at 15:11