Browse Source

Add A-GPS trick to GPS documentation

pull/130/head
KemoNine 9 months ago
parent
commit
36ae4b7773
Signed by: KemoNine <kemonine@lollipopcloud.solutions> GPG Key ID: 3BC2928798AE11AB
1 changed files with 70 additions and 1 deletions
  1. 70
    1
      hardware/gps.md

+ 70
- 1
hardware/gps.md View File

@@ -63,7 +63,10 @@ Setup PPS for chrony
63 63
 ``` bash
64 64
 
65 65
 cat >> /boot/armbianEnv.txt <<EOF
66
-param_pps_pin=PA6
66
+# Orange Pi PC 2e PPS Pin
67
+# param_pps_pin=PA6
68
+# Pine64 PPS Pin
69
+# param_pps_pin=PH9
67 70
 
68 71
 EOF
69 72
 systemctl reboot
@@ -182,3 +185,69 @@ systemctl enable gpsconvert.timer
182 185
 systemctl start gpsconvert.timer
183 186
 
184 187
 ```
188
+
189
+## A-GPS
190
+
191
+This sets up a form of A-GPS to speed locks when indoors or having a hard time getting a lock in general.
192
+
193
+*This setup is specific to the Adafruit Ultimate GPS modules. You'll need to adapt this if using a different GPS receiver.*
194
+
195
+### Setup mt3339 utils and get latest sattelite hints
196
+
197
+``` bash
198
+
199
+apt install python-pip python-setuptools python-wheel python3-pip python3-setuptools python3-wheel geoip-bin
200
+pip install -U pyserial && pip3 install -U pyserial
201
+cd /opt
202
+git clone https://github.com/f5eng/mt3339-utils.git
203
+cd /opt/mt3339-utils
204
+./eporetrieve 
205
+
206
+```
207
+
208
+### Get your current ip address
209
+
210
+*Note: this MUST be done from your main internet connection, NOT VPN*
211
+
212
+``` bash
213
+
214
+curl http://ifconfig.co
215
+
216
+```
217
+
218
+### Setup Maxmind GeoIP database
219
+
220
+``` bash
221
+
222
+mkdir GeoLite2
223
+cd GeoLite2
224
+wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
225
+tar -xzf GeoLite2-City.tar.gz
226
+cd ..
227
+
228
+```
229
+
230
+### Get IP Address Location
231
+
232
+```
233
+
234
+pip3 install -U maxminddb
235
+python3
236
+import maxminddb
237
+reader = maxminddb.open_database('./GeoLite2/GeoLite2-City_20190402/GeoLite2-City.mmdb')
238
+rec = reader.get('anipaddress')
239
+print('%s,%s,0' %(rec['location']['latitude'], rec['location']['longitude']))
240
+exit()
241
+
242
+```
243
+
244
+### Seed GPS Unit With Rough Location and System Time
245
+
246
+``` bash
247
+
248
+systemctl stop gpsd gpsd.socket gpsconvert.timer gpsconvert.service gps-logger
249
+./epoloader --speed 9600 --time - --location python_output ./MTK14.EPO /dev/ttyS2
250
+systemctl restart gpsd gpsd.socket gpsconvert.timer gpsconvert.service gps-logger
251
+
252
+```
253
+

Loading…
Cancel
Save