Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Talking NMEA to a GPS

Options
  • 12-10-2011 5:02pm
    #1
    Registered Users Posts: 2,501 ✭✭✭


    I'm messing around with an old GPS receiver that I have. So far I've determined that it speaks NMEA and I have managed to get an application (forgot the name at the moment) to talk to it and pull down location data using the NMEA protocol.

    Next move is to write a small script of my own making to talk to it, as further practice with a view to building a more detailed app which has a 'get location' button along with a form for me to input details about the location. Does anyone know any sites out there that might have suitable scripts (perl, python, etc . . .) that I can use as a basis for hacking around with ?

    From what I've see from NMEA (early days yet) the command structure is pretty straight forward, so I just need to open a connection to the device, send it the relevant $GP command and read in the response. However, as above, it's still early days so some pointers would be appreciated.

    Thanks,

    z


Comments

  • Registered Users Posts: 21,467 ✭✭✭✭Alun


    I don't know anything about any suitable libraries / scripts, but I'd like to point out that you don't need to send any commands to get a position fix via NMEA. The device will just be continually sending out a whole bunch of NMEA sentences giving positional and satellite status info all the time, usually at 1 second intervals, and it's up to the app to read these and sift out the information it needs. You can see what's being sent just using a simple terminal emulator set (usually) to 4800 baud. I have a copy of the NMEA 0183 specs as a text file if you're interested?


  • Registered Users Posts: 2,501 ✭✭✭zagmund


    Thanks Alun, as you point out the device just sends stuff and you don't need to send commands to it. It wasn't clear to me before from the stuff I had read on NMEA, and I was getting a little confused alright as to why they would show only one way content (the device talking to whatever would listen to it). It makes sense now.

    I got output from it last night - $GPGSV (satellites in view), $GPGLL (location in lat & long) & $GPGGA (location, plus time, plus others) by hooking it up to gpscat I think.

    This is enough for me to work with for the moment. I can just parse the $GPGLL results that come back for my positioning.

    As a matter of interest, how do you go about sending commands to the device (for example to set waypoints) ? Is this something that is done with a protocol other than NMEA?

    z


  • Registered Users Posts: 21,467 ✭✭✭✭Alun


    zagmund wrote: »
    As a matter of interest, how do you go about sending commands to the device (for example to set waypoints) ? Is this something that is done with a protocol other than NMEA?
    The only NMEA commands I've come across have been proprietary ones (beginning with $P as per NMEA spec, see here for some examples) to set various device parameters and I don't recall ever seeing any to set waypoints.

    If by any chance it's a Garmin device, then you'll need to get info on Garmin's proprietary PVT protocol to do stuff like that. I seem to remember there's a document lurking somewhere on their site that describes it.

    Otherwise you'll have to scour the web looking for documentation for your device.


  • Registered Users Posts: 2,099 ✭✭✭morana




Advertisement