discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Installing GNURadio On Raspberry Pi


From: P C
Subject: Re: [Discuss-gnuradio] Installing GNURadio On Raspberry Pi
Date: Wed, 24 Apr 2019 14:22:45 -0500
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Nick, Marcus,

To answer your osmosdr question I used the instructions here:
https://osmocom.org/projects/gr-osmosdr/wiki/GrOsmoSDR

And I also did:

sudo apt-get install rtl-sdr gr-osmosdr

Since then I did some more experimenting and I believe it is a problem with osmosdr. I don't know a lot about Raspbian (the RPi OS) or Python but it may be that I have multiple versions of Python and that is confusing osmosdr.

Here is what I did, I found in /usr/local/bin, a program, osmosdr_fft which I believe was installed when I installed gr-osmosdr.
It gives me exactly the same error and Traceback?? that gnuradio gave me.
I know I have Python 3.??? and Python 2.??? but I don't know enough about where Raspbian squirrels away executables to know how to find all the Pythons that are installed.?? I used the GUI (startx) search function that came with the Pi and found 25 folders named Python and 4 files named Python.?? I sure don't know what to do with that.

This is why I believe osmosdr is confused.?? I looked at the Traceback and to my (very limited) understanding it looks like osmosdr is trying to determine which version of Python is being used.?? The result is it thinks it needs to run "_osmosdr_swig" but a search for "_osmosdr_swig" in all folders reports that it can't find "_osmosdr_swig".

I am trying to understand the Traceback and the thread through the modules.
At the risk of driving everybody away I have included, below, both the Traceback and then code snippets from the trace points. Together it is 2,622 characters and 69 lines if anybody is interested.?? Don't feel bad if it is TMI.?? I understand.

Pete


Here is what is reported:
Traceback (most recent call last):
?? File "/home/pi/Documents/Security/top_block.py", line 28, in <module>
?????? import osmosdr
?? File "/usr/local/lib/python2.7/dist-packages/osmosdr/__init__.py", line 26, in <module>
?????? from osmosdr_swig import *
?? File "/usr/local/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py", line 21, in <module>
?????? _osmosdr_swig = swig_import_helper()
?? File "/usr/local/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py", line 20, in swig_import_helper
?????? return importlib.import_module('_osmosdr_swig')
?? File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
?????? __import__(name)
ImportError: No module named _osmosdr_swig

Python code snippets from around the traces are:

From top_block.py
25 from gnuradio.eng_option import eng_option
26 from gnuradio.filter import firdes
27 from optparse import OptionParser
28 import osmosdr
29 import sip

From /usr/local/lib/python2.7/dist-packages/osmosdr/__init__.py
25 # import swig generated symbols into the osmosdr namespace
26 from osmosdr_swig import *
27
28 # import any pure python here
29 #

From /usr/local/lib/python2.7/dist-packages/osmosdr/osmosdr_swig.py
11 from sys import version_info as _swig_python_version_info
12 if _swig_python_version_info >= (2, 7, 0):
13???????? def swig_import_helper():
14???????????????? import importlib
15???????????????? pkg = __name__.rpartition('.')[0]
16???????????????? mname = '.'.join((pkg, '_osmosdr_swig')).lstrip('.')
17???????????????? try:
18???????????????????????? return importlib.import_module(mname)
19???????????????? except ImportError:
20???????????????????????? return importlib.import_module('_osmosdr_swig')
21???????? _osmosdr_swig = swig_import_helper()
22???????? del swig_import_helper
23 elif _swig_python_version_info >= (2, 6, 0):

From /usr/lib/python2.7/importlib/__init__.py
20 def import_module(name, package=None):
21???????? """Import a module.
22
23???????? The 'package' argument is required when performing a relative import. It 24???????? specifies the package to use as the anchor point from which to resolve the
25???????? relative import to an absolute import.
26
27???????? """
28???????? if name.startswith('.'):
29???????????????? if not package:
30???????????????????????? raise TypeError("relative imports require the 'package' argument")
31???????????????? level = 0
32???????????????? for character in name:
33???????????????????????? if character != '.':
34???????????????????????????????? break
35???????????????????????? level += 1
36???????????????? name = _resolve_name(name[level:], package, level)
37???????? __import__(name)
38???????? return sys.modules[name]




On 4/24/2019 11:31 AM, Nick Hansen wrote:
> Pete:
>
> Sounds like your gnuradio install works fine, but getting the blocks for RTL SDR is an issue.
> Did you try building gr-osmosdr from source?
> https://osmocom.org/projects/gr-osmosdr/wiki
> Another possibility is that gnuradio just can't find the osmo blocks. In that case you would need to move the blocks from where they were installed, or else add the location of the blocks to the pythonPATH search variable. Default install paths can cause problems.
>
> I have a friend who has RPI+RTL set up to listen to FM radio, so I know it CAN work.
>
> Cheers,
> Nick
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



On 4/24/2019 11:31 AM, Nick Hansen wrote:
Pete:

Sounds like your gnuradio install works fine, but getting the blocks for RTL SDR is an issue.
Did you try building gr-osmosdr from source?
https://osmocom.org/projects/gr-osmosdr/wiki
Another possibility is that gnuradio just can't find the osmo blocks. In that case you would need to move the blocks from where they were installed, or else add the location of the blocks to the pythonPATH search variable. Default install paths can cause problems.

I have a friend who has RPI+RTL set up to listen to FM radio, so I know it CAN work.

Cheers,
Nick

_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




reply via email to

[Prev in Thread] Current Thread [Next in Thread]