Here is my python3 script which executes straight forward commands for querying location on demand:
portwrite = “/dev/ttyUSB2”
serw = serial.Serial(portwrite, baudrate = 115200, rtscts=True, dsrdtr=True,timeout = 1)
logger.info(str(gpsac)+’ => init_QGPS’)
serw.write(‘AT+QGPSEND\r’.encode())
time.sleep(0.25)
serw.write(‘AT+QGPS=1\r’.encode())
time.sleep(0.25)
while True:
serw.write(‘AT+QGPSLOC=1\r’.encode())
time.sleep(1)
line = serw.readline().decode(‘utf-8’)
loginfo = str(datetime.datetime.utcnow())+’: '+line
logger.info(loginfo)
************ And here is the log output: *************
2021-07-12 08:19:08,593 2021-07-12 07:19:08.592959: AT+QGPS=1
2021-07-12 08:19:13,605 2021-07-12 07:19:13.605676: OK
2021-07-12 08:19:14,609 2021-07-12 07:19:14.608903: AT+QGPSLOC=1
2021-07-12 08:19:15,618 2021-07-12 07:19:15.618202: +QGPSLOC: 071906.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:18,866 2021-07-12 07:19:18.866119: AT+QGPSLOC=1
2021-07-12 08:19:19,875 2021-07-12 07:19:19.875499: +QGPSLOC: 071906.900,3205.019379,N,03453.995285,E,0.8,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:20,878 2021-07-12 07:19:20.877927:
2021-07-12 08:19:21,880 2021-07-12 07:19:21.880143: OK
2021-07-12 08:19:22,883 2021-07-12 07:19:22.883302: AT+QGPSLOC=1
2021-07-12 08:19:23,892 2021-07-12 07:19:23.892554: +QGPSLOC: 071908.0,3205.019379,N,03453.995285,E,0.8,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:24,907 2021-07-12 07:19:24.907761:
2021-07-12 08:19:25,910 2021-07-12 07:19:25.910036: OK
2021-07-12 08:19:26,913 2021-07-12 07:19:26.913298: AT+QGPSLOC=1
2021-07-12 08:19:27,922 2021-07-12 07:19:27.922525: +QGPSLOC: 071909.0,3205.019379,N,03453.995285,E,0.8,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:28,925 2021-07-12 07:19:28.924971:
2021-07-12 08:19:29,936 2021-07-12 07:19:29.936847: OK
2021-07-12 08:19:30,940 2021-07-12 07:19:30.940126: AT+QGPSLOC=1
2021-07-12 08:19:31,949 2021-07-12 07:19:31.949389: +QGPSLOC: 071910.0,3205.019379,N,03453.995285,E,0.8,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:32,951 2021-07-12 07:19:32.951786:
2021-07-12 08:19:33,954 2021-07-12 07:19:33.954036: OK
2021-07-12 08:19:34,966 2021-07-12 07:19:34.966856: AT+QGPSLOC=1
2021-07-12 08:19:35,976 2021-07-12 07:19:35.976096: +QGPSLOC: 071911.0,3205.019379,N,03453.995285,E,0.7,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:36,978 2021-07-12 07:19:36.978606:
2021-07-12 08:19:37,980 2021-07-12 07:19:37.980868: OK
2021-07-12 08:19:38,984 2021-07-12 07:19:38.984103: AT+QGPSLOC=1
2021-07-12 08:19:40,009 2021-07-12 07:19:40.009082: +QGPSLOC: 071912.0,3205.019379,N,03453.995285,E,0.7,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:41,011 2021-07-12 07:19:41.011519:
2021-07-12 08:19:42,013 2021-07-12 07:19:42.013772: OK
2021-07-12 08:19:43,017 2021-07-12 07:19:43.016988: AT+QGPSLOC=1
2021-07-12 08:19:44,026 2021-07-12 07:19:44.026256: +QGPSLOC: 071913.0,3205.019379,N,03453.995285,E,0.7,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:45,043 2021-07-12 07:19:45.043854:
2021-07-12 08:19:46,046 2021-07-12 07:19:46.046128: OK
2021-07-12 08:19:47,048 2021-07-12 07:19:47.048514: AT+QGPSLOC=1
2021-07-12 08:19:48,057 2021-07-12 07:19:48.057518: +QGPSLOC: 071914.0,3205.019379,N,03453.995285,E,0.7,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:49,060 2021-07-12 07:19:49.060036:
2021-07-12 08:19:50,078 2021-07-12 07:19:50.078725: OK
2021-07-12 08:19:51,082 2021-07-12 07:19:51.081952: AT+QGPSLOC=1
2021-07-12 08:19:52,091 2021-07-12 07:19:52.090955: +QGPSLOC: 071915.0,3205.019379,N,03453.995285,E,0.7,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:53,093 2021-07-12 07:19:53.093432:
2021-07-12 08:19:54,095 2021-07-12 07:19:54.095743: OK
2021-07-12 08:19:55,099 2021-07-12 07:19:55.099037: AT+QGPSLOC=1
2021-07-12 08:19:56,108 2021-07-12 07:19:56.108170: +QGPSLOC: 071916.0,3205.019379,N,03453.995285,E,0.7,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:19:57,110 2021-07-12 07:19:57.110742:
2021-07-12 08:19:58,113 2021-07-12 07:19:58.113111: OK
2021-07-12 08:19:59,116 2021-07-12 07:19:59.116520: AT+QGPSLOC=1
2021-07-12 08:20:00,126 2021-07-12 07:20:00.126118: +QGPSLOC: 071917.0,3205.019379,N,03453.995285,E,0.7,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:01,149 2021-07-12 07:20:01.149160:
2021-07-12 08:20:02,151 2021-07-12 07:20:02.151558: OK
2021-07-12 08:20:03,155 2021-07-12 07:20:03.155049: AT+QGPSLOC=1
2021-07-12 08:20:04,164 2021-07-12 07:20:04.164824: +QGPSLOC: 071918.0,3205.019379,N,03453.995285,E,0.7,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:05,167 2021-07-12 07:20:05.167483:
2021-07-12 08:20:06,170 2021-07-12 07:20:06.169915: OK
2021-07-12 08:20:07,172 2021-07-12 07:20:07.172480: AT+QGPSLOC=1
2021-07-12 08:20:08,181 2021-07-12 07:20:08.181807: +QGPSLOC: 071919.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:09,184 2021-07-12 07:20:09.184431:
2021-07-12 08:20:10,186 2021-07-12 07:20:10.186813: OK
2021-07-12 08:20:11,190 2021-07-12 07:20:11.190257: AT+QGPSLOC=1
2021-07-12 08:20:12,200 2021-07-12 07:20:12.200028: +QGPSLOC: 071920.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:13,202 2021-07-12 07:20:13.202713:
2021-07-12 08:20:14,205 2021-07-12 07:20:14.204949: OK
2021-07-12 08:20:15,208 2021-07-12 07:20:15.208423: AT+QGPSLOC=1
2021-07-12 08:20:16,218 2021-07-12 07:20:16.218183: +QGPSLOC: 071921.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:17,221 2021-07-12 07:20:17.220882:
2021-07-12 08:20:18,223 2021-07-12 07:20:18.223358: OK
2021-07-12 08:20:19,226 2021-07-12 07:20:19.226850: AT+QGPSLOC=1
2021-07-12 08:20:20,236 2021-07-12 07:20:20.236719: +QGPSLOC: 071922.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:21,239 2021-07-12 07:20:21.239473:
2021-07-12 08:20:22,241 2021-07-12 07:20:22.241839: OK
2021-07-12 08:20:23,245 2021-07-12 07:20:23.245223: AT+QGPSLOC=1
2021-07-12 08:20:24,255 2021-07-12 07:20:24.255009: +QGPSLOC: 071923.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:25,257 2021-07-12 07:20:25.257789:
2021-07-12 08:20:26,260 2021-07-12 07:20:26.260241: OK
2021-07-12 08:20:27,263 2021-07-12 07:20:27.263674: AT+QGPSLOC=1
2021-07-12 08:20:28,273 2021-07-12 07:20:28.273459: +QGPSLOC: 071924.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:29,276 2021-07-12 07:20:29.276215:
2021-07-12 08:20:30,278 2021-07-12 07:20:30.278627: OK
2021-07-12 08:20:31,282 2021-07-12 07:20:31.282041: AT+QGPSLOC=1
2021-07-12 08:20:32,291 2021-07-12 07:20:32.291764: +QGPSLOC: 071925.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:33,294 2021-07-12 07:20:33.294496:
2021-07-12 08:20:34,297 2021-07-12 07:20:34.296914: OK
2021-07-12 08:20:35,300 2021-07-12 07:20:35.300368: AT+QGPSLOC=1
2021-07-12 08:20:36,310 2021-07-12 07:20:36.310182: +QGPSLOC: 071926.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:37,326 2021-07-12 07:20:37.326093:
2021-07-12 08:20:38,328 2021-07-12 07:20:38.328471: OK
2021-07-12 08:20:39,331 2021-07-12 07:20:39.331874: AT+QGPSLOC=1
2021-07-12 08:20:40,341 2021-07-12 07:20:40.341587: +QGPSLOC: 071927.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:41,344 2021-07-12 07:20:41.344291:
2021-07-12 08:20:42,346 2021-07-12 07:20:42.346704: OK
2021-07-12 08:20:43,349 2021-07-12 07:20:43.349363: AT+QGPSLOC=1
2021-07-12 08:20:44,358 2021-07-12 07:20:44.358693: +QGPSLOC: 071928.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:45,361 2021-07-12 07:20:45.361307:
2021-07-12 08:20:46,363 2021-07-12 07:20:46.363718: OK
2021-07-12 08:20:47,367 2021-07-12 07:20:47.367222: AT+QGPSLOC=1
2021-07-12 08:20:48,377 2021-07-12 07:20:48.376930: +QGPSLOC: 071929.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:49,379 2021-07-12 07:20:49.379867:
2021-07-12 08:20:50,382 2021-07-12 07:20:50.382243: OK
2021-07-12 08:20:51,385 2021-07-12 07:20:51.385622: AT+QGPSLOC=1
2021-07-12 08:20:52,395 2021-07-12 07:20:52.395314: +QGPSLOC: 071930.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:53,398 2021-07-12 07:20:53.398073:
2021-07-12 08:20:54,400 2021-07-12 07:20:54.400529: OK
2021-07-12 08:20:55,404 2021-07-12 07:20:55.403963: AT+QGPSLOC=1
2021-07-12 08:20:56,413 2021-07-12 07:20:56.413784: +QGPSLOC: 071931.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:20:57,416 2021-07-12 07:20:57.416489:
2021-07-12 08:20:58,419 2021-07-12 07:20:58.419024: OK
2021-07-12 08:20:59,422 2021-07-12 07:20:59.422461: AT+QGPSLOC=1
2021-07-12 08:21:00,432 2021-07-12 07:21:00.432185: +QGPSLOC: 071932.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:21:01,434 2021-07-12 07:21:01.434800:
2021-07-12 08:21:02,437 2021-07-12 07:21:02.436969: OK
2021-07-12 08:21:03,440 2021-07-12 07:21:03.440413: AT+QGPSLOC=1
2021-07-12 08:21:04,450 2021-07-12 07:21:04.450219: +QGPSLOC: 071933.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
2021-07-12 08:21:05,453 2021-07-12 07:21:05.452927:
2021-07-12 08:21:06,455 2021-07-12 07:21:06.455330: OK
2021-07-12 08:21:07,458 2021-07-12 07:21:07.458743: AT+QGPSLOC=1
2021-07-12 08:21:08,468 2021-07-12 07:21:08.468578: +QGPSLOC: 071934.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
It can be seen that at the beginning the +QGPSLOC UTC time is in phase with the log time (wrap with ** **):
2021-07-12 08:19:15,618 2021-07-12 07:19:15.618202: +QGPSLOC: 071906.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
But then +QGPSLOC UTC time is constantly lagging behind the real UTC log time, as it can seen on the last record : 07:21:08 vs 071934.
2021-07-12 08:21:08,468 2021-07-12 07:21:08.468578: +QGPSLOC: 071934.0,3205.019379,N,03453.995285,E,0.9,44.0,2,0.00,0.0,0.0,120721,07
The above log was taken on a static device (not moving), but when I drive/walk with the device the actual location is NOT presented by the +QGPSLOC record on that time; it is actually presenting my history location (time lagging). When I stop, the +QGPSLOC records still presenting my history movements (since it is lagging in time) until it eventually ‘arrive’ to my rest location.
It look like the system buffer the +QGPSLOC records is phase of the real time location.
What should be fixed here to get the real time location? My python3 script? any additional AT commands?
*I have several EC25-E models which show same results.
Regards
Assaf