kopia lustrzana https://github.com/cyoung/stratux
explicitly disable PUBX and increase baud rate
rodzic
746e197692
commit
1bd277bcdc
14
main/gps.go
14
main/gps.go
|
@ -360,7 +360,7 @@ func initGPSSerial() bool {
|
|||
cfg[7] = 0x00
|
||||
|
||||
// Baud rate. Little endian order.
|
||||
bdrt := uint32(38400)
|
||||
bdrt := uint32(115200)
|
||||
cfg[11] = byte((bdrt >> 24) & 0xFF)
|
||||
cfg[10] = byte((bdrt >> 16) & 0xFF)
|
||||
cfg[9] = byte((bdrt >> 8) & 0xFF)
|
||||
|
@ -385,7 +385,7 @@ func initGPSSerial() bool {
|
|||
|
||||
|
||||
// time.Sleep(100* time.Millisecond) // pause and wait for the GPS to finish configuring itself before closing / reopening the port
|
||||
baudrates[0] = 38400
|
||||
baudrates[0] = int(bdrt)
|
||||
|
||||
if globalSettings.DEBUG {
|
||||
log.Printf("Finished writing u-blox GPS config to %s. Opening port to test connection.\n", device)
|
||||
|
@ -512,13 +512,21 @@ func writeUbloxGenericCommands(navrate uint16, p *serial.Port) {
|
|||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00})) // VGT - Course over ground and Ground speed
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // GRS - GNSS Range Residuals
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // GST - GNSS Pseudo Range Error Statistics
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // ZDA - Time and Date
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // ZDA - Time and Date<
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // GBS - GNSS Satellite Fault Detection
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // DTM - Datum Reference
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // GNS - GNSS fix data
|
||||
// p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // ???
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // VLW - Dual ground/water distance
|
||||
|
||||
// UBX-CFG-MSG (NMEA PUBX Messages) msg msg Ports 1-6
|
||||
// Class ID DDC UART1 UART2 USB I2C Res
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // Ublox - Lat/Long Position Data
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF1, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // Ublox - Satellite Status
|
||||
p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF1, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})) // Ublox - Time of Day and Clock Information
|
||||
|
||||
|
||||
|
||||
if navrate == 10 {
|
||||
p.Write(makeUBXCFG(0x06, 0x08, 6, []byte{0x64, 0x00, 0x01, 0x00, 0x01, 0x00})) // 100ms & 1 cycle -> 10Hz (UBX-CFG-RATE payload bytes: little endian!)
|
||||
} else if navrate == 5 {
|
||||
|
|
Ładowanie…
Reference in New Issue