Sorry for the dummy question, but I didn’t find a simple and direct
answer searching around for this. (Not need to say also that I am just
starting with GNU Radio…
OK I have a code, generated with Gnu radio companion that i want to
run
over the command line to follow with GDB. I was under the impression
that
if I simply got the code generated in the ~/.grc_gnuradio, add the
def main():
“”" go, go, go “”"
top_block = CLASS
top_block.run()
if name == “main”:
print ‘Blocked waiting for GDB attach (pid = %d)’ % (os.getpid(),)
raw_input ('Press Enter to continue: ')
main()
Traceback (most recent call last):
File “ieee802_15_4_phy.py”, line 120, in
main()
File “ieee802_15_4_phy.py”, line 115, in main
top_block.run()
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py”,
line 53, in getattr
return getattr(self._hb, name)
AttributeError: ‘hier_block2_sptr’ object has no attribute ‘run’
The code runs correctly on Gnuradio companion! No problem whatsoever!
Which would be the correct way to run the code auto-generated by
gnuradio
companion in a stand alone way?
OK I have a code, generated with Gnu radio companion that i want
to run over the command line to follow with GDB. I was under the
impression that if I simply got the code generated in the
~/.grc_gnuradio, add the
This folder usually only contains ‘hier_blocks’. Executable flowgraph
pythons files are usually created in the same folder your .grc file is
located in.
|def main(): “”" go, go, go “”" top_block = CLASS
top_block.run()
Did you replace a class by [Class]? According to the Tutorial it
expects an object of type gr.top_block in this line.
if name == “main”: print ‘Blocked waiting for GDB attach
(pid = %d)’ % (os.getpid(),) raw_input ('Press Enter to continue:
') main() ---- |
it would run to attach GDB. However, i am getting the following error:
— Traceback (most recent call last): File “ieee802_15_4_phy.py”,
line 120, in main() File “ieee802_15_4_phy.py”, line 115,
in main top_block.run() File
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py”,
line 53, in getattr
return getattr(self._hb, name) AttributeError: ‘hier_block2_sptr’
object has no attribute ‘run’
You try to call run on a ‘hier_block’. ‘run’ is a member of
‘gr.top_block’. top_block contains the scheduler and takes care of
correct initialization etc. So it is essentially the flowgraph.
I hope I could give you some hints on what might go wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
THANKS a lot!!! Yes you did really helped, as you said I was trying
to
run the wrong .py!!! The example generates two .py on on the main
directory, as you said, and another on the ~/.grc_gnuradio. I had seen
somewhere that gnuradio companion generate code on the ~/.grc_gnuradio.
I
looked, the code was there, I didn’t even think it could have also
generated other part of the code on the same directory of the .grc. It
was
naive, sorry.
I managed to run and connect gdb to it, using the PID. Now things will
become really interesting, i.e.e me fighting with gdb, and the
breakpoints,
to understand the values it passes through the code ;).
Thanks again Johannes, for taking your time to answer!
Best regards…
Daniel
On Mon, Dec 22, 2014 at 4:24 PM, Johannes D. [email protected]
wrote:
This folder usually only contains ‘hier_blocks’. Executable flowgraph
‘gr.top_block’. top_block contains the scheduler and takes care of
gPoHowIvWFwuiR/owJjwHhSGyCmZU1/Iz3yGT0TLdOZ8odlP0z9braIOt2bT3x9V