非常粗糙的实验性实现,基于 gps-sdr-sim 进行实时信号生成。该代码适用于 bladeRF,并已在 Windows 10 和 Ubuntu 20.04 上测试通过。
Usage: bladegps [options]
Options:
-e <gps_nav> RINEX navigation file for GPS ephemerides (required)
-y <yuma_alm> YUMA almanac file for GPS almanacs
-u <user_motion> User motion file (dynamic mode)
-g <nmea_gga> NMEA GGA stream (dynamic mode)
-l <location> Lat,Lon,Hgt (static mode) e.g. 35.274,137.014,100
-t <date,time> Scenario start time YYYY/MM/DD,hh:mm:ss
-T <date,time> Overwrite TOC and TOE to scenario start time
-d <duration> Duration [sec] (max: 86400)
-x <XB_number> Enable XB board, e.g. '-x 200' for XB200
-i Interactive mode: North='w', South='s', East='d', West='a'
-I Disable ionospheric delay for spacecraft scenario
-p Disable path loss and hold power level constant
按照 Nuand wiki 页面 上的说明,并使用 Visual Studio 2013 Express for Windows Desktop 从源代码构建 bladeRF 库。假设您已经下载了 pthread 和 libusb 文件,并且成功为您的 Windows 环境构建了 bladeRF 库。
Configuration Properties -> C/C++ -> General -> Additional Include Directories 中添加以下文件夹的路径:
Configuration Properties -> Linker -> General -> Additional Library Directories 中添加以下文件夹的路径:
Configuration Properties -> Linker -> Input -> Additional Dependencies 中指定附加库的名称:
Build -> Build Solution构建成功后,您可以在 Release 文件夹中找到可执行文件。您应该将以下 DLL 的副本放在同一文件夹中以运行代码:
在当前目录旁边的目录中获取 bladeRF 源代码
$ cd ..
$ git clone [email protected]:Nuand/bladeRF.git
构建 bladeRF 主机库
$ cd bladeRF/host
$ mkdir build
$ cd build
$ cmake ..
$ make
构建 bladeGPS
$ cd ../../../bladeGPS
$ make
安装 Xcode
安装 Xcode 命令行工具
$ xcode-select --install
安装 MacPorts
为 port 创建符号链接
$ sudo ln -s /opt/local/bin/port /usr/local/bin/port
安装 bladeRF
$ sudo port install bladeRF +tecla
安装 cmake
$ sudo port install cmake
在当前目录旁边的目录中获取 bladeRF 源代码
$ cd ..
$ git clone [email protected]:Nuand/bladeRF.git
构建 bladeRF 主机库
$ cd bladeRF/host
$ mkdir build
$ cd build
$ cmake ..
$ make && sudo make install
安装 libomp 和 wget
$ sudo port install libomp
$ sudo port install wget
使用 OpenMP 路径为 _MACOSX 编译并构建 bladeGPS
$ cd ../../../bladeGPS
$ make CFLAGS="-I/opt/local/include/libomp _MACOSX"
基于 Ubuntu 20.04 镜像创建了一个 Dockerfile,可让您在几秒内启动一个 docker 容器。
构建 docker 镜像
$ cd docker
$ docker build -t bladegps .
直接运行 bladegps 命令
$ docker run -it --rm --privileged --device /dev/ttyUSB0 bladegps \
/bin/bash -c "bladegps -e /opt/bladeGPS/brdc3300.18n -l 35.274,137.014,100 -d 86400"
从 docker cli 运行 bladegps 命令
$ docker run -it --rm --privileged --device /dev/ttyUSB0 bladegps /bin/bash
bladegps@cb744220dea3:~$ bladegps -e /opt/bladeGPS/brdc3300.18n -l 35.274,137.014,100 -d 86400
提供了一个 docker-compose.yml 示例,如果您希望将 bladegps 作为服务运行,在达到持续时间后自动重启。在启动使用 docker-compose 的服务之前,请编辑命令和设备名称。
在后台运行 docker-compose 服务
$ cd docker
$ docker-compose up -d
检查 docker-compose 进程状态
$ docker-compose ps
如果需要,连接到正在运行服务的容器
$ docker-compose exec bladegps /bin/bash
完成后关闭服务
$ docker-compose down
Copyright © 2015-2022 Takuji Ebinuma
根据 MIT 许可证 分发。