DIY 天线+SDR+GNURadio 实现低成本接收解码韩国GK-2A(GEO-KOMPSAT-2A)气象卫星信号

公开时间:2020-02

https://www.freebuf.com/geek/226035.html

0x00 前言

这几年玩了很多种 SDR 开发板,也在尝试着玩各种天线,分析解码不同协议的无线信号。

上小学的时候,玩过一段时间的电视卫星(中六、亚太五),介于气象卫星和电视卫星存在一些相通性,便在近期开始尝试接收、解码气象卫星信号。

0x01 硬件:

SDR:RTL-SDR v3 、Airspy Mini

LNA:Nooelec’s SAMbird+GOES

2.4GHz网格天线 + 买投影or买相机送的支架

天线是从淘宝买的 2.4Ghz放大WiFi 信号的接收设备,虽然频率是 2.4Ghz,但是国内外很多火腿用这款天线接收1.7Ghz 左右的卫星信号。

花了半天时间拆快递、组装天线,装完后:

4631573305359_.pic_hd

上面的图是室内,在室外接收的时候需要调整天线,修正垂直、水平极化方式:

4731573305401_.pic_hd

SDR+LNA特写:

4651573305368_.pic_hd

0x02 Windows

安装 GNURadio

wget http://www.gcndevelopment.com/gnuradio/downloads/installers/v1.6.0/gnuradio_3.7.13.5_win64.msi

安装 Python3.7

wget https://www.python.org/ftp/python/3.7.5/python-3.7.5-amd64.exe

安装依赖库

pip install pycryptodome
pip install jdcal

WechatIMG472

启动 GNURadio 执行LRIT Demod.grc流图:

Xnip2019-11-17_22-06-23.png

运行xritdecoder.exe、运行UDP-bridge.bat、运行xrit-rx.bat:

Xnip2019-11-15_21-15-25
@usa_satcom  有写一些气象卫星解码用的软件,如 XRIT_Decoder 、XHRPT decoder ,本来打算找作者购买软件授权 License key,结果被告知软件不向中国用户提供购买服务… 这里猜测应该是之前有国内用户试用他的软件,在 30 天试用期内破解了作者的软件然后在网上宣传,最后导致作者拒绝向国内用户提供软件下载和购买使用。后面改用 Linux 进行解码。

0x03 Linux Ubuntu 16.04

安装依赖:

sudo apt-get install -y \
  build-essential \
  cmake \
  git-core \
  libopencv-dev \
  zlib1g-dev

安装RTL-SDR驱动:

git clone https://github.com/osmocom/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make -j8
sudo make install
sudo ldconfig
cd ../..

安装AirSpy驱动:

git clone https://github.com/airspy/airspyone_host
cd airspyone_host
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make -j8
sudo make install
sudo ldconfig
cd ../..

安装GOES Tool:

git clone --recursive https://github.com/sam210723/goestools
cd goestools
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local
make -j8
sudo make install
cd ../..

安装XRIT-RX:

git clone https://github.com/sam210723/xrit-rx
cd xrit-rx
pip3 install pycryptodome
pip3 install Pillow==5.0.0

启动monitor:

goesrecv -i 1 -c goestools/etc/goesrecv.conf
python3 xrit-rx.py

校准天线:

WechatIMG470

GK-2A部分参数:

Xnip2019-11-09_21-55-11.png

传输示意图:

Xnip2019-11-18_11-18-08

打开 gqrx,将频点设为卫星中心频率,如天线以对准卫星,瀑布图上可以看到很明显的信号,北京地区将天线对准大概东南方向的位置即可。

mmexport15738241138021105539245546742605.jpg

GK-2A在 1692.14MHz每隔十分钟向地面传输一次图像,比如16:00:20 开始第一次传输,到 16:04:00 传输完成,下次将在 16:10:20 至 16:14:00 左右传输第二次。

Xnip2019-11-16_16-12-34

接收到的加密文件将存在XRIT-RX/received/LRIT/$年月日/FD目录中,如:IMG_FD_049_IR105_20191116_082006_01.lrit –IMG_FD_049_IR105_20191116_082006_10.lrit:

Xnip2019-11-16_16-31-32.png

10 个 lrit 文件可解出一张 JPG 图片,在 tools 目录中有用于解码的 lrit-img.py脚本:

