|
|
@@ -41,6 +41,30 @@ VERBOSE = True
|
|
|
|
|
|
ser = serial.Serial(DEVGPS, GPS_BAUD, bytesize=8, parity='N', stopbits=1, timeout=1, xonxoff=0, rtscts=0)
|
|
|
|
|
|
+###
|
|
|
+###
|
|
|
+
|
|
|
+
|
|
|
+if DEBUG: print "send:", "AT+CGPS=1"
|
|
|
+
|
|
|
+ser.write("AT+CGPS=1\r")
|
|
|
+ser.flush()
|
|
|
+resp = ser.readline()
|
|
|
+while (len(resp) > 0) and (resp[0] == '$'):
|
|
|
+ resp = ser.readline()
|
|
|
+if not re.search(r'[aA][tT]', resp): print "WARNING: got response: '" + str(resp) + "', expecting 'OK'. continuing"
|
|
|
+resp = ser.readline()
|
|
|
+while (len(resp) > 0) and (resp[0] == '$'):
|
|
|
+ resp = ser.readline()
|
|
|
+if not re.search(r'[oO][kK]', resp): print "WARNING: got response: '" + str(resp) + "', expecting 'OK'. continuing"
|
|
|
+
|
|
|
+if DEBUG: print "got:", resp
|
|
|
+
|
|
|
+time.sleep(1)
|
|
|
+
|
|
|
+###
|
|
|
+###
|
|
|
+
|
|
|
if DEBUG: print "send:", "AT+CGPSINFOCFG=" + str(FREQ_SECOND) + "," + str(BITMASK)
|
|
|
|
|
|
ser.write("AT+CGPSINFOCFG=" + str(FREQ_SECOND) + "," + str(BITMASK) + "\r")
|