Porting GR-AIS to GN3.7

Dear Gnuradio members,

I am working on a port for GR-AIS to version 3.7. The initial version
was
for GN3.3, later it is merged to CMake.

The problem is that I am trying to compile Gnuradio with the gr-ais
extension on a beaglebone black (bbb). I managed to compile 3.7 on the
bbb,
but the problem is that I don’t have GRUEL available. On a x86 it is
possible to pull (libgruel) from the package-manager. So I decided that
the
fastest to get everything running is to upgrade gr-ais to version 3.7. I
managed to do this using the
wikihttp://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7
.

I believe that the cpp is up and running, it compiles fine, but am
running
into some problems with CMake. I haven’t worked with CMake before, so I
haven’t worked with the scripting earlier. The problem is CMake+SWIG.
When
Python tries to invoke Boost it gives an error.

Traceback (most recent call last):
File “/usr/local/bin/ais_rx.py”, line 15, in
from gr_ais import *
File “/usr/local/lib/python2.7/dist-packages/gr_ais/init.py”, line
45, in
from gr_ais_swig import *
File “/usr/local/lib/python2.7/dist-packages/gr_ais/gr_ais_swig.py”,
line
26, in
_gr_ais_swig = swig_import_helper()
File “/usr/local/lib/python2.7/dist-packages/gr_ais/gr_ais_swig.py”,
line
22, in swig_import_helper
_mod = imp.load_module(’_gr_ais_swig’, fp, pathname, description)
ImportError:
/usr/local/lib/python2.7/dist-packages/gr_ais/_gr_ais_swig.so:
undefined symbol: _ZN5boost6system15system_categoryEv

I have re-installed Ubuntu 13.10 and installed gnuradio with the latest
git
version. The make test succeeded. I have forked the gr-ais repository
into
a seperate public repo https://github.com/Fokko/gr-ais.

If someone has any idea, please let me know!

​Kind regards,

ing. Fokko Driesprong

Hi Fokko,

awesome project!
Although this might not actually help the matter on hand much: Compiling
something as big as GNU Radio on something as weak and embedded as a
beaglebone is a really bad idea, since especially the linking process
requires large amounts of RAM and I would not guarantee that it will
work with only 512MB RAM at all.

So for your porting efforts, you really should work on a fully fledged
PC. When everything is up and running, you might want to cross-compile
GNU Radio and gr-ais for your beaglebone; but the latter really should
not be your development environment of choice.

You should not install a version of gruel that does not belong to your
GR version, so fetching gruel from your package manager and installing
GR from git does not sound ok; gruel is part of the GNU Radio runtime
and therefore is not necessary to install GNU Radio.

So: On your PC, uninstall gruel using your package manager, build and
install GNU Radio from source (using the build-gnuradio script or even
better pybombs), and port gr-ais to GR3.7.

When that works, set up a cross-compiling environment for your linux of
choice on the beaglebone (I’m tempted to say Ubuntu 13.10 is not the
right distribution for an embedded environment that is less powerful
than recent smartphones), and compile GNU Radio for that; do the same
for gr-ais and install both on your beaglebone.

Hope I was of assistance anyhow,
Marcus M.

Hi Marcus,

Thanks for the response and thoughts.

I am running Ubuntu 12.04 on the beaglebone. I don’t use any GUI, and I
start the gr-ais script from the commandline. With the cortex A8 and
neon
co-processor the beaglebone is suprisingly powerfull.

Currently I am developing on a Ubuntu 13.10 desktop with the same
gnuradio
(3.7.2) and with the
libgruel-devhttp://packages.ubuntu.com/nl/lucid/libgruel-dev and
libgruel0 http://packages.ubuntu.com/nl/lucid/libgruel0 package
uninstalled. I don’t have these available on the beaglebone. I believe
when
I run 3.7 with the gruelpackage remove (since it is depricated), it uses
the methods from these packages. Please correct me if I am wrong on
this.

Maybe I will go back to 3.6 to check if the Beaglebone is powerfull
enough.

​Kind regards,

Fokko Driesprong

2013/9/3 Marcus Müller [email protected]

FYI: Gruel was removed in 3.7.

See also:
http://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7

MB

On Wed, Sep 04, 2013 at 11:55:59AM +0200, Marcus Müller wrote:

