[Note: As of October, 2013, Sparkfun no longer carries thie D2523T, but a Google search will locate other sources.]
I'm using this interface cable to connect the D2523T GPS module to this GPS breakout on a breadboard.
Connections
Pin 3 (3V3) P9 3
Pin 4 (GND) P9 1
Pin 5 (TX) P9 26
Pin 6 (RX) P9 24
See this post for the configuration needed to use the Beaglebone Black's pins for serial (UART) communication.
Python Code
The following code pulls the latitude and longitude from the $GPRMC sentence.
import serial
import time
import datetime
import re
import os
os.system("echo uart1 > /sys/devices/bone_capemgr.9/slots")
os.system("echo uart1 > /sys/devices/bone_capemgr.9/slots")
serial = serial.Serial("/dev/ttyO1", baudrate=9600)
resp = ""
while True:
while (serial.inWaiting() > 0):
resp += serial.read()
if "\r\n" in resp:
if "$GPRMC" in resp:
data = resp.split(',')
info = data[3] + " " + data[4] + " " + data[5] + " " + data[6]
print info
resp = ""
That's great! a question, If I use a beaglebone black with Android, is it GPS receiver works with gps app in Android?
ReplyDeleteregards.
Juan C.
Hi Juan -
DeleteI got another Beaglebone Black a couple weeks ago so I could try another OS besides Ångström Linux, but I haven't gotten around to it. I'm not sure (yet) if the Android OS on the Beaglebone Black uses the same approach to configuring the I/O pins or not. If you are able to find out, please do post here. I would appreciate knowing how it works.
--Brad
Hi Brad,
DeleteNow I have a beaglebone black and I try to install android. The installation has been successful but I don't know how to configure the I/O pins. I followed next tutorial
http://icculus.org/~hendersa/android/
I hope that you can help me or maybe you can give me more ideas about this topic.
Juan C.
HI Brad
ReplyDeletei have a beaglebone black and i try to install the gps program to find locatio e.g. but have errors i dont know why im using gps vayu 2g beaglebone cape,can you help me to finish my work?
do you have any example i C programing?
ReplyDelete