python3 lrit-img.py ../received/LRIT/20191116/FD/
Found 40 ".lrit" files: 
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_01.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_02.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_03.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_04.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_05.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_06.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_07.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_08.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_09.lrit
  ../received/LRIT/20191116/FD/IMG_FD_048_IR105_20191116_081006_10.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_01.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_02.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_03.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_04.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_05.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_06.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_07.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_08.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_09.lrit
  ../received/LRIT/20191116/FD/IMG_FD_049_IR105_20191116_082006_10.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_01.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_02.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_03.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_04.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_05.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_06.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_07.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_08.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_09.lrit
  ../received/LRIT/20191116/FD/IMG_FD_050_IR105_20191116_083006_10.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_01.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_02.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_03.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_04.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_05.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_06.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_07.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_08.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_09.lrit
  ../received/LRIT/20191116/FD/IMG_FD_051_IR105_20191116_084006_10.lrit


Found 4 images:
  IMG_FD_049_IR105_20191116_082006
    Found 10 of 10 segments

  IMG_FD_048_IR105_20191116_081006
    Found 10 of 10 segments

  IMG_FD_050_IR105_20191116_083006
    Found 10 of 10 segments

  IMG_FD_051_IR105_20191116_084006
    Found 10 of 10 segments

-----------------------------------------

Processing IMG_FD_049_IR105_20191116_082006...
  Loading segments..........
  Joining segments..........
  Saved image: "../received/LRIT/20191116/FD//IMG_FD_049_IR105_20191116_082006.jpg"


Processing IMG_FD_048_IR105_20191116_081006...
  Loading segments..........
  Joining segments..........
  Saved image: "../received/LRIT/20191116/FD//IMG_FD_048_IR105_20191116_081006.jpg"


Processing IMG_FD_050_IR105_20191116_083006...
  Loading segments..........
  Joining segments..........
  Saved image: "../received/LRIT/20191116/FD//IMG_FD_050_IR105_20191116_083006.jpg"


Processing IMG_FD_051_IR105_20191116_084006...
  Loading segments..........
  Joining segmentsTraceback (most recent call last):
  File "lrit-img.py", line 294, in <module>
    init()
  File "lrit-img.py", line 105, in init
    process_group(name, mode, groups[img])
  File "lrit-img.py", line 145, in process_group
    img = Image.open(buf)
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2295, in open
    % (filename if filename else fp))
OSError: cannot identify image file <_io.BytesIO object at 0x7fae93d1cba0>

IMG_FD_049_IR105_20191116_082006

0x04 参考资料&感谢

https://github.com/opensatelliteproject/OpenSatelliteProject
https://pietern.github.io/goestools/guides/minimal_receiver.html
https://usa-satcom.com/wp-content/uploads/2018/12/GEOS-16_Receiver_Project-12022018.pdf

https://www.teske.net.br/lucas/2016/10/goes-satellite-hunt-part-1-antenna-system/

https://www.teske.net.br/lucas/2016/10/goes-satellite-hunt-part-2-demodulator/

https://www.teske.net.br/lucas/2016/11/goes-satellite-hunt-part-3-frame-decoder/

https://github.com/opensatelliteproject/OpenSatelliteProject

https://github.com/sam210723/goestools

https://github.com/sam210723/xrit-rx

https://www.rtl-sdr.com/rtl-sdr-com-goes-16-17-and-gk-2a-weather-satellite-reception-comprehensive-tutorial
https://medium.com/@luigifcruz/reverse-engineering-goes-16-cda-telemetry-b0234cdfb0c1
http://monitor-post.blogspot.com/2019/09/
https://luigifreitas.me/2018-02-12/reverse-engineering-goes-cda-telemetry
http://www.prutchi.com/2019/07/11/receiving-emwin-and-hrit-services-from-goes-16-with-xrit
http://www.virtuallab.bom.gov.au/files/7314/9880/1019/201705_current_status_of_GK-2A.pdf
https://directory.eoportal.org/web/eoportal/satellite-missions/g/geo-kompsat-2

发表评论

Please log in using one of these methods to post your comment:

WordPress.com 徽标

您正在使用您的 WordPress.com 账号评论。 注销 /  更改 )

Twitter picture

您正在使用您的 Twitter 账号评论。 注销 /  更改 )

Facebook photo

您正在使用您的 Facebook 账号评论。 注销 /  更改 )

Connecting to %s