don't have these available on the beaglebone. I believe when I run 3.7 with
Fokko Driesprong
    Compiling something as big as GNU Radio on something as weak and
    GR version, so fetching gruel from your package manager and installing
    than recent smartphones), and compile GNU Radio for that; do the same
        version was for GN3.3, later it is merged to CMake.
        I believe that the cpp is up and running, it compiles fine, but am

          File "/usr/local/lib/python2.7/dist-packages/gr_ais/
        I have re-installed Ubuntu 13.10 and installed gnuradio with the
        ing. Fokko Driesprong
    _______________________________________________
    Discuss-gnuradio mailing list
    [email protected]
    https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Hi Martin B.,

Thanks for the information. I was aware of that. When
can gr-howto-write-a-block for version 3.7 be expected?

​Kind regards,

ing. Fokko Driesprong

2013/9/4 Martin B. (CEL) [email protected]

Gruel really IS a part of GNU Radio. You never need gruel / gruel-dev on
a system to compile GNU Radio, since the GR source tree contains
gruel.
Since it is integral to GR, a gruel from a different version of GNU
Radio (which is most probably the case when you install it via your
package manager), will almost never do. Please do not mix up GNU Radio
versions.

Never, it’s obsolete; use gr_modtool to generate a 3.7 module, and refer
to the GR wiki for instructions.

Side note, is there a data file containing AIS samples for testing
anywhere?

Philip

I’ve been following the discussion and I’m grateful for the porting work
to
3.7 as I haven’t had time to do it myself. That said, I’m happy to help
with gr-ais-specific questions.

Here’s a sample file recorded a couple of years ago in SF Bay. It was
recorded with a USRP1 + WBX at 256ksps.

http://www.nerdnetworks.org/~bistromath/ais.dat.tar.gz

–n

He Guys,

Thank you for the prompt replies, in special Nick F. for the reply,
I
am very thankful for the gr-ais package! :slight_smile:

Currently I am working with the modtool. I didn’t know it’s existence. A
very helpful tool.

I might have found a bug. I have version 3.7.2git-0-gd19aa281. When I
create a new block using modtool newmod I get the basic structure. When
I
go to gr-blockname/blockname_swig.i, I see that it includes
gnuradio.i,
In the wiki is
statedhttp://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7?version=7that
this should be ‘runtime_swig.i’.

I have regenerated all the blocks using the modtool. From this base I
can
rebuild the module. I have ported all the code from the old-version to
the
3.7 file structure. From this point I have some ground that the cmake
files
are ok. Everything compiles OK, but at run time I get a swig related
issue.

File “/home/fokko/Desktop/gr-ais/apps/ais_rx.py”, line 12, in
from ais import *
File “/usr/local/lib/python2.7/dist-packages/ais/init.py”, line
45,
in
from ais_swig import *
File “/usr/local/lib/python2.7/dist-packages/ais/ais_swig.py”, line
26,
in
_ais_swig = swig_import_helper()
File “/usr/local/lib/python2.7/dist-packages/ais/ais_swig.py”, line
22,
in swig_import_helper
_mod = imp.load_module(’_ais_swig’, fp, pathname, description)
ImportError: /usr/local/lib/libgnuradio-ais.so: undefined symbol:
_Z14gr_rounduppow2j

​It seems that the gr_rounduppow2 (from misc.h) function isn’t
available
in the swig environment.​
​​ I believe that the declaration is interpreted as a concrete class.​ I
am
studying CS at the university, but I don’t have much experience with
​the
SWIG package
​, a nice opportunity to learn :)​

​Kind regards,
Fokko Driesprong

2013/9/4 Nick F. [email protected]

On Thu, Sep 05, 2013 at 12:20:17AM +0200, Driesprong, Fokko wrote:

He Guys,

Thank you for the prompt replies, in special Nick F. for the reply, I am
very thankful for the gr-ais package! :slight_smile:

Currently I am working with the modtool. I didn’t know it’s existence. A very
helpful tool.

Fokko,

You really should read the tutorials on how to work with out-of-tree
modules if you want to work with out-of-tree modules:
http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules

MB


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Hi Fokko,
The information you’re offering is a little sparse.
Do you have the source code (at leas ais_rx.py in your current version)
somewhere?

He guys,

I have managed to fix all the swig error’s, but now I have some issue’s
with python. Maybe you guys have run into it earlier?

All the SWIG objects and Python classes are available. But something
might
have changed in the connect method of the top_block.

