GNSS Protocol Reference
The Wireless Tracker uses the Unicore UC6580 GNSS module, which communicates via the Unicore protocol (compatible with NMEA-0183). This page covers the most commonly used commands.
Serial Configuration
Section titled “Serial Configuration”| Parameter | Value |
|---|---|
| Default Baud | 115200 |
| Data Bits | 8 |
| Parity | None |
| Stop Bits | 1 |
| GPIO TX | 33 (GNSS → ESP32) |
| GPIO RX | 34 (ESP32 → GNSS) |
Message Format
Section titled “Message Format”All messages follow this format:
$MSGNAME,data1,data2,data3,...[*CC]\r\n$- Message startMSGNAME- Command name,- Parameter separator*CC- Optional checksum (XOR of all characters between$and*)\r\n- Message terminator
Common Commands
Section titled “Common Commands”PDTINFO - Product Information
Section titled “PDTINFO - Product Information”Query device information:
$PDTINFOResponse:
$PDTINFO,UC6580,G1B1,V4.1,R3.4.0.19,080101000001,000101114303845| Field | Description |
|---|---|
| pdtName | Product name |
| config | Configuration |
| hwVer | Hardware version |
| fwVer | Firmware version |
| PN | Product number |
| SN | Serial number |
RESET - Receiver Reset
Section titled “RESET - Receiver Reset”$RESET,type,clrMask| clrMask | Start Type |
|---|---|
| h00 | Hot start |
| h01 | Warm start |
| h85 | Cold start |
Example (cold start):
$RESET,0,h85CFGPRT - Port Configuration
Section titled “CFGPRT - Port Configuration”Query current port:
$CFGPRTSet port configuration:
$CFGPRT,portID,addr,baud,inProto,outProto| Parameter | Description |
|---|---|
| portID | 1 = UART1, 2 = UART2 |
| addr | Always h0 |
| baud | 9600, 115200, 230400, 460800 |
| inProto | Input protocol mask |
| outProto | Output protocol mask |
CFGMSG - Message Output Configuration
Section titled “CFGMSG - Message Output Configuration”Enable/disable specific messages:
$CFGMSG,msgClass,msgID,switch| Message | Class | ID | Switch |
|---|---|---|---|
| GGA | 0 | 0 | 0=off, 1=on |
| GLL | 0 | 1 | 0=off, 1=on |
| GSA | 0 | 2 | 0=off, 1=on |
| GSV | 0 | 3 | 0=off, 1=on |
| RMC | 0 | 4 | 0=off, 1=on |
| VTG | 0 | 5 | 0=off, 1=on |
| ZDA | 0 | 6 | 0=off, 1=on |
| GST | 0 | 7 | 0=off, 1=on |
Example (enable GGA):
$CFGMSG,0,0,1CFGSYS - Satellite System Configuration
Section titled “CFGSYS - Satellite System Configuration”$CFGSYS,sysMask| sysMask | Systems |
|---|---|
| H01 | GPS+SBAS+QZSS |
| H10 | BDS only |
| H11 | GPS+BDS+Galileo+SBAS+QZSS |
| H101 | GPS+GLONASS+Galileo+SBAS+QZSS |
CFGSAVE - Save Configuration
Section titled “CFGSAVE - Save Configuration”Save current settings to flash:
$CFGSAVENMEA Output Messages
Section titled “NMEA Output Messages”GGA - Position Fix
Section titled “GGA - Position Fix”$GPGGA,time,lat,N,lon,E,quality,numSV,HDOP,alt,M,sep,M,diffAge,diffStation*cs| Field | Description |
|---|---|
| time | UTC time (hhmmss.ss) |
| lat | Latitude (ddmm.mmmmm) |
| N/S | North/South indicator |
| lon | Longitude (dddmm.mmmmm) |
| E/W | East/West indicator |
| quality | 0=invalid, 1=GPS, 2=DGPS |
| numSV | Number of satellites |
| HDOP | Horizontal dilution |
| alt | Altitude (meters) |
RMC - Recommended Minimum
Section titled “RMC - Recommended Minimum”$GPRMC,time,status,lat,N,lon,E,speed,course,date,magVar,magE,mode*cs| Field | Description |
|---|---|
| time | UTC time |
| status | A=valid, V=invalid |
| speed | Speed over ground (knots) |
| course | Course over ground (degrees) |
| date | UTC date (ddmmyy) |
GSV - Satellites in View
Section titled “GSV - Satellites in View”$GPGSV,numMsg,msgNum,numSV,prn1,elv1,az1,snr1,...*csReports visible satellites with:
- PRN number
- Elevation angle (0-90°)
- Azimuth (0-359°)
- Signal-to-noise ratio (dB-Hz)
ESP32 Code Examples
Section titled “ESP32 Code Examples”#include <HardwareSerial.h>
HardwareSerial GNSS(1);
void setup() { Serial.begin(115200);
// Enable GNSS power (V1.1) pinMode(3, OUTPUT); digitalWrite(3, HIGH); delay(100);
// Initialize GNSS serial GNSS.begin(115200, SERIAL_8N1, 33, 34);
Serial.println("GNSS initialized");}
void loop() { while (GNSS.available()) { char c = GNSS.read(); Serial.write(c); }}void sendGNSSCommand(const char* cmd) { // Calculate checksum uint8_t checksum = 0; for (int i = 1; cmd[i] != '\0' && cmd[i] != '*'; i++) { checksum ^= cmd[i]; }
// Send command with checksum GNSS.printf("%s*%02X\r\n", cmd, checksum);}
void configureGNSS() { // Enable all GNSS systems sendGNSSCommand("$CFGSYS,H11"); delay(100);
// Enable GGA and RMC at 1Hz sendGNSSCommand("$CFGMSG,0,0,1"); sendGNSSCommand("$CFGMSG,0,4,1"); delay(100);
// Save configuration sendGNSSCommand("$CFGSAVE");}#include <TinyGPS++.h>
TinyGPSPlus gps;
void loop() { while (GNSS.available()) { if (gps.encode(GNSS.read())) { if (gps.location.isValid()) { Serial.printf("Lat: %.6f, Lon: %.6f\n", gps.location.lat(), gps.location.lng()); Serial.printf("Satellites: %d\n", gps.satellites.value()); Serial.printf("HDOP: %.2f\n", gps.hdop.hdop()); } } }}Position Accuracy
Section titled “Position Accuracy”| Parameter | Value |
|---|---|
| Horizontal (RMS) | 1.5 m |
| Vertical (RMS) | 2.5 m |
| Time (RMS) | 5 ns |
| Velocity | 0.02 m/s |
Time to First Fix
Section titled “Time to First Fix”| Mode | Time |
|---|---|
| Cold Start | < 26 s |
| Warm Start | < 2 s |
| Recapture | 1 s |
Sensitivity
Section titled “Sensitivity”| Mode | GPS | BDS | Galileo | GLONASS |
|---|---|---|---|---|
| Cold Start | -148 dBm | -146 dBm | -144 dBm | -144 dBm |
| Tracking | -165 dBm | -163 dBm | -163 dBm | -158 dBm |