News:

Precision Simulator update 10.180 (14 October 2024) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

AdaptPSX, NMEA, and Google Earth

Started by martin, Sun, 15 Mar 2015 16:49

martin

Greetings!

So as not to be entirely thrown off track by emu- and alligators, I decided to have a look at the capability of Google Earth (the stand-alone desktop application, not the browser plug-in!) to read and display NMEA sentences coming from AdaptPSX (pretending to be a GPS device).
[size=8](What with the hardware obsession of the HC builders, this aspect does not seem to have received much attention so far.)[/size]   :D

Leaving aside for now the networking aspects (fake serial ports etc.; to be discussed later), here is what I found:

¤ I could get (without any problem!) AdaptPSX (Beta 2.7, running under WinXP) to send a stream of NMEA data.

¤ But none of the applications I tried were able to digest and interpret these properly.

Disclaimer: This is not much of a surprise (and very probably not the fault of AdaptPSX  ;) ), as
a) "NMEA" comprises a rather wild bunch of different formats,
b) my applications are all rather ancient:
___¤    Google Earth 6.0.3.2197
_____(I tried direct import of GPS data; see below for result);
___¤ EarthBridge
_____(reformats the NMEA data into a *.kml file to be read by GE,
_____but produced only 00N 000E coordinates in the KML file)
___¤ OziExplorer v.3.95.3c,
_____a GPS mapping software which can also read a GPS device directly,
_____as moving map, but was unable to interpret the data coming from AdaptPSX.
   
I then used a serial port monitor to intercept the data in order to have a closer direct look.
Here is an example line as sent by AdaptPSX:   
$GPGGA,155113,494407.356,N,021511.078,E,1,08,0.0,11375,M,0,M,,*4A$GPRMC,155113,A,494407.356,N,021511.078,E,496,040.62,150315,-8.0,,*2D
(apologies for the slider, but it may be relevant that everything is on one line)

Next, I collected a bunch of those lines in a file, and tried to import that into GE (to exclude all possible issues related to networking).
But again GE refused to load these data.

Then I split those lines so that each one starts either with $GPGGA or with $GPRMC (thus with only one sentence per line); e.g. (from the line above):
$GPGGA,155113,494407.356,N,021511.078,E,1,08,0.0,11375,M,0,M,,*4A
$GPRMC,155113,A,494407.356,N,021511.078,E,496,040.62,150315,-8.0,,*2D

This one GE did load.
(But it displayed the plane track in Antarctica when it was actually in Northern France; I was using the "Basic 016 - 60 nm to TOD" situ. However, that is probably "merely"a numerical or parsing error, left for another day.)

Questions:
¤ Is it possible that AdaptPSX incorrectly merges two NMEA sentences on one line (it looks suspiciously like yet another Mac/Linux vs Windows thing), or is that irrelevant?

¤ Has anyone used AdaptPSX NMEA output successfully with any other GPS-data-consuming application (perhaps not quite so ancient as mine)?

Cheers,
$MAR
$TIN

Pierre Theillere

Hi Martin,

Maybe you could try AdaptPSX v2.6, that's latest "official" released version? I didn't know that version 2.7 existed... maybe it's hidden somewhere?
Pierre, LFPG

martin

Hello Pierre,

some small discrepancy here:

The file I downloaded (straight from Garry's site, unhidden) is indeed called adaptpsx.b2.6.zip, but what I quoted above came from the "About" tab in AdaptPSX itself, and that says "Beta 2.7".

So I am probably using the same version you refer to.

Cheers,
Martin

Dirk Schepmann

Hi Martin,

I can confirm what you described, I also tried to link the NMEA output of Adapt PSX (version 2.6 or version 2.7 - the latest beta version) to a moving map application but also without success. I tied the output to a virtual com port because many GPS tools support this.

I used several different programs but none of them displayed (or interpretated) the coordinates of PSX correctly. I then used a terminal viewer to analyze the data sent to my virtual com port and it also displayed the strings you mentioned.

At least one of the freeware GPS tools read either the latitude or longitude correctly (I can't remember what it was - I'm on holidays in GCRR right now  8) ) - but not the combination of both.

It seems that there is a small issue with the NMEA output - I wanted to have a deeper look at the strings after my holidays to see where the problem is.

It would be awesome to have a compatible NMEA output because that's the only reason why I run FSX in the background (totally stripped down, i.e. no AI, autogen very sparse, scenery complexity very low, simple clouds etc. - no problems with the frame rate in PSX running on the same computer).

best regards,
Dirk

martin

#4
Thanks, Dirk, that is helpful information.

I have tried to find out how the coordinates may be garbled, but so far, no luck. It seems to be nothing simple (such as 180° added or subtracted from each value, or swapping the sequence of latitude / longitude).

