LimeSDR实验教程(9) GPS接收 (portapack发射的信号、实际卫星信号)

2023-10-07 14:20

本文主要是介绍LimeSDR实验教程(9) GPS接收 (portapack发射的信号、实际卫星信号),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

LimeSDR接收GPS其实我去年试过,但是没成功锁定。所以停滞了一段时间。最近用了portapack,可以手持式发射gps信号,这样我有了可控的信号源,确保信号强度没问题,并且实验环境搭建也方便了好多,所以这几天我打算重新测试gps接收功能,搞定以后再到室外收实际信号。

首先我们来实现portapack的gps发射。

参考这个视频:

https://www.bilibili.com/video/av76517684

要注意portapack必须要购买带高精度晶振的版本,另外固件要刷gridRF版本,用官方的或者havoc的都不行。

固件在这下载:

链接: https://pan.baidu.com/s/16flB0h_nBvkfMGmqYMv95w 提取码: iccf 

刷完固件要上github:

https://github.com/furrtek/portapack-havoc

到这里把sdcard目录里的东西复制到一张tf卡里。

如果网速不够可以从下面地址下载:

链接: https://pan.baidu.com/s/1wnjvZTCjrqkQyzI147bSFQ 提取码: avgp

然后用之前发射gps文章里提过的gps-sdr-sim里的命令

./gps-sdr-sim -e brdc3540.14n -l 40,110,100 -b 8

这个命令会生成生成gpssim.bin文件。

接下来是关键部分:

首先把你生成的gpssim.bin文件改名为BBD_0003.C8,另外再新建一个BBD_0003.TXT,内容是:

sample_rate=2600000

center_frequency=1575420000

然后把BBD_0003.C8和BBD_0003.TXT这两个文件一起复制到sd卡根目录下,再把sd卡放到portapack里。

这样,你在portapack里就能用这个文件了,步骤如下。

这样portapack就能作为gps信号源了。

接下来说电脑如何安装gnss-sdr。ubuntu 16.04里可以apt安装0.0.6版本,但是我的ubuntu里现在gnuradio是我自己编译的3.7.13了,gnss-sdr会自动让apt装3.7.9的老版本gnuradio,有冲突,所以我自己下载了gnss-sdr源代码安装。我也试过了好多个版本,最新的0.0.11版本,它会嫌弃ubuntu 16.04里的2.6版protobuf太老,要求下载protobuf,是从code.google.com里下载的,国内被墙,而且我自己按照他们的步骤编译安装的3.9版本也没找到。然后我倒退了几个版本,发现0.0.9版本,编译起来还算比较容易。下面是步骤,由于我试过几个版本,安装包有重复安装的情况,所以下面的步骤不一定完全正确,要以后找干净的电脑试了才准确知道。

有几个包挺重要的,如果不apt装他们,编译gnss-sdr的时候会自动上网下载它们的源代码,那就非常耗时了而且可能失败,所以推荐apt装好:

libmatio-dev   libpugixml-dev  libgtest-dev

另外,libblas-dev liblapack-dev libarmadillo-dev libgflags-dev libgoogle-glog-dev libhdf5-dev  libgnutls-openssl-dev这些包我应该没去装,我是按照gnss-sdr的编译教程里下载源代码装的,但是apt装这些包有可能就不用编译那些代码了,以后可以试试。

下面是gnss-sdr里编译这些依赖库的步骤,我都做过了,但是我觉得可以用上面那些apt包代替,也许你可以不装下面的这些东西。

 

Install Armadillo, a C++ linear algebra library:

$ sudo apt-get install libblas-dev liblapack-dev       # For Debian/Ubuntu/LinuxMint
$ sudo yum install lapack-devel blas-devel             # For Fedora/CentOS/RHEL
$ sudo zypper install lapack-devel blas-devel          # For OpenSUSE
$ sudo pacman -S blas lapack                           # For Arch Linux
$ wget http://sourceforge.net/projects/arma/files/armadillo-9.600.4.tar.xz
$ tar xvfz armadillo-9.600.4.tar.xz
$ cd armadillo-9.600.4
$ cmake .
$ make
$ sudo make install

The full stop separated from cmake by a space is important. CMake will figure out what other libraries are currently installed and will modify Armadillo's configuration correspondingly. CMake will also generate a run-time armadillo library, which is a combined alias for all the relevant libraries present on your system (eg. BLAS, LAPACK and ATLAS).

Install Gflags, a commandline flags processing module for C++:

$ wget https://github.com/gflags/gflags/archive/v2.2.2.tar.gz
$ tar xvfz v2.2.2.tar.gz
$ cd gflags-2.2.2
$ cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DBUILD_gflags_nothreads_LIB=OFF .
$ make
$ sudo make install
$ sudo ldconfig

Install Glog, a library that implements application-level logging:

$ wget https://github.com/google/glog/archive/v0.4.0.tar.gz
$ tar xvfz v0.4.0.tar.gz
$ cd glog-0.4.0
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig

Build the Google C++ Testing Framework, also known as Google Test:

$ wget https://github.com/google/googletest/archive/release-1.8.1.zip
$ unzip release-1.8.1.zip
$ cd googletest-release-1.8.1
$ cmake -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF .
$ make

Please DO NOT install Google Test (do not type sudo make install). Every user needs to compile his tests using the same compiler flags used to compile the installed Google Test libraries; otherwise he may run into undefined behaviors (i.e. the tests can behave strangely and may even crash for no obvious reasons). The reason is that C++ has this thing called the One-Definition Rule: if two C++ source files contain different definitions of the same class/function/variable, and you link them together, you violate the rule. The linker may or may not catch the error (in many cases it is not required by the C++ standard to catch the violation). If it does not, you get strange run-time behaviors that are unexpected and hard to debug. If you compile Google Test and your test code using different compiler flags, they may see different definitions of the same class/function/variable (e.g. due to the use of #if in Google Test). Therefore, for your sanity, we recommend to avoid installing pre-compiled Google Test libraries. Instead, each project should compile Google Test itself such that it can be sure that the same flags are used for both Google Test and the tests. The building system of GNSS-SDR does the compilation and linking of googletest to its own tests; it is only required that you tell the system where the googletest folder that you downloaded resides. Just add to your $HOME/.bashrc file the following line:

export GTEST_DIR=/home/username/googletest-release-1.8.1/googletest

changing /home/username/googletest-release-1.8.1/googletest by the actual directory where you built googletest.

Install the GnuTLS or OpenSSL libraries:

$ sudo apt-get install libgnutls-openssl-dev    # For Debian/Ubuntu/LinuxMint
$ sudo yum install openssl-devel                # For Fedora/CentOS/RHEL
$ sudo zypper install openssl-devel             # For OpenSUSE
$ sudo pacman -S openssl                        # For Arch Linux

In case the GnuTLS library with openssl extensions package is not available in your GNU/Linux distribution, GNSS-SDR can also work well with OpenSSL.

Install Protocol Buffers, a portable mechanism for serialization of structured data:

GNSS-SDR requires Protocol Buffers v3.0.0 or later. If the packages that come with your distribution are older than that (e.g., Ubuntu 16.04 Xenial and Debian 8 Jessie came with older versions), then you will need to install it manually. First, install the dependencies:

$ sudo apt-get install autoconf automake libtool curl make g++ unzip

and then: 

$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.9.0/protobuf-cpp-3.9.0.tar.gz
$ tar xvfz protobuf-cpp-3.9.0.tar.gz
$ cd protobuf-3.9.0
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig

前期准备做完了可以编译安装gnss-sdr了。

https://github.com/gnss-sdr/gnss-sdr

你可以直接到gnss-sdr的release里找到0.0.9版本。

$ cd gnss-sdr
$ mkdir build
$ cd build
$ cmake -DENABLE_OSMOSDR=ON ..
$ make
$ sudo make install

这样gnss-sdr就装好了,你还需要一个好用的conf文件,这个也很重要。

我用的是这个,对于limesdr-mini,天线用LNAW,如果是limesdr-usb,我用的是LNAL。

[GNSS-SDR];######### GLOBAL OPTIONS ##################
GNSS-SDR.internal_fs_hz=2000000;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=Osmosdr_Signal_Source
SignalSource.item_type=gr_complex
SignalSource.sampling_frequency=2000000
;# LimeSDR RX1 antennas: NONE,LNAH,LNAL,LNAW
SignalSource.antenna=LNAW
SignalSource.freq=1575420000
SignalSource.gain=40
SignalSource.rf_gain=40
SignalSource.if_gain=30
SignalSource.AGC_enabled=false
SignalSource.samples=0
SignalSource.repeat=false
;# Next line enables the LimeSDR
SignalSource.osmosdr_args=driver=lime,soapy=0
SignalSource.enable_throttle_control=false
SignalSource.dump=false
SignalSource.dump_filename=./LimeSDR_signal_source.dat;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Signal_Conditioner;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Pass_Through;######### INPUT_FILTER CONFIG ############
InputFilter.implementation=Freq_Xlating_Fir_Filter
InputFilter.decimation_factor=1
InputFilter.input_item_type=gr_complex
InputFilter.output_item_type=gr_complex
InputFilter.taps_item_type=float
InputFilter.number_of_taps=5
InputFilter.number_of_bands=2
InputFilter.band1_begin=0.0
InputFilter.band1_end=0.85
InputFilter.band2_begin=0.9
InputFilter.band2_end=1.0
InputFilter.ampl1_begin=1.0
InputFilter.ampl1_end=1.0
InputFilter.ampl2_begin=0.0
InputFilter.ampl2_end=0.0
InputFilter.band1_error=1.0
InputFilter.band2_error=1.0
InputFilter.filter_type=bandpass
InputFilter.grid_density=16
InputFilter.dump=false
InputFilter.dump_filename=…/data/input_filter.dat;######### RESAMPLER CONFIG ############
Resampler.implementation=Pass_Through;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=8
Channels.in_acquisition=1
Channel.signal=1C;######### ACQUISITION GLOBAL CONFIG ############
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition_Fine_Doppler
Acquisition_1C.item_type=gr_complex
Acquisition_1C.if=0
Acquisition_1C.sampled_ms=1
Acquisition_1C.threshold=0.015
Acquisition_1C.doppler_max=10000
Acquisition_1C.doppler_min=-10000
Acquisition_1C.doppler_step=500
Acquisition_1C.max_dwells=15
Acquisition_1C.dump=false
Acquisition_1C.dump_filename=./acq_dump.dat;######### TRACKING GLOBAL CONFIG ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.if=0
Tracking_1C.pll_bw_hz=30.0;
Tracking_1C.dll_bw_hz=4.0;
Tracking_1C.order=3;
Tracking_1C.early_late_space_chips=0.5;
Tracking_1C.dump=false
Tracking_1C.dump_filename=./tracking_ch_;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_1C.dump=false
TelemetryDecoder_1C.decimation_factor=1;;######### OBSERVABLES CONFIG ############
Observables.implementation=GPS_L1_CA_Observables
Observables.dump=true
Observables.dump_filename=./observables.dat;######### PVT CONFIG ############
PVT.implementation=GPS_L1_CA_PVT
PVT.flag_averaging=true
PVT.averaging_depth=5
PVT.output_rate_ms=100
PVT.display_rate_ms=500
PVT.flag_nmea_tty_port=false;
PVT.nmea_dump_devname=/dev/pts/4
PVT.nmea_dump_filename=./nmea_pvt.nmea
PVT.flag_rtcm_server=false
PVT.flag_rtcm_tty_port=false
PVT.rtcm_dump_devname=/dev/pts/1
PVT.dump=true
PVT.dump_filename=./PVT

有了这个文件以后,在这个文件目录下,执行:

gnss-sdr --config_file=./limesdr.conf

参考limesdr接收gps(portapack发射):

https://www.bilibili.com/video/av77174591

如果你要接收室外真实gps信号,还需要一个有源天线和电压偏置就行。

参考:https://www.bilibili.com/video/av77179389

portapack镜像:


 

这篇关于LimeSDR实验教程(9) GPS接收 (portapack发射的信号、实际卫星信号)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/158333

相关文章

JavaWeb项目创建、部署、连接数据库保姆级教程(tomcat)

《JavaWeb项目创建、部署、连接数据库保姆级教程(tomcat)》:本文主要介绍如何在IntelliJIDEA2020.1中创建和部署一个JavaWeb项目,包括创建项目、配置Tomcat服务... 目录简介:一、创建项目二、tomcat部署1、将tomcat解压在一个自己找得到路径2、在idea中添加

Python + Streamlit项目部署方案超详细教程(非Docker版)

《Python+Streamlit项目部署方案超详细教程(非Docker版)》Streamlit是一款强大的Python框架,专为机器学习及数据可视化打造,:本文主要介绍Python+St... 目录一、针对 Alibaba Cloud linux/Centos 系统的完整部署方案1. 服务器基础配置(阿里

Spring IOC核心原理详解与运用实战教程

《SpringIOC核心原理详解与运用实战教程》本文详细解析了SpringIOC容器的核心原理,包括BeanFactory体系、依赖注入机制、循环依赖解决和三级缓存机制,同时,介绍了SpringBo... 目录1. Spring IOC核心原理深度解析1.1 BeanFactory体系与内部结构1.1.1

SpringBoot集成iText快速生成PDF教程

《SpringBoot集成iText快速生成PDF教程》本文介绍了如何在SpringBoot项目中集成iText9.4.0生成PDF文档,包括新特性的介绍、环境准备、Service层实现、Contro... 目录SpringBoot集成iText 9.4.0生成PDF一、iText 9新特性与架构变革二、环

2025最新版Android Studio安装及组件配置教程(SDK、JDK、Gradle)

《2025最新版AndroidStudio安装及组件配置教程(SDK、JDK、Gradle)》:本文主要介绍2025最新版AndroidStudio安装及组件配置(SDK、JDK、Gradle... 目录原生 android 简介Android Studio必备组件一、Android Studio安装二、A

前端Visual Studio Code安装配置教程之下载、汉化、常用组件及基本操作

《前端VisualStudioCode安装配置教程之下载、汉化、常用组件及基本操作》VisualStudioCode是微软推出的一个强大的代码编辑器,功能强大,操作简单便捷,还有着良好的用户界面,... 目录一、Visual Studio Code下载二、汉化三、常用组件1、Auto Rename Tag2

JavaScript装饰器从基础到实战教程

《JavaScript装饰器从基础到实战教程》装饰器是js中一种声明式语法特性,用于在不修改原始代码的情况下,动态扩展类、方法、属性或参数的行为,本文将从基础概念入手,逐步讲解装饰器的类型、用法、进阶... 目录一、装饰器基础概念1.1 什么是装饰器?1.2 装饰器的语法1.3 装饰器的执行时机二、装饰器的

MySQL 5.7彻底卸载与重新安装保姆级教程(附常见问题解决)

《MySQL5.7彻底卸载与重新安装保姆级教程(附常见问题解决)》:本文主要介绍MySQL5.7彻底卸载与重新安装保姆级教程的相关资料,步骤包括停止服务、卸载程序、删除文件和注册表项、清理环境... 目录一、彻底卸载旧版本mysql(核心步骤)二、MySQL 5.7重新安装与配置三、常见问题解决总结废话不多

全网最全Tomcat完全卸载重装教程小结

《全网最全Tomcat完全卸载重装教程小结》windows系统卸载Tomcat重新通过ZIP方式安装Tomcat,优点是灵活可控,适合开发者自定义配置,手动配置环境变量后,可通过命令行快速启动和管理... 目录一、完全卸载Tomcat1. 停止Tomcat服务2. 通过控制面板卸载3. 手动删除残留文件4.

利用Python操作Word文档页码的实际应用

《利用Python操作Word文档页码的实际应用》在撰写长篇文档时,经常需要将文档分成多个节,每个节都需要单独的页码,下面:本文主要介绍利用Python操作Word文档页码的相关资料,文中通过代码... 目录需求:文档详情:要求:该程序的功能是:总结需求:一次性处理24个文档的页码。文档详情:1、每个