Discussion:
[Discuss-gnuradio] OOT block not showing in GRC
Washbourne, Logan
2015-08-08 22:33:29 UTC
Permalink
Hello all,

I am trying to create a simple OOT block. Eventually I would like to create
a block that lets a transmitting agent know if their message was received
or not, but for now I am just trying to create a block that multiplies the
input values by 2 (very similar to the guided tutorial example of the
square_ff block).

So the problem is that when I follow all of the instructions no errors
appear but when I open up the GRC, my module and blocks are not there.

So hopefully no one minds if I explain how I have installed Gnuradio on my
machine and the process of creating the OOT module, in hopes someone might
find where I made an error.

I have already gotten previous help and responses on here that really did
help me out so I'd like to say again, thank you to the community.

Ok, so I used Pybombs to install Gnuradio.

/home/username/Thesis/pybombs is where I installed pybombs.

Before installing gnuradio I changed the permissions to the path of
/opt/gnuradio/pybombs by using: sudo chown username:mygroupname
/opt/gnuradio/pybombs (thanks to Nathan West)

I then used ./pybombs install gnuradio.

I changed the install prefix to /opt/gnuradio/pybombs

Then I used ./pybobms env
source /opt/gnuradio/pybombs/setup_env.sh (sometimes I have to rerun this
to get the GRC to open, not sure what I'm doing to undo this command)

Then I created the folder, /home/username/Thesis/OOT

I then used gr_modtool newmod ACK

Then /home/username/Thesis/OOT/gr-ACK gr_modtool add -t general check

altered the QA file
rewrote the check_impl.cc file

Created the build folder(/home/username/Thesis/OOT/gr-ACK/build

ran cmake ../
ran make
ran make test

Everything passed(after some debugging, array indices start at 0 btw)

I then ran gr_modtool makexml check in the gr-ACK folder

Then cd build

sudo make install
sudo ldconfig

gnuradio-companion

And I can't find my module or block.

I have a feeling that I'm still installing gnuradio or my OOT blocks in the
wrong places, but I'm not sure how to remedy it.

*********check_impl.cc***********

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <gnuradio/io_signature.h>
#include "check_impl.h"

namespace gr {
namespace ACK {

check::sptr
check::make()
{
return gnuradio::get_initial_sptr
(new check_impl());
}

/*
* The private constructor
*/
check_impl::check_impl()
: gr::block("check",
gr::io_signature::make(1,1, sizeof (float)),
gr::io_signature::make(1,1, sizeof (float)))
{}

/*
* Our virtual destructor.
*/
check_impl::~check_impl()
{
}

void
check_impl::forecast (int noutput_items, gr_vector_int
&ninput_items_required)
{
ninput_items_required[0] = noutput_items;
}

int
check_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];

// Do <+signal processing+>
// Tell runtime system how many input items we consumed on
// each input stream.

for(int i = 0; i < noutput_items ;i++)
{
out[i] = in[i] * 2;
}


consume_each (noutput_items);

// Tell runtime system how many output items we produced.
return noutput_items;
}

} /* namespace ACK */
} /* namespace gr */


***********qa_check.py**********************

#!/usr/bin/env python


from gnuradio import gr, gr_unittest
from gnuradio import blocks
import ACK_swig as ACK

class qa_check (gr_unittest.TestCase):

def setUp (self):
self.tb = gr.top_block ()

def tearDown (self):
self.tb = None

def test_001_check (self):

src_data = (3, 4, 5.5, 2, 3)
expected_result = (6, 8, 11, 4, 6)
src = blocks.vector_source_f(src_data)
sqr = ACK.check()
dst = blocks.vector_sink_f()
self.tb.connect(src,sqr)
self.tb.connect(sqr,dst)
self.tb.run()
result_data = dst.data()
self.assertFloatTuplesAlmostEqual(expected_result,result_data,6)






if __name__ == '__main__':
gr_unittest.run(qa_check, "qa_check.xml")




I really appreciate all of your time,

Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
Kevin McQuiggin
2015-08-08 22:43:40 UTC
Permalink
Hi Logan:

I just went through the same process! My new OOT block wasn't being found. The solution is to add a [grc] segment to the config.conf file in ~/.gnuradio:

I had to create the .gnuradio directory, then add the simple two-line [grc] stanza to a new config.conf file:

[grc]
local_blocks_path=/usr/local/share/gnuradio/grc/blocks

This tells grc to look for additional blocks in the stated directory. So you would do something like:

cd
mkdir .gnuradio
cd .gnuradio
vi config.conf

Then add the two lines above, your OOT block install path may be different so I'd check it first.

Hope this helps,

Kevin
Post by Washbourne, Logan
Hello all,
I am trying to create a simple OOT block. Eventually I would like to create a block that lets a transmitting agent know if their message was received or not, but for now I am just trying to create a block that multiplies the input values by 2 (very similar to the guided tutorial example of the square_ff block).
So the problem is that when I follow all of the instructions no errors appear but when I open up the GRC, my module and blocks are not there.
So hopefully no one minds if I explain how I have installed Gnuradio on my machine and the process of creating the OOT module, in hopes someone might find where I made an error.
I have already gotten previous help and responses on here that really did help me out so I'd like to say again, thank you to the community.
Ok, so I used Pybombs to install Gnuradio.
/home/username/Thesis/pybombs is where I installed pybombs.
Before installing gnuradio I changed the permissions to the path of /opt/gnuradio/pybombs by using: sudo chown username:mygroupname /opt/gnuradio/pybombs (thanks to Nathan West)
I then used ./pybombs install gnuradio.
I changed the install prefix to /opt/gnuradio/pybombs
Then I used ./pybobms env
source /opt/gnuradio/pybombs/setup_env.sh (sometimes I have to rerun this to get the GRC to open, not sure what I'm doing to undo this command)
Then I created the folder, /home/username/Thesis/OOT
I then used gr_modtool newmod ACK
Then /home/username/Thesis/OOT/gr-ACK gr_modtool add -t general check
altered the QA file
rewrote the check_impl.cc file
Created the build folder(/home/username/Thesis/OOT/gr-ACK/build
ran cmake ../
ran make
ran make test
Everything passed(after some debugging, array indices start at 0 btw)
I then ran gr_modtool makexml check in the gr-ACK folder
Then cd build
sudo make install
sudo ldconfig
gnuradio-companion
And I can't find my module or block.
I have a feeling that I'm still installing gnuradio or my OOT blocks in the wrong places, but I'm not sure how to remedy it.
*********check_impl.cc***********
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "check_impl.h"
namespace gr {
namespace ACK {
check::sptr
check::make()
{
return gnuradio::get_initial_sptr
(new check_impl());
}
/*
* The private constructor
*/
check_impl::check_impl()
: gr::block("check",
gr::io_signature::make(1,1, sizeof (float)),
gr::io_signature::make(1,1, sizeof (float)))
{}
/*
* Our virtual destructor.
*/
check_impl::~check_impl()
{
}
void
check_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
ninput_items_required[0] = noutput_items;
}
int
check_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
// Do <+signal processing+>
// Tell runtime system how many input items we consumed on
// each input stream.
for(int i = 0; i < noutput_items ;i++)
{
out[i] = in[i] * 2;
}
consume_each (noutput_items);
// Tell runtime system how many output items we produced.
return noutput_items;
}
} /* namespace ACK */
} /* namespace gr */
***********qa_check.py**********************
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import ACK_swig as ACK
self.tb = gr.top_block ()
self.tb = None
src_data = (3, 4, 5.5, 2, 3)
expected_result = (6, 8, 11, 4, 6)
src = blocks.vector_source_f(src_data)
sqr = ACK.check()
dst = blocks.vector_sink_f()
self.tb.connect(src,sqr)
self.tb.connect(sqr,dst)
self.tb.run()
result_data = dst.data()
self.assertFloatTuplesAlmostEqual(expected_result,result_data,6)
gr_unittest.run(qa_check, "qa_check.xml")
I really appreciate all of your time,
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
_______________________________________________
Discuss-gnuradio mailing list
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Ron Economos
2015-08-08 22:53:49 UTC
Permalink
That's one way to skin the cat. You can also use an install prefix with
cmake.

cmake -DCMAKE_INSTALL_PREFIX=/opt/gnuradio/pybombs ../

