Re: Working Narrowband FM examples?

2021-08-03 Thread Mike Markowski

Nathan,

When I was refreshing my gnuradio awareness - I hesitate to use the word 
"skills" :-)  - I ran through the official tutorials and modified them 
as needed to work with a usrp b210.  On the page


   https://udel.edu/~mm/gr/

about halfway down is the title "Gnuradio Official Tutorials" with the 
link "Here are my versions" where you'll find nbfm.grc.  It's very 
simple, using filter/squelch/NBFM Receive block and runs here on grc 
3.8.2.0, a promising sign.


Hope it's useful,
Mike

On 8/3/21 2:40 AM, Nathan Van Ymeren wrote:

Hello,

I am seeking a working NBFM receiver example, as the one on the wiki[0] 
produces unintelligible output.  I am confident that my hardware is functioning 
properly because if I tune to the same frequency (162.525 MHz ) in gqrx, I can 
hear the weather radio broadcasts clearly.  I am on OpenSUSE Tumbleweed, 
running gnuradio 3.8.x with a HackRF One and a standard telescopic antenna.

I have reproduced [0] verbatim except with the following change:  Instead of a 
ZeroMQ source, I am using an osmocom source for my hackrf.

I’ve also tried adapting the flowgraph from the “SDR with HackRF” tutorial[1], 
which implements a wideband FM receiver in gnuradio, but I wasn’t able to make 
it produce anything resembling speech when I changed it to narrowband FM.

Additionally, I’ve tried a few NOAA weather radio flowgraphs found online but 
most of what I’ve found either didn’t work or else was for an older version of 
gnuradio and thus had errors that I wasn’t able to work around since I am a 
gnuradio novice.

Can anyone recommend a working flowgraph for narrowband FM, ideally something 
simple and working in gnuradio 3.8+?

Thanks,

Nathan

[0] 
https://wiki.gnuradio.org/index.php/Simulation_example:_Narrowband_FM_transceiver#NBFM_receiver
[1] https://greatscottgadgets.com/sdr/1/





How to debug GNU Radio's C++ program from source code?

2021-08-03 Thread ????????
Hi guys!
I want to know how to debug c++ code in gnuradio. As far as I know, after we 
run GRC, a Python file will be generated. The Python file connects various 
blocks, but if I debug this Python file directly, I cannot observe the internal 
operations of the C++ block. I want to know if there is any way to let me Can I 
see the contents of the c++work function when I run the python file? It's like 
executing a pure Python or pure C++ program.
If this is not possible because of the swig connection method, how can I 
observe the work of a C++ block's work function? If I look at the code 
directly, it is definitely not accurate enough. Can I write a demo by myself? 
Or other ways.
In addition, how to edit an existing block? I just want to modify its function 
slightly. Do I have to use gr_modtool to create a new OOT module and rewrite it 
based on the contents of the original block? You must also use debugging 
methods when writing, but I don't know how to do it.
in addition. I have tried the tutorials on the official website, but none of 
them worked. I also checked the previous mailing list, but it was not very 
helpful. I think anyone has a better solution?
Sincerely

Re: How to debug GNU Radio's C++ program from source code?

2021-08-03 Thread Josh Morman
Hello!

Even though GNU Radio has python bindings with swig or pybind11, the
underlying code c++ symbols are still accessible with GDB. Using Visual
Studio Code and GNU Radio compiled from source with Debug Symbols this is
pretty straightforward:
1) Open up the source tree of gnuradio in visual studio code
2) edit the launch.json and add a C++/GDB configuration where program is
python and args is the output of the GRC rendering
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/usr/bin/python3",
"args": ["/path/to/grc_output.py"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
3) put the breakpoint where you want to hit - note that GR will have been
compiled with optimizations, so the breakpoints might be a bit funky
4) F5 to run the application

If you are debugging your own OOT, this makes it even simpler because you
can compile as "-DCMAKE_BUILD_TYPE=Debug" and then your breakpoints will be
very predictable - in this case you just open up VS code from the root of
your project and follow the same steps.

Hope this helps.

Josh



On Tue, Aug 3, 2021 at 8:41 AM 能书能言 <2127629...@qq.com> wrote:

> Hi guys!
> I want to know how to debug c++ code in gnuradio. As far as I know, after
> we run GRC, a Python file will be generated. The Python file connects
> various blocks, but if I debug this Python file directly, I cannot observe
> the internal operations of the C++ block. I want to know if there is any
> way to let me Can I see the contents of the c++work function when I run the
> python file? It's like executing a pure Python or pure C++ program.
> If this is not possible because of the swig connection method, how can I
> observe the work of a C++ block's work function? If I look at the code
> directly, it is definitely not accurate enough. Can I write a demo by
> myself? Or other ways.
> In addition, how to edit an existing block? I just want to modify its
> function slightly. Do I have to use gr_modtool to create a new OOT module
> and rewrite it based on the contents of the original block? You must also
> use debugging methods when writing, but I don't know how to do it.
> in addition. I have tried the tutorials on the official website, but none
> of them worked. I also checked the previous mailing list, but it was not
> very helpful. I think anyone has a better solution?
> Sincerely
>
>


Re: How to debug GNU Radio's C++ program from source code?

2021-08-03 Thread Martin Luelf

Hi,

