GPS Module: Difference between revisions
NickPGSmith (talk | contribs) |
NickPGSmith (talk | contribs) |
||
(34 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== HW-595 Board == | == HW-595 Board == | ||
[[Image:UBlox_GPS_Module.jpg|top|thumbnail|uBlox GPS Board]] | [[Image:UBlox_GPS_Module.jpg|top|thumbnail|uBlox GPS Board]] | ||
* Based on [https://www.u-blox.com/en/product/neo-6-series uBlox NEO-6M-0-001] | * Based on [https://www.u-blox.com/en/product/neo-6-series uBlox NEO-6M-0-001] | ||
* [https://content.u-blox.com/sites/default/files/products/documents/u-blox6_ReceiverDescrProtSpec_%28GPS.G6-SW-10018%29_Public.pdf Receiver Description] | |||
* 5V operation (3.3 V regulator onboard) | * 5V operation (3.3 V regulator onboard) | ||
* UART: 4800 - 230400 bps (9600 bps 8N1 default), TTL levels buffered by 220R resistors | * UART: 4800 - 230400 bps (9600 bps 8N1 default), TTL levels buffered by 220R resistors | ||
* [https://en.wikipedia.org/wiki/Hirose_U.FL U.FL] connector supplies 3.3 V to active antenna | * [https://en.wikipedia.org/wiki/Hirose_U.FL U.FL] connector supplies 3.3 V to active antenna | ||
* Crystal Osc, not TCXO | * Crystal Osc, not TCXO | ||
* LED: | * PPS LED: Invertion of PPS pin | ||
* Battery-backed RAM contains config data and clock and speeds first-time-to-fix | * Battery-backed RAM contains config data and clock and speeds first-time-to-fix | ||
* Data in [http://www.gpsinformation.org/dale/nmea.htm NMEA] 0183 format | * Data in [http://www.gpsinformation.org/dale/nmea.htm NMEA] 0183 format | ||
Line 24: | Line 23: | ||
|1 | |1 | ||
|PPS | |PPS | ||
|1 pulse/s, synchronised at rising edge, length 100 ms | |1 pulse/s, synchronised at rising edge, length 100 ms (by default) | ||
|- | |- | ||
|2 | |2 | ||
Line 43: | Line 42: | ||
|} | |} | ||
PPS | PPS: | ||
* Send PPS to UART via CTS | * Send PPS to UART via CTS to allow GPSD to acurately sync | ||
* 0.25 Hz - 10 MHz | * Can be configured as a frequency reference: 0.25 Hz - 10 MHz | ||
** Output has high frequency accuracy | |||
** Suffers from jitter except at a few specific frequencies | |||
* Configure in u-Center [[Media:u-Center Configuration.png|here]] | * Configure in u-Center [[Media:u-Center Configuration.png|here]] | ||
* | * Different frquencies/duty cycles can be configure for GPS synced/not synced | ||
== Software == | == Software == | ||
Line 54: | Line 55: | ||
* [https://www.u-blox.com/en/product/u-center U-Center] | * [https://www.u-blox.com/en/product/u-center U-Center] | ||
* Select COM port and Baud rate | |||
* Communicates with uBlox with binary UBX Protocol | |||
View -> Configuration View; to activate change: Send | |||
* CFG (Configuration) | |||
** Select: Save current configuration | |||
** Select in Devices: 2-I2C-EEPROM | |||
* PRT (Ports) | |||
** Baud Rate : 9600 -> 115200 | |||
* TP5 (Timepulse 5) | |||
** PPS Settings for no GPS lock (eg use as an "alert" signal: | |||
*** Frequency : 1 Hz -> 10 Hz | |||
*** Duty Cycle : 100% -> 25% (alternatively set to 0% for permanent low output) | |||
** PPS Settings for GPS Locked: | |||
*** Frequency Locked : 1 Hz | |||
*** Duty Locked : 50% | |||
** Rising Edge on TOS | |||
** Cable Delay : 50 ns -> 10 ns (This compensates for cable delay between antenna and receiver) | |||
View -> Message View: | |||
* Firmware version: UBX -> MON (Monitor) -> VER (Version) | |||
** Currently: 7.03 (45969) | |||
=== GPSD === | === GPSD === | ||
Line 60: | Line 83: | ||
* Packages: gpsd, gpsd-clients | * Packages: gpsd, gpsd-clients | ||
Use of a serial device (eg ttyS0) is prefered over a USB/serial interface (eg ttyUSB0) due to lower latency and [https://docs.kernel.org/driver-api/pps.html PPS] availability. | |||
Can be tested with something like (Debug level 4) : | Can be tested with something like (Debug level 4) : | ||
gpsd -N -n -s 9600 -D 4 /dev/ttyS0 /dev/pps0 | gpsd -N -n -s 9600 -D 4 /dev/ttyS0 /dev/pps0 | ||
Configuration in /etc/sysconfig/gpsd | Configuration in /etc/sysconfig/gpsd, which by default enables detection of USB devices via udev events including creation of a PPS device (/dev/pps0): | ||
USBAUTO="true" | |||
Options can be forced, eg: | |||
OPTIONS="-n -s 9600" | OPTIONS="-n -s 9600" | ||
DEVICES="/dev/ttyS0 /dev/pps0" | DEVICES="/dev/ttyS0 /dev/pps0" | ||
Check data stream with [https://gpsd.gitlab.io/gpsd/gpsmon.html gpsmon]: | |||
gpsmon /dev/ttyS0 | |||
when gpsd is not started, or connected to gpsd: | |||
gpsmon | |||
Can show raw data: | |||
gpscat /dev/ttyS0 | |||
Enable and start gpsd: | Enable and start gpsd: | ||
Line 77: | Line 108: | ||
systemctl start gpsd | systemctl start gpsd | ||
Monitor with: | |||
cgps -s | |||
gpsmon | |||
gpscsv | |||
gpsplot --image gps.png | |||
xgps | |||
=== Pulse Per Second (PPS) === | |||
With PPS output connected to a serial port pin, GPSD should detect it. If it is on GPIO or other serial port, this can be used to create a PPS device: | |||
dnf install pps-tools | dnf install pps-tools | ||
modprobe pps_ldisc | modprobe pps_ldisc | ||
setserial -v /dev/ttyS0 low_latency | |||
ldattach PPS /dev/ttyS0 | ldattach PPS /dev/ttyS0 | ||
Line 91: | Line 127: | ||
ppstest /dev/pps0 | ppstest /dev/pps0 | ||
ppscheck /dev/ttyS0 | ppscheck /dev/ttyS0 | ||
Can set at boot with udev rule (/etc/udev/rules.d/gps.rules): | |||
KERNEL=="ttyS0", SYMLINK+="gps0" | |||
KERNEL=="ttyS0", RUN+="/usr/bin/setserial -v /dev/%k low_latency" | |||
KERNEL=="ttyS0", RUN+="/usr/sbin/ldattach PPS /dev/%k" |
Revision as of 19:47, 5 June 2024
HW-595 Board
- Based on uBlox NEO-6M-0-001
- Receiver Description
- 5V operation (3.3 V regulator onboard)
- UART: 4800 - 230400 bps (9600 bps 8N1 default), TTL levels buffered by 220R resistors
- U.FL connector supplies 3.3 V to active antenna
- Crystal Osc, not TCXO
- PPS LED: Invertion of PPS pin
- Battery-backed RAM contains config data and clock and speeds first-time-to-fix
- Data in NMEA 0183 format
- More background here
Board pinouts:
Pin | Function | Description |
---|---|---|
1 | PPS | 1 pulse/s, synchronised at rising edge, length 100 ms (by default) |
2 | RXD | UART input |
3 | TXD | UART output |
4 | GND | Ground |
5 | VCC | 3.3 - 5 V |
PPS:
- Send PPS to UART via CTS to allow GPSD to acurately sync
- Can be configured as a frequency reference: 0.25 Hz - 10 MHz
- Output has high frequency accuracy
- Suffers from jitter except at a few specific frequencies
- Configure in u-Center here
- Different frquencies/duty cycles can be configure for GPS synced/not synced
Software
U-Center
- U-Center
- Select COM port and Baud rate
- Communicates with uBlox with binary UBX Protocol
View -> Configuration View; to activate change: Send
- CFG (Configuration)
- Select: Save current configuration
- Select in Devices: 2-I2C-EEPROM
- PRT (Ports)
- Baud Rate : 9600 -> 115200
- TP5 (Timepulse 5)
- PPS Settings for no GPS lock (eg use as an "alert" signal:
- Frequency : 1 Hz -> 10 Hz
- Duty Cycle : 100% -> 25% (alternatively set to 0% for permanent low output)
- PPS Settings for GPS Locked:
- Frequency Locked : 1 Hz
- Duty Locked : 50%
- Rising Edge on TOS
- Cable Delay : 50 ns -> 10 ns (This compensates for cable delay between antenna and receiver)
- PPS Settings for no GPS lock (eg use as an "alert" signal:
View -> Message View:
- Firmware version: UBX -> MON (Monitor) -> VER (Version)
- Currently: 7.03 (45969)
GPSD
- gpsd
- Packages: gpsd, gpsd-clients
Use of a serial device (eg ttyS0) is prefered over a USB/serial interface (eg ttyUSB0) due to lower latency and PPS availability.
Can be tested with something like (Debug level 4) :
gpsd -N -n -s 9600 -D 4 /dev/ttyS0 /dev/pps0
Configuration in /etc/sysconfig/gpsd, which by default enables detection of USB devices via udev events including creation of a PPS device (/dev/pps0):
USBAUTO="true"
Options can be forced, eg:
OPTIONS="-n -s 9600" DEVICES="/dev/ttyS0 /dev/pps0"
Check data stream with gpsmon:
gpsmon /dev/ttyS0
when gpsd is not started, or connected to gpsd:
gpsmon
Can show raw data:
gpscat /dev/ttyS0
Enable and start gpsd:
systemctl enable gpsd systemctl start gpsd
Monitor with:
cgps -s gpsmon gpscsv gpsplot --image gps.png xgps
Pulse Per Second (PPS)
With PPS output connected to a serial port pin, GPSD should detect it. If it is on GPIO or other serial port, this can be used to create a PPS device:
dnf install pps-tools modprobe pps_ldisc setserial -v /dev/ttyS0 low_latency ldattach PPS /dev/ttyS0
Check PPS signal:
ppstest /dev/pps0 ppscheck /dev/ttyS0
Can set at boot with udev rule (/etc/udev/rules.d/gps.rules):
KERNEL=="ttyS0", SYMLINK+="gps0" KERNEL=="ttyS0", RUN+="/usr/bin/setserial -v /dev/%k low_latency" KERNEL=="ttyS0", RUN+="/usr/sbin/ldattach PPS /dev/%k"