Beaglebone Black GPS LESSON 2: Sending Commands to the Adafruit GPS Module

Adafruit GPS
Adafruit Ultimate GPS Connected to the Beaglebone Blak

In lesson 1 we showed you how to connect the Adafruit Ultimate GPS breakout board to the Beaglebone Black and how to read the NMEA sentences streaming off the GPS over the UART pins. In this lesson we will show you how to send commands to the GPS to better tailor its operation for our needs. There are a number of commands that can be sent to it. Some of the things we we can control are the baud rate it communicates at, and the rate that it takes and sends data. We can also influence which NMEA sentences it sends.  In this video we will go over the different commands we can use.

To review, you should connect the GPS as follows:

Beaglebone GPS
Adafruit Ultimate GPS connected to the Beaglebone Black Rev C Microcontroller

The video explains the code step-by-step, but here it is for your reference.

This code sets the GPS to communicate at baud rate of 57600, and set it to read and report 5 readings a second. It then sets the GPS to only report the $GPRMC and the $GPGGA sentences. It then constantly reads and reports the NMEA sentences.

4 thoughts on “Beaglebone Black GPS LESSON 2: Sending Commands to the Adafruit GPS Module”

  1. You could use Ctrl + Shift + C to copy the text and
    Ctrl + Shift + V to paste the text.

    Sorry to say that it is not a technical comment but it might be useful in your further tutorials.

    Its good to go with your tutorial
    A nice communication skill to teach.
    Keep it up !!

  2. Nice tutorial. I really enjoyed it as it is an elegant solution to the problem.

    Something nice I would have liked to see is a few comments on parsing the data and extracting some useful information from the GPRMC string.

    For those in similar need, I followed these posts in understanding what each part of the GPRMC means:

    1) how the string is divided: http://aprs.gids.nl/nmea/#rmc

    2) how to compute lat and long values from the string http://stackoverflow.com/questions/12263599/nmea-gps-sentence-to-a-map-location

    Thanks for you contribution to the community, you certainly helped many of us.

  3. Hey, I’m following along with these videos and my Adafruit GPS wont get a fix(different issue). However, you seem to be able to read NEMA sentences even without a fix. When I run my code, (identical to yours), it gets stuck at “while ser.inWaiting==0” or sometimes at “NEMA1 = ser.readline”
    Any idea how to fix this would be greatly appreciated

    -John

    1. Three possibilities . . . the code is not identical to mine, you have hooked the GPS up wrong , or your GPS is bad. Make sure you have the GPS wired up correctly. This is a very simple foolproof component. Check the GPS by just connecting power and connect TX to an arduino RX and RX to an arduino TX and then you should just be able to see data streaming in by looking at arduino serial monitor. That would show the GPS is working. What you indicate would make me guess you do not have things wired correctly. Once data is connected to the GPS it starts spitting out NMEA sentences.

Comments are closed.