Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPS-SDR-SIM #169

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f7fbba8
tcp
gym487 Apr 22, 2017
3f1a1f0
support tcp for realtime
gym487 Apr 22, 2017
a44168a
Delete socket.c~
gym487 Apr 22, 2017
06ccc1e
Delete gpssim.c~
gym487 Apr 22, 2017
a476e0a
Delete gpssim.h~
gym487 Apr 22, 2017
7cd1c94
descreption
gym487 Apr 22, 2017
44a428f
port
gym487 Apr 22, 2017
309f14e
Update README.md
gym487 Apr 22, 2017
f2c74ff
Merge branch 'master' of https://github.com/gym487/gps-sdr-sim
gym487 Apr 22, 2017
789e2e4
demo
gym487 Apr 22, 2017
58048e9
readme
gym487 Apr 22, 2017
a66b200
fix
gym487 Apr 22, 2017
6b27d22
hackrf
gym487 Apr 22, 2017
330d178
-v no:
gym487 Apr 23, 2017
86a5678
typo
gym487 Apr 23, 2017
8e1a045
del useless files
gym487 Apr 24, 2017
de301fa
map
gym487 Apr 30, 2017
05b364f
remove test
gym487 Apr 30, 2017
7f94850
readme
gym487 Apr 30, 2017
c21bdac
readme
gym487 Apr 30, 2017
1fcd35f
Update gpssim.c
gym487 Apr 9, 2019
45883e2
Use google map instead to avoid false position.
May 9, 2019
33aa99c
Fix false description.
May 9, 2019
5661672
fix
gym487 Jun 25, 2019
54e14ad
fix README
gym487 Jun 25, 2019
c808588
run!
gym487 Nov 13, 2020
4673325
Merge branch 'master' of https://github.com/gym487/gps-sdr-sim-realtime
gym487 Nov 13, 2020
5e08d67
upgrade to python3
Dec 12, 2020
4b10bc9
change to tornado
Dec 12, 2020
ff45f46
found why tornado doesn't work
Dec 12, 2020
4ce4d0a
change back to web.py since it is much more faster
Dec 12, 2020
986ebf0
Merge pull request #6 from chuangzhu/master
gym487 Dec 13, 2020
a12c467
merge
Jan 12, 2022
1820908
merge
Jan 12, 2022
f74ca8b
update readme
Jan 12, 2022
5118df5
Merge branch 'osqzss:master' into master
gym487 Jan 27, 2022
19fcb91
merge
gym487 Apr 15, 2022
a70a509
Merge branch 'YukariChiba-master'
gym487 Apr 15, 2022
a6809b8
Use variable UDP port for map.
gym487 Apr 16, 2022
089f15e
Update args
gym487 Apr 16, 2022
2475e3f
remove build instruction for windows
gym487 Apr 23, 2022
482d511
Fixed the bug that occurs when the location changes rapidly by disabl…
gym487 Jul 12, 2022
759dd3b
Merge branch 'osqzss:master' into master
gym487 Jul 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,155 @@ gps-sdr-sim-lut
# Temporary files
*.swp

*~
<<<<<<< HEAD
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/


# Netbeans project folder
nbproject/*

# Last used USER_MOTION_SIZE variable
.user-motion-size
=======

# Python bytecodes
*.pyc
>>>>>>> 33aa99cdff44ab8f8ced315ff0b7ea047ef92403
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ all: gps-sdr-sim

SHELL=/bin/bash
CC=gcc
LDFLAGS=-lm -lpthread
CFLAGS=-O3 -Wall -D_FILE_OFFSET_BITS=64
ifdef USER_MOTION_SIZE
CFLAGS+=-DUSER_MOTION_SIZE=$(USER_MOTION_SIZE)
endif
LDFLAGS=-lm


gps-sdr-sim: gpssim.o
${CC} $< ${LDFLAGS} -o $@
Expand Down
51 changes: 42 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,47 @@
# GPS-SDR-SIM
# GPS-SDR-SIM realtime

GPS-SDR-SIM generates GPS baseband signal data streams, which can be converted
to RF using software-defined radio (SDR) platforms, such as
[ADALM-Pluto](https://wiki.analog.com/university/tools/pluto), [bladeRF](http://nuand.com/), [HackRF](https://github.com/mossmann/hackrf/wiki), and [USRP](http://www.ettus.com/).

### Windows build instructions

1. Start Visual Studio.
2. Create an empty project for a console application.
3. On the Solution Explorer at right, add "gpssim.c" and "getopt.c" to the Souce Files folder.
4. Select "Release" in Solution Configurations drop-down list.
5. Build the solution.
### Building with make

### Building with GCC
```
$ make
```


### Realtime by Gnuradio

Use -n option can connect to a TCP source in Gnuradio for realtime simulation.

The tcp source should be set in "Server" mode.

See tcp.grc as an example.

### Map

Run gps-sdr-sim with -w option, and

cd into /mapserver, and run

```
$ gcc gpssim.c -lm -O3 -o gps-sdr-sim
python mapper.py
```

Then visit http://127.0.0.1:8080/static/baidumap.html to use the Online map.

Or visit http://127.0.0.1:8080/static/googlemap.html to use the google Online map.

You can also write an map which can POST data to http://127.0.0.1:8080/post like this

```
lon=116&lat=39&hgt=10
```



### Using bigger user motion files

In order to use user motion files with more than 30000 samples (at 10Hz), the `USER_MOTION_SIZE`
Expand All @@ -34,6 +58,7 @@ This variable can also be set when compiling directly with GCC:
$ gcc gpssim.c -lm -O3 -o gps-sdr-sim -DUSER_MOTION_SIZE=4000
```


### Generating the GPS signal file

A user-defined trajectory can be specified in either a CSV file, which contains
Expand Down Expand Up @@ -86,6 +111,8 @@ Options:
-b <iq_bits> I/Q data format [1/8/16] (default: 16)
-i Disable ionospheric delay for spacecraft scenario
-v Show details about simulated channels
-n <port> Use TCP connection to Gnuradio TCP-Source for realtime simulation.
-w <port> Connect with map server(/mapserver/mapper.py) by UDP (default port 5678).
```

The user motion can be specified in either dynamic or static mode:
Expand All @@ -102,6 +129,12 @@ The user motion can be specified in either dynamic or static mode:
> gps-sdr-sim -e brdc3540.14n -l 30.286502,120.032669,100
```

Use Gnuradio to realtime simulate 3000s:

```
> gps-sdr-sim -e brdc3540.14n -l 30.286502,120.032669,100 -n 1234 -d 3000
```

### Transmitting the samples

The TX port of a particular SDR platform is connected to the GPS receiver
Expand Down
Loading