📜 ⬆️ ⬇️

Data emulator with GNSS receiver using NMEA protocol

Introduction



I have a need to test an application using GNSS data using NMEA protocol. It was connected with the fact that he worked on the project of the aircraft navigation program, it is naturally expensive to test in the air, it’s not particularly convenient to drive a car with a GNSS receiver on the ground, so I wanted to have NMEA data from the allegedly moving equipment on a virtual parallel port. At first I looked for different software, I thought I would find something suitable, but most of them are paid and control of data emulation is not very convenient, although they emulate almost all the parameters of the NMEA standard. But I needed something simple, emulating coordinates, speed, in principle no more than that, and quite convenient and logical control was required. So I had to write an application of this kind in C #.

Fly_nmea



NMEA ("National Marine Electronics Association") - the full name "NMEA 0183" is a text-based communication protocol for marine (usually navigation) equipment between them.
Data is transmitted in the form of sentences. The format of the sentences is as follows:
$ AAAAA [, <data>] * hh , where:
$ - the symbol of the beginning of the sentence (code 24h);
AAAAA - Five-character address (name) of the proposal;
[, <data>] - a list of data fields separated by commas (code 2h);
* - the sign of the checksum (code 2Ah);
hh - checksum.

Example sentences:
GGA - GPS Location Data
Time place and data related to the observation.
$ GPGGA, hhmmss.sss, llll.ll, a, yyyy.yy, a, x, xx, xx, xx, M, xx, M, xx, xxx * hh
')
I needed to emulate four lines:

The emulation is organized in the following order:

Fly_nmea + Android Sensor

For more convenient testing, I also adjusted data reception from Android sensors (angles of inclination). Android over UDP sends two lines of type:

On the emulation application, I accept them and, based on the angles of inclination, I change the parameters:

In the emulation application, you can switch from control through the program interface to the Android Sensor.

Connect Fly_nmea

To emulate COM ports, Virtual Serial Ports Emulator is also useful. You will need to configure the connection of two virtual COM ports, for example: COM1 <-> COM6, and the Fly_nmea program will send data to COM6, and to COM1, the program using the NMEA protocol will take them.

Conclusion


In general, I spent more time searching for such software, and not finding what would have completely satisfied me would have written it myself faster. In addition to the project I was working on, it was also possible to quite successfully connect the emulator to programs that understand the NMEA protocol such as: 2Gis and SAS planet.




FlyNMEA and android sensor (project to transfer data from sensors via UDP) here
VSPE to emulate ports here

upd: 5 Hz emulated data frequency

Source: https://habr.com/ru/post/129316/


All Articles