ptrkrysik / gr-gsm

Gnuradio blocks and tools for receiving GSM transmissions
Other
1.32k stars 427 forks source link

grgsm_livemon Error Ubuntu 18.04.4 LTS #518

Open wistoff opened 4 years ago

wistoff commented 4 years ago

I'm struggling since 3 days now to get this work... I'm using a fresh install of Ubuntu 18.04.4 LTS (Jetpack Version) on a NVIDIA Jetson Nano.

No matter what I do, always errors. First I tried to do the manual installation of gr-gsm which worked. But running grgsm_livemon didn't. Then tried sudo apt-get install gr-gsm and copied the grgsm_livemon file here /usr/local/bin/. Still an error: I would really appreciate some help!

Traceback (most recent call last): File "/usr/bin/grgsm_livemon", line 45, in from gnuradio import qtgui File "/usr/lib/python2.7/dist-packages/gnuradio/qtgui/init.py", line 37, in from range import Range, RangeWidget File "/usr/lib/python2.7/dist-packages/gnuradio/qtgui/range.py", line 67, in class RangeWidget(QtWidgets.QWidget): AttributeError: 'module' object has no attribute 'QWidget'

theoden8 commented 4 years ago

Ubuntu 18.04 here. I am struggling to get it running as well, but I got around that particular issue by downloading https://github.com/ptrkrysik/gr-gsm/blob/master/apps/grgsm_livemon.grc and installing with

$ grcc grgsm_livemon.grc
$ mv grgsm_livemon.py grgsm_livemon
# move it to /usr/bin

Maybe checking that /usr/local/bin appears before /usr/bin in your $PATH will resolve it?

wistoff commented 4 years ago

How do you mean that? When I try to compile it the way you said I get A LOT of these errors: grgsm_livemon.grc:172:267:FATAL:PARSER:ERR_UNDECLARED_ENTITY: Entity 'rarr' not defined

theoden8 commented 4 years ago

Sorry, my bad. The command is grcc -d . grgsm_livemon.grc, like it says here.

wistoff commented 4 years ago

Still a lot of errors like the one I described in my previous post. But I did this before and it worked.

velichkov commented 4 years ago

Hi @kjellxvx,

But running grgsm_livemon didn't. Then tried sudo apt-get install gr-gsm and copied the grgsm_livemon file here /usr/local/bin/.

You should not do this. You can't mix scripts from different versions and expect them to work.

Right now you most probably have two different versions installed at the same time and this can leads to various hard to debug problems.

My advice is to either remove the version you've installed from source (go in the build directory and execute sudo make uninstall) and do what @theoden8 have described or remove the apt version (sudo apt-get remove gr-gsm) and provide the exact error you are getting when running grgsm_livemon

wistoff commented 4 years ago

Thanks for the help so far. I'm going to do a fresh install now because things seem to be messed up. Can you tell which which way I should try it this time? Manuel mode or sudo apt-get install? As I said, I'm using Ubuntu 18.04.4 LTS. A few days ago I tried both installation types (not at the same time ;)) and had errors on both.

wistoff commented 4 years ago

I tried to install it the apt-get way on a fresh system and it ends with the error:

Processing triggers for shared-mime-info (1.9-2) ... /usr/share/mime/packages/gnuradio.xml:1: parser error : Start tag expected, '<' not found /usr/share/gnuradio/grc/freedesktop/gnuradio-grc.xml ^ Failed to parse '/usr/share/mime/packages/gnuradio.xml' Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Processing triggers for hicolor-icon-theme (0.17-2) ...

velichkov commented 4 years ago

/usr/share/mime/packages/gnuradio.xml:1: parser error : Start tag expected, '<' not found /usr/share/gnuradio/grc/freedesktop/gnuradio-grc.xml ^ Failed to parse '/usr/share/mime/packages/gnuradio.xml'

This is a known bug in the gnuradio package. You can either ignore it or replace gnuradio.xml with a symlink to gnuradio-grc.xml

sudo rm /usr/share/mime/packages/gnuradio.xml
sudo ln -s /usr/share/gnuradio/grc/freedesktop/gnuradio-grc.xml /usr/share/mime/packages/gnuradio.xml
sudo update-mime-database -V /usr/share/mime/
wistoff commented 4 years ago

Alright great! Thanks! When running grgsm_livemon I get the following error:

Traceback (most recent call last): File "/usr/bin/grgsm_livemon", line 41, in from PyQt4 import Qt ImportError: No module named PyQt4

Shouldn't the apt-get method install all modules in order to make it run?

velichkov commented 4 years ago

Alright great! Thanks! When running grgsm_livemon I get the following error:

Traceback (most recent call last): File "/usr/bin/grgsm_livemon", line 41, in from PyQt4 import Qt ImportError: No module named PyQt4

Shouldn't the apt-get method install all modules in order to make it run?

It does install all required modules but the gr-gsm package in Ubuntu 18.04 is a bit broken and that's why you need to download grgsm_livemon.grc and rebuild it manually as described by @theoden8 and in our wiki

wget http://git.osmocom.org/gr-gsm/plain/apps/grgsm_livemon.grc
grcc -d . grgsm_livemon.grc
sudo cp grgsm_livemon.py /usr/bin/grgsm_livemon
wistoff commented 4 years ago

The second command gives me the error:

Gtk-Message: 15:45:31.643: Failed to load module "canberra-gtk-module" linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown

velichkov commented 4 years ago

Gtk-Message: 15:45:31.643: Failed to load module "canberra-gtk-module"

You can either ignore this or install the canberra gtk module.

sudo apt install libcanberra-gtk-module libcanberra-gtk3-module
wistoff commented 4 years ago

Tried running grgsm_livemoon again:

linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown

gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.11 built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock [ERROR] SoapySSDPEndpoint::sendTo(udp://[ff02::c]:1900) = -1 sendto(udp://[ff02::c]:1900) [99: Cannot assign requested address] Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock [INFO] Using format CF32. Segmentation fault (core dumped)

velichkov commented 4 years ago

Segmentation fault (core dumped)

What SDR device do you have and is it connected to your computer?

To suppress most of the above messages you can specify the device using the --args= option, for example for RTL dongles you can run grgsm_livemon --args=rtl.

wistoff commented 4 years ago

That seems to work right now. At least the GUI does start and show something. So it seems to work, right? However it says that it can't find a supported tuner, what I probably have to fix with the rtl-sdr tools.

linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown

gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.11 built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock [ERROR] SoapySSDPEndpoint::sendTo(udp://[ff02::c]:1900) = -1 sendto(udp://[ff02::c]:1900) [99: Cannot assign requested address] No supported tuner found Enabled direct sampling mode, input 1 Using device #0 Realtek RTL2838UHIDIR SN: 00000001 No supported tuner found Enabled direct sampling mode, input 1 Exact sample rate is: 2000000,052982 Hz /home/name/.gnuradio/prefs/vmcircbuf_default_factory: No such file or directory vmcircbuf_createfilemapping: createfilemapping is not available OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

Thank you for all the feedback and the fast replies!

velichkov commented 4 years ago

Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock [ERROR] SoapySSDPEndpoint::sendTo(udp://[ff02::c]:1900) = -1 sendto(udp://[ff02::c]:1900) [99: Cannot assign requested address]

To suppress the above always run with --args=rtl

No supported tuner found

I don't now about this one.

Enabled direct sampling mode, input 1

Not quite sure what direct sampling mode is. Try finding a way to disable this.

/home/name/.gnuradio/prefs/vmcircbuf_default_factory: No such file or directory vmcircbuf_createfilemapping: createfilemapping is not available

You are going to see this only on the first start so ignore the above two lines.

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

The multiple O characters indicate buffer Overrun/Overflow and this means your computer can't read the incoming data fast enough. Try running rtl_test, try a different USB port, a small sample rage (-s 1e6) and stop other processes that consume a lot of CPU. In case you are using USB hub try without it.

Also note that when running livemon you need to specify frequency of a known GSM C0 cell (-f 941.8M), you can find such frequencies using the grgsm_scanner script.

wistoff commented 4 years ago

The hint about Overrun/Overflow was really useful! Thank you! It looks like the jetson nano is kind of to weak for this process. All 4 CPUs immediately use 100%. Running rtl_test -s 1e6 keeps the GPUs at around 5-15% and doesn't show any output. Which is probably that what should happen.

Running grgsm_scanner makes the CPUs use 100% (probably overrun again) and shows after a few minutes either nothing or 0 stations found.

velichkov commented 4 years ago

It looks like the jetson nano is kind of to weak for this process.

I have no experience with Jetson and other ARM based single board computers but here are some advices.

  1. Run volk-config-info --avail-machines and volk-config-info --machine and make sure the NEON kernels are available and selected.
  2. Run volk_profile that will test all volk kernels and select the best ones.
  3. When running grgsm_livemon in another terminal execute top -H to get the name of the block that takes the most CPU and then try optimizing it.

If NEON kernels are not available then you will need to uninstall volk, gnuradio, gr-osmosdr and gr-gsm and install them from source. Rebuild with -O3 or -ftree-vectorize option in CFLGAS and CXXFLGAS.

Running rtl_test -s 1e6 keeps the GPUs at around 5-15% and doesn't show any output. Which is probably that what should happen.

The GPUs are not used. When you stop rtl_test with Ctrl + C it prints the number of lost samples

User cancel, exiting...
Samples per million lost (minimum): 0
velichkov commented 4 years ago

Also to get some more output from grgsm_scanner you need to open /usr/bin/grgsm_scanner and comment out lines 320 and 321

            os.dup2(null_fds[0], 1)
            os.dup2(null_fds[1], 2)

The newer versions have a --debug flag that is not available in version 0.41.2-1

My other advice is to first install gr-gsm on a normal PC and make yourself familiar with the various tools - how to scan, capture and decode GSM messages and calls. After that you can run all tools on the Jetson board and compare the results with what you get on your PC.

theoden8 commented 4 years ago

I fixed my hackrf by updating firmware. Still, after running grgsm_scanner I have to press "Reset" for the board to be usable again. Maybe try that as well.

marwon1 commented 3 years ago

l have a problem with this

sudo grgsm_livemon
Warning: failed to XInitThreads() QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' [INFO] [UHD] linux; GNU C++ version 10.2.1 20201207; Boost_107400; UHD_3.15.0.0-4+b1 [ERROR] avahi_service_browser_new() failed: Bad state Traceback (most recent call last): File "/usr/local/bin/grgsm_livemon", line 385, in main() File "/usr/local/bin/grgsm_livemon", line 361, in main tb = top_block_cls(args=options.args, collector=options.collector, collectorport=options.collectorport, fc=options.fc, gain=options.gain, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, serverport=options.serverport, shiftoff=options.shiftoff) File "/usr/local/bin/grgsm_livemon", line 113, in init args="numchan=" + str(1) + " " + str(grgsm.device.get_default_args(args)) File "/usr/lib/python3/dist-packages/grgsm/device.py", line 55, in get_default_args raise RuntimeError("Unable to find any supported SDR devices") RuntimeError: Unable to find any supported SDR devices

SDR888 commented 2 years ago

Alright great! Thanks! When running grgsm_livemon I get the following error: Traceback (most recent call last): File "/usr/bin/grgsm_livemon", line 41, in from PyQt4 import Qt ImportError: No module named PyQt4 Shouldn't the apt-get method install all modules in order to make it run?

It does install all required modules but the gr-gsm package in Ubuntu 18.04 is a bit broken and that's why you need to download grgsm_livemon.grc and rebuild it manually as described by @theoden8 and in our wiki

wget http://git.osmocom.org/gr-gsm/plain/apps/grgsm_livemon.grc
grcc -d . grgsm_livemon.grc
**sudo cp grgsm_livemon.py** /usr/bin/grgsm_livemon

I did find where is grgsm_livemon.py ,i search everywhere but can't find grgsm_livemon.py . help please!!! thank you so much!

velichkov commented 2 years ago

Hi @SDR888,

I did find where is grgsm_livemon.py ,i search everywhere but can't find grgsm_livemon.py . help please!!! thank you so much!

How did you install gr-gsm and gnuradio and which versions? Which Linux distribution do you use and which version?

Provide the full output of sudo find /usr -name grgsm_livemon.py