Ron
Post by Kevin McQuiggin
[grc]
local_blocks_path=/usr/local/share/gnuradio/grc/blocks
cd
mkdir .gnuradio
cd .gnuradio
vi config.conf
Then add the two lines above, your OOT block install path may be different so I'd check it first.
Hope this helps,
Kevin
Post by Washbourne, Logan
Hello all,
I am trying to create a simple OOT block. Eventually I would like to create a block that lets a transmitting agent know if their message was received or not, but for now I am just trying to create a block that multiplies the input values by 2 (very similar to the guided tutorial example of the square_ff block).
So the problem is that when I follow all of the instructions no errors appear but when I open up the GRC, my module and blocks are not there.
So hopefully no one minds if I explain how I have installed Gnuradio on my machine and the process of creating the OOT module, in hopes someone might find where I made an error.
I have already gotten previous help and responses on here that really did help me out so I'd like to say again, thank you to the community.
Ok, so I used Pybombs to install Gnuradio.
/home/username/Thesis/pybombs is where I installed pybombs.
Before installing gnuradio I changed the permissions to the path of /opt/gnuradio/pybombs by using: sudo chown username:mygroupname /opt/gnuradio/pybombs (thanks to Nathan West)
I then used ./pybombs install gnuradio.
I changed the install prefix to /opt/gnuradio/pybombs
Then I used ./pybobms env
source /opt/gnuradio/pybombs/setup_env.sh (sometimes I have to rerun this to get the GRC to open, not sure what I'm doing to undo this command)
Then I created the folder, /home/username/Thesis/OOT
I then used gr_modtool newmod ACK
Then /home/username/Thesis/OOT/gr-ACK gr_modtool add -t general check
altered the QA file
rewrote the check_impl.cc file
Created the build folder(/home/username/Thesis/OOT/gr-ACK/build
ran cmake ../
ran make
ran make test
Everything passed(after some debugging, array indices start at 0 btw)
I then ran gr_modtool makexml check in the gr-ACK folder
Then cd build
sudo make install
sudo ldconfig
gnuradio-companion
And I can't find my module or block.
I have a feeling that I'm still installing gnuradio or my OOT blocks in the wrong places, but I'm not sure how to remedy it.
*********check_impl.cc***********
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "check_impl.h"
namespace gr {
namespace ACK {
check::sptr
check::make()
{
return gnuradio::get_initial_sptr
(new check_impl());
}
/*
* The private constructor
*/
check_impl::check_impl()
: gr::block("check",
gr::io_signature::make(1,1, sizeof (float)),
gr::io_signature::make(1,1, sizeof (float)))
{}
/*
* Our virtual destructor.
*/
check_impl::~check_impl()
{
}
void
check_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
ninput_items_required[0] = noutput_items;
}
int
check_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
// Do <+signal processing+>
// Tell runtime system how many input items we consumed on
// each input stream.
for(int i = 0; i < noutput_items ;i++)
{
out[i] = in[i] * 2;
}
consume_each (noutput_items);
// Tell runtime system how many output items we produced.
return noutput_items;
}
} /* namespace ACK */
} /* namespace gr */
***********qa_check.py**********************
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import ACK_swig as ACK
self.tb = gr.top_block ()
self.tb = None
src_data = (3, 4, 5.5, 2, 3)
expected_result = (6, 8, 11, 4, 6)
src = blocks.vector_source_f(src_data)
sqr = ACK.check()
dst = blocks.vector_sink_f()
self.tb.connect(src,sqr)
self.tb.connect(sqr,dst)
self.tb.run()
result_data = dst.data()
self.assertFloatTuplesAlmostEqual(expected_result,result_data,6)
gr_unittest.run(qa_check, "qa_check.xml")
I really appreciate all of your time,
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
_______________________________________________
Discuss-gnuradio mailing list
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Washbourne, Logan
2015-08-08 22:56:42 UTC
Permalink
Kevin,

It worked! I really appreciate your help!!

Ron,

So that install prefix should be pointing to where I installed gnuradio?

(Never can know too many ways to skin a cat-metaphorically)



Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
Post by Kevin McQuiggin
I just went through the same process! My new OOT block wasn't being
found. The solution is to add a [grc] segment to the config.conf file in
I had to create the .gnuradio directory, then add the simple two-line
[grc]
local_blocks_path=/usr/local/share/gnuradio/grc/blocks
This tells grc to look for additional blocks in the stated directory. So
cd
mkdir .gnuradio
cd .gnuradio
vi config.conf
Then add the two lines above, your OOT block install path may be different
so I'd check it first.
Hope this helps,
Kevin
On Aug 8, 2015, at 3:33 PM, Washbourne, Logan <
Hello all,
I am trying to create a simple OOT block. Eventually I would like to
create a block that lets a transmitting agent know if their message was
received or not, but for now I am just trying to create a block that
multiplies the input values by 2 (very similar to the guided tutorial
example of the square_ff block).
So the problem is that when I follow all of the instructions no errors
appear but when I open up the GRC, my module and blocks are not there.
So hopefully no one minds if I explain how I have installed Gnuradio on
my machine and the process of creating the OOT module, in hopes someone
might find where I made an error.
I have already gotten previous help and responses on here that really
did help me out so I'd like to say again, thank you to the community.
Ok, so I used Pybombs to install Gnuradio.
/home/username/Thesis/pybombs is where I installed pybombs.
Before installing gnuradio I changed the permissions to the path of
/opt/gnuradio/pybombs by using: sudo chown username:mygroupname
/opt/gnuradio/pybombs (thanks to Nathan West)
I then used ./pybombs install gnuradio.
I changed the install prefix to /opt/gnuradio/pybombs
Then I used ./pybobms env
source /opt/gnuradio/pybombs/setup_env.sh (sometimes I have to rerun
this to get the GRC to open, not sure what I'm doing to undo this command)
Then I created the folder, /home/username/Thesis/OOT
I then used gr_modtool newmod ACK
Then /home/username/Thesis/OOT/gr-ACK gr_modtool add -t general check
altered the QA file
rewrote the check_impl.cc file
Created the build folder(/home/username/Thesis/OOT/gr-ACK/build
ran cmake ../
ran make
ran make test
Everything passed(after some debugging, array indices start at 0 btw)
I then ran gr_modtool makexml check in the gr-ACK folder
Then cd build
sudo make install
sudo ldconfig
gnuradio-companion
And I can't find my module or block.
I have a feeling that I'm still installing gnuradio or my OOT blocks in
the wrong places, but I'm not sure how to remedy it.
*********check_impl.cc***********
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "check_impl.h"
namespace gr {
namespace ACK {
check::sptr
check::make()
{
return gnuradio::get_initial_sptr
(new check_impl());
}
/*
* The private constructor
*/
check_impl::check_impl()
: gr::block("check",
gr::io_signature::make(1,1, sizeof (float)),
gr::io_signature::make(1,1, sizeof (float)))
{}
/*
* Our virtual destructor.
*/
check_impl::~check_impl()
{
}
void
check_impl::forecast (int noutput_items, gr_vector_int
&ninput_items_required)
{
ninput_items_required[0] = noutput_items;
}
int
check_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
// Do <+signal processing+>
// Tell runtime system how many input items we consumed on
// each input stream.
for(int i = 0; i < noutput_items ;i++)
{
out[i] = in[i] * 2;
}
consume_each (noutput_items);
// Tell runtime system how many output items we produced.
return noutput_items;
}
} /* namespace ACK */
} /* namespace gr */
***********qa_check.py**********************
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import ACK_swig as ACK
self.tb = gr.top_block ()
self.tb = None
src_data = (3, 4, 5.5, 2, 3)
expected_result = (6, 8, 11, 4, 6)
src = blocks.vector_source_f(src_data)
sqr = ACK.check()
dst = blocks.vector_sink_f()
self.tb.connect(src,sqr)
self.tb.connect(sqr,dst)
self.tb.run()
result_data = dst.data()
self.assertFloatTuplesAlmostEqual(expected_result,result_data,6)
gr_unittest.run(qa_check, "qa_check.xml")
I really appreciate all of your time,
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
_______________________________________________
Discuss-gnuradio mailing list
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Ron Economos
2015-08-08 22:59:45 UTC
Permalink
Yes. I will cause your OOT blocks to be installed in the same place as
all the other GNU Radio blocks.

Ron
Post by Washbourne, Logan
Kevin,
It worked! I really appreciate your help!!
Ron,
So that install prefix should be pointing to where I installed gnuradio?
(Never can know too many ways to skin a cat-metaphorically)
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
I just went through the same process! My new OOT block wasn't
being found. The solution is to add a [grc] segment to the
I had to create the .gnuradio directory, then add the simple
[grc]
local_blocks_path=/usr/local/share/gnuradio/grc/blocks
This tells grc to look for additional blocks in the stated
cd
mkdir .gnuradio
cd .gnuradio
vi config.conf
Then add the two lines above, your OOT block install path may be
different so I'd check it first.
Hope this helps,
Kevin
On Aug 8, 2015, at 3:33 PM, Washbourne, Logan
Hello all,
I am trying to create a simple OOT block. Eventually I would
like to create a block that lets a transmitting agent know if
their message was received or not, but for now I am just trying to
create a block that multiplies the input values by 2 (very similar
to the guided tutorial example of the square_ff block).
So the problem is that when I follow all of the instructions no
errors appear but when I open up the GRC, my module and blocks are
not there.
So hopefully no one minds if I explain how I have installed
Gnuradio on my machine and the process of creating the OOT module,
in hopes someone might find where I made an error.
I have already gotten previous help and responses on here that
really did help me out so I'd like to say again, thank you to the
community.
Ok, so I used Pybombs to install Gnuradio.
/home/username/Thesis/pybombs is where I installed pybombs.
Before installing gnuradio I changed the permissions to the path
of /opt/gnuradio/pybombs by using: sudo chown username:mygroupname
/opt/gnuradio/pybombs (thanks to Nathan West)
I then used ./pybombs install gnuradio.
I changed the install prefix to /opt/gnuradio/pybombs
Then I used ./pybobms env
source /opt/gnuradio/pybombs/setup_env.sh (sometimes I have to
rerun this to get the GRC to open, not sure what I'm doing to undo
this command)
Then I created the folder, /home/username/Thesis/OOT
I then used gr_modtool newmod ACK
Then /home/username/Thesis/OOT/gr-ACK gr_modtool add -t general
check
altered the QA file
rewrote the check_impl.cc file
Created the build folder(/home/username/Thesis/OOT/gr-ACK/build
ran cmake ../
ran make
ran make test
Everything passed(after some debugging, array indices start at 0
btw)
I then ran gr_modtool makexml check in the gr-ACK folder
Then cd build
sudo make install
sudo ldconfig
gnuradio-companion
And I can't find my module or block.
I have a feeling that I'm still installing gnuradio or my OOT
blocks in the wrong places, but I'm not sure how to remedy it.
*********check_impl.cc***********
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "check_impl.h"
namespace gr {
namespace ACK {
check::sptr
check::make()
{
return gnuradio::get_initial_sptr
(new check_impl());
}
/*
* The private constructor
*/
check_impl::check_impl()
: gr::block("check",
gr::io_signature::make(1,1, sizeof (float)),
gr::io_signature::make(1,1, sizeof (float)))
{}
/*
* Our virtual destructor.
*/
check_impl::~check_impl()
{
}
void
check_impl::forecast (int noutput_items, gr_vector_int
&ninput_items_required)
{
ninput_items_required[0] = noutput_items;
}
int
check_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
// Do <+signal processing+>
// Tell runtime system how many input items we consumed on
// each input stream.
for(int i = 0; i < noutput_items ;i++)
{
out[i] = in[i] * 2;
}
consume_each (noutput_items);
// Tell runtime system how many output items we produced.
return noutput_items;
}
} /* namespace ACK */
} /* namespace gr */
***********qa_check.py**********************
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import ACK_swig as ACK
self.tb = gr.top_block ()
self.tb = None
src_data = (3, 4, 5.5, 2, 3)
expected_result = (6, 8, 11, 4, 6)
src = blocks.vector_source_f(src_data)
sqr = ACK.check()
dst = blocks.vector_sink_f()
self.tb.connect(src,sqr)
self.tb.connect(sqr,dst)
self.tb.run()
result_data = dst.data()
self.assertFloatTuplesAlmostEqual(expected_result,result_data,6)
gr_unittest.run(qa_check, "qa_check.xml")
I really appreciate all of your time,
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
_______________________________________________
Discuss-gnuradio mailing list
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
l***@ostatemail.okstate.edu
2015-08-08 23:06:20 UTC
Permalink
Ron,

Thanks for the info!

Logan

Sent from my Cyanogen phone
Yes. I will cause your OOT blocks to be installed in the same place as all the other GNU Radio blocks.
Ron
Post by Washbourne, Logan
Kevin,
It worked! I really appreciate your help!!
Ron,
So that install prefix should be pointing to where I installed gnuradio?
(Never can know too many ways to skin a cat-metaphorically)
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
Post by Kevin McQuiggin
[grc]
local_blocks_path=/usr/local/share/gnuradio/grc/blocks
cd
mkdir .gnuradio
cd .gnuradio
vi config.conf
Then add the two lines above, your OOT block install path may be different so I'd check it first.
Hope this helps,
Kevin
Post by Washbourne, Logan
Hello all,
I am trying to create a simple OOT block. Eventually I would like to create a block that lets a transmitting agent know if their message was received or not, but for now I am just trying to create a block that multiplies the input values by 2 (very similar to the guided tutorial example of the square_ff block).
So the problem is that when I follow all of the instructions no errors appear but when I open up the GRC, my module and blocks are not there.
So hopefully no one minds if I explain how I have installed Gnuradio on my machine and the process of creating the OOT module, in hopes someone might find where I made an error.
I have already gotten previous help and responses on here that really did help me out so I'd like to say again, thank you to the community.
Ok, so I used Pybombs to install Gnuradio.
/home/username/Thesis/pybombs is where I installed pybombs.
Before installing gnuradio I changed the permissions to the path of /opt/gnuradio/pybombs by using: sudo chown username:mygroupname /opt/gnuradio/pybombs (thanks to Nathan West)
I then used ./pybombs install gnuradio.
I changed the install prefix to /opt/gnuradio/pybombs
Then I used ./pybobms env
source /opt/gnuradio/pybombs/setup_env.sh (sometimes I have to rerun this to get the GRC to open, not sure what I'm doing to undo this command)
Then I created the folder, /home/username/Thesis/OOT
I then used gr_modtool newmod ACK
Then /home/username/Thesis/OOT/gr-ACK gr_modtool add -t general check
altered the QA file
rewrote the check_impl.cc file
Created the build folder(/home/username/Thesis/OOT/gr-ACK/build
ran cmake ../
ran make
ran make test
Everything passed(after some debugging, array indices start at 0 btw)
I then ran gr_modtool makexml check in the gr-ACK folder
Then cd build
sudo make install
sudo ldconfig
gnuradio-companion
And I can't find my module or block.
I have a feeling that I'm still installing gnuradio or my OOT blocks in the wrong places, but I'm not sure how to remedy it.
*********check_impl.cc***********
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "check_impl.h"
namespace gr {
   namespace ACK {
     check::sptr
     check::make()
     {
       return gnuradio::get_initial_sptr
         (new check_impl());
     }
     /*
      * The private constructor
      */
     check_impl::check_impl()
       : gr::block("check",
               gr::io_signature::make(1,1, sizeof (float)),
               gr::io_signature::make(1,1, sizeof (float)))
     {}
     /*
      * Our virtual destructor.
      */
     check_impl::~check_impl()
     {
     }
     void
     check_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
     {
         ninput_items_required[0] = noutput_items;
     }
     int
     check_impl::general_work (int noutput_items,
                        gr_vector_int &ninput_items,
                        gr_vector_const_void_star &input_items,
                        gr_vector_void_star &output_items)
     {
         const float *in = (const float *) input_items[0];
         float *out = (float *) output_items[0];
         // Do <+signal processing+>
         // Tell runtime system how many input items we consumed on
         // each input stream.
     for(int i = 0; i < noutput_items ;i++)
     {
         out[i] = in[i] * 2;
     }
         consume_each (noutput_items);
         // Tell runtime system how many output items we produced.
         return noutput_items;
     }
   } /* namespace ACK */
} /* namespace gr */
***********qa_check.py**********************
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import ACK_swig as ACK
         self.tb = gr.top_block ()
         self.tb = None
     src_data = (3, 4, 5.5, 2, 3)
     expected_result = (6, 8, 11, 4, 6)
     src = blocks.vector_source_f(src_data)
     sqr = ACK.check()
     dst = blocks.vector_sink_f()
     self.tb.connect(src,sqr)
     self.tb.connect(sqr,dst)
     self.tb.run()
     result_data = dst.data()
     self.assertFloatTuplesAlmostEqual(expected_result,result_data,6)
     gr_unittest.run(qa_check, "qa_check.xml")
I really appreciate all of your time,
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
_______________________________________________
Discuss-gnuradio mailing list
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Kevin McQuiggin
2015-08-08 23:03:00 UTC
Permalink
Hi Logan:

Glad to hear that! Happy to help.

My first OOT block was a variant of the “Repeat” block that permitted the repeat factor (the “Interpolation” parameter in the block itself) to be changed on the fly. I needed that capability for an approach to demodulating AFSK that I have since found a much better way to do... So I don’t “need” the block myself anymore, but nonetheless it is handy to have around.

Kevin
Post by Washbourne, Logan
Kevin,
It worked! I really appreciate your help!!
Ron,
So that install prefix should be pointing to where I installed gnuradio?
(Never can know too many ways to skin a cat-metaphorically)
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
[grc]
local_blocks_path=/usr/local/share/gnuradio/grc/blocks
cd
mkdir .gnuradio
cd .gnuradio
vi config.conf
Then add the two lines above, your OOT block install path may be different so I'd check it first.
Hope this helps,
Kevin
Post by Washbourne, Logan
Hello all,
I am trying to create a simple OOT block. Eventually I would like to create a block that lets a transmitting agent know if their message was received or not, but for now I am just trying to create a block that multiplies the input values by 2 (very similar to the guided tutorial example of the square_ff block).
So the problem is that when I follow all of the instructions no errors appear but when I open up the GRC, my module and blocks are not there.
So hopefully no one minds if I explain how I have installed Gnuradio on my machine and the process of creating the OOT module, in hopes someone might find where I made an error.
I have already gotten previous help and responses on here that really did help me out so I'd like to say again, thank you to the community.
Ok, so I used Pybombs to install Gnuradio.
/home/username/Thesis/pybombs is where I installed pybombs.
Before installing gnuradio I changed the permissions to the path of /opt/gnuradio/pybombs by using: sudo chown username:mygroupname /opt/gnuradio/pybombs (thanks to Nathan West)
I then used ./pybombs install gnuradio.
I changed the install prefix to /opt/gnuradio/pybombs
Then I used ./pybobms env
source /opt/gnuradio/pybombs/setup_env.sh (sometimes I have to rerun this to get the GRC to open, not sure what I'm doing to undo this command)
Then I created the folder, /home/username/Thesis/OOT
I then used gr_modtool newmod ACK
Then /home/username/Thesis/OOT/gr-ACK gr_modtool add -t general check
altered the QA file
rewrote the check_impl.cc file
Created the build folder(/home/username/Thesis/OOT/gr-ACK/build
ran cmake ../
ran make
ran make test
Everything passed(after some debugging, array indices start at 0 btw)
I then ran gr_modtool makexml check in the gr-ACK folder
Then cd build
sudo make install
sudo ldconfig
gnuradio-companion
And I can't find my module or block.
I have a feeling that I'm still installing gnuradio or my OOT blocks in the wrong places, but I'm not sure how to remedy it.
*********check_impl.cc***********
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gnuradio/io_signature.h>
#include "check_impl.h"
namespace gr {
namespace ACK {
check::sptr
check::make()
{
return gnuradio::get_initial_sptr
(new check_impl());
}
/*
* The private constructor
*/
check_impl::check_impl()
: gr::block("check",
gr::io_signature::make(1,1, sizeof (float)),
gr::io_signature::make(1,1, sizeof (float)))
{}
/*
* Our virtual destructor.
*/
check_impl::~check_impl()
{
}
void
check_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
ninput_items_required[0] = noutput_items;
}
int
check_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
// Do <+signal processing+>
// Tell runtime system how many input items we consumed on
// each input stream.
for(int i = 0; i < noutput_items ;i++)
{
out[i] = in[i] * 2;
}
consume_each (noutput_items);
// Tell runtime system how many output items we produced.
return noutput_items;
}
} /* namespace ACK */
} /* namespace gr */
***********qa_check.py**********************
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import ACK_swig as ACK
self.tb = gr.top_block ()
self.tb = None
src_data = (3, 4, 5.5, 2, 3)
expected_result = (6, 8, 11, 4, 6)
src = blocks.vector_source_f(src_data)
sqr = ACK.check()
dst = blocks.vector_sink_f()
self.tb.connect(src,sqr)
self.tb.connect(sqr,dst)
self.tb.run()
result_data = dst.data()
self.assertFloatTuplesAlmostEqual(expected_result,result_data,6)
gr_unittest.run(qa_check, "qa_check.xml")
I really appreciate all of your time,
Logan Washbourne
Electrical Engineering Graduate Student
(Electromagnetics)
_______________________________________________
Discuss-gnuradio mailing list
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio <https://lists.gnu.org/mailman/listinfo/discuss-gnuradio>
_______________________________________________
Discuss-gnuradio mailing list
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Loading...