1
\$\begingroup\$

I have LS20031 GPS module (I believe with MT3339 chip) connected to Arduino. Using SoftwareSerial reading data when available(). 57600 is the baudrate for GPS. However, I rarely get checksum at all. Here is sample output.

$GPGGA,211152.400,4011.3996,N,04431.9971,E,1,3,5.75,135.5,M,14.37,,$GPGGA,211152.600,4011.3996,N,04431.9970,E,1,3,5.75,135.5,M,14.$67
2$GPGGA,211152.800,4011.3996,N,04431.9969,E,1,3,5.75,135.5,M,14.9802$GPGGA,211153.000,4011.3996,N,04431.9968,E,1,3,5.75,135.5,M,14.9000N$GPGGA,211153.200,4011.3997,N,04431.9967,E,1,3,5.75,135.5,M,14.,70M$GPGGA,211153.400,4011.3997,N,04431.9965,E,1,3,5.75,135.5,M,14.41,$GPGGA,211153.600,4011.3997,N,04431.9964,E,1,3,5.75,135.5,M,14.9602N$GPGGA,211153.800,4011.3998,N,04431.9963,E,1,3,5.75,135.5,M,14.950$,$GPGGA,211154.000,4011.3999,N,04431.9962,E,1,3,5.75,135.5,M,14.40.K$GPGGA,211154.200,4011.3999,N,04431.9961,E,1,3,5.75,135.5,M,14.L7,8$GPGGA,211154.400,4011.4000,N,04431.9959,E,1,3,5.75,135.5,M,14.4.8,$GPGGA,211154.600,4011.4000,N,04431.9958,E,1,3,5.75,135.5,M,14.960M,$GPGGA,211154.800,4011.4001,N,04431.9957,E,1,3,5.75,135.5,M,14.,,,3$GPGGA,211155.000,4011.4001,N,04431.9956,E,1,3,5.75,135.5,M,14.4784$GPGGA,211155.200,4011.4002,N,04431.9955,E,1,3,5.75,135.5,M,14.4.,$GPGGA,211155.400,4011.4002,N,04431.9955,E,1,3,5.75,135.5,M,14.4,$9$GPGGA,211155.600,4011.4002,N,04431.9954,E,1,3,5.75,135.5,M,14.4,7.$GPGGA,211155.800,4011.4003,N,04431.9953,E,1,3,5.75,135.5,M,14.1$P2$GPGGA,211156.000,4011.4003,N,04431.9953,E,1,3,5.75,135.5,M,14.,007,.$GPGGA,211156.078,4011.4003,N,04431.9953,E,1,3,5.75,135.5,M,14.2.,GAG$GPGGA,211156.400,4011.4004,N,04431.9953,E,1,3,5.75,135.5,M,14.,7,2$GPGGA,211156.600,4011.4005,N,04431.9952,E,1,3,5.75,135.5,M,14.962.K$GPGGA,211156.800,4011.4005,N,04431.9952,E,1,3,5.75,135.5,M,14.9*0N4$GPGGA,211157.000,4011.4005,N,04431.9952,E,1,3,5.75,135.5,M,14.9G22$GPGGA,211157.200,4011.4005,N,04431.9953,E,1,3,5.75,135.5,M,14.P*
2$GPGGA,211157.400,4011.4005,N,04431.9953,E,1,3,5.75,135.5,M,14.G7,.$GPGGA,211157.600,4011.4006,N,04431.9953,E,1,3,5.75,135.5,M,14.9S,N$GPGGA,211157.800,4011.4006,N,04431.9952,E,1,3,5.75,135.5,M,14.,.N$GPGGA,211158.000,4011.4006,N,04431.9952,E,1,3,5.75,135.6,M,14.,7,2$GPGGA,211158.200,4011.4006,N,04431.9952,E,1,3,5.75,135.6,M,14.,.

GPS module is blinking red which means it has enough satellites. Also I can see 3 satellites are found in the messages and fix. This module is brand new and less likely it can be buggy.

I also tried TinyGPS library, particularly examples. There is a strange thing. If I just run the program, it will give me no data and checksum errors slowly increasing.

enter image description here

If I leave the program for a while, it will occasionally produce data (sentence).

enter image description here

I have tried to change RX pin as well as Arduino itself, to exclude error there.

Update:

Here is some data, when I take the module inside of house, so it will be out of satellite coverage:

enter image description here

How to find the where is the problem? What additional information I can provide?

\$\endgroup\$
  • \$\begingroup\$ Can you explain the fact that successive messages seem to be run together without line breaks? It appears you may be losing the end of each line. \$\endgroup\$ – gbarry Nov 1 '12 at 22:47
  • \$\begingroup\$ @gbarry, not really. But I can give more information in that way. Please check my update. It looks like when the data stream is less intensive, less data is lost. Is there buffer size for serial data which can be configured? \$\endgroup\$ – Pablo Nov 1 '12 at 22:58
  • \$\begingroup\$ I tried to configure GPS baudrate to 9600 and no errors at all! Now I am more sure this has something to do with serial buffers... \$\endgroup\$ – Pablo Nov 1 '12 at 23:27
  • \$\begingroup\$ There's not buffering, but as you're using a software UART you might be missing bits. Bad wiring might also lead to missing bits. \$\endgroup\$ – Trygve Laugstøl Nov 2 '12 at 7:30
0
\$\begingroup\$

Probably you are not handling the incoming bytes quickly enough and you are experiencing serial buffer overflow. Can you write a basic sketch that makes no attempt to do any other processing other than echoing the received bytes to the hardware Serial port? Do you get different behavior if you use the hardware Serial port to receive the data rather than SoftSerial?

\$\endgroup\$
  • \$\begingroup\$ my sketch loop is only echoing received data from gps. I will try hardware serial as well. It looks like I can't go further than 9600 with gps, even when PC serial baudrate is set to 115200. \$\endgroup\$ – Pablo Nov 2 '12 at 8:44
  • \$\begingroup\$ The GPS probably operates at a predefined baud rate, right? whether you are buffering in your sketch or not, the SoftSerial library is either buffering through an interrupt or needs to be serviced often enough that bits are reliably sampled \$\endgroup\$ – vicatcu Nov 2 '12 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.