LinuxQuestions.org Member Success StoriesJust spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Current setup is openSUSE 11.2, but should work on other versions as well. Using the 'stock' NTP and GPSD software, available through the repos, you're able to get a stratum-1 clock up and running, for under $100USD.
Get your GPS receiver. Don't get anything fancy...just needs to support NMEA data. Have seen USB connected units for $59USD, and I'm using a Bluetooth GPS receiver that I got for $89.
Connect it to your Linux system, somehow...this will depend on the type of device. A USB device will show up as a serial device, like /dev/ttyUSB0, etc. The Bluetooth device shows up after I bind it with rfcomm, as /dev/rfcomm2. Regardless, connect the thing.
Start the GPSD daemon. I use "gpsd -n -b /dev/rfcomm2", obviously replacing the device name with whatever device you've got. The man pages for GPSD tell you about the options, but the "-n" tells GPSD to poll the device, and 'activate' it. Otherwise, some devices will just sit there, waiting for software to TELL it to do something. The "-b" is for "bluetooth mode", setting it to read-only. Some devices don't like being written to...your mileage may vary.
The GPSD daemon contains a shared memory segment, specifically there to let NTPD talk to it. In your ntp.conf file, put lines similar to this:
The '127.127.28.0' is what you're interested in. The '.28' tells it to use the SHM segment of GPSD, the '.0', says use the first one (since you COULD have multiple GPS devices running...).
Fire up ntpd, usually with "/etc/init.d/ntp start". Check your system logs, and especially your NTP log. You MAY see something like this in your NTP log:
SHM shmget (unit 0): Permission denied
If you do, that just means that SELinux is blocking access to the SHM. In the case of openSUSE, run Yast, go into AppArmor, and set NTP to be "complain", rather than "enforce". Restart NTP.
How do you know if it's working? Run "ntpq -p", and you should see something like...
remote refid st t when poll reach delay offset jitter
*SHM(0) .GPS. 0 l 4 16 377 0.000 1.955 58.555
Remote server is the SHM, ID'ed as GPS. A negative offset means that the PC is faster than perfect; a positive offset means that the PC is lagging behind. The negative of this value would be reflected in ntpq -p after the ntpd samples the driver: ntpq's "offset" is described as "the difference between the server system time (which is the time distributed) and the NTP-time (the time steered to the external UTC-traceable clocks)." Reach for the GPS should always be 377: it is eight ones in binary, meaning the latest eight consecutive samples were successful. Let it settle down, and your offset should get better and better. You can see this by doing "ntptrace"...
See?? Stratum 1 clock (0 is highest...meaning atomic-clock type accuracy, 16 lowest/untrusted or inaccurate time source). Point everything else on your network to this one system, and enjoy your clock.
Hi, Your Post really helped me.
Looking for some urgent help, To build a NTP server I have installed Open Suse Linux and plugged in Garmin 18xLVc,5m GPS device with a Searial Cable.
After installed gpsd deamon 3.4 i have followed all required steps to work my gps but I am confused to see its result.
I have configured /etc/ntp.conf
server 127.127.28.0 minpoll 4
fudge 127.127.28.0 time1 0.535 refid NMEA
server 127.127.28.1 minpoll 4 prefer
fudge 127.127.28.1 refid PPS
Note, the offset, jitter is not showing any value? Please tell me where is the problem? Is my gps device is working? How i can understand? Any steps i missed or what?
Please help me its really urgent to get a solution, My project is stopped.
This is NOT URGENT for anyone here...we volunteer our time, so asking for 'urgent' priority help is fairly rude.
There are a few things that (if you read the initial post), are different. First, the NTP line in your is NMEA, when it should be GPS. Second, have you checked SElinux (as mentioned), to allow NTP to access that shared memory segment?
On a side note, if you're indoors, a GPS signal will be VERY weak, if you can get one at all. Where is your antenna? Have you tried running something like gpsmon, or even minicom on that tty port to see what kind of data you're getting?