-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Found two issues and wanted to share the findings:
- I know the NMEA spec specifies 82 character max, however when using a high-accuracy GPS which needs a lot more digits to represent the precision, you go beyond the limit. I'd suggest making the buffer size configurable beyond 77. (100 works just fine for me).
- I was getting A LOT of parsing errors. I couldn't reproduce in a console app, making me suspect the buffer. I found the following approach to run way more stable:
in setup() set timeout pretty low:
Serial.setTimeout(10);In the loop reach in chunks:
char buf[1024];
int readCount;
void loop()
{
if (Serial1.available()) {
while((readCount = Serial.readBytes(buf, 1024)) > 0)
{
for(int i=0;i<readCount;i++)
parser << buf[i];
}
}With these two changes, all my parser errors went away.
You might want to update the doc to suggest the read approach. Might only be an issue on slow arduino's?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels