Code Monkey home page Code Monkey logo

bladegps's Introduction

bladeGPS

Very crude experimental implementation of gps-sdr-sim for real-time signal generation. The code works with bladeRF and has been tested on Windows 10 and 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

Build on Windows with Visual Studio

Follow the instructions at Nuand wiki page and build the bladeRF library from the source with Visual Studio 2013 Express for Windows Desktop. Assume you already downloaded pthread and libusb files and successfully built the bladeRF library for your Windows environment.

  1. Start Visual Studio
  2. Create an empty project for a console application
  3. On the Solution Explorer at right, add the following files to the project:
    • bladegps.c and bladegps.h
    • gpssim.c and gpssim.h
    • getopt.c and getopt.h
  4. Add the paths to the following folders in Configuration Properties -> C/C++ -> General -> Additional Include Directories:
    • pthreads-w32-2-9-1-release/Pre-built.2/include for pthread.h
    • bladeRF/include for libbladeRF.h
  5. Add the paths to the following folders in Configuration Properties -> Linker -> General -> Additional Library Directories:
    • pthreads-w32-2-9-1-release/Pre-built.2/lib/x64 for pthreadVC2.lib
    • bladeRF/x64 for bladeRF.lib
  6. Specify the name of the additional libraries in Configuration Properties -> Linker -> Input -> Additional Dependencies:
    • pthreadVC2.lib
    • bladeRF.lib
  7. Select Release in the Solution Configurations drop-down list
  8. Select X64 in the Sofution Platforms drop-down list
  9. Run Build -> Build Solution

After a successful build, you can find the executable in the Release folder. You should put the copies of the following DLLs in the same folder to run the code:

  • bladeRF.dll
  • libusb-1.0.dll
  • pthreadVC2.dll

Build on Linux (Ubuntu 20.04)

  1. Retrieve the bladeRF source in a directory next to the current directory

     $ cd ..
     $ git clone [email protected]:Nuand/bladeRF.git
    
  2. Build the bladeRF host library

     $ cd bladeRF/host
     $ mkdir build
     $ cd build
     $ cmake ..
     $ make
    
  3. Build bladeGPS

     $ cd ../../../bladeGPS
     $ make
    

Build on Mac OS X (Catalina)

  1. Install Xcode

  2. Install Xcode Command Line Tools

     $ xcode-select --install
    
  3. Install MacPorts

  4. Create a symlink to port

     $ sudo ln -s /opt/local/bin/port /usr/local/bin/port
    
  5. Install bladeRF

     $ sudo port install bladeRF +tecla
    
  6. Install cmake

     $ sudo port install cmake
    
  7. Retrieve the bladeRF source in a directory next to the current directory

     $ cd ..
     $ git clone [email protected]:Nuand/bladeRF.git
    
  8. Build the bladeRF host library

     $ cd bladeRF/host
     $ mkdir build
     $ cd build
     $ cmake ..
     $ make && sudo make install
    
  9. Install libomp and wget

     $ sudo port install libomp
     $ sudo port install wget
    
  10. Compile for _MACOSX with OpenMP path and build bladeGPS

    $ cd ../../../bladeGPS
    $ make CFLAGS=”-I/opt/local/include/libomp _MACOSX”
    

Docker

A Dockerfile was created from Ubuntu 20.04 image that allows you to spin up a docker container in seconds.

  1. Build docker image

     $ cd docker
     $ docker build -t bladegps .
    
  2. Run bladegps command directly

     $ 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"
    
  3. Run bladegps command from docker cli

     $ 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

A docker-compose.yml example is provided, if you want to run bladegps as a service, restarting when it hits end of duration. Edit command and the device name before starting up service using docker-compose.

  1. Run docker-compose service in background

     $ cd docker
     $ docker-compose up -d
    
  2. Check docker-compose process status

     $ docker-compose ps
    
  3. Connect to container running service, if desired

     $ docker-compose exec bladegps /bin/bash
    
  4. Down the service when done

     $ docker-compose down
    

License

Copyright © 2015-2022 Takuji Ebinuma
Distributed under the MIT License.

bladegps's People

Contributors

ameliameles avatar chackn avatar dhoer avatar ggkangwon avatar greypowersweater avatar hongkongkiwi avatar osqzss avatar piranha32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bladegps's Issues

gpssim.c uses conio.h which isn't available on linux so can't compile

gpssim.c uses conio.h, which from my googling is Windows only. When you run make on linux you get the following error:

user@ubuntu:~/bladeGPS$ make
gcc -O3 -Wall -I../bladeRF/host/libraries/libbladeRF/include   -c -o gpssim.o gpssim.c
gpssim.c:19:19: fatal error: conio.h: No such file or directory
compilation terminated.
<builtin>: recipe for target 'gpssim.o' failed
make: *** [gpssim.o] Error 1

Could I use it as GPS transmitter that keep changing values?

I have a project I am working on I generate positions on Microcontroller and need to convert these digital data into RF data as the transmitted from GPS because my other device only gets GPS data in form of RF as it contains internal GPS receiver. So I want to know is it possible using your library to generate GPS that is changeable in real time using bladeRF?
Thanks in advance.

Pause dynamic path

I have tried the interactive mode and that works well. Seems to loop the same location unless you move using the keyboard. If I were to use a dynamic mode file, would it be simple to add a pause function that would loop cause the application to pause the file and loop my current location?

I'm still learning about the bladerf, so I apologize for the potential newbie question. :-)

somthing wrong with bladeRF 2.0 micro xA4 TX

Thanks for your gpr-sdr-sim!
bladeRF 2.0 micro xA4 ,when using gps-sdr-sim to generate data (https://github.com/osqzss/gps-sdr-sim ,or https://github.com/osqzss/bladeGPS),send data by bladeRF-cli or bladeGPS, the parameter of bladeRF -cli is :
set frequency tx 1575.42M
set frequency rx 1573.42M
set samplerate 2.6M
set bandwidth 2.5M
set txvga1 -25
cal lms
cal dc tx
tx config file=gpssim.bin format=bin
tx start
tx wait

when the bladeRF -cli starting, Program display:" Error (bladerf.script:4): Invalid operation or parameter".May I ask what is the cause?

Changing the date in the BRDC file

Hi,

I am working with v0.1 of bladeGPS rather than v0.2 because of #13.

I have edited the brdc (it was originally from 2016-05-31) to have today's date in it (2016-07-26). I am running with the following command line:

./bladegps -e dave.16n -l 30.286502,120.032669,100 -t 2016/07/26,01:00:00

I would expect the GPS date to be 2016-07-26.

But instead I am receiving 2016-05-31 as the date when viewed in cgps (part of the GPSd library). Though the time aspect matches the command line.

Please see the following screenshot:

  • On the left is the brdc file.
  • Top right is the bladegps script running.
  • The bottom right is the output of cgps

bladegps-date-wrong-time-correct

BladeRF A5 Periodically Stops Broadcasting

Hi,

I have a bladeRF A5 that can TX a GPS location that my GPS receiver can lock on to, but the issue is that the signal will periodically turn off for a few minutes, then turn back on. This does not happen on a bladeRF A4.

Ubuntu 20.04
Latest A5 firmware

Failed to set TX frequency

Hello

I'm trying to use this simulator in real time with bladeRF but I'm having some problems ..
I've done the "Building libbladeRF for Windows" step by step and I managed to do so.
Now I've done the "Build on Windows with Visual Studio" of the bladeGPS simulator step by step and I also managed to do it, but now I run the executable and I get the error "Failed to set TX frequency: Invalid operation or parameter".
Can you explain what the problem might be?

VCTCXO taming

I was reading this issue Nuand/bladeRF#414 and I was wondering if bladeGPS is able to use a 1PPS or 10MHz inputs (1.8V) via J71-1 for better accuracy. If so, had you been using a device to do this? I am new to this world, so maybe this isn't even applicable here.

User Motion file option not working

I used a user motion file to try and move the location. The first location in the user motion file is the only one that is used and it doesn't move around to the other locations in the file.

Antenna

I have a crude antenna built, but I believe the signal is pretty messy. Any suggestions on a proper antenna to buy?

undefined bladerf_channel

HI, All
I was trying to run bladegps on a Bladerf micro xA4. But bladegps.c complains about bladerf_channel is undefined.

The code line is: bladerf_channel tx_channel = BLADERF_CHANNEL_TX(0);

Any help would be appreciated.

Why max duration of 86400?

Hi @osqzss - thanks so much for building this! With a few small tweaks it seems to work great on Ubuntu 16.04.

A quick question for you: Is there a particular reason for the 86400 second (24 hour) limit? Would there be any problems with running this without a time limit?

Make: nothing to be done for 'all'

Dear,
Thank you for sharing your code. Could you help me? When I run 'make' of this source code on Ubuntu 20.04, 'Make: nothing to be done for 'all' is shown. I tried many times but I can run on Ubuntu. Please help me! Thanks so much!

Support for HackRF?

Are there any plans to support hackrf devices?

I've been using Mictronics multi-sdr-sim(https://github.com/Mictronics/multi-sdr-gps-sim) but his version does not work with all GPS receivers. Some receivers have a very difficult time getting a fix and the fix is very unstable, while with your version they have a good fix within a minute.

Almanac Week Rollover

Hi,

I was trying to use the almanac option to hopefully get better simulation results for future dates, in the limits of the almanac of course, but I received an error with the almanac file from here and the rinex from here. When reading through the internet I found out that this may be related to the week rollover that happened last weekend.
The error I get is:
ERROR: Invalid time of almanac.
1028
2052
Abort.
(Where the two numbers are something I added in to find out what time it reads - first number: time of the almanac (gps week number); second number: time of ephemeris file (gps week number))

Would this issue be solved by adding another 1024 to the coefficient in gpssim.c line 1041 ? Or would it be worth putting this into a constant for easier finding?

Thanks

Max

Could some additional instructions be provided?

Hi!
I was able to build the gps-sdr-sim using Visual Studio, but I'm struggling to get this to build. I must be missing a small step. Any additional instructions would be very much appreciated, thanks!

Rinex file reload

I assume that the rinex file is loaded only once when the command starts the application. If I were updating the rinex file with a newer file version, but kept the same name while the application is running, triggering a reload of the file, could that be a simpler way to generate closer to real-time date/time information?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.