And I may first have to refresh my memory about the intricacies of the NMEA record ("sentence") format.

If I find anything of interest, I'll report back.
Enjoy your vacation!  8)

Cheers,
Martin

cavaricooper

Martin:

Please know your efforts are appreciated, and your reports being eagerly followed....

C
Carl Avari-Cooper, KTPA

Will

Agreed, I'm eagerly following as well!
Will /Chicago /USA

Markus Vitzethum

Hi Martin, Dirk, ... and all

back in PS1 days I programmed a light weight GPS output program which read position data from PS1 (via the broker) and wrote NMEA data to a COM port.

Since I also have just finished another add-on program which connects to PSX and uses a current up-to-date compiler (Lazarus, using Free Pascal), I could probably merge both programs with not too much (*) effort to create a light weight GPS output program for PSX. I still have working program code (**) to create working NMEA sentences.

Would that help?

Markus

(*) I don't really believe myself in "not too much" effort.  :mrgreen:  But the source code is all there. It just needs merging and a little debugging.

(**) Working back then...  :P

Pierre Theillere

Hi Markus!

Aaaah, of course, I remember your small program for PS1: I have been using it quite a lot, feeding a Jeppesen program to get real-time aircraft position on enroute charts, it was great!
I no longer use that program (charts waaaayyy outdated, and needed an expensive monthly subscription), but sure getting NMEA output could help, maybe with real GPS units?
Pierre, LFPG

martin

#9
Moi,

after finding and employing two more nifty tools (a GPS simulator and an NMEA analyzer), it looks now as if the coordinates in the AdaptPSX output are all too large by a factor of 100.
[size=8](For many variables, PSX sends values multiplied by a 10^x constant; and the data consumer has then to divide accordingly, to get back to the proper units.)[/size]

E.g. this (sent from AdaptPSX, and with lines already split manually, see above) will not work in Google Earth or the other NMEA consumers I have:
$GPGGA,132931,600000.112,N,240000.442,E,1,08,0.0,11374,M,0,M,,*41
$GPRMC,132931,A,600000.112,N,240000.442,E,22433,090.00,160414,-7.0,,*2B

but this will (coordinates edited manually):
$GPGGA,132931,6000.112,N,2400.442,E,1,08,0.0,11374,M,0,M,,*41
$GPRMC,132931,A,6000.112,N,2400.442,E,22433,090.00,160414,-7.0,,*2B

This also agrees with the NMEA record definition where latitude should be DDMM.MMM...  and longitude DDDMM.MM... (with D being the digits of the integer degree, and M those of the decimal minute).

As before, I can test this only with the NMEA output captured in a file.
Obviously, to fix the "live" data stream, a patch of the AdaptPSX source code will be needed, for which we'll require John's help.

There may be other issues, too, but I think those should be tackled only after the present one has been solved.

Cheers,
Martin00

Hardy Heinlin

Moin.

Quote from: martin[size=8](For many variables, PSX sends values multiplied by a 10^x constant; and the data consumer has then to divide accordingly, to get back to the proper units.)[/size]
When this muliplication is applied, it is applied to integers only; to get more precision in a compact format without "endless" floating points.

The lat/lon output of the aircraft position, however, comes in 64 bit floats, hence without multiplication. The 64 bit floats are necessary to keep PSX instances in sync down to the millimeter.


Cheers,

|-|ardy

cavaricooper

#11
AdaptPSX serves an important need and from my understanding does it brilliantly.

For the rest of us on a quest to run PSX alone there is a need for a client that does 2 things. DIRECTLY (without Comm port HW) outputs PSX position to Google Earth (Pro) and allows for VATSIM connectivity.  It is my ardent hope that this can be accomplished. Seeing the talent/knowledge level of those on this Fora, I remain optimistic!

Best- Carl
Carl Avari-Cooper, KTPA

martin

Quote from: cavaricooperDIRECTLY (without Comm port HW) outputs PSX position to Google Earth (Pro)
This can indeed be accomplished (even with the non-Pro GE), as I have now tested. No extra hardware required; you only have to install a kind of "virtual serial port", but it's not difficult. (I'll post links and instructions later).

At the moment, the only obstacle is that there seems to be a minor glitch in how AdaptPSX formats the NMEA records ("sentences"); so GE and other GPS applications don't quite understand them. It should be easy to fix, though [size=8](said the man who didn't have to do it... :D)[/size].
Other NMEA data may still present other issues, but that remains to be seen.

Cheers,
Martin

cavaricooper

Martin-

We wait with fingers x'ed :)

Jeroen-

Should your workload permit, a simple networkable PSX VATSIM client would be greatly appreciated!

Best- C
Carl Avari-Cooper, KTPA