arduino-libraries / Arduino_MKRGPS

MKRGPS Library for Arduino
GNU Lesser General Public License v2.1
8 stars 14 forks source link

serial poll() is always reading only 1 byte per call #35

Open ku3i opened 8 months ago

ku3i commented 8 months ago

https://github.com/arduino-libraries/Arduino_MKRGPS/blob/c736985026d5b72514faec561c912c2035b0b801/src/GPS.cpp#L195

The current version is "taking forever" to read a GPS location, if the user has a significant delay (e.g. 500ms) in the loop() method, since on each GPS.available() call only 1 byte is read.

proposed fix: replace the "if" with a "while" in line 195 (GPS.cpp)

Another tip: make the GPS_DEBUG flag available in the begin() method (2nd argument or so), to better track issues like this easily and without modifying the library.

AlexBimmerHead commented 7 months ago

Yes i have modified the library this way and work perfectly with a delay of 300ms on the loop which read GPS data.