Setting up GR-GSM

avoid pybombs at all cost

Requirements

apt install gnuradio gnuradio-dev
apt install osmo-sdr libosmosdr-dev
apt install libosmocore libosmocore-dev
apt install libosmocore-utils
dpkg -L libosmocore-utils
#libosmocore6

apt-get install cmake libboost-all-dev libcppunit-dev swig doxygen liblog4cpp5-dev python-docutils
#python-scipy

apt install gr-osmosdr
ls -lhF /usr/share/gnuradio/grc/blocks/osmosdr_*
ls -lhF /usr/share/gnuradio/grc/blocks/rtlsdr_*

FOR GNU RADIO 3.8

apt install liborc-dev
ldconfig

Installation

grab current

git clone https://github.com/ptrkrysik/gr-gsm.git

–or– the one from OSMOCOM

git clone https://git.osmocom.org/gr-gsm
#git clone git://git.osmocom.org/gr-gsm
cd gr-gsm/

–or– see https://github.com/ptrkrysik/gr-gsm/issues/480

rm -rf gr-gsm/
#git clone https://github.com/velichkov/gr-gsm.git
git clone -b maint-3.8 https://github.com/velichkov/gr-gsm.git
cd gr-gsm/

make sure OOM (memory killer) does not hit you

free -m

and proceed

mkdir build/
cd build/
cmake ../
echo $MAKEFLAGS
make
make install
ldconfig

which grgsm_scanner
which grgsm_livemon_headless
which grgsm_capture
which grgsm_decode

vi /etc/bash.bashrc

export PYTHONPATH=/usr/lib/python3/dist-packages
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3/dist-packages
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.8/dist-packages

source /etc/bash.bashrc

grgsm_scanner -h
grgsm_livemon_headless -h
grgsm_capture -h
    grgsm_decode -h

# dpkg -l | grep grgsm
# dpkg -l | grep gr-gsm
# apt purge gr-gsm
# rm -rf build/
# make clean

Handy arfcncalc

prepare to watch live

This one might become handy. Either take the frequency from grgsm_scanner’s output, or install arfcncalc for convenience

    wget https://lab.nethence.com/elge/tarballs/arfcncalc.tar
    #wget http://www.runningserver.com/software/arfcncalc.tar
    tar xf arfcncalc.tar
    cp arfcncalc/arfcncalc /usr/local/bin/
    arfcncalc -h

GSM900

    freq=`arfcncalc -a $arfcn -d`

DCS1800

    arfcncalc -b GSM1800 -p
    freq=`arfcncalc -b GSM1800 -a $arfcn -d`

Ready to go

see gsm

Troubleshooting

no module found

ModuleNotFoundError: No module named 'grgsm'

==> define PYTHONPATH

avoid reports spamming

To disable automated crash reports,

#systemctl status apport
#systemctl stop apport
#systemctl disable apport
#cp /etc/default/apport /etc/default/apport.dist
#vi /etc/default/apport

unknown

I do not remember why but this might be useful,

sysctl kernel.shmmni
cp -pi /etc/sysctl.conf /etc/sysctl.conf.dist
echo kernel.shmmni=32000 >> /etc/sysctl.conf
sysctl -p

GRC blocks

Block key "rtlsdr_source" not found
Validation failed:

Block - blocks_rotator_cc_0 - Rotator(blocks_rotator_cc):
    Sink - in(0):
        Port is not connected.
Error during file compilation.
apps/CMakeFiles/pygen_apps.dir/build.make:79: recipe for target 'apps/grgsm_livemon' failed
make[2]: *** [apps/grgsm_livemon] Error 1
CMakeFiles/Makefile2:1099: recipe for target 'apps/CMakeFiles/pygen_apps.dir/all' failed
make[1]: *** [apps/CMakeFiles/pygen_apps.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

==> install gr-osmosdr,

apt install gr-osmosdr

swig

ImportError: No module named _grgsm_swig

==> you need to enable the library folder containing those, check with,

cat /etc/ld.so.conf
ldconfig

segfault

Segmentation fault

hackrf_source_c[3200]: segfault at 7fe2328b2000 ip 00007fe2378c46f1 sp 00007fe1b17f91e0 error 6 in libgnuradio-osmosdr.so.0.1.4[7fe23784c000+ee000]

==>

cp -pi apps/grgsm_scanner apps/grgsm_scanner.dist
vi apps/grgsm_scanner

remove line containing,

self.rtlsdr_source.set_min_output_buffer

and rebuild over it,

cd build
make
make install

grgsm_scanner Aborted (core dumped) #336 https://github.com/ptrkrysik/gr-gsm/issues/336

Trash

apt install yasm
wget http://mpir.org/mpir-3.0.0.tar.bz2
tar xjf mpir-3.0.0.tar.bz2
./configure
make # ONLY ONE JOB
make install

Resources

Gnuradio blocks and tools for receiving GSM transmissions https://github.com/ptrkrysik/gr-gsm/

0koester gr-gsm Repository https://git.informatik.uni-hamburg.de/0koester/gr-gsm/

https://osmocom.org/projects/gr-gsm/wiki/Installation

troubles

No module named grgsm #28 https://github.com/ptrkrysik/gr-gsm/issues/28

gnuradio error #480 –> PYTHONPATH https://github.com/ptrkrysik/gr-gsm/issues/480#issuecomment-532305188


GUIDES | LECTURES | BENCHMARKS | SMTP HEALTH