in case you don't have VS code, you can also run GDB directly 
https://wiki.gnuradio.org/index.php/TutorialsDebugging#Tutorial:_Using_gdb_with_Pythonic_GR_applications


Yours
Martin


On 03/08/2021 15:48, Josh Morman wrote:

Hello!

Even though GNU Radio has python bindings with swig or pybind11, the 
underlying code c++ symbols are still accessible with GDB. Using Visual 
Studio Code and GNU Radio compiled from source with Debug Symbols this 
is pretty straightforward:

1) Open up the source tree of gnuradio in visual studio code
2) edit the launch.json and add a C++/GDB configuration where program is 
python and args is the output of the GRC rendering

         {
             "name": "(gdb) Launch",
             "type": "cppdbg",
             "request": "launch",
             "program": "/usr/bin/python3",
             "args": ["/path/to/grc_output.py"],
             "stopAtEntry": false,
             "cwd": "${workspaceFolder}",
             "environment": [],
             "externalConsole": false,
             "MIMode": "gdb",
             "setupCommands": [
                 {
                     "description": "Enable pretty-printing for gdb",
                     "text": "-enable-pretty-printing",
                     "ignoreFailures": true
                 }
             ]
         },
3) put the breakpoint where you want to hit - note that GR will have 
been compiled with optimizations, so the breakpoints might be a bit funky

4) F5 to run the application

If you are debugging your own OOT, this makes it even simpler because 
you can compile as "-DCMAKE_BUILD_TYPE=Debug" and then your breakpoints 
will be very predictable - in this case you just open up VS code from 
the root of your project and follow the same steps.


Hope this helps.

Josh



On Tue, Aug 3, 2021 at 8:41 AM 能书能言 <2127629...@qq.com 
> wrote:


Hi guys!
I want to know how to debug c++ code in gnuradio. As far as I know,
after we run GRC, a Python file will be generated. The Python file
connects various blocks, but if I debug this Python file directly, I
cannot observe the internal operations of the C++ block. I want to
know if there is any way to let me Can I see the contents of the
c++work function when I run the python file? It's like executing a
pure Python or pure C++ program.
If this is not possible because of the swig connection method, how
can I observe the work of a C++ block's work function? If I look at
the code directly, it is definitely not accurate enough. Can I write
a demo by myself? Or other ways.
In addition, how to edit an existing block? I just want to modify
its function slightly. Do I have to use gr_modtool to create a new
OOT module and rewrite it based on the contents of the original
block? You must also use debugging methods when writing, but I don't
know how to do it.
in addition. I have tried the tutorials on the official website, but
none of them worked. I also checked the previous mailing list, but
it was not very helpful. I think anyone has a better solution?
Sincerely





?????? How to debug GNU Radio's C++ program from source code?

2021-08-03 Thread ????????
Hi,
Thank you very much for your suggestions, this is exactly what I want, I am a 
novice, do not have a lot of experience in program debugging, and there are 
some details I haven't figured out.


Step 1: Open the source tree in VScode. What does the source tree here refer 
to? A directory? I am using GNUradio built from source installation. Which 
directory should I open? Is it the one before or after the installation? Where 
is the source tree after installation?


Step 2: Is the setting of "args" the absolute path of the Python program I want 
to debug? Whether it can exist anywhere on the computer, but after I entered 
the path, the font turned red. Obviously, something went wrong.


One last question: If I want to modify the function of an existing module, do I 
create a new OOT module and then copy the content of the original module to 
modify it?
Sincerely






--  --
??: 
   "Josh Morman"



Re: Working Narrowband FM examples?

2021-08-03 Thread Gavin Jacobs
Nathan,
Look on this page:
https://wiki.gnuradio.org/index.php/Talk:HamRadio
Scroll down to: Saturday 12 December 2020 16:00 UTC

There you will find links to a flowgraph for narrowband FM on a HackRf.

Jake


Date: Mon, 2 Aug 2021 23:40:41 -0700
From: Nathan Van Ymeren 
To: discuss-gnuradio@gnu.org
Subject: Working Narrowband FM examples?
Message-ID: <20515f1e-1e1a-4fab-a319-df004d897...@0x85.org>
Content-Type: text/plain;   charset=utf-8

Hello,

I am seeking a working NBFM receiver example, as the one on the wiki[0] 
produces unintelligible output.  I am confident that my hardware is functioning 
properly because if I tune to the same frequency (162.525 MHz ) in gqrx, I can 
hear the weather radio broadcasts clearly.  I am on OpenSUSE Tumbleweed, 
running gnuradio 3.8.x with a HackRF One and a standard telescopic antenna.

I have reproduced [0] verbatim except with the following change:  Instead of a 
ZeroMQ source, I am using an osmocom source for my hackrf.

I’ve also tried adapting the flowgraph from the “SDR with HackRF” tutorial[1], 
which implements a wideband FM receiver in gnuradio, but I wasn’t able to make 
it produce anything resembling speech when I changed it to narrowband FM.

Additionally, I’ve tried a few NOAA weather radio flowgraphs found online but 
most of what I’ve found either didn’t work or else was for an older version of 
gnuradio and thus had errors that I wasn’t able to work around since I am a 
gnuradio novice.

Can anyone recommend a working flowgraph for narrowband FM, ideally something 
simple and working in gnuradio 3.8+?