kemonine
/
lollipopcloud
Archived
1
0
Fork 0

Add A-GPS trick to GPS documentation

This commit is contained in:
KemoNine 2019-04-12 00:41:51 +01:00
parent e9ce0f6700
commit 36ae4b7773
No known key found for this signature in database
GPG Key ID: 3BC2928798AE11AB
1 changed files with 70 additions and 1 deletions

View File

@ -63,7 +63,10 @@ Setup PPS for chrony
``` bash
cat >> /boot/armbianEnv.txt <<EOF
param_pps_pin=PA6
# Orange Pi PC 2e PPS Pin
# param_pps_pin=PA6
# Pine64 PPS Pin
# param_pps_pin=PH9
EOF
systemctl reboot
@ -182,3 +185,69 @@ systemctl enable gpsconvert.timer
systemctl start gpsconvert.timer
```
## A-GPS
This sets up a form of A-GPS to speed locks when indoors or having a hard time getting a lock in general.
*This setup is specific to the Adafruit Ultimate GPS modules. You'll need to adapt this if using a different GPS receiver.*
### Setup mt3339 utils and get latest sattelite hints
``` bash
apt install python-pip python-setuptools python-wheel python3-pip python3-setuptools python3-wheel geoip-bin
pip install -U pyserial && pip3 install -U pyserial
cd /opt
git clone https://github.com/f5eng/mt3339-utils.git
cd /opt/mt3339-utils
./eporetrieve
```
### Get your current ip address
*Note: this MUST be done from your main internet connection, NOT VPN*
``` bash
curl http://ifconfig.co
```
### Setup Maxmind GeoIP database
``` bash
mkdir GeoLite2
cd GeoLite2
wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
tar -xzf GeoLite2-City.tar.gz
cd ..
```
### Get IP Address Location
```
pip3 install -U maxminddb
python3
import maxminddb
reader = maxminddb.open_database('./GeoLite2/GeoLite2-City_20190402/GeoLite2-City.mmdb')
rec = reader.get('anipaddress')
print('%s,%s,0' %(rec['location']['latitude'], rec['location']['longitude']))
exit()
```
### Seed GPS Unit With Rough Location and System Time
``` bash
systemctl stop gpsd gpsd.socket gpsconvert.timer gpsconvert.service gps-logger
./epoloader --speed 9600 --time - --location python_output ./MTK14.EPO /dev/ttyS2
systemctl restart gpsd gpsd.socket gpsconvert.timer gpsconvert.service gps-logger
```