Uknown Error when trying out FM Radio Receiver Example

Before I post the error message it might be noteworthy to mention I installed gr-limesdr throught the source code considering it gives you access to the gnu radio 3.8 version, and also I had the common error:

ModuleNotFoundError: No module named ‘limesdr’

Which I understand was fixed by running the commands:

export PYTHONPATH=/usr/local/lib/python3/dist-packages/:$PYTHONPATH
gnuradio-companion

But after this is done and I try to Run the FM receiver example I get this error:

<<< Welcome to GNU Radio Companion 3.8.2.0 >>>

Block paths:
/usr/share/gnuradio/grc/blocks
/usr/local/share/gnuradio/grc/blocks

Loading: “/home/ruben/gr-limesdr/examples/FM_receiver.grc”

Done

Generating: ‘/home/ruben/gr-limesdr/examples/top_block.py’

Executing: /usr/bin/python3 -u /home/ruben/gr-limesdr/examples/top_block.py

Traceback (most recent call last):
File “/home/ruben/gr-limesdr/examples/top_block.py”, line 342, in
main()
File “/home/ruben/gr-limesdr/examples/top_block.py”, line 318, in main
tb = top_block_cls()
File “/home/ruben/gr-limesdr/examples/top_block.py”, line 199, in init
self._lna_path_callback(self.lna_path)
File “/home/ruben/gr-limesdr/examples/top_block.py”, line 198, in
self._lna_path_callback = lambda i: Qt.QMetaObject.invokeMethod(self._lna_path_combo_box, “setCurrentIndex”, Qt.Q_ARG(“int”, self._lna_path_options.index(i)))
ValueError: tuple.index(x): x not in tuple

I am really new to this so any help would be awesome thanks! I’m thinking I probably don’t have all my parameters clearly defined within each block in the example or something like that but I’m not entirely sure.

What system are you using ? It works with Gnuradio companion (3.8.1.0) and Python 3.7.8.

I am running GNU radio 3.8.2.0 but it looks like im running Python 2.7.17 – Will update and let you know what happens! Thanks!

Update to your version, but it did not work unfortunately… same error.

Are you running Ubuntu 20.04 ?

I looked into my “top_block.py” and it has exactly the same line 198 that yours fails on except that it works on my system. When you do the “about” in gnuradio-companion does it list Python 3.7.8 ?

Does
python3 --version
Python 3.7.8
give you the correct version.

Is the first line in your “top_block.py” -
#!/usr/bin/env python3

Does -

python3 top_block.py

give you the same result ?

It looks like you are some how running the wrong version of python or the wrong libraries.

I tried updating Python to 3.8 but now my whole ubuntu system is corrupted. Im not sure how to fix this, I cannot even update to ubuntu 20.04:

Checking package manager
Reading package lists… Done
Building dependency tree
Reading state information… Done

Calculating the changes

Calculating the changes

Could not calculate the upgrade

An unresolvable problem occurred while calculating the upgrade.

This was likely caused by:

  • Unofficial software packages not provided by Ubuntu
    Please use the tool ‘ppa-purge’ from the ppa-purge
    package to remove software from a Launchpad PPA and
    try the upgrade again.

If none of this applies, then please report this bug using the
command ‘ubuntu-bug ubuntu-release-upgrader-core’ in a terminal. If
you want to investigate this yourself the log files in
‘/var/log/dist-upgrade’ will contain details about the upgrade.
Specifically, look at ‘main.log’ and ‘apt.log’.

Restoring original system state

Aborting
Reading package lists… Done
Building dependency tree
Reading state information… Done

I tried, installing a the Resetter application (https://vitux.com/how-to-restore-your-ubuntu-linux-system-to-its-previous-state/) but even that depends on Python…

sudo resetter
File “/usr/lib/resetter/Resetter.py”, line 324
except subprocess.CalledProcessError, e:
^
SyntaxError: invalid syntax

That is going on loll

If all you did was an install of python3.8, you can use the switch manager to go back to using 3.7.8 version -

https://linuxconfig.org/ubuntu-20-04-python-version-switch-manager

I managed to get Ubuntu up and running again as well as installed Ubuntu 20.04 since this allows for Python3.8. Now I believe everything should be fine and I have everything needed (Although not the exact same version of Python). Problem is I still get the same error:

$ python3 --version
Python 3.8.5

First line in “top_block.py” is:

#!/usr/bin/env python3

Running top_block.py gives:

$ python3 top_block.py
Traceback (most recent call last):
File “top_block.py”, line 339, in
main()
File “top_block.py”, line 315, in main
tb = top_block_cls()
File “top_block.py”, line 199, in init
self._lna_path_callback(self.lna_path)
File “top_block.py”, line 198, in
self._lna_path_callback = lambda i: Qt.QMetaObject.invokeMethod(self._lna_path_combo_box, “setCurrentIndex”, Qt.Q_ARG(“int”, self._lna_path_options.index(i)))
ValueError: tuple.index(x): x not in tuple

Which I believe is the same result. Does the python version really matter this much, even if it’s a more recent version?

Again thanks for all the help and comments!

Try creating your project from scratch - start with a new blank window and add everything new from the menus - Once, I had to do that to get one of my projects going on a new version of gnuradio-companion. My be you got something left behind that no longer works like I did.

Awesome will try!

I just came across this post and was running into the exact same error - same python and GRC versions as well.

The issue seems to be with the example flow file itself. Specifically the QT GUI Chooser block where the chooser for the LNA Path is configured. If you double click on this block and look at the various options there should be “Default option” which for me was set to 255. There are only a max of 4 options (not 255 options) configured for this part of the GUI which is why the error “ValueErrorL tuple.index(x): x not in tuple” is received. I set the “Default option” to 0 and then ran the flow file with no problem.

I know this is 2 months after your last post, but in case anyone has this problem, this is the solution that worked for me.

1 Like

Thanks for reaching out garv, the solution for me was to simply delete the LimeSuite source and add the new one in. I am guessing this example was simply not updated or something! the installtion works really well and I updated to Ubuntu 20.04 and worked well.