ptrkrysik / gr-gsm

Gnuradio blocks and tools for receiving GSM transmissions
Other
1.34k stars 430 forks source link

Can't find osmosdr #596

Open hbarnard opened 2 years ago

hbarnard commented 2 years ago

I've added export PYTHONPATH=/usr/local/lib/python3/dist-packages/:$PYTHONPATH to my path also compiled and installed from: https://github.com/igorauad/gr-osmosdr/tree/gr3.8 but I'm still stuck here: ModuleNotFoundError: No module named 'osmosdr' Traceback (most recent call last): File "/home/hbarnard/projects/gr-gsm/python/grgsm/__init__.py", line 64, in <module> from .device import *

I'm compiling everything, because I couldn't get the installation with gnuradio 3.7 to work on a raspberry pi, so I'm trying with an upgrade on Linux Mint (which may be the problem). So the current solution doesn't seem to work for me. osmosdr is in python3 BTW.

velichkov commented 2 years ago

Hi @hbarnard,

I've added export PYTHONPATH=/usr/local/lib/python3/dist-packages/:$PYTHONPATH to my path

Provide the full output of find /usr/local/ -name osmosdr

also compiled and installed from: https://github.com/igorauad/gr-osmosdr/tree/gr3.8

gr-osmosdr has been ported to gnuradio 3.8 (from gr3.8 branch) so better install from the official repository

but I'm still stuck here: ModuleNotFoundError: No module named 'osmosdr' Traceback (most recent call last): File "/home/hbarnard/projects/gr-gsm/python/grgsm/__init__.py", line 64, in <module> from .device import *

How do you start it and what do you start? Provide the full output together with the command that you are using.

hbarnard commented 2 years ago

Hi, thanks for the quick reply, here's the output from find /usr/local/lib/python3/dist-packages/osmosdr /usr/local/lib/cmake/osmosdr /usr/local/include/osmosdr

Ok, now used the repository. git clone git://git.osmocom.org/gr-osmosdr

CMake Error at CMakeLists.txt:45 (find_package): Could not find a configuration file for package "Gnuradio" that is compatible with requested version "3.9".

The following configuration files were considered but not accepted:

