Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I work in a lab doing non-NTP/GPS work, yet, nevertheless, my boss was like "Hey kid, why don't you hook this GPS device up to a computer around here and setup an NTP server. It would be nice to have our own NTP server," at which point I was like "What's NTP?" --- that was about a week and a half ago.
Where I'm at now: I've obtained the latest LinuxPPS Git repository, configured the kernel appropriately (AFAIK), compiled, etc. as the install guide suggests. No errors or anything catastrophic has occurred.
At this point the LinuxPPS install guide says one can test to see if the PPS signal is there and the devices are configured correctly. This is where my understanding starts to really fall apart and I am unable to find further helpful information.
My problem: Whether or not I have my 1PPS device connected to the serial port, or, to put it another way, if I DO NOT have the serial port connected, and I run the suggested "./ppstest /dev/pps0" command I get a fully-functional response that tells me a 1PPS source has been found, and everything checks out. This is rather confusing and clearly causes problems for determining whether the 1PPS information is from my GPS device or not once I DO connect it. I do not know what is causing this "ghost 1PPS signal" and I'm really not sure where to go from here.
Thanks in advance for any advice and pointers, and my apologies if I've
forgotten to include some crucial system information. Let me know and I'll try and respond with any necessary bits.
Cheers,
-Kevin
P.S. A lot of the web pages I've found and information out there is semi-dated (~2-5 years old), so if I am, by chance, completely out of the loop on a more up-to-date way to get this working, please let me know. Give that all of the question/answer threads seem to stop around 2007 makes me think -something- must have come about to make life easy around then...
I use GPS in my work a lot,but I never had to setup NTP server or connect GPS to PC,but I'll try to help anyway.
First,it would be helpful to know what is your distro and what type of GPS you have there. Also,how many computers will use your new NTP server as their NTP server? Will this be on LAN or over the internet? Wire or wireless?
Will you post the output of these commands:
Code:
find /sys/class/pps/
Code:
ls -l /dev/pps*
Code:
ppstest /dev/pps0
Also use ppsfind command to locate the source (GPS).
They say;
Quote:
The GPS will only accept data input from one device at a time, but it can output data to no more than three devices simultaneously.
Example with DGPS (let's just say a better GPS);
Quote:
Since the DGPS and PC both need to utilize two-way communication with the GPS, it is necessary to wire the GPS to only output data to the PC or install a SPDT (Single Throw, Double Pole) switch. This will allow you to alternate the input to the GPS between the PC and DGPS data outputs. This will allow you to still upload data to the GPS from the PC, but will disable the DGPS during data transfer. Once switched back to data input from the DGPS, the GPS will resume receiving DGPS corrections and only output data to the PC.
The easiest way to check if things are working is to compare the time from the GPS with the time on the PC. If things are hooked up OK,they will be the same.
Sometimes the obvious is forgotten; have you configured your distro to use GPS as NTP server?
Hi, and thanks for your willingness to help me out! Now, onto your questions:
Quote:
Originally Posted by alan_ri
First,it would be helpful to know what is your distro and what type of GPS you have there. Also,how many computers will use your new NTP server as their NTP server? Will this be on LAN or over the internet? Wire or wireless?
I'm using Scientific Linux and with the latest LinuxPPS git repository I have "uname -r: 2.6.28-rc6-20450-gace6faa". I am not 100% sure about the number of computers that will use this NTP server, but I'd guess order of magnitude 10. The connections to other computers will be via wired LAN (but access to the internet is available). I'm using a 1PPS output from a Symmetricom XL-DC (Formerly TrueTime XL-DC): http://www.symmetricom.com/media/fil...-dc-manual.pdf (page 19 has the 1PPS info).
(I realize now (mentioned below) that this "ghost source" is probably the ktimer source...).
Quote:
Originally Posted by alan_ri
Also use ppsfind command to locate the source (GPS).
In writing my response to your questions I realized that ktimer is enabled and a dummy pps signal (I think?), which solves my "ghost 1pps" problem. However, I don't know the names of other gps sources, i.e. are there standard source names one uses with ppsfind?:
Code:
# ./ppsfind ktimer
pps0: name=ktimer path=
Quote:
Originally Posted by alan_ri
The easiest way to check if things are working is to compare the time from the GPS with the time on the PC. If things are hooked up OK,they will be the same.
That makes sense, but from what little I read and from what I have setup, I imagined using a standard NTP server (over internet) for universal time and then the local GPS 1PPS for stability/precision. Is that... Dumb? Or a wrong way of thinking about things? At this point, all my GPS device is doing is sending 1PPS, I don't get any NMEA data or the like out of it, so, as far as I know, I can't get a "time".
Quote:
Originally Posted by alan_ri
Sometimes the obvious is forgotten; have you configured your distro to use GPS as NTP server?
Again, pardon my naivety here, but in reading the LinuxPPS wiki it seems like everything in the installation guide is pre-NTP configuration. In other words, should I not be able to get a PPS signal functioning and discovered by ppstest before I even worry about configuring NTP?
The short answer to your question is "I'm not sure". I've read about what lines to add to the ntp.conf file (with only moderate confusion) but in fear of putting the carriage in front of the horse I put off diving into ntp/ntpd configuration until I got the LinuxPPS side functioning. Perhaps this is a big mistake? Also, there are multiple mentions on various sites/guides to necessary patching of NTP code, but links to said patch seem to be dead... So I'm avoiding running into the brick wall by pretending I don't have to configure NTP quite yet :D
Thank you again for your efforts! Much appreciated!
I've never played with setting up a NTP server yet but it is possible to use the 1PPS without a GPS source. However, IMO why not setup a complete stand alone system. Your receiver does not output NMEA messages but it seems to be compatible with TrueTime MKII output. Another option if your unit has the capability is using IRIG-B.
I've never played with setting up a NTP server yet but it is possible to use the 1PPS without a GPS source. However, IMO why not setup a complete stand alone system. Your receiver does not output NMEA messages but it seems to be compatible with TrueTime MKII output. Another option if your unit has the capability is using IRIG-B.
Thanks for the suggestions. I haven't looked into MKII, but if it requires the RS-232 port then I can't do it as that is being used by another system right now. The IRIG-B option seems possible, and I may look into it if this pursuit becomes overly complicated. I've already soldered up a 1PPS connection and put some effort into this approach, so I want to see if I can make it work
Just to keep you informed: I looked at my kernel config and found that PPS_CLIENT_TIMER was enabled. I disabled it and recompiled and my ghost source disappeared, as did /dev/pps0, and the directory structure in /sys/class/pps/ is now gone.
The suggested ldattach command does not seem to bring a pps device into play, nor do the udev config file options. For what it's worth I also have the following message in my /var/log/messages, which seems ominous:
Are you using a level converter to change TTL to RS-232?
I connected the GPS 1PPS BNC output to a serial DB9 connector (signal to pin#1, ground to pin#5 if I recall correctly), across a 50ohm resistor (as suggested per the manual). I checked the signal with an oscilloscope and it was about 3.1V at the serial connector, which I connected to the computer... Was that an epic fail maneuver?
Maybe not an epic failure....
RS-232 signals levels are +/- 3-15 vs 0-5 VDC for TTL. Zero volts is not a valid logic level for RS-232.
So you are going to need a level converter.
I'm sorry that I don't have enough time now to write all that I wanted,because I've been searching and reading about the topic and found some really interesting things. Many things are just as I thought.
Please go here and read the guide very carefully. It should get you up and running anyway that you want.
Maybe not an epic failure....
RS-232 signals levels are +/- 3-15 vs 0-5 VDC for TTL. Zero volts is not a valid logic level for RS-232.
So you are going to need a level converter.
I just re-read the RS-232 wiki and I see what you mean. However, I am a bit perplexed because, as the page Alan_ri links to above, it looks like the 1PPS signal is connected to ground across some minimal resistance and that's it. See: http://time.qnan.org/gps18lvc/wiring/0800x0600.png from this guide: http://time.qnan.org/ . This guide is for a Garmin GPS Device, which is not the device I'm using, but the tech spec sheet says "transmit voltage levels that swing from ground to the positive supply voltage level."... Which I read as "0V to 5V," which in light of the RS-232 standards, does not make any sense.
Similarly, this separate guide has a wiring diagram, that, as far as I can tell (I'm not experienced with this at all, so that isn't saying much) sends a 0V-5V voltage directing into the serial port: http://www.satsignal.eu/ntp/FreeBSD-GPS-PPS.htm
Sorry to overwhelm with links here, but I thought I'd google up 'linuxpps required voltage levels' before sending off this reply, and from the quick few threads I've found it seems that the 0V-5V levels into a serial port are OK, which would be good (I don't need to worry about level conversion) and bad (if it's not my voltage levels, what's the problem?). See, for example: http://www.frameip.com/nntp/comp-pro...ux-status.html
I'm sorry that I don't have enough time now to write all that I wanted,because I've been searching and reading about the topic and found some really interesting things. Many things are just as I thought.
Please go here and read the guide very carefully. It should get you up and running anyway that you want.
Thanks for the link. I have read both of those pages many times already hehe... Which I guess is sort of a sad testament to my inability to get things working >
My situation is similar, though as mentioned above I'm not using NMEA data and I'm not using the Garmin device. However, I have a verified 1PPS signal connected to my serial port (verified by oscilloscope, not software...), which allows me to skip a lot of those guides. I'm basically at the software point where all I'm trying to do now, before worrying about NTPd configuration, is verify the input of my 1PPS signal. UHG!
So, not to reiterate myself too much here, but it is not clear to me whether I need to do a variety of NTPd configuration steps first. The LinuxPPS "ppstest" program seems to be a pre-NTP step, but if I am mistaken in thinking that then perhaps there are some necessary NTPd configuration options I have not taken care of yet. Any advice in this regard?
And, for the sake of other people reading up on this topic, or to spare you kind repliers of my thread the hassle of googling around, here's a list of pages I've enjoyed or found useful so far:
According to Einstein's definition of insanity, namely doing something over and over again and expecting different results, I am insane. However, I did get different results. Embarrassingly enough, I'm not quite sure why things appear to be behaving differently. Anyway, here's the status update:
Recompiled the kernel with the 8250 serial support as a module as opposed to being built in (for the sole purpose of being able to follow the LinuxPPS wiki -exactly-, i.e. to be able to issue "modprob 8250"... I know, desperate measures...) and proceeded as suggested. After initial boot, found no /dev/ttyS* devices, and no /dev/pps* devices. modprob'ed 8250, which produced the /dev/ttyS[0-3] devices. Still no sign of /dev/pps* devices, however. Issued "ldattach 18 /dev/ttyS0" and still did not find any pps devices. However, I did an ls again about 30 seconds later and /dev/pps and /dev/pps0 were present. Take-home point? It takes a few seconds to generate pps devices, I guess... Ran "ppstest /dev/pps0" and!...
Success!? Out of curiosity I ran "ppstest /dev/pps" and the exact same output was produced, with the sequence (number of seconds active) picking up where /dev/pps0 left off.
So, for those of you enthralled by my saga, there are two subtleties I'm now pursuing: You'll notice in my ppstest results that each line ends with a repeat of "sequence: xxx", where xxx is the current sequence. However, on the LinuxPPS wiki the sequence is listed once, and then at the end of each line it always has "sequence: 0" -- big deal?
Second, is there an obvious explanation for why two pps devices are created (/dev/pps, /dev/pps0) and why they both apparently carry the same signal (ppstest treats them identically)?
Thank you all for the support and motivation to keep my head up in exploring this topic I know nothing about :D (but now know a little!).
I will begin the NTPd configuration now, which judging from all the "how to configure ntpd" articles I'm guessing will be a saga of its own...
So, for those of you enthralled by my saga, there are two subtleties I'm now pursuing: You'll notice in my ppstest results that each line ends with a repeat of "sequence: xxx", where xxx is the current sequence. However, on the LinuxPPS wiki the sequence is listed once, and then at the end of each line it always has "sequence: 0" -- big deal?
Second, is there an obvious explanation for why two pps devices are created (/dev/pps, /dev/pps0) and why they both apparently carry the same signal (ppstest treats them identically)?
Here's what I've found;
Quote:
The "doubled"-"repeated" sequence numbers are related to the fact that each change of the pulse status prints the last assert and clear, if you check carefully your ppstest log you will see the timestamp reported twice both for the assert and the clear:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.