Beispiel #1
0
def getGNGGA():
    gngga = ''
    with pyxa1110.GPS(debug=True) as gps:
        for n in range(10):
            gps.receiveData()
            data = gps.ascii()
            if data.startswith("$GNGGA"):
                gngga = data
    return gngga
Beispiel #2
0
def getVersion():
    with pyxa1110.GPS() as gps:
        #Send command, request version
        packet = gps.createMTKPacket(605, "")
        gps.sendData(packet)

        #Measaure time and check if data was present
        start_time = time.time()
        fetched = False
        elapsed_time = 0

        while fetched is False and elapsed_time < 5:
            gps.receiveData()
            line = gps.ascii()
            if "PMTK" in line:
                print(line)
                fetched = True
            elapsed_time = time.time() - start_time
Beispiel #3
0
def setNMEAAll():
    with pyxa1110.GPS() as gps:
        packet = gps.createMTKPacket(314, ",-1")
        gps.sendData(packet)
Beispiel #4
0
def setNMEAOnlyGAA():
    with pyxa1110.GPS() as gps:
        packet = gps.createMTKPacket(
            314, ",0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0")
        gps.sendData(packet)
Beispiel #5
0
def set10hz():
    with pyxa1110.GPS() as gps:
        packet = gps.createMTKPacket(220, ",100")
        gps.sendData(packet)
import pyxa1110

#This code gets NMEA frames one by one
with pyxa1110.GPS(debug=True) as gps:
    for n in range(10):
        gps.receiveData()
        print(gps.ascii())
Beispiel #7
0
def fetchData():
    with pyxa1110.GPS() as gps:
        while runEvent.is_set():
            gps.receiveData()
            framesQueue.put(gps.ascii())