Wednesday, January 15, 2025

Re: Stuck in tutorial "Creating Python OOT with gr-modtool"

Hi Robert,

There is a bug in gnuradio 3.10.11.0 with the gr_modtool add command.
It was rewritten and a small code mistake causes the error you're
experiencing. It has been fixed in the main branch, so the next
iteration of gnuradio should work as described in the tutorial.

When gr_modtool add is run during the tutorial, it is supposed to edit
the file ...

python/customModule/__init__.py

and add the line ...

from .addSubSelect import addSubSelect

to __init__.py.

In 3.10.11.0 it doesn't do this. It creates the space for the python
import, but forgets to add the command. So how to get around this.
The simplest way is to add the 'from .module_name import module_name'
line to __init__.py file in the space created near the end of the
file, under the comment # import any pure python here. Then when you
go to build the program the build will succeed. I recommend removing
the build directory and creating a new one before restarting the build
process.

So make the changes to __init__.py, then from the gr-customModule directory ...

rm -rf build
mkdir build && cd build
cmake ..

If I recall correctly, this shouldn't affect the building of the C++
OOT modules.

Let me know if you run into any more obstacles with this.

Best regards,

Chris




On Tue, Jan 14, 2025 at 5:31 AM Robert Heerekop
<robertheerekop@gmail.com> wrote:
>
> Thanks for providing all the documentation and tutorials.
> They are really usefull for beginners like me.
> I'm trying to learn and following the tutorials but I got stuck in "Creating Python OOT with gr-modtool"
>
> I keep facing the following error message:
>
> "AttributeError: module 'gnuradio.customModule' has no attribute 'addSubSelect'"
>
> Question:
> I wonder if I make a mistake or is there something wrong with my (freshly installed) system setup (Ubuntu 24.10 GRC3.10.11.0) ?
> Thanks in advance for helping me out, guidance, tips or tricks!
>
> Robert
>
> This is the complete log:
> <<< Welcome to GNU Radio Companion 3.10.11.0 >>>
> Block paths:
> /home/robert/.local/state/gnuradio
> /usr/share/gnuradio/grc/blocks
> /usr/local/share/gnuradio/grc/blocks
> Loading: "/home/robert/My_First-block.grc"
> >>> Done
> Loading: "/home/robert/Creating_Python_OOT2.grc"
> >>> Done
> Loading: "/home/robert/Creating_Python_OOT.grc"
> >>> Done
> Generating: "/home/robert/default.py"
> Executing: /usr/bin/python3 -u /home/robert/default.py
> QSocketNotifier: Can only be used with threads started with QThread
> Traceback (most recent call last):
> File "/home/robert/default.py", line 186, in <module>
> main()
> File "/home/robert/default.py", line 163, in main
> tb = top_block_cls()
> ^^^^^^^^^^^^^^^
> File "/home/robert/default.py", line 124, in __init__
> self.customModule_addSubSelect_0 = customModule.addSubSelect(True)
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> AttributeError: module 'gnuradio.customModule' has no attribute 'addSubSelect'
> >>> Done (return code 1)
>
>

No comments:

Post a Comment