在阅读本文章之前,请先去隔壁I BCL. 的文章补课

同时请注意本文章写于2021.11.6,请注意时间导致的信息改变。


因为Debian和Arch两大发行版的巨大不同之处

博主今天下午花了4个小时,解决完各种错误,才接收到944.2MHz的GSM信号

在这里以本文章记述,如果能有人为此少走点弯路那也是好的(


本文的环境搭建将会以I BCL. 的上文作为基础。

让我们回到开始,一步一步来让原来用在Debian的指令行适用于Arch:

1
2
3
4
sudo apt install -y cmake libusb-1.0-0-dev build-essential libtool \
automake autoconf libfftw3-dev pkg-config python-scipy python-docutils \
libosmocore-dev libboost-all-dev swig doxygen git \
gnuradio-dev gr-osmosdr libcppunit-dev liblog4cpp5-dev

根据我在 https://archlinux.org/packages/高强度查询,以下是软件包对应表:

Debian Buster 包名 ArchLinux 包名(2021.11.6) 备注
libusb-1.0-0-dev libusb
build-essential base-devel
libfftw3-dev fftw
libosmocore-dev libosmocore AUR
libboost-all-dev boost
libcppunit-dev cppunit
liblog4cpp5-dev log4cpp

但~是~

有以下软件包需要注意:

libosmocore 中出现了multiple definition问题

GR-GSM目前仍未被Port到GnuRadio 3.9版本,这里还不能先安装gnuradio 软件包。

所以最终第一步安装命令如下:

1
sudo pacman -S cmake libusb base-devel libtool automake autoconf fftw pkg-config python-scipy python-docutils boost swig doxygen git cppunit log4cpp

接下来我们处理gr-gsm和libosmocore

libosmocore: 使用 -git AUR包

gnuradio: 在Tuna于7月19日Archive的Arch Linux Rollback Machine下载,你需要下载以下软件包:

https://arch-archive.tuna.tsinghua.edu.cn/2021/07-19/community/os/x86_64/gnuradio-3.8.2.0-2-x86_64.pkg.tar.zst

https://arch-archive.tuna.tsinghua.edu.cn/2021/07-19/community/os/x86_64/gnuradio-osmosdr-0.2.3-3-x86_64.pkg.tar.zst

https://arch-archive.tuna.tsinghua.edu.cn/2021/07-19/community/os/x86_64/gnuradio-iqbal-0.38.1-4-x86_64.pkg.tar.zst

https://arch-archive.tuna.tsinghua.edu.cn/2021/07-19/community/os/x86_64/libvolk-2%3A2.4.1-1-x86_64.pkg.tar.zst

https://arch-archive.tuna.tsinghua.edu.cn/2021/07-19/community/os/x86_64/libuhd-4.0.0.0-2-x86_64.pkg.tar.zst

然后使用 pacman -U安装

别忘了添加环境变数

这时候你就可以安全跟随I BCL的原文章的3.1-3.4编译安装别的Something(

此时 你应该可以使用kal找到你身边的GSM-900基站了。

如你所见,博主和I BCL同款的RTL2832U+R820T2

在38偏频下(同样的垃圾)能够搜索到许多且Power高的GSM900基站(相对于I BCL而言):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[[email protected] ~]$ kal -s GSM900 -e 38 
Found 1 device(s):
0: Generic RTL2832U OEM
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T/2 tuner
Exact sample rate is: 270833.002142 Hz
kal: Scanning for GSM-900 base stations.
GSM-900:
chan: 15 (938.0MHz - 1.826kHz) power: 2823053.10
chan: 46 (944.2MHz + 760Hz) power: 4187130.40
chan: 48 (944.6MHz + 835Hz) power: 953992.24
chan: 50 (945.0MHz + 153Hz) power: 1800331.28
chan: 51 (945.2MHz + 258Hz) power: 2380976.40
chan: 52 (945.4MHz + 281Hz) power: 1566731.69
chan: 55 (946.0MHz + 287Hz) power: 694859.79
...chan 107

当然 依然少不了 kal的“亲切问候”:

1
2
Difference of offsets between channels is >1kHz. This likely means that the correct PPM is too far away and you need to provide a rough estimate using the '
-e' option. Try tuning against a local FM radio or other known frequency first.

正当你以为你终于可以快乐地开始监听的时候:

1
[[email protected] ~]$ grgsm_livemon_headless -f 944.2M -p 38
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/usr/lib/python3.9/site-packages/gnuradio/qtgui/range.py:41: SyntaxWarning: "is not" with a literal. Did you mean "!="?
precision = len(temp) if temp is not '0' else 0
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/grgsm/__init__.py", line 48, in
from .grgsm_swig import *
File "/usr/lib/python3.9/site-packages/grgsm/grgsm_swig.py", line 13, in
from . import _grgsm_swig
ImportError: libgrgsm.so.1.0.0git: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/usr/local/bin/grgsm_livemon", line 37, in
from grgsm import arfcn
File "/usr/lib/python3.9/site-packages/grgsm/__init__.py", line 48, in
from .grgsm_swig import *
File "/usr/lib/python3.9/site-packages/grgsm/grgsm_swig.py", line 13, in
from . import _grgsm_swig
ImportError: libgrgsm.so.1.0.0git: cannot open shared object file: No such file or directory

是的,gr-gsm找不见刚刚自己编译的库了 :(

而实际上,这是ArchLinux的配置与其他发行版不同导致的。可以查看这个来自于2019年的Issue了解

当你按照上面的步骤排除万难,那么你就可以开始快乐地监听了(

1
2
3
4
5
6
7
8
9
10
11
12
[[email protected] ~]$ grgsm_livemon_headless -f 944.2M -p 38
[INFO] [UHD] linux; GNU C++ version 11.1.0; Boost_107600; UHD_4.0.0.0-0-unknown
gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.2.0
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy soapy redpitaya
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T/2 tuner
Exact sample rate is: 2000000.052982 Hz
Allocating 15 zero-copy buffers
2d 06 3f 10 0d a0 2e 79 f2 39 01 00 c9 41 0b 3a eb 2b 2b 2b 2b 2b 2b
2d 06 3f 10 0e a0 2e 73 f3 89 03 00 c5 9c fa 58 ab 2b 2b 2b 2b 2b 2b
03 aa 11 06 0d 00 c1 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
55 06 19 00 00 00 00 00 00 00 03 8b 00 62 a0 00 00 00 41 b9 00 00 2b

开始玩吧(