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

相关文章

IDEA自动生成注释模板的配置教程

《IDEA自动生成注释模板的配置教程》本文介绍了如何在IntelliJIDEA中配置类和方法的注释模板,包括自动生成项目名称、包名、日期和时间等内容,以及如何定制参数和返回值的注释格式,需要的朋友可以... 目录项目场景配置方法类注释模板定义类开头的注释步骤类注释效果方法注释模板定义方法开头的注释步骤方法注

Python虚拟环境终极(含PyCharm的使用教程)

《Python虚拟环境终极(含PyCharm的使用教程)》:本文主要介绍Python虚拟环境终极(含PyCharm的使用教程),具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,... 目录一、为什么需要虚拟环境?二、虚拟环境创建方式对比三、命令行创建虚拟环境(venv)3.1 基础命令3

使用Node.js制作图片上传服务的详细教程

《使用Node.js制作图片上传服务的详细教程》在现代Web应用开发中,图片上传是一项常见且重要的功能,借助Node.js强大的生态系统,我们可以轻松搭建高效的图片上传服务,本文将深入探讨如何使用No... 目录准备工作搭建 Express 服务器配置 multer 进行图片上传处理图片上传请求完整代码示例

MySQL高级查询之JOIN、子查询、窗口函数实际案例

《MySQL高级查询之JOIN、子查询、窗口函数实际案例》:本文主要介绍MySQL高级查询之JOIN、子查询、窗口函数实际案例的相关资料,JOIN用于多表关联查询,子查询用于数据筛选和过滤,窗口函... 目录前言1. JOIN(连接查询)1.1 内连接(INNER JOIN)1.2 左连接(LEFT JOI

python连接本地SQL server详细图文教程

《python连接本地SQLserver详细图文教程》在数据分析领域,经常需要从数据库中获取数据进行分析和处理,下面:本文主要介绍python连接本地SQLserver的相关资料,文中通过代码... 目录一.设置本地账号1.新建用户2.开启双重验证3,开启TCP/IP本地服务二js.python连接实例1.

C语言函数递归实际应用举例详解

《C语言函数递归实际应用举例详解》程序调用自身的编程技巧称为递归,递归做为一种算法在程序设计语言中广泛应用,:本文主要介绍C语言函数递归实际应用举例的相关资料,文中通过代码介绍的非常详细,需要的朋... 目录前言一、递归的概念与思想二、递归的限制条件 三、递归的实际应用举例(一)求 n 的阶乘(二)顺序打印

Python 安装和配置flask, flask_cors的图文教程

《Python安装和配置flask,flask_cors的图文教程》:本文主要介绍Python安装和配置flask,flask_cors的图文教程,本文通过图文并茂的形式给大家介绍的非常详细,... 目录一.python安装:二,配置环境变量,三:检查Python安装和环境变量,四:安装flask和flas

Spring Security基于数据库的ABAC属性权限模型实战开发教程

《SpringSecurity基于数据库的ABAC属性权限模型实战开发教程》:本文主要介绍SpringSecurity基于数据库的ABAC属性权限模型实战开发教程,本文给大家介绍的非常详细,对大... 目录1. 前言2. 权限决策依据RBACABAC综合对比3. 数据库表结构说明4. 实战开始5. MyBA

Ubuntu中远程连接Mysql数据库的详细图文教程

《Ubuntu中远程连接Mysql数据库的详细图文教程》Ubuntu是一个以桌面应用为主的Linux发行版操作系统,这篇文章主要为大家详细介绍了Ubuntu中远程连接Mysql数据库的详细图文教程,有... 目录1、版本2、检查有没有mysql2.1 查询是否安装了Mysql包2.2 查看Mysql版本2.

Elasticsearch 在 Java 中的使用教程

《Elasticsearch在Java中的使用教程》Elasticsearch是一个分布式搜索和分析引擎,基于ApacheLucene构建,能够实现实时数据的存储、搜索、和分析,它广泛应用于全文... 目录1. Elasticsearch 简介2. 环境准备2.1 安装 Elasticsearch2.2 J