[ntp:questions] need help installing gps with ntp on Linux

Ron Frazier (NTP) timekeepingntplist at c3energy.com
Sat Feb 11 21:09:03 UTC 2012

On 02/11/2012 06:09 AM, Uwe Klein wrote:
> Ron Frazier (NTP) wrote:
>> Hi all,
>> I have recently been posting messages about my experience trying to 
>> install a USB GPS and wring out the maximum performance in Windows.
>> Now I need help doing the same thing in Linux. I want to install the 
>> GPS using only NTPD if possible, without GPSD, to make my install 
>> configuration as close as possible to the way it's set up in Windows. 
>> Please let me know if I'm on track or not and why my GPS is not 
>> working, if possible.
>> I'm running Ubuntu 11.04 and had already installed NTP version 
>> from the Ubuntu Natty repositories. That runs fine, 
>> polling from the internet.
>> I plugged in the USB GPS and it appeared as /dev/ttyUSB0. I used the 
>> following configuration line to set up the port:
>> From: http://www.satsignal.eu/ntp/Sure-GPS.htm
>> I used: stty -F /dev/ttyUSB0 57600 igncr clocal -echo -ixon
>> Then, I used the following command to set up a symlink to the port:
>> ln -T /dev/ttyUSB0 /dev/gps1 (Actually, I tried gps5 first.)
>> Then, I did cat /dev/gps1 and got the following:
>> ron at asus-k52f-1:/etc$ cat /dev/gps1
>> $GPZDA,011724.000,11,02,2012,,*54
>> $GPZDA,011725.000,11,02,2012,,*55
>> $GPZDA,011726.000,11,02,2012,,*56
>> $GPZDA,011727.000,11,02,2012,,*57
>> $GPZDA,011728.000,11,02,2012,,*58
>> $GPZDA,011729.000,11,02,2012,,*59
>> $GPZDA,011730.000,11,02,2012,,*51
>> $GPZDA,011731.000,11,02,2012,,*50
>> So, I know the port is working and I know the GPS is putting out data.
>> Before editing the ntp.conf file, I stopped the service using:
>> sudo /etc/init.d/ntp stop
>> These are the GPS lines in /etc/ntp.conf:
>> server prefer minpoll 3 maxpoll 3 mode 72
>> fudge time2 0.3000 refid GPS1
> last year I played around with the Sure Board.
> see http://wiki.tcl.tk/28358
> for me the mode keyword did not work the way it was supposed.( 
> baudrate wise )
> check what the baudrate is after ntp has started.
> Look in the log : /var/log/messages or /var/log/ntp/* for errors.
> I am running on SuSE, log destination tend to vary over distributions.
> uwe

Hi Uwe,

Thanks for the note. I've spent most of the day troubleshooting this. 
Your suggestion to check the error logs helped me find a solution. I 
found an error by apparmor in the syslog. I'll post the complete 
procedure to get it working once I've had a chance to write it up. 
Basically, though, I had to edit the apparmor tunable profile for ntpd 
to allow ntpd to access /dev/gps1 or /dev/gps5, then restart apparmor, 
then restart ntpd. Once I did that, the dominos started falling into 
place. I'm now on my way to having a functional system.



(PS - If you email me and don't get a quick response, don't be concerned.
I get about 300 emails per day from alternate energy mailing lists and
such.  I don't always see new messages very quickly.  If you need a
reply and have not heard from me in 1 - 2 weeks, send your message again.)

Ron Frazier
timekeepingdude AT c3energy.com

More information about the questions mailing list