Problem with delayed data from pl2303 usb serial gps
Problem:
I run car navigation software on linux, using a gps.
Getting data from the gps unit in a timely fashion is important, as the software says thing like "turn left in 50m". That is useless however, if the message arrives 10s after you passed the intersection!
The gps unit reports location once per second.
I frequently see delays of up to 13 seconds. I drive down a street and make a turn or stop. Then I look at map display, and count 13 updates before the map reflects what I did.
This is also a problem when mapping in real-time. I.e. someone drive the car over a bridge, and I record the bridge start and endpoints on the live gps tracklog. Needless to say, this approach doesn't work if the live tracklog lags behind reality by 13s. . .
I make sure the pc has a load well below 1, so this is not cpu starvation. This even happens with dual cores. I have observed the problem with two different
machines: a core2duo laptop in 64bit mode, and a via mini-itx in 32-bit mode.
I have also seen the problem with various software, a commercial navigation program reading directly from /dev/ttyUSB0, as well as the open programs josm and navit, both going via gpsd. gpsd is supposed to run with low latency.
The problem is an old one. It is in 2.6.24, and it existed a couple of years ago too. I have used two different gps units (my old one broke) of different manufacture. Both uses pl2303 though.
The delay is not constant. Everything may be ok when I start the software, and then the delay build up gradually over a few minutes.
Is there hope of fixing this, or is the pl2303 something to avoid?
Helge Hafting
Quoted 5 lines · Helge Hafting
Problem:
I run car navigation software on linux, using a gps.
Getting data from the gps unit in a timely fashion is important, as the software says thing like "turn left in 50m". That is useless however, if the message arrives 10s after you passed the intersection!
That sounds like a problem either in the device, or in the pl2303 chip, or possibly, your userspace program.
As a test, enable debugging in the pl2303 driver:
modprobe pl2303 debug=1
or enable it after it is loaded with:
echo 1 > /sys/module/pl2303/parameters/debug
and run your program. Look at the timestamps in the kernel log for when the pl2303 driver gets your data and compare it to when your userspace program is getting them.
Let me know if you find anything we can help out with.
thanks,
greg k-h