I am giving a complete description leading up to my problem. If you want
to skip down to just my problem go down to the headin my error
I am trying to learn how to write my own block. I have tried the well
documented way, with older versions using (./bootstrap ./configure
…)
Following various guides (and adding ‘sudo ldconfig’) I was able to see
the ‘square-ff’ block in GRC. following the documented way gave me
‘square’ blocks in GRC but they didn’t function.
After not finding any good solutions I decided to get the latest
GNURadio version 3.6.2 which comes with the gr-howto-… directory.
I built GNURadio from the tarball with (cd build, cmake …/, make, make
test, sudo make install). I installed GRC with (apt-get install
gnuradio-companion). I tested grc and got a ton of warnings like:
{ed@ubuntu:$ grc
Warning: Block validation failed:
/usr/local/share/gnuradio/grc/blocks/audio_sink.xml:7:0:ERROR:VALID:DTD_NOT_PCDATA:
Element block was declared #PCDATA but contains non text nodes
}
{
/usr/local/share/gnuradio/grc/blocks/uhd_usrp_source.xml:2712:0:ERROR:VALID:DTD_UNKNOWN_ELEM:
No declaration for element doc
}
and
{
Warning: Block with key “blks2_fm_preemph” already exists.
Ignoring: /usr/share/gnuradio/grc/blocks/blks2_fm_preemph.xml
}
GRC still ran without and functional error
I went ahead and cd into the ‘gr-howto…’ directory.
I did (cmake ./, make, make test, sudo make install)
make test failed test #3 (but I still installed it):
{
Test project /home/ed/gnuradio-3.6.2/gr-howto-write-a-block
Start 1: qa_howto_square_ff
1/3 Test #1: qa_howto_square_ff … Passed 0.02 sec
Start 2: qa_howto_square2_ff
2/3 Test #2: qa_howto_square2_ff … Passed 0.01 sec
Start 3: qa_howto
3/3 Test #3: qa_howto …***Failed 0.09 sec
67% tests passed, 1 tests failed out of 3
Total Test time (real) = 0.12 sec
The following tests FAILED:
3 - qa_howto (Failed)
Errors while running CTest
make: *** [test] Error 8
}
I looked in the ‘qa_howto.py’ file and there were only 2 tests
my error
I installed ‘gr-howto-…’ without any chagnes and ran sudo ldconfig
the square blocks appeared in grc
I made a flow graph with a signal source and a WXGUI scope sink
this worked
I added a square block between the source and scope sink.
when I execute this one I get the following:
{
Generating: “/home/ed/Desktop/top_block.py”
Warning: This flow graph may not have flow control: no audio or usrp blocks
found. Add a Misc->Throttle block to your flow graph to avoid CPU
congestion.
Executing: “/home/ed/Desktop/top_block.py”
Traceback (most recent call last):
File “/home/ed/Desktop/top_block.py”, line 64, in
tb = top_block()
File “/home/ed/Desktop/top_block.py”, line 53, in init
self.connect((self.gr_sig_source_x_0, 0), (self.howto_square_ff_0,
0))
File “/usr/lib/python2.6/dist-packages/gnuradio/gr/top_block.py”, line
124, in connect
self._connect(points[i-1], points[i])
File “/usr/lib/python2.6/dist-packages/gnuradio/gr/top_block.py”, line
130, in _connect
dst_block.basic_block(), dst_port)
AttributeError: ‘howto_square_ff_sptr’ object has no attribute
‘basic_block’
}
Can anyone tell me what I’m doing wrong?
I have attached my terminal output starting from the cmake ./ of the
gr-howto directory