-
Notifications
You must be signed in to change notification settings - Fork 497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem parsing HDOP, satellites number and altitude #140
Comments
Which (example) code do you use? |
You need to divide the HDOP by 100.0f |
The HDOP class has a member hdop() that does the division for you, if that helps. Try lcd.print(gps.hdop.hdop()); |
@TD-er Thanks. I will try $GPGGA,110617.00,41XX.XXXXX,N,00831.54761,W,1,05,2.68,129.0,M,50.1,M,,*42 110617 – represents the time at which the fix location was taken, 11:06:17 UTC @mikalhart Thanks, I will try today and let you know if it works. |
Just the first hit on DuckDuckGo when searching for "GGA nmea message": https://receiverhelp.trimble.com/alloy-gnss/en-us/NMEA-0183messages_GGA.html Fields 11 & 12:
Since I had no idea what this is, I searched for it and found this: https://gis.stackexchange.com/a/174116 |
Unfortunately, it doesn't help. |
Also, this doesn't work as well |
An updated code is: #include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal_I2C.h>
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
Serial.begin(9600);
ss.begin(GPSBaud);
lcd.init();
lcd.backlight();
lcd.clear();
}
void loop() {
while (ss.available() > 0) {
gps.encode(ss.read());
if (gps.location.isUpdated()) {
Serial.print("HDOP: ");
// Serial.println(gps.hdop.value());
Serial.println(gps.hdop.hdop()); //HDOP has a member hdop() - updated 23/07/2024
Serial.print("Satellites: ");
Serial.println(gps.satellites.value());
Serial.print("Altitude: ");
// Serial.println(gps.altitude.meters());
Serial.println(gps.altitude.value() / 100.0f); //updated 23/07/2024
lcd.setCursor(0, 0);
lcd.print("HDOP: ");
// lcd.print(gps.hdop.value());
lcd.print(gps.hdop.hdop()); //HDOP has a member hdop() - updated 23/07/2024
lcd.setCursor(0, 1);
lcd.print("Satellites: ");
lcd.print(gps.satellites.value());
lcd.setCursor(0, 2);
lcd.print("Altitude: ");
// lcd.print(gps.altitude.meters());
lcd.print(gps.altitude.value() / 100.0f); //updated 23/07/2024
}
}
} Input from GPS module: Output from Arduino: |
Can you wrap your code in 3 backticks (each on a separate line) so it is better readable? |
I have been using this library on my test instruments for years. number of sats Like NASA and startrek, altitude is in metres. What is the GPS model Great idea for the terminal. I will have to try that |
Hi,
I've got a problem with the library. For some reason, I get back too high HDOP (Horizontal Dilution of Precision), satellites number and altitude.
The input is: $GPGGA,110641.00,5126.37428,N,00003.02175,E,1,07,1.02,58.8,M,45.4,M,,*63
where:
07 – number of satellites being tracked
1.02 - Horizontal dilution of position
58.8,M - Altitude, in meters above the sea level
45.4,M - Height of geoid (mean sea level) above WGS84 ellipsoid
Outputs on Arduino serial are:
11:06:42 UTC 22/07/2024
Latitude = 51.439590N Longitude = 0.050383E
COG = 0.0
SOG = 1.86
MPH = 2.14
KMPH = 3.44
Altitude in meters = 0.00
Altitude in feet = 0.00
Number of satellites in use = 7
HDOP = 354
Any thoughts?
The text was updated successfully, but these errors were encountered: