Giter Site home page Giter Site logo

voiapp / nmea-gps-emulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luk-kop/nmea-gps-emulator

0.0 0.0 0.0 87 KB

The NMEA-GPS Emulator is a simple script that emulates a GPS receiver (simulates unit's movement). Data generated by the script are sent to clients in NMEA 0183 format.

License: MIT License

Python 100.00%

nmea-gps-emulator's Introduction

NMEA-GPS Emulator

Python 3.8.5 MIT license

The NMEA-GPS Emulator is a simple script that emulates a GPS receiver (simulates unit's movement). Data generated by the script are sent to clients in NMEA 0183 format. This script can be useful for testing applications or systems that require some unit's GPS position data.

The NMEA-GPS Emulator script can be used in one of the following operating modes:

  • NMEA TCP Stream (sends TCP packets to the specified client),
  • NMEA UDP Stream (sends UDP packets to the specified client),
  • NMEA TCP Server (the server waits for client connections, then sends TCP packets to the connected clients - max 10 connections)
  • NMEA Serial (transmit serial data on specified RS port).

Features

  • The script allows the user to enter the following data:
    • unit's position;
    • unit's speed;
    • unit's course;
    • operating mode selection (NMEA Serial, NMEA TCP Server, NMEA TCP or UDP Stream);
    • IP address & port pair or serial port name.
  • After the NMEA data transmission has started, the script allows the user to interactively change the speed and course of the unit.
  • Generated NMEA sentences are resent to the selected clients periodically (every second). Each time a data with NMEA sentences is sent, the position of the unit is updated based on its speed and course.

List of NMEA sentences generated by NMEA-GPS Emulator script:

GPGGA - Global Positioning System Fix Data
GPGLL - Position data: position fix, time of position fix, and status
GPRMC - Recommended minimum specific GPS/Transit data
GPGSA - GPS DOP and active satellites
GPGSV - GPS Satellites in view
GPHDT - True Heading
GPVTG - Track made good and ground speed
GPZDA - Date & Time

Output example:

$GPGGA,173124.00,5430.000,N,01921.029,E,1,09,0.92,15.2,M,32.5,M,,*6C
$GPGSA,A,3,22,11,27,01,03,02,10,21,19,,,,1.56,0.92,1.25*02
$GPGSV,4,1,15,26,25,138,53,16,25,091,67,01,51,238,77,02,45,085,41*79
$GPGSV,4,2,15,03,38,312,01,30,68,187,37,11,22,049,44,09,67,076,71*77
$GPGSV,4,3,15,10,14,177,12,19,86,235,37,21,84,343,95,22,77,040,66*79
$GPGSV,4,4,15,08,50,177,60,06,81,336,46,27,63,209,83*4C
$GPGLL,5430.000,N,01921.029,E,173124.000,A,A*59
$GPRMC,173124.000,A,5430.000,N,01921.029,E,10.500,90.0,051121,,,A*65
$GPHDT,90.0,T*0C
$GPVTG,90.0,T,,M,10.5,N,19.4,K*51
$GPZDA,173124.000,05,11,2021,0,0*50

Getting Started

Below instructions will get you a copy of the project up and running on your local machine.

Requirements

Python third party packages:

In order to use NMEA Serial mode correctly, it is necessary to use dedicated serial null modem cable.

On Linux systems you will probably need to change the permissions for the device matching your serial port before running the script.

# Example command for /dev/ttyUSB0 device
sudo chmod a+rw /dev/ttyUSB0

Installation with venv

The script can be build and run locally with virtualenv tool. Run following commands in order to create virtual environment and install the required packages.

$ virtualenv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt

Running the script

You can start the script using the following command:

(venv) $ python main.py

After starting the script correctly, the following prompt should appear in the OS console:

..####...#####....####...........######..##...##..##..##..##.......####...######...####...#####..
.##......##..##..##..............##......###.###..##..##..##......##..##....##....##..##..##..##.
.##.###..#####....####...........####....##.#.##..##..##..##......######....##....##..##..#####..
.##..##..##..........##..........##......##...##..##..##..##......##..##....##....##..##..##..##.
..####...##.......####...........######..##...##...####...######..##..##....##.....####...##..##.
.................................................................................................
        
### Choose emulator option: ###
1 - NMEA Serial
2 - NMEA TCP Server
3 - NMEA TCP or UDP Stream
4 - Quit
>>>

nmea-gps-emulator's People

Contributors

luk-kop avatar ludvigsyren avatar smauland avatar

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.