Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GNU Radio (Companion) gives Python Syntax Error on variable substitution

I'm trying out GNU Radio (Compantion) for the first time right now, having bought an RTL SDR (the SDR SMARt from NooElec) and trying to build a simple FM radio. I have a (reasonably correct) flowgraph and Compilation runs without errors, but when I try to run it, I get the following Error:

Generating: '/home/fl0wless/.grc_gnuradio/Radio.py'

Executing: /usr/bin/python3 -u /home/fl0wless/.grc_gnuradio/Radio.py

  File "/home/fl0wless/.grc_gnuradio/Radio.py", line 42
    self.samp_rate = samp_rate = 2M
                                  ^
SyntaxError: invalid syntax

Instead of substituting the value of samp_rate, it seems the whole expression is simply inserted. This also happens with all other variables, if I remove the current one another appears.

Is this a (known) bug? The GNU Radio installation is fresh, as is the python3 one, I haven't tampered with anything (yet).

like image 210
Fl0wless Avatar asked Oct 21 '25 15:10

Fl0wless


1 Answers

Forget it, sorry, I found the problem: while Gnu Radio Companion will show you variables truncated with units (k, M, etc.) one cannot, in fact, enter them inside variable fields as they are not translated into their original python friendly numeric values. So my mistake was literally entering 2M into the field.

like image 71
Fl0wless Avatar answered Oct 23 '25 03:10

Fl0wless



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!