BeagleBone Black: UART + GPS

Setting up a GPSd client on the BeagleBone was very similar to setting one up on the Raspberry Pi. The difference in this setup is that the GPS data will be read using the UART capabilities of the BeagleBone. Not only does this free up the USB port on the BeagleBone, but allows us to use a stronger 66 channel GPS (not the one with a built in USB cable).

We used Adafruit's 66 Channel Ultimate GPS along with the powerful BeagleBone Black embedded linux device. The GPS we used is pictured below:

Similar to this post, we will be using GPSd on the BeagleBone. Downloading and installing GPSd is easy:

UART on the BeagleBone Black can be configured in a number of different ways. The BeagleBone uses devices tree overlays to configure its I/O pin capabilities. Before continuing, read this summary on device tree overlays. There are a total of 5 UARTs available on the BeagleBone. Each of these communication options vary and include single or bidirectional control. This table was helpful in finding the correct pins when configuring UART with the pre-installed device tree overlays.

Check in /dev to see the UART devices available (there should only be one -- it's connected to the USB port):

Check the /lib/firmware directory for the .dtbo files (if you don't have these files continue reading...):

If these .dtbo files are not included in you Bone kernel, update your image (Saucy 13.1 works well) or download and install the Adafruit_BBIO Library. For more information on how to update your image or software read this post. If the UART overlays are available, continue reading.

Attach the UART you want by using the Cape Manager on the BeagleBone. What this does is imitate a cape (similar to an Arduino "shield") on the BeagleBone and gives you direct access to the pins you would like to use. This can be everything from PWM to UART to GPIO. To do this, echo the UART you would like to use to slots which is located in /sys/devices/bone_cape.#/ (the # depends on the Bone kernel you have). You must be root to do this (sudo su).

Now you should see /dev/ttyO4 as a new device:

Now plug in your GPS module (UART 4 pins):


...and read the incoming NMEA data:

To connect the UART device /dev/ttyO4 with gpsd use this command:

To read the GPS using Python, you can download our repository for the BeagleBone Black. For the latest code clone BBB.git:

And then run the Python script in the gps folder:

To check if the GPS is receiving data use the cgps -s command. You should see something similar to the image below:

Again, this capability will be used on the float. To attach our GPS module we will be creating custom PCB Capes...stay tuned to see how the boards turn out!

1 comment: