From 0207ede47d8c2a734796e93a79629b65cc6bf02c Mon Sep 17 00:00:00 2001 From: kjablonski Date: Sun, 26 Mar 2017 19:15:31 -0500 Subject: [PATCH 01/18] Update gps.go Added support for Galileo GNSS constellation --- main/gps.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/gps.go b/main/gps.go index 92b218bd..e25c1a62 100644 --- a/main/gps.go +++ b/main/gps.go @@ -276,22 +276,25 @@ func initGPSSerial() bool { // gpsattitude too much -- without WAAS corrections, the algorithm could get jumpy at higher // sampling rates. - cfgGnss := []byte{0x00, 0x20, 0x20, 0x05} + cfgGnss := []byte{0x00, 0x20, 0x20, 0x06} gps := []byte{0x00, 0x08, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01} // enable GPS with 8-16 tracking channels sbas := []byte{0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x01, 0x01} // enable SBAS (WAAS) with 2-3 tracking channels beidou := []byte{0x03, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x01} qzss := []byte{0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x01} glonass := []byte{0x06, 0x04, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x01} // this disables GLONASS + galileo := []byte{0x02, 0x04, 0x10, 0x00, 0x00, 0x00, 0x01, 0x01} // this disables Galileo if (globalStatus.GPS_detected_type == GPS_TYPE_UBX8) || (globalStatus.GPS_detected_type == GPS_TYPE_UART) { // assume that any GPS connected to serial GPIO is ublox8 (RY835/6AI) //log.Printf("UBX8 device detected on USB, or GPS serial connection in use. Attempting GLONASS configuration.\n") glonass = []byte{0x06, 0x08, 0x0E, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables GLONASS with 8-14 tracking channels + galileo = []byte{0x02, 0x04, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables Galileo with 4-16 tracking channels } cfgGnss = append(cfgGnss, gps...) cfgGnss = append(cfgGnss, sbas...) cfgGnss = append(cfgGnss, beidou...) cfgGnss = append(cfgGnss, qzss...) cfgGnss = append(cfgGnss, glonass...) + cfgGnss = append(cfgGnss, galileo...) p.Write(makeUBXCFG(0x06, 0x3E, uint16(len(cfgGnss)), cfgGnss)) // SBAS configuration for ublox 6 and higher From 1d33f79e0424e61545b9a93fe8b54fe0d67385a4 Mon Sep 17 00:00:00 2001 From: kjablonski Date: Sun, 26 Mar 2017 21:50:14 -0500 Subject: [PATCH 02/18] More Galileo Updates Updated sv numbers and added text to indicated Galileo in solution E# --- main/gps.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/main/gps.go b/main/gps.go index e25c1a62..452302af 100644 --- a/main/gps.go +++ b/main/gps.go @@ -33,7 +33,7 @@ const ( SAT_TYPE_UNKNOWN = 0 // default type SAT_TYPE_GPS = 1 // GPxxx; NMEA IDs 1-32 SAT_TYPE_GLONASS = 2 // GLxxx; NMEA IDs 65-88 - SAT_TYPE_GALILEO = 3 // GAxxx; NMEA IDs unknown + SAT_TYPE_GALILEO = 3 // GAxxx; NMEA IDs 301-332 SAT_TYPE_BEIDOU = 4 // GBxxx; NMEA IDs 201-235 SAT_TYPE_SBAS = 10 // NMEA IDs 33-54 ) @@ -1550,6 +1550,7 @@ func processNMEALine(l string) (sentenceUsed bool) { var svType uint8 var svSBAS bool // used to indicate whether this GSA message contains a SBAS satellite var svGLONASS bool // used to indicate whether this GSA message contains GLONASS satellites + var svGalileo bool // used to indicate whether this GSA message contains Galileo satellites sat := 0 for _, svtxt := range x[3:15] { @@ -1568,7 +1569,11 @@ func processNMEALine(l string) (sentenceUsed bool) { svType = SAT_TYPE_GLONASS svStr = fmt.Sprintf("R%d", sv-64) // subtract 64 to convert from NMEA to PRN. svGLONASS = true - } else { //TODO: Galileo + } else if sv < 300 { // Galileo + svType = SAT_TYPE_GALILEO + svStr = fmt.Sprintf("E%d", sv-300) // subtract 300 to convert from NMEA to PRN + svGalileo = true + } else { svType = SAT_TYPE_UNKNOWN svStr = fmt.Sprintf("U%d", sv) } @@ -1636,7 +1641,7 @@ func processNMEALine(l string) (sentenceUsed bool) { } - if (x[0] == "GPGSV") || (x[0] == "GLGSV") { // GPS + SBAS or GLONASS satellites in view message. Galileo is TBD. + if (x[0] == "GPGSV") || (x[0] == "GLGSV") || (x[0] == "GAGSV"){ // GPS + SBAS or GLONASS or Galileo satellites in view message. if len(x) < 4 { return false } @@ -1692,7 +1697,11 @@ func processNMEALine(l string) (sentenceUsed bool) { } else if sv < 97 { // GLONASS svType = SAT_TYPE_GLONASS svStr = fmt.Sprintf("R%d", sv-64) // subtract 64 to convert from NMEA to PRN. - } else { //TODO: Galileo + } else if sv < 300 { // Galileo + svType = SAT_TYPE_GALILEO + svStr = fmt.Sprintf("E%d", sv-300) // subtract 300 to convert from NMEA to PRN + svGalileo = true + } else { svType = SAT_TYPE_UNKNOWN svStr = fmt.Sprintf("U%d", sv) } From aaf2025968d3576932684e88ec107026d6f48290 Mon Sep 17 00:00:00 2001 From: kjablonski Date: Sun, 26 Mar 2017 21:59:56 -0500 Subject: [PATCH 03/18] Update gps.go --- main/gps.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/gps.go b/main/gps.go index 452302af..27997991 100644 --- a/main/gps.go +++ b/main/gps.go @@ -282,12 +282,12 @@ func initGPSSerial() bool { beidou := []byte{0x03, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x01} qzss := []byte{0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x01} glonass := []byte{0x06, 0x04, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x01} // this disables GLONASS - galileo := []byte{0x02, 0x04, 0x10, 0x00, 0x00, 0x00, 0x01, 0x01} // this disables Galileo + galileo := []byte{0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01} // this disables Galileo if (globalStatus.GPS_detected_type == GPS_TYPE_UBX8) || (globalStatus.GPS_detected_type == GPS_TYPE_UART) { // assume that any GPS connected to serial GPIO is ublox8 (RY835/6AI) //log.Printf("UBX8 device detected on USB, or GPS serial connection in use. Attempting GLONASS configuration.\n") glonass = []byte{0x06, 0x08, 0x0E, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables GLONASS with 8-14 tracking channels - galileo = []byte{0x02, 0x04, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables Galileo with 4-16 tracking channels + galileo = []byte{0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables Galileo with 4-8 tracking channels } cfgGnss = append(cfgGnss, gps...) cfgGnss = append(cfgGnss, sbas...) From 992367e50a00f37e737f4c0aed60e5a536f10fec Mon Sep 17 00:00:00 2001 From: kjablonski Date: Mon, 27 Mar 2017 21:49:01 -0500 Subject: [PATCH 04/18] Updates to gps.go tweaks after testing on stratux --- main/gps.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/main/gps.go b/main/gps.go index 27997991..c4be0ac9 100644 --- a/main/gps.go +++ b/main/gps.go @@ -33,7 +33,7 @@ const ( SAT_TYPE_UNKNOWN = 0 // default type SAT_TYPE_GPS = 1 // GPxxx; NMEA IDs 1-32 SAT_TYPE_GLONASS = 2 // GLxxx; NMEA IDs 65-88 - SAT_TYPE_GALILEO = 3 // GAxxx; NMEA IDs 301-332 + SAT_TYPE_GALILEO = 3 // GAxxx; NMEA IDs SAT_TYPE_BEIDOU = 4 // GBxxx; NMEA IDs 201-235 SAT_TYPE_SBAS = 10 // NMEA IDs 33-54 ) @@ -254,8 +254,8 @@ func initGPSSerial() bool { // Byte order for UBX configuration is little endian. // Set 10 Hz update to make gpsattitude more responsive for ublox7/8. - p.Write(makeUBXCFG(0x06, 0x08, 6, []byte{0x64, 0x00, 0x01, 0x00, 0x01, 0x00})) // 10 Hz - //p.Write(makeUBXCFG(0x06, 0x08, 6, []byte{0xc8, 0x00, 0x01, 0x00, 0x01, 0x00})) // 5 Hz + //p.Write(makeUBXCFG(0x06, 0x08, 6, []byte{0x64, 0x00, 0x01, 0x00, 0x01, 0x00})) // 10 Hz + p.Write(makeUBXCFG(0x06, 0x08, 6, []byte{0x06, 0x00, 0xF4, 0x01, 0x01, 0x00})) // 2 Hz // Set navigation settings. nav := make([]byte, 36) @@ -285,7 +285,7 @@ func initGPSSerial() bool { galileo := []byte{0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x01, 0x01} // this disables Galileo if (globalStatus.GPS_detected_type == GPS_TYPE_UBX8) || (globalStatus.GPS_detected_type == GPS_TYPE_UART) { // assume that any GPS connected to serial GPIO is ublox8 (RY835/6AI) - //log.Printf("UBX8 device detected on USB, or GPS serial connection in use. Attempting GLONASS configuration.\n") + //log.Printf("UBX8 device detected on USB, or GPS serial connection in use. Attempting GLONASS and Galelio configuration.\n") glonass = []byte{0x06, 0x08, 0x0E, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables GLONASS with 8-14 tracking channels galileo = []byte{0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables Galileo with 4-8 tracking channels } @@ -1101,7 +1101,10 @@ func processNMEALine(l string) (sentenceUsed bool) { svType = SAT_TYPE_SBAS svStr = fmt.Sprintf("S%d", sv) sv -= 87 // subtract 87 to convert to NMEA from PRN. - } else { //TODO: Galileo + } else if sv > 210 { + svType = SAT_TYPE_GALILEO + svStr = fmt.Sprintf("E%d", sv-210) + } else { //TODO: Galileo svType = SAT_TYPE_UNKNOWN svStr = fmt.Sprintf("U%d", sv) } @@ -1569,9 +1572,9 @@ func processNMEALine(l string) (sentenceUsed bool) { svType = SAT_TYPE_GLONASS svStr = fmt.Sprintf("R%d", sv-64) // subtract 64 to convert from NMEA to PRN. svGLONASS = true - } else if sv < 300 { // Galileo + } else if sv < 210 { // Galileo svType = SAT_TYPE_GALILEO - svStr = fmt.Sprintf("E%d", sv-300) // subtract 300 to convert from NMEA to PRN + svStr = fmt.Sprintf("E%d", sv-210) // subtract 300 to convert from NMEA to PRN svGalileo = true } else { svType = SAT_TYPE_UNKNOWN @@ -1607,7 +1610,7 @@ func processNMEALine(l string) (sentenceUsed bool) { } if sat < 12 || tmpSituation.Satellites < 13 { // GSA only reports up to 12 satellites in solution, so we don't want to overwrite higher counts based on updateConstellation(). tmpSituation.Satellites = uint16(sat) - if (tmpSituation.Quality == 2) && !svSBAS && !svGLONASS { // add one to the satellite count if we have a SBAS solution, but the GSA message doesn't track a SBAS satellite + if (tmpSituation.Quality == 2) && !svSBAS && !svGLONASS && !svGalileo { // add one to the satellite count if we have a SBAS solution, but the GSA message doesn't track a SBAS satellite tmpSituation.Satellites++ } } @@ -1697,10 +1700,9 @@ func processNMEALine(l string) (sentenceUsed bool) { } else if sv < 97 { // GLONASS svType = SAT_TYPE_GLONASS svStr = fmt.Sprintf("R%d", sv-64) // subtract 64 to convert from NMEA to PRN. - } else if sv < 300 { // Galileo + } else if sv < 210 { // Galileo svType = SAT_TYPE_GALILEO - svStr = fmt.Sprintf("E%d", sv-300) // subtract 300 to convert from NMEA to PRN - svGalileo = true + svStr = fmt.Sprintf("E%d", sv-210) // subtract 300 to convert from NMEA to PRN } else { svType = SAT_TYPE_UNKNOWN svStr = fmt.Sprintf("U%d", sv) From 24d20e7cdb653d8656071b3e15fb1286019b76a4 Mon Sep 17 00:00:00 2001 From: Brad Benson Date: Mon, 3 Apr 2017 14:10:12 -0500 Subject: [PATCH 05/18] Remove hardcoded alert flag on traffic report and replace with simple logic to set it only if a target is within 2nm. This addresses issue #580 . --- main/traffic.go | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/main/traffic.go b/main/traffic.go index 56f30f6d..da88d083 100755 --- a/main/traffic.go +++ b/main/traffic.go @@ -111,9 +111,9 @@ type TrafficInfo struct { Last_speed time.Time // Time of last velocity and track update (stratuxClock). Last_source uint8 // Last frequency on which this target was received. ExtrapolatedPosition bool //TODO: True if Stratux is "coasting" the target from last known position. + BearingDist_valid bool // set when bearing and distance information is valid Bearing float64 // Bearing in degrees true to traffic from ownship, if it can be calculated. Distance float64 // Distance to traffic from ownship, if it can be calculated. - //FIXME: Some indicator that Bearing and Distance are valid, since they aren't always available. //FIXME: Rename variables for consistency, especially "Last_". } @@ -191,6 +191,7 @@ func sendTrafficUpdates() { dist, bearing := distance(float64(mySituation.Lat), float64(mySituation.Lng), float64(ti.Lat), float64(ti.Lng)) ti.Distance = dist ti.Bearing = bearing + ti.BearingDist_valid = true } ti.Age = stratuxClock.Since(ti.Last_seen).Seconds() ti.AgeLastAlt = stratuxClock.Since(ti.Last_alt).Seconds() @@ -251,13 +252,31 @@ func registerTrafficUpdate(ti TrafficInfo) { trafficUpdate.SendJSON(ti) } +func isTrafficAlertable(ti TrafficInfo) bool { + // Set alert bit if possible and traffic is within some threshold + // TODO: Could be more intelligent, taking into account headings etc. + if ti.BearingDist_valid && + ti.Distance < 3704 { // TODO: Maybe make configurable? + return true + } + + return false +} + func makeTrafficReportMsg(ti TrafficInfo) []byte { msg := make([]byte, 28) // See p.16. msg[0] = 0x14 // Message type "Traffic Report". - msg[1] = 0x10 | ti.Addr_type // Alert status, address type. - + // Address type + msg[1] = ti.Addr_type + + // Set alert if needed + if isTrafficAlertable(ti) { + // Set the alert bit. See pg. 18 of GDL90 ICD + msg[1] |= 0x10 + } + // ICAO Address. msg[2] = byte((ti.Icao_addr & 0x00FF0000) >> 16) msg[3] = byte((ti.Icao_addr & 0x0000FF00) >> 8) @@ -568,6 +587,7 @@ func parseDownlinkReport(s string, signalLevel int) { ti.Lng = lng if isGPSValid() { ti.Distance, ti.Bearing = distance(float64(mySituation.Lat), float64(mySituation.Lng), float64(ti.Lat), float64(ti.Lng)) + ti.BearingDist_valid = true } ti.Last_seen = stratuxClock.Time ti.ExtrapolatedPosition = false @@ -849,6 +869,7 @@ func esListen() { ti.Lng = lng if isGPSValid() { ti.Distance, ti.Bearing = distance(float64(mySituation.Lat), float64(mySituation.Lng), float64(ti.Lat), float64(ti.Lng)) + ti.BearingDist_valid = true } ti.Position_valid = true ti.ExtrapolatedPosition = false @@ -1083,6 +1104,7 @@ func updateDemoTraffic(icao uint32, tail string, relAlt float32, gs float64, off ti.Lng = float32(lng + traffRelLng) ti.Distance, ti.Bearing = distance(float64(lat), float64(lng), float64(ti.Lat), float64(ti.Lng)) + ti.BearingDist_valid = true ti.Position_valid = true ti.ExtrapolatedPosition = false From b8dd5d7b2cd6b1d60580c62deffd1a1ae389019e Mon Sep 17 00:00:00 2001 From: kjablonski Date: Mon, 3 Apr 2017 14:12:18 -0500 Subject: [PATCH 06/18] Update stxAliases.txt Typo fixes --- image/stxAliases.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/image/stxAliases.txt b/image/stxAliases.txt index 323e7e27..17238f77 100644 --- a/image/stxAliases.txt +++ b/image/stxAliases.txt @@ -43,9 +43,9 @@ echo "stxstart Start Stratux Service." echo "sdr0 Test to see if sdr0 is in use by Stratux." echo "sdr1 Test to see if sdr1 is in use by Startux." echo "sdrs Test to see if both SDRs are in use by Stratux." -echo "d90 List my SDRs with serials" +echo "d90 Run dump1090 on SDR0" echo "d900 Run dump1090 on SDR0 in interactive mode." -echo "d901 Run dump1090 on SDR0 in interactive mode." +echo "d901 Run dump1090 on SDR1 in interactive mode." echo "kal0 Find Channels for calibrating PPM of SDR0." echo "kal1 Find Channels for calibrating PPM of SDR1." echo "kalChan0 Use the Chan from above to get ppm pf SDR0. Example: kalChan0 151" @@ -53,7 +53,7 @@ echo "kalChan1 Use the Chan from above to get ppm pf SDR1. Exam echo "setSerial0 Set the PPM error to SDR0. Value from kalChan0. Example: setSerial0 -45" echo "setSerial1 Set the PPM error to SDR1. Value from kalChan1. Example: setSerial1 23" echo "hostapd_manager.sh Sets the Change SSID, Channel, or Encryption for your Stratux" -echo "sdr-tool.sh Tool to walk you though setting your SDRs Serials" +echo "sdr-tool.sh Tool to walk you though setting your SDRs Serials" echo "raspi-config Open Raspberry Pi settings to expand filesystem" } From 5d5f165218e6d6ef5a138c369963c6f8f15836a0 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Thu, 6 Apr 2017 11:24:46 -0400 Subject: [PATCH 07/18] Formatting. Use gofmt after edits. #580, #582. --- main/traffic.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/main/traffic.go b/main/traffic.go index da88d083..33964e3b 100755 --- a/main/traffic.go +++ b/main/traffic.go @@ -111,7 +111,7 @@ type TrafficInfo struct { Last_speed time.Time // Time of last velocity and track update (stratuxClock). Last_source uint8 // Last frequency on which this target was received. ExtrapolatedPosition bool //TODO: True if Stratux is "coasting" the target from last known position. - BearingDist_valid bool // set when bearing and distance information is valid + BearingDist_valid bool // set when bearing and distance information is valid Bearing float64 // Bearing in degrees true to traffic from ownship, if it can be calculated. Distance float64 // Distance to traffic from ownship, if it can be calculated. //FIXME: Rename variables for consistency, especially "Last_". @@ -191,7 +191,7 @@ func sendTrafficUpdates() { dist, bearing := distance(float64(mySituation.Lat), float64(mySituation.Lng), float64(ti.Lat), float64(ti.Lng)) ti.Distance = dist ti.Bearing = bearing - ti.BearingDist_valid = true + ti.BearingDist_valid = true } ti.Age = stratuxClock.Since(ti.Last_seen).Seconds() ti.AgeLastAlt = stratuxClock.Since(ti.Last_alt).Seconds() @@ -256,10 +256,10 @@ func isTrafficAlertable(ti TrafficInfo) bool { // Set alert bit if possible and traffic is within some threshold // TODO: Could be more intelligent, taking into account headings etc. if ti.BearingDist_valid && - ti.Distance < 3704 { // TODO: Maybe make configurable? - return true + ti.Distance < 3704 { // TODO: Maybe make configurable? + return true } - + return false } @@ -268,15 +268,15 @@ func makeTrafficReportMsg(ti TrafficInfo) []byte { // See p.16. msg[0] = 0x14 // Message type "Traffic Report". - // Address type + // Address type msg[1] = ti.Addr_type - + // Set alert if needed if isTrafficAlertable(ti) { - // Set the alert bit. See pg. 18 of GDL90 ICD - msg[1] |= 0x10 + // Set the alert bit. See pg. 18 of GDL90 ICD + msg[1] |= 0x10 } - + // ICAO Address. msg[2] = byte((ti.Icao_addr & 0x00FF0000) >> 16) msg[3] = byte((ti.Icao_addr & 0x0000FF00) >> 8) From 93321a4f8fd0f63b0ff3bf1be6541686552cd1d2 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Thu, 6 Apr 2017 11:26:51 -0400 Subject: [PATCH 08/18] Reset Distance, Bearing, and BearingDist_valid if GPS data becomes invalid. #580, #582. --- main/traffic.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/traffic.go b/main/traffic.go index 33964e3b..6dd7fb92 100755 --- a/main/traffic.go +++ b/main/traffic.go @@ -192,6 +192,10 @@ func sendTrafficUpdates() { ti.Distance = dist ti.Bearing = bearing ti.BearingDist_valid = true + } else { + ti.Distance = 0 + ti.Bearing = 0 + ti.BearingDist_valid = false } ti.Age = stratuxClock.Since(ti.Last_seen).Seconds() ti.AgeLastAlt = stratuxClock.Since(ti.Last_alt).Seconds() From f564f2bb6b6f98e1b4b646234afdb3dd1209f324 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Thu, 6 Apr 2017 11:27:03 -0400 Subject: [PATCH 09/18] Remove redundant distance calculation. --- main/traffic.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main/traffic.go b/main/traffic.go index 6dd7fb92..c5b10d14 100755 --- a/main/traffic.go +++ b/main/traffic.go @@ -589,10 +589,6 @@ func parseDownlinkReport(s string, signalLevel int) { if ti.Position_valid { ti.Lat = lat ti.Lng = lng - if isGPSValid() { - ti.Distance, ti.Bearing = distance(float64(mySituation.Lat), float64(mySituation.Lng), float64(ti.Lat), float64(ti.Lng)) - ti.BearingDist_valid = true - } ti.Last_seen = stratuxClock.Time ti.ExtrapolatedPosition = false } From 9e12f693182225b253f3f4fddcd0b8bc3b6d8960 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Thu, 6 Apr 2017 11:28:56 -0400 Subject: [PATCH 10/18] Add comments on units and constants. #580, #582. --- main/traffic.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/traffic.go b/main/traffic.go index c5b10d14..5637d502 100755 --- a/main/traffic.go +++ b/main/traffic.go @@ -112,8 +112,8 @@ type TrafficInfo struct { Last_source uint8 // Last frequency on which this target was received. ExtrapolatedPosition bool //TODO: True if Stratux is "coasting" the target from last known position. BearingDist_valid bool // set when bearing and distance information is valid - Bearing float64 // Bearing in degrees true to traffic from ownship, if it can be calculated. - Distance float64 // Distance to traffic from ownship, if it can be calculated. + Bearing float64 // Bearing in degrees true to traffic from ownship, if it can be calculated. Units: degrees. + Distance float64 // Distance to traffic from ownship, if it can be calculated. Units: meters. //FIXME: Rename variables for consistency, especially "Last_". } @@ -260,7 +260,7 @@ func isTrafficAlertable(ti TrafficInfo) bool { // Set alert bit if possible and traffic is within some threshold // TODO: Could be more intelligent, taking into account headings etc. if ti.BearingDist_valid && - ti.Distance < 3704 { // TODO: Maybe make configurable? + ti.Distance < 3704 { // 3704 meters, 2 nm. return true } From 2645f982937829b45040f0518d33cfc102d642cd Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Wed, 19 Apr 2017 15:51:49 -0400 Subject: [PATCH 11/18] Cleanup. --- main/gps.go | 54 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/main/gps.go b/main/gps.go index 92b218bd..d4be6a6d 100644 --- a/main/gps.go +++ b/main/gps.go @@ -107,6 +107,7 @@ type gpsPerfStats struct { gpsPitch float64 // estimated pitch angle, deg. Calculated from gps ground speed and VV. Equal to flight path angle. gpsRoll float64 // estimated roll angle from turn rate and groundspeed, deg. Assumes airplane in coordinated turns. gpsLoadFactor float64 // estimated load factor from turn rate and groundspeed, "gee". Assumes airplane in coordinated turns. + //TODO: valid/invalid flag. } var gpsPerf gpsPerfStats @@ -319,6 +320,50 @@ func initGPSSerial() bool { p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF1, 0x03, 0x00, 0x05, 0x00, 0x05, 0x00, 0x00})) // Ublox,3 p.Write(makeUBXCFG(0x06, 0x01, 8, []byte{0xF1, 0x04, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x00})) // Ublox,4 + // Power save mode. + + // UBX-CFG-PM2. + pm2 := make([]byte, 44) + pm2[0] = 1 // Version. + + // flags. + pm2[4] = 0 + pm2[5] = 0 // ON/OFF mode. + pm2[6] = 4 + 8 + 16 // WaitTimeFix+updateRTC+updateEPH. + pm2[7] = 32 // extintWake. + + // updatePeriod. + pm2[8] = 0 + pm2[9] = 0 + pm2[10] = 0x3A // 15000ms. + pm2[11] = 0x98 + + // searchPeriod. + pm2[12] = 0 + pm2[13] = 0 + pm2[14] = 0x3A // 15000ms. + pm2[15] = 0x98 + + // gridOffset. + pm2[16] = 0 + pm2[17] = 0 + pm2[18] = 0 + pm2[19] = 0 + + // onTime. + pm2[20] = 0 + pm2[21] = 15 // 15s. + + // minAcqTime. + pm2[22] = 0 + pm2[23] = 15 // 15s. + + p.Write(makeUBXCFG(0x06, 0x3B, 44, pm2)) + + // UBX-CFG-RXM. + + p.Write(makeUBXCFG(0x06, 0x11, 2, []byte{8, 1})) // Enable. + // Reconfigure serial port. cfg := make([]byte, 20) cfg[0] = 0x01 // portID. @@ -692,7 +737,7 @@ func calcGPSAttitude() bool { //log.Printf("\n") //log.Printf("tempHdg: %v\n", tempHdg) - // Next, unwrap the heading so we don't mess up the regression by fitting a line across the 0/360 deg discontinutiy + // Next, unwrap the heading so we don't mess up the regression by fitting a line across the 0/360 deg discontinuity. lengthHeading = len(tempHdg) tempHdgUnwrapped = make([]float64, lengthHeading, lengthHeading) tempRegWeights = make([]float64, lengthHeading, lengthHeading) @@ -770,7 +815,7 @@ func calcGPSAttitude() bool { */ - g := 32.174 // ft-s^-2 + g := 32.174 // ft/(s^2) omega = radians(myGPSPerfStats[index].gpsTurnRate) // need radians/sec a_c = v_x * omega myGPSPerfStats[index].gpsRoll = math.Atan2(a_c, g) * 180 / math.Pi // output is degrees @@ -781,11 +826,12 @@ func calcGPSAttitude() bool { myGPSPerfStats[index].gpsLoadFactor = 1 } - // Output format:GPSAtttiude,seconds,nmeaTime,msg_type,GS,Course,Alt,VV,filtered_GS,filtered_course,turn rate,filtered_vv,pitch, roll,load_factor - buf := fmt.Sprintf("GPSAttitude,%.1f,%.2f,%s,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f\n", float64(stratuxClock.Milliseconds)/1000, myGPSPerfStats[index].nmeaTime, myGPSPerfStats[index].msgType, myGPSPerfStats[index].gsf, myGPSPerfStats[index].coursef, myGPSPerfStats[index].alt, myGPSPerfStats[index].vv, v_x/1.687810, headingAvg, myGPSPerfStats[index].gpsTurnRate, v_z, myGPSPerfStats[index].gpsPitch, myGPSPerfStats[index].gpsRoll, myGPSPerfStats[index].gpsLoadFactor) if globalSettings.DEBUG { + // Output format:GPSAtttiude,seconds,nmeaTime,msg_type,GS,Course,Alt,VV,filtered_GS,filtered_course,turn rate,filtered_vv,pitch, roll,load_factor + buf := fmt.Sprintf("GPSAttitude,%.1f,%.2f,%s,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f,%0.3f\n", float64(stratuxClock.Milliseconds)/1000, myGPSPerfStats[index].nmeaTime, myGPSPerfStats[index].msgType, myGPSPerfStats[index].gsf, myGPSPerfStats[index].coursef, myGPSPerfStats[index].alt, myGPSPerfStats[index].vv, v_x/1.687810, headingAvg, myGPSPerfStats[index].gpsTurnRate, v_z, myGPSPerfStats[index].gpsPitch, myGPSPerfStats[index].gpsRoll, myGPSPerfStats[index].gpsLoadFactor) log.Printf("%s", buf) // FIXME. Send to sqlite log or other file? } + logGPSAttitude(myGPSPerfStats[index]) //replayLog(buf, MSGCLASS_AHRS) return true From fe7dc97c19ab0a09728d7a83eee68328109676b7 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Wed, 19 Apr 2017 15:57:25 -0400 Subject: [PATCH 12/18] Clean up typos and formatting. --- main/datalog.go | 2 +- main/gen_gdl90.go | 2 +- main/gps.go | 2 +- main/managementinterface.go | 4 ++-- main/monotonic.go | 2 +- main/network.go | 8 +++----- main/ping.go | 2 +- main/sdr.go | 2 +- main/traffic.go | 2 +- main/uibroadcast.go | 2 +- 10 files changed, 13 insertions(+), 15 deletions(-) diff --git a/main/datalog.go b/main/datalog.go index 621400fa..e1f081a7 100644 --- a/main/datalog.go +++ b/main/datalog.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. diff --git a/main/gen_gdl90.go b/main/gen_gdl90.go index e400211f..4d8d524e 100755 --- a/main/gen_gdl90.go +++ b/main/gen_gdl90.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. diff --git a/main/gps.go b/main/gps.go index d4be6a6d..0826183b 100644 --- a/main/gps.go +++ b/main/gps.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. diff --git a/main/managementinterface.go b/main/managementinterface.go index f6fa0afa..c4c38a56 100755 --- a/main/managementinterface.go +++ b/main/managementinterface.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. @@ -335,7 +335,7 @@ func handleSettingsSetRequest(w http.ResponseWriter, r *http.Request) { err = err + "Invalid IP: " + ip + ". " } } - if err != "" { + if err != "" { log.Printf("handleSettingsSetRequest:StaticIps: %s\n", err) continue } diff --git a/main/monotonic.go b/main/monotonic.go index c2aca2cc..2016f316 100644 --- a/main/monotonic.go +++ b/main/monotonic.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. diff --git a/main/network.go b/main/network.go index 5da50cb3..17b8d742 100644 --- a/main/network.go +++ b/main/network.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. @@ -63,11 +63,10 @@ var messageQueue chan networkMessage var outSockets map[string]networkConnection var dhcpLeases map[string]string var pingResponse map[string]time.Time // Last time an IP responded to an "echo" response. -var netMutex *sync.Mutex // netMutex needs to be locked before accessing dhcpLeases, pingResponse, and outSockets and calling isSleeping() and isThrottled(). +var netMutex *sync.Mutex // netMutex needs to be locked before accessing dhcpLeases, pingResponse, and outSockets and calling isSleeping() and isThrottled(). var totalNetworkMessagesSent uint32 - const ( NETWORK_GDL90_STANDARD = 1 NETWORK_AHRS_FFSIM = 2 @@ -116,14 +115,13 @@ func getDHCPLeases() (map[string]string, error) { } } - // Add IP's set through the settings page + // Add IP's set through the settings page if globalSettings.StaticIps != nil { for _, ip := range globalSettings.StaticIps { ret[ip] = "" } } - // Added the ability to have static IP hosts stored in /etc/stratux-static-hosts.conf dat2, err := ioutil.ReadFile(extra_hosts_file) diff --git a/main/ping.go b/main/ping.go index b491b9d7..2039cfa1 100644 --- a/main/ping.go +++ b/main/ping.go @@ -1,6 +1,6 @@ /* Copyright (c) 2016 uAvionix - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. diff --git a/main/sdr.go b/main/sdr.go index 3f2ec258..882876ca 100644 --- a/main/sdr.go +++ b/main/sdr.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. diff --git a/main/traffic.go b/main/traffic.go index 5637d502..a26afc86 100755 --- a/main/traffic.go +++ b/main/traffic.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. diff --git a/main/uibroadcast.go b/main/uibroadcast.go index b7d45ab1..46e87214 100644 --- a/main/uibroadcast.go +++ b/main/uibroadcast.go @@ -1,6 +1,6 @@ /* Copyright (c) 2015-2016 Christopher Young - Distributable under the terms of The "BSD New"" License + Distributable under the terms of The "BSD New" License that can be found in the LICENSE file, herein included as part of this header. From b431187d7aea1403965eec273aeb5941062472ce Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Wed, 19 Apr 2017 16:01:29 -0400 Subject: [PATCH 13/18] Use isGPSValid(). --- main/gps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/gps.go b/main/gps.go index 0826183b..0e813f7a 100644 --- a/main/gps.go +++ b/main/gps.go @@ -1949,7 +1949,7 @@ func gpsAttitudeSender() { for globalSettings.GPS_Enabled && globalStatus.GPS_connected { <-timer.C - if mySituation.Quality == 0 || !calcGPSAttitude() { + if !isGPSValid() || !calcGPSAttitude() { if globalSettings.DEBUG { log.Printf("Couldn't calculate GPS-based attitude statistics\n") } From c0b6e9a93b9b2e3d86b9d56aac48519465341965 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Wed, 19 Apr 2017 16:49:35 -0400 Subject: [PATCH 14/18] Set "Maintenance Req'd" bit in GDL90 heartbeat when there exists a system error. #567. --- main/gen_gdl90.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main/gen_gdl90.go b/main/gen_gdl90.go index 4d8d524e..42db916d 100755 --- a/main/gen_gdl90.go +++ b/main/gen_gdl90.go @@ -574,6 +574,11 @@ func makeHeartbeat() []byte { } msg[1] = msg[1] | 0x10 //FIXME: Addr talkback. + // "Maintenance Req'd". Add flag if there are any current critical system errors. + if len(globalStatus.Errors) > 0 { + msg[1] = msg[1] | 0x40 + } + nowUTC := time.Now().UTC() // Seconds since 0000Z. midnightUTC := time.Date(nowUTC.Year(), nowUTC.Month(), nowUTC.Day(), 0, 0, 0, 0, time.UTC) From 176cf42f2e8a03852456782ac4e3903d703fca30 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Wed, 19 Apr 2017 17:04:12 -0400 Subject: [PATCH 15/18] Blink ACT LED ten times per second when there is a system error. #567. --- main/gen_gdl90.go | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/main/gen_gdl90.go b/main/gen_gdl90.go index 42db916d..8680ce25 100755 --- a/main/gen_gdl90.go +++ b/main/gen_gdl90.go @@ -610,14 +610,37 @@ func relayMessage(msgtype uint16, msg []byte) { sendGDL90(prepareMessage(ret), true) } +func blinkStatusLED() { + timer := time.NewTicker(100 * time.Millisecond) + ledON := false + for { + <-timer.C + if ledON { + ioutil.WriteFile("/sys/class/leds/led0/brightness", []byte("0\n"), 0644) + } else { + ioutil.WriteFile("/sys/class/leds/led0/brightness", []byte("1\n"), 0644) + } + ledON = !ledON + } +} func heartBeatSender() { timer := time.NewTicker(1 * time.Second) timerMessageStats := time.NewTicker(2 * time.Second) + ledBlinking := false for { select { case <-timer.C: - // Turn on green ACT LED on the Pi. - ioutil.WriteFile("/sys/class/leds/led0/brightness", []byte("1\n"), 0644) + // Green LED - always on during normal operation. + // Blinking when there is a critical system error (and Stratux is still running). + + if len(globalStatus.Errors) == 0 { // Any system errors? + // Turn on green ACT LED on the Pi. + ioutil.WriteFile("/sys/class/leds/led0/brightness", []byte("1\n"), 0644) + } else if !ledBlinking { + // This assumes that system errors do not disappear until restart. + go blinkStatusLED() + ledBlinking = true + } sendGDL90(makeHeartbeat(), false) sendGDL90(makeStratuxHeartbeat(), false) From a8bd9a28f9d1431640278e29147e322edc585fdb Mon Sep 17 00:00:00 2001 From: kjablonski Date: Thu, 20 Apr 2017 21:42:45 -0500 Subject: [PATCH 16/18] Update gps.go Added logic to only slow down to 2Hz for UBX8 using Galileo --- main/gps.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/gps.go b/main/gps.go index c4be0ac9..826e439f 100644 --- a/main/gps.go +++ b/main/gps.go @@ -254,8 +254,7 @@ func initGPSSerial() bool { // Byte order for UBX configuration is little endian. // Set 10 Hz update to make gpsattitude more responsive for ublox7/8. - //p.Write(makeUBXCFG(0x06, 0x08, 6, []byte{0x64, 0x00, 0x01, 0x00, 0x01, 0x00})) // 10 Hz - p.Write(makeUBXCFG(0x06, 0x08, 6, []byte{0x06, 0x00, 0xF4, 0x01, 0x01, 0x00})) // 2 Hz + updatespeed = []byte{0x64, 0x00, 0x01, 0x00, 0x01, 0x00} // 10 Hz // Set navigation settings. nav := make([]byte, 36) @@ -288,6 +287,7 @@ func initGPSSerial() bool { //log.Printf("UBX8 device detected on USB, or GPS serial connection in use. Attempting GLONASS and Galelio configuration.\n") glonass = []byte{0x06, 0x08, 0x0E, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables GLONASS with 8-14 tracking channels galileo = []byte{0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables Galileo with 4-8 tracking channels + updatespeed = []byte{0x06, 0x00, 0xF4, 0x01, 0x01, 0x00} // Nav speed 2Hz } cfgGnss = append(cfgGnss, gps...) cfgGnss = append(cfgGnss, sbas...) @@ -299,6 +299,8 @@ func initGPSSerial() bool { // SBAS configuration for ublox 6 and higher p.Write(makeUBXCFG(0x06, 0x16, 8, []byte{0x01, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00})) + //Navigation Rate 10Hz for <= UBX7 2Hz for UBX8 + p.Write(makeUBXCFG(0x06, 0x08, 6, upatespeed)) // Message output configuration: UBX,00 (position) on each calculated fix; UBX,03 (satellite info) every 5th fix, // UBX,04 (timing) every 10th, GGA (NMEA position) every 5th. All other NMEA messages disabled. From e3fcadb4ba9c6358423cfa3c825585f016648072 Mon Sep 17 00:00:00 2001 From: kjablonski Date: Fri, 21 Apr 2017 06:57:18 -0500 Subject: [PATCH 17/18] Update gps.go Fixed undeclared variable updatespeed --- main/gps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/gps.go b/main/gps.go index 826e439f..fc1f321d 100644 --- a/main/gps.go +++ b/main/gps.go @@ -254,7 +254,7 @@ func initGPSSerial() bool { // Byte order for UBX configuration is little endian. // Set 10 Hz update to make gpsattitude more responsive for ublox7/8. - updatespeed = []byte{0x64, 0x00, 0x01, 0x00, 0x01, 0x00} // 10 Hz + updatespeed := []byte{0x64, 0x00, 0x01, 0x00, 0x01, 0x00} // 10 Hz // Set navigation settings. nav := make([]byte, 36) From 7d7c2abe354256e9a7cf0afa3d37ba5e38882b68 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Fri, 21 Apr 2017 14:16:21 -0400 Subject: [PATCH 18/18] Gofmt. Typo fix. Comment change. --- main/gps.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/gps.go b/main/gps.go index 9133102a..7d91e395 100644 --- a/main/gps.go +++ b/main/gps.go @@ -33,7 +33,7 @@ const ( SAT_TYPE_UNKNOWN = 0 // default type SAT_TYPE_GPS = 1 // GPxxx; NMEA IDs 1-32 SAT_TYPE_GLONASS = 2 // GLxxx; NMEA IDs 65-88 - SAT_TYPE_GALILEO = 3 // GAxxx; NMEA IDs + SAT_TYPE_GALILEO = 3 // GAxxx; NMEA IDs SAT_TYPE_BEIDOU = 4 // GBxxx; NMEA IDs 201-235 SAT_TYPE_SBAS = 10 // NMEA IDs 33-54 ) @@ -254,7 +254,7 @@ func initGPSSerial() bool { } else { // Byte order for UBX configuration is little endian. - // Set 10 Hz update to make gpsattitude more responsive for ublox7/8. + // Set 10 Hz update to make gpsattitude more responsive for ublox7. updatespeed := []byte{0x64, 0x00, 0x01, 0x00, 0x01, 0x00} // 10 Hz // Set navigation settings. @@ -288,7 +288,7 @@ func initGPSSerial() bool { //log.Printf("UBX8 device detected on USB, or GPS serial connection in use. Attempting GLONASS and Galelio configuration.\n") glonass = []byte{0x06, 0x08, 0x0E, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables GLONASS with 8-14 tracking channels galileo = []byte{0x02, 0x04, 0x08, 0x00, 0x01, 0x00, 0x01, 0x01} // this enables Galileo with 4-8 tracking channels - updatespeed = []byte{0x06, 0x00, 0xF4, 0x01, 0x01, 0x00} // Nav speed 2Hz + updatespeed = []byte{0x06, 0x00, 0xF4, 0x01, 0x01, 0x00} // Nav speed 2Hz } cfgGnss = append(cfgGnss, gps...) cfgGnss = append(cfgGnss, sbas...) @@ -301,7 +301,7 @@ func initGPSSerial() bool { // SBAS configuration for ublox 6 and higher p.Write(makeUBXCFG(0x06, 0x16, 8, []byte{0x01, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00})) //Navigation Rate 10Hz for <= UBX7 2Hz for UBX8 - p.Write(makeUBXCFG(0x06, 0x08, 6, upatespeed)) + p.Write(makeUBXCFG(0x06, 0x08, 6, updatespeed)) // Message output configuration: UBX,00 (position) on each calculated fix; UBX,03 (satellite info) every 5th fix, // UBX,04 (timing) every 10th, GGA (NMEA position) every 5th. All other NMEA messages disabled. @@ -1151,8 +1151,8 @@ func processNMEALine(l string) (sentenceUsed bool) { sv -= 87 // subtract 87 to convert to NMEA from PRN. } else if sv > 210 { svType = SAT_TYPE_GALILEO - svStr = fmt.Sprintf("E%d", sv-210) - } else { //TODO: Galileo + svStr = fmt.Sprintf("E%d", sv-210) + } else { //TODO: Galileo svType = SAT_TYPE_UNKNOWN svStr = fmt.Sprintf("U%d", sv) } @@ -1624,7 +1624,7 @@ func processNMEALine(l string) (sentenceUsed bool) { svType = SAT_TYPE_GALILEO svStr = fmt.Sprintf("E%d", sv-210) // subtract 300 to convert from NMEA to PRN svGalileo = true - } else { + } else { svType = SAT_TYPE_UNKNOWN svStr = fmt.Sprintf("U%d", sv) } @@ -1692,7 +1692,7 @@ func processNMEALine(l string) (sentenceUsed bool) { } - if (x[0] == "GPGSV") || (x[0] == "GLGSV") || (x[0] == "GAGSV"){ // GPS + SBAS or GLONASS or Galileo satellites in view message. + if (x[0] == "GPGSV") || (x[0] == "GLGSV") || (x[0] == "GAGSV") { // GPS + SBAS or GLONASS or Galileo satellites in view message. if len(x) < 4 { return false } @@ -1751,7 +1751,7 @@ func processNMEALine(l string) (sentenceUsed bool) { } else if sv < 210 { // Galileo svType = SAT_TYPE_GALILEO svStr = fmt.Sprintf("E%d", sv-210) // subtract 300 to convert from NMEA to PRN - } else { + } else { svType = SAT_TYPE_UNKNOWN svStr = fmt.Sprintf("U%d", sv) }