/usr/lib/x86_64-linux-gnu/cmake/gnuradio/GnuradioConfig.cmake, version: 3.8.2.0`

So I guess, I should either checkout a previous commit of gr-osmosdr or try and get my current gnuradio to 3.9? I'm pretty new to gnuradio, although I've been working with rtl-sdr applications for a while, so some of this may be newbie mistakes...

velichkov commented 2 years ago

Hi, thanks for the quick reply, here's the output from find /usr/local/lib/python3/dist-packages/osmosdr /usr/local/lib/cmake/osmosdr /usr/local/include/osmosdr

Provide the full output of /usr/local/lib/python3/dist-packages/osmosdr.

Ok, now used the repository. git clone git://git.osmocom.org/gr-osmosdr

CMake Error at CMakeLists.txt:45 (find_package): Could not find a configuration file for package "Gnuradio" that is compatible with requested version "3.9".

You need to build from gr3.8 branch as I've stated in my previous message and not from master where the version for gnuradio 3.9

So I guess, I should either checkout a previous commit of gr-osmosdr or try and get my current gnuradio to 3.9?

gr-gsm still have not been ported to gnuradio 3.9 so if you need gr-gsm then gnuradio 3.9 is not an option unless you want to port it.

You did not answer the question what did you start and how did you started it. Again provide the full output together with the command that you are using.

velichkov commented 2 years ago

I'm compiling everything, because I couldn't get the installation with gnuradio 3.7 to work on a raspberry pi, so I'm trying with an upgrade on Linux Mint

How did you install gnuradio? In case you installed it from the Mint package repository then my recommendation is to install gr-osmosdr from the package repository as well - sudo apt-get install gr-osmosdr. Don't forget to uninstall/remove every osmosdr directory in /usr/local/ as otherwise you will end up with two different versions.

hbarnard commented 2 years ago

Here's my current attempt: gnuradio-config-info -v 3.8.2.0 also echo $PYTHONPATH /usr/local/lib/python3/dist-packages/:

git clone -b maint-3.8 https://github.com/velichkov/gr-gsm.git + cmake + make as your recipe, looks good then fails with this:

[ 76%] Built target grgsm_swig_swig_compilation
Consolidate compiler generated dependencies of target grgsm_swig
[ 77%] Built target grgsm_swig
[ 78%] Generating grgsm_livemon
<<< Welcome to GNU Radio Companion Compiler 3.8.2.0 >>>

Block paths:
    /home/hbarnard/projects/gr-gsm/grc
    /usr/share/gnuradio/grc/blocks
    /usr/local/share/gnuradio/grc/blocks

>>> Loading: /home/hbarnard/projects/gr-gsm/apps/grgsm_livemon.grc
Traceback (most recent call last):
  File "/home/hbarnard/projects/gr-gsm/python/grgsm/__init__.py", line 64, in <module>
    from .device import *
  File "/home/hbarnard/projects/gr-gsm/python/grgsm/misc_utils/device.py", line 24, in <module>
    import osmosdr
ModuleNotFoundError: No module named 'osmosdr'

I haven't posted all the output, which seems to repeat ModuleNotFoundError: No module named 'osmosdr'

velichkov commented 2 years ago

git clone -b maint-3.8 https://github.com/velichkov/gr-gsm.git

All change from my fork have been merged in the main repository so better use https://github.com/ptrkrysik/gr-gsm.git

  • cmake + make as your recipe, looks good then fails with this:
    
    [ 76%] Built target grgsm_swig_swig_compilation
    Consolidate compiler generated dependencies of target grgsm_swig
    [ 77%] Built target grgsm_swig
    [ 78%] Generating grgsm_livemon
    <<< Welcome to GNU Radio Companion Compiler 3.8.2.0 >>>

Block paths: /home/hbarnard/projects/gr-gsm/grc /usr/share/gnuradio/grc/blocks /usr/local/share/gnuradio/grc/blocks

Loading: /home/hbarnard/projects/gr-gsm/apps/grgsm_livemon.grc Traceback (most recent call last): File "/home/hbarnard/projects/gr-gsm/python/grgsm/init.py", line 64, in from .device import * File "/home/hbarnard/projects/gr-gsm/python/grgsm/misc_utils/device.py", line 24, in import osmosdr ModuleNotFoundError: No module named 'osmosdr'

OK, so you are getting this error while building. Interesting! Unless you plan to modify osmosdr or you have build gnuradio from source then there is really no need to build gr-osmosdr from source so my advice is to remove every osmosdr from /usr/local/ then install gr-osmosdr package (do this only if you have installed gnuradio 3.8 from the Mint package repository).

velichkov commented 2 years ago

If you want to debug this build failure run make VERBOSE=1 and provide the full output

hbarnard commented 2 years ago

Here's the full make output. Incidentally, this started when I tried to use standard everything from repositories and hit:

Traceback (most recent call last):
  File "/usr/bin/grgsm_scanner", line 24, in <module>
    from gnuradio import blocks
ImportError: No module named gnuradio

So I decided that a rebuild might be a good way forward.

make-error.txt

Thanks for all your help.

velichkov commented 2 years ago

Incidentally, this started when I tried to use standard everything from repositories and hit:

What exactly do you mean by standard everything?

Traceback (most recent call last):
  File "/usr/bin/grgsm_scanner", line 24, in <module>
    from gnuradio import blocks
ImportError: No module named gnuradio

How did you install gr-gsm in this specific case?

So I decided that a rebuild might be a good way forward.

It's a possible way forward but I would not recommend it unless you plan to modify the thing you are going to rebuild.

make-error.txt

The errors in the attached file are quite different and are related to the documentation. You most probably don't need this documentation so you can run cmake -DENABLE_DOXYGEN=OFF .. to disable documentation. Then again rerun make VERBOSE=1, check that the output contains the error we are trying to resolve and provide the full output.

hbarnard commented 2 years ago

By standard everything, I mean I try not to build or compile stuff that's available in repositories, sogr-gsm was via apt install. I was aware that there was some complexity in dependencies (!), so this seemed the cleanest way. Best thing may be to move to Kali or a distribution where it will work out of the box.

velichkov commented 2 years ago

By standard everything, I mean I try not to build or compile stuff that's available in repositories, sogr-gsm was via apt install.

The gr-gsm package in Debian and all derivatives Mint/Ubunt/Kali/.. is not well tested and well maintained. I'm not Debian user so I can't help there.

I was aware that there was some complexity in dependencies (!), so this seemed the cleanest way.

The thing I don't understand is how you ended up building gr-osmosdr from unofficial repository.

Best thing may be to move to Kali or a distribution where it will work out of the box.

I don't think so. In my opinion the easiest way to install gr-gsm on most Linux distributions is to install all dependencies from the package repository and then only build only gr-gsm from source.

If gr-gsm package is available for your distribution of choice then you may try it but if it does not work you need to report the problem to the package maintainer. https://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/where.html

hbarnard commented 2 years ago

Ok thanks for all you help. Have got some knowledge too now. I have to work on something else but will come back to your suggestion above. The unofficial repository idea probably came from stackoverflow or something when I was trying to sort the thing out.