Traceback (most recent call last):
File “/usr/local/bin/ais_rx.py”, line 216, in
main()
File “/usr/local/bin/ais_rx.py”, line 169, in main
tb = my_top_block(options, queue)
File “/usr/local/bin/ais_rx.py”, line 79, in init
self.ais_rx(self.u, 161.975e6 - 162.0e6, “A”, options, queue);
File “/usr/local/bin/ais_rx.py”, line 121, in ais_rx
self.connect(self.u, self.filter, self.demod, self.unstuff,
self.start_correlator, self.stop_correlator, self.parse)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/top_block.py”,
line 131, in connect
self._connect(points[i-1], points[i])
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/top_block.py”,
line 143, in _connect
dst_block.to_basic_block(), dst_port)
File
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/runtime_swig.py”,
line
4130, in primitive_connect
return _runtime_swig.top_block_sptr_primitive_connect(self, *args)
NotImplementedError: Wrong number or type of arguments for overloaded
function ‘top_block_sptr_primitive_connect’.
Possible C/C++ prototypes are:
gr::hier_block2::connect(gr::basic_block_sptr)

gr::hier_block2::connect(gr::basic_block_sptr,int,gr::basic_block_sptr,int)

Some blocks are getting chained by the connect method. It crashes on the
following blocks:
<gr_block osmosdr_source_c_impl (0)> -> <gr_block
freq_xlating_fir_filter_ccf (1)>
These two blocks should pass complex numbers.

Anyone any idea? I am confused because the osmosdr and freq_xlanting
objects shipped with osmosdr/gnuradio.

Kind regards,
ing. Fokko Driesprong

2013/9/5 Martin B. (CEL) [email protected]

Hello Marcus,

I am sorry for the scare information. Please let me elaborate.

The most recent version is pushed in my fork of the repository of
gr-ais:
https://github.com/Fokko/gr-ais/blob/master/apps/ais_rx.py

I have digged in the generated python swig code, but the type of the
osmosdr_source_c_impl
and freq_xlating_fir_filter_ccf blocks seem the be gr_block, which
should
be accepted. It doesn’t reach the ais.demod block, it crashes right
away.

​Kind regards
,
ing. Fokko Driesprong

2013/9/8 Marcus Müller removed_email_addre[email protected]

Hi all,

Just to update you all, I’ve updated gr-ais to the GR 3.7 API this
morning.
I still have a mile’s worth of updates to take care of, but it compiles
and
runs OK. Be sure to use a 162MHz bandpass filter as in many places
nearby
FM and broadcast TV RFI will saturate even the most linear front end.

Best,
–n

Hi Fokko,

you have a misconception of what flowgraphs are.
You call connect twice, connecting all the blocks twice; this can’t be
done, since every block only has one set of input ports.
Please consider flowgraphs as mathematical digraphs: Just a set of
vertices (blocks) and directed edges; if you connect the two same blocks
with the exact same connect(…) call, you end up with double edges and
blocks that have more incoming edges than they can accept, since you try
to add the same vertices and edges to a graph that it already has.
You even made the mistake of overwriting self.filter with the second
call to ais_rx - are you sure you know what you’re coding here?
Try with only one ais_rx; I don’t see why that should not work. When you
want to construct the second branch of your flowgraph, you need to
duplicate all the vertices (blocks) first, so that they can function on
their own.

H
​e Nick,

Great work on the update of gr-ais. University is starting again, so I
am
running short on time.

I have the following make-problem:
make[2]: *** No rule to make target ../apps/ais_rx.py', needed byapps/ais_rx.py.exe’. Stop.
make[1]: *** [apps/CMakeFiles/pygen_apps_8ba3a.dir/all] Error 2
make: *** [all] Error 2

Not sure where it comes from.

​Kind regards,

Fokko Driesprong

2013/9/11 Nick F. [email protected]

He Nick,

Thanks for the quick response! One last error in the make install. In
the
grc/CMakeLists.txt there are multiple xml files that are copied by
cmake,
but these files don’t exists. I commented it out and everything works
fine.
I think you should correct that in the master too.

​Kind regards,

Fokko Driesprong

2013/9/12 Nick F. [email protected]

Dangit. Missed one – had renamed ais_rx.py to ais_rx but forgot to
change
apps/CMakeLists.txt to reflect it. Fixed, pushed the fix to master.

Thanks!
Nick

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs