GPS.js: Invalid GGA/GSV length
Hello! I’m experiencing an issue: the gps library frequently throws errors that the GSV or sometimes the GGA message has incorrect length - log:
Invalid GSV length: $GPGSV,4,,,A*7A
or
Invalid GGA length: $GPGGA,223154.00,5025.333,E,223154.00,A,A*67
I’m 100% sure the data isn’t malformed or broken. I can enclose the gps.update(…) within try/catch to omit crash, but I’d like to have the code running without such problems. Maybe it’s due to the NMEA standard length difference (‘note’ there: http://www.trimble.com/oem_receiverhelp/v4.44/en/nmea-0183messages_gga.html)?
My exact code:
nmeaData.split(/\r?\n/).forEach(function(nmeaLine) {
try {
gps.update(nmeaLine);
} catch(e){
console.log("Caught GPS lib error: " + JSON.stringify(e));
}
}, this);
I’m running node v9.2.0, npm v5.5.1 and tried both gps v0.3 and v0.4.1
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 20 (9 by maintainers)
Commits related to this issue
- fix: nmea version 4.x에서만 residual 동작 (#9) — committed to ppsoln/GPS.js by ho-1 2 years ago
@anking In my case, to blame was the faulty input data. Long story short, the problem turned out to be completely uncorrelated with GPS.js. If you are having a similar problem, what I would suggest based on this experience, would be to triple-check your input data manually, by reading and checking if it looks fine so as to ensure that the problem is not your data source.