1
|
#!/bin/sh
|
2
|
#
|
3
|
# Initialization script. Good for me. Maybe you too. - bms
|
4
|
#
|
5
|
_ubloxdev= /dev/cuaU0
|
6
|
_gpsctl= gpsctl
|
7
|
_gpsctl_opts= "-t u-blox"
|
8
|
|
9
|
### Binary mode config.
|
10
|
|
11
|
# On USB, accept UBX and NMEA; emit only UBX.
|
12
|
${_gpsctl} ${_gpsctl_opts} -x \
|
13
|
'\x06\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x01\x00\x00\x00\x00\x00' ${_ubloxdev}
|
14
|
|
15
|
# Enable all UBX messages.
|
16
|
${_gpsctl} ${_gpsctl_opts} -x \
|
17
|
'\x06\x02\x00\x00\x00\x00\x00\x00\x00\x1F' ${_ubloxdev}
|
18
|
|
19
|
# Disable all NMEA messages.
|
20
|
${_gpsctl} ${_gpsctl_opts} -x \
|
21
|
'\x06\x02\x01\x00\x00\x00\x00\x00\x00\x00' ${_ubloxdev}
|
22
|
|
23
|
### 1PPS config.
|
24
|
|
25
|
# Enable 1PPS on +-ve assert, UTC seconds, no antenna/group/user delay factor,
|
26
|
# undisciplined seconds permitted (!), 100us pulse length.
|
27
|
# (1PPS is NOT supported on USB without using a separate GPIO line.)
|
28
|
${_gpsctl} ${_gpsctl_opts} -x \
|
29
|
'\x06\x07\xE8\x03\x00\x00\x54\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ${_ubloxdev}
|
30
|
|
31
|
### Performance tuning.
|
32
|
|
33
|
# Enable max performance mode.
|
34
|
${_gpsctl} ${_gpsctl_opts} -x '\x06\x11\x00\x00' ${_ubloxdev}
|
35
|
|
36
|
# Enable auto 2D/3D fix mode, with 3 sats minimum, 20 sats maximum.
|
37
|
${_gpsctl} ${_gpsctl_opts} -x \
|
38
|
'\x06\x23\x00\x00\x44\x00\x00\x00\x00\x00\x00\x00\x03\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ${_ubloxdev}
|
39
|
|
40
|
### Localisation for SBAS extra satellite feeds.
|
41
|
|
42
|
# Astra-5B only (London, UK -- limited sky view.)
|
43
|
${_gpsctl} ${_gpsctl_opts} -x \
|
44
|
'\x06\x16\x03\x07\x01\x00\x08\x00\x00\x00' ${_ubloxdev}
|
45
|
|
46
|
# Now ready to run gpsd on ${_ubloxdev} itself.
|
47
|
exit 0
|