Tinker Board Forum

Full Version: USB GPS BU-353 BY GLOBALSAT
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[img]<a href=[/img][Image: IMG_20180107_010733134.jpg]" />

1. connect gps device to USB of TB.
2. check from /etc the name such as ttyUSB0 etc
3. open a terminal and :
sudo pkill gpsd
4. Since this particular device works at 4800 baud rate, do necessary settings:
stty 4800 > /dev/ttyUSB0
5. Then do manual forcing of data
sudo gpsd -b /dev/ttyUSB0
6. check output using 
cat /dev/ttyUSB0
this will throw GPS data continuously like ---- 

$GPGSA,.................................
$GPRMC,.............................
$GPGGA,..............................

7. You can also use following python code to get a single line output.
output will be as:
$GPGGA,XXXXX,YYYYYYY,N,ZZZZZZZZ,E,A,B,C,D,M,-E,M,,0000*7A




Code:
# coding: utf-8 
import serial
ser = serial.Serial('/dev/ttyUSB0', 4800, timeout =5)

while 1:
    line = ser.readline()
    splitline = line.split(',')

    if splitline[0] == '$GPGGA':
        latitude = line[2]
        latDirec = line[3]
        longitude = line[4]
        longDirec = line[5]
        print line
        break
Hi, working on android?
(01-11-2018, 07:30 PM)serlilo Wrote: [ -> ]Hi, working on android?

No. Tinker OS.