Building a GPS Time Reference for NTP on pfSense

  Рет қаралды 29,935

Mark Furneaux

Mark Furneaux

8 жыл бұрын

I go over one way to use a u-blox NEO 7M as a PPS source for NTP. You can use this on pfSense or any other networked PC with the right software. The pfSense config is for some reason missing from the video, but all that is necessary is to select the "U-blox" GPS type and the correct baud rate in Services/NTP/Serial GPS.
This is what the stability looked like after: imgur.com/dbOTsic
I have a second channel:
/ @markfurneaux2659

Пікірлер: 58
@Retr0id
@Retr0id 8 жыл бұрын
I just wanted to say, this is a really great youtube channel. Keep it up!
@CharlieRasch
@CharlieRasch 7 жыл бұрын
I recommend getting a GPS module with a PPS (pulse per second) wired pin. Almost ublox chips have a PPS, you just need to get a pre-built module with one. Just make sure use pin one for the PPS timing. (Yes, you have to use the voltage stepper. I am using a Garmin GPS 18x lvc. With the 18x lvc I didn't need a voltage stepper due to it already set for 5V.
@titanronnie9590
@titanronnie9590 2 жыл бұрын
instablaster
@westraiser8702
@westraiser8702 3 жыл бұрын
Very interesting, watching you taking PFSense to that level of accuracy. You're blessed with creativity. Thanks alot!
@NavidGowani
@NavidGowani 8 жыл бұрын
Really informative video, Mark!
@tommajor2940
@tommajor2940 7 жыл бұрын
This brings back so many memories of working with RS232 and 449. You pretty much described synchronized data transmission. Very interesting but shielded twisted pair cable would have cut down on any cross over noise. Yeah I know it can be expensive. If you continue to do more work with RS232 I would suggest a break out box with jumpers to help troubleshoot without the need to rip everything apart. Oh and it would have really been interesting if you had shown both transmitted data and the pulse together on the scope so we could see them line up. Great Video...
@Darkipod
@Darkipod 8 жыл бұрын
Please do a video on USB, I would love it. I really enjoy they way you explain things.
@ams718
@ams718 3 жыл бұрын
USB has a high latency with an erratic slew offset, due to the unidirectional request/response signal transmission model. So it makes no sense to build your own time reference on it. You'd be better off using any NTP server out there for the same or better accuracy.
@user-pu6ow5il4g
@user-pu6ow5il4g 6 жыл бұрын
Hi Mark, just for your informatio, MAX3232 has two channels,by default one RS232_to_TTL adaptor only use one of them.You can actually wire PPS to another channel. MAX actually can handle power range from 3.3 to 5.5v, So you can directly use USB's power source. Inspired by your idea, I used one adaptor and cut one of serial port to to deliver USB 5V to ethernet cable, powered them up directly. Next step I will design a circuit board to attach them all together.
@chrislee6650
@chrislee6650 Жыл бұрын
I'm doing a similar project but don't think the MAX3232 should be powered using 5 volt, this is because the TTL logic on the GPS module is at 3.3 volt, if the MAX3232 is powered by 5 volt I think it will convert incoming from the RS232 to TTL of 5 volt, and I don't know if the GPS module pins are 5 volt tolerant. It will probably work but might risk damage in the longer term.
@MomirPeh
@MomirPeh 7 жыл бұрын
Nice video, Mark! I like it very much and it helped me a lot to understand how a GPS-locked time reference works exactly. Although, I was thinking about what you said about USB being a possible jitter "inducer" if it's used instead of a RS232. RS232 operates on a much lower speed and, thus, introducing latency as well. But that latency can be predictable since the speed is constant on RS232 and it's not a shared media. I would like to see the same graph measurement with a USB-RS232 adapter used instead of a direct RS232 connection. High-speed USB2.0 devices should be polled by the USB host every 125 microseconds and that is probably enough to keep the time reference and ntp time on the PC accurate within 1ms. At least, that's what I think... Thank you again! Keep up the good work, man! BTW, is that a Cacti generated graph? :)
@DanDrown
@DanDrown 7 жыл бұрын
Most USB/UART chipsets are Full Speed USB, which is polled every 1ms. The RS232 DCD interrupt is not clocked at the rate of the data on the serial port, so it can get the system time to better than +/- 1 microsecond (plus a static interrupt latency offset). It is possible to adjust for the USB polling latency (in the USB/UART chipset firmware), and you can get to around +/- 5 microseconds by doing that.
@jasonperry6046
@jasonperry6046 6 жыл бұрын
I was wondering if you still have your list of references you used to research this. I loved your video and I want to binge on this subject. When you reference location vs time gps are you referring to dual frequency gps? I now need to look into see if an Intel NUC has serial on it. You referenced there are better serial devices to use for this. What attributes should I be looking for, just a secondary data pin? Could you not build this ontop of a RPi, use it as the NTP server, and run DIY PoE out to the device?
@sivalley
@sivalley 7 жыл бұрын
In LOOONG retrospect, would it have been easier to use a long five conductor cable to feed power and pull signals from the GPS module, fitted it in a small box, and run wires back to your level shifter module near the PC? Using an old S-Video cable comes to mind as you have 4 conductors and a shield that can carry ground. ;)
@saftschinken2353
@saftschinken2353 4 жыл бұрын
So if I need the Data on my Arduino, can I connect the GPS thing directly to the Arduino? I want to make a GPS LED clock is this even possible with this kind of setup? (Arduino + this GPS Module)
@PaulJosephdeWerk
@PaulJosephdeWerk 7 жыл бұрын
Would have been nice to include a parts list and possibly links in your description. Even better would to also have a link to a schematic.
@lmamakos
@lmamakos 6 жыл бұрын
I'll bet that serial cable came with your UPS and is wired crazy to put various status info from the UPS on various RS-232 status signals. I think the choice of "Invert Pulse" or not is important, depending on which edge of the DCD transition the interrupt fires on. Otherwise, your 1PPS signal will be off the width of the pulse. Perhaps the 1PPS driver in FreeBSD can be configured to use either edge? Very nice work, I'd like to eventually do something like this with my pfSense box.. I did some work back in the FreeBSD 4.x days with a custom "time and frequency processor" board that had a disciplined oscillator (either by GPS or IRIG-B timecode). You could get the current time to 100ns resolution with a couple of PCI bus accesses (with the time latched on the first read cycle.) It also had the ability to generate an interrupt at a programmed time, and it made an interesting platform to measure interrupt service time latency. I think its improved quite a bit since the days of the 266MHz Pentium, but interrupt service time jitter was much worse when the ATA disk driver was busy.. This was part of some work to do precise one-way network latency measurements over an ISP backbone, and eventually led to getting the SO_TIMESTAMP code I wrote into FreeBSD (and later other OS platforms) and the corresponding code in NTP. Extreme NTP time synch stuff is a sickness, but so much fun!
@nicksmith4507
@nicksmith4507 Жыл бұрын
Yep I have been caught out by APC UPS cables in the past. May have a code number embossed into one of the plugs
@ikkuranus
@ikkuranus 8 жыл бұрын
My pfsense machine lacks serial. would one of those really expensive mini pcie cards do the trick or would that also suffer weird latency similar to usb? Another thing I noticed is those cards had a 4 pin molex cable for 5 or 12 volts. Is that actually needed for this project?
@ruhnet
@ruhnet 2 жыл бұрын
Except for the profanity this is a superb video. I enjoyed watching your journey to a good time source. Be careful though or you'll turn into a time nut and start comparing different GPS unit stability, then you'll end up getting your own cesium standard. 😆
@jordandeiss
@jordandeiss 5 жыл бұрын
You said that the resolution of this location gps (vs time gps) is good enough... How good is it? I’m trying to sync 2 or more computers accurate to +/- 1ms.
@thomasjones145
@thomasjones145 4 жыл бұрын
The time accuracy of the Neo-7 series of GPS' is 30-60ns. You should be fine. www.u-blox.com/sites/default/files/products/documents/NEO-7_DataSheet_%28UBX-13003830%29.pdf#page=6
@kreynolds1123
@kreynolds1123 3 жыл бұрын
unaware of how much voltage sag there is with intermittent power consumption but it would be simple to nearly eliminate with a small capacitor to ground at the end of the power wires.
@tylerwildman7119
@tylerwildman7119 8 жыл бұрын
dude you are crazy smart. how did you learn to do all of this?
@ig_foobar
@ig_foobar 7 жыл бұрын
This video has put me to sleep both times I tried to watch it. I think I need more coffee.
@ClintMaas
@ClintMaas 8 жыл бұрын
Could that of been a UPS serial cable? I know my old rackmount APC didn't works unless I had the "special" cable. This looks like a nice project and may have to give it a try. Is the maps section enabled only because it's a local?
@nathanparr7336
@nathanparr7336 8 жыл бұрын
+Clint Maas I think your probably right. I know at my work we have a few pieces of test equipment (oscilloscopes and such) that have a different pin-out than a standard serial cable.
@TheUbuntuGuy
@TheUbuntuGuy 8 жыл бұрын
+David Beem I use TTL serial all the time; it's inevitable in embedded systems. I haven't used full blown RS-232 since, I don't know, probably my Palm Pilot. I probably gave away most of my cables.
@ClintMaas
@ClintMaas 8 жыл бұрын
+David Beem I have a box of serials yet and know some of them are mystery pin outs. I'll probably never use them but the moment I get rid of them, I'll need one.
@forumtyish
@forumtyish 3 жыл бұрын
@@ClintMaas ​Yup. The first thing I thought when he flashed that molded end black serial cable was that it looked like an APC Item # 940-0024C or similar APC “Advanced/Smart Signaling Cable” which has a special pinout. Info on this pinout can be found online. Note that the APC item # should be included as a molded mark on the connector. In fact, if I pause this video on a few select frames I can somewhat make out what appears to be said item #! While I hate that equipment makers decide to use all sorts of different pinouts for things like this (think APC, Cisco…), I figured someone with this much experience/knowledge would know better than to just grab some random serial cable and assume it’s wired a certain way.
@Real_Tim_S
@Real_Tim_S 4 жыл бұрын
Might be interesting to do a revisit - timing-grade GNSS receivers (multi-constellation "GPS") are under $100 now... And, one can do a local 10MHz ovenized oscillator to generate the 1PPS tick - then use the GPS 1PPS to steer the local oscillator. Also would have been better (IMHO) to do some RS-485 conversion for the TX and 1PPS signals over Cat-5, using the remaining two pairs for power+ground.
@TheUbuntuGuy
@TheUbuntuGuy 8 жыл бұрын
This shows the stability change after the installation: imgur.com/dbOTsic
@troyBORG
@troyBORG 8 жыл бұрын
+Mark Furneaux Here is what mine shows (Using internet, not GPS): i.imgur.com/3ul7jn3.png
@MikeG-js1jt
@MikeG-js1jt 3 жыл бұрын
can you convert the uart to ethernet?.... and if so is Ethernet appropriate for timing NTP?
@DaHaiZhu
@DaHaiZhu 7 жыл бұрын
Sounds like a null modem serial cable.
@simonn6427
@simonn6427 7 жыл бұрын
Nice video!I am not entirely sure if the problem with the weird Serial cable was already addressed in a comment, but I believe the cable you've got there is an Null Modem Cable. en.m.wikipedia.org/wiki/Null_modemSincerely SN
@timlipinski2571
@timlipinski2571 8 жыл бұрын
What was the other more expensive GPS board you looked at ? Can you make a GPS that plugs into the RJ-45 Ethernet Lan Port ? And you do plug into the Lan and not the Wan Port ? Thank you for the video ! tjl
@TheUbuntuGuy
@TheUbuntuGuy 8 жыл бұрын
+Tim Lipinski There is no way to connect a GPS directly over a network. That makes no sense since that's what NTP is for...
@MikeG-js1jt
@MikeG-js1jt 7 жыл бұрын
would this setup render the result as an official stratum 1 server, or does the fact that you didn't use the "time GPS" module disqualify it for that?
@TheUbuntuGuy
@TheUbuntuGuy 7 жыл бұрын
IIRC you need to actually have a real atomic clock to qualify as a world wide recognised stratum 1. There's nothing that stops you from broadcasting as an S1 though.
@avamander.
@avamander. 4 жыл бұрын
It takes an atomic clock to be stratum 0 AFAIK, nothing stopping or incorrect from not having an atomic clock and being stratum 1 synced to GPS.
@sethbyas2452
@sethbyas2452 7 жыл бұрын
I have the Neo-6M and if I put 5 volts to vcc, the regulator gets hot
@ramonlrivera
@ramonlrivera 5 жыл бұрын
5v is on the top end of the operating range; you may only need to use 3.3v and as low as 2.5v IIRC.
@cryan584
@cryan584 7 жыл бұрын
could you not have just run the program with wine?
@theLuigiFan0007Productions
@theLuigiFan0007Productions 6 жыл бұрын
*That would be a valid solution, it just needs a hint of configuring.* *First you need to run:* _ln -s /dev/ttyS0 ~/.wine/dosdevices/com1_ *Then you need to add the following to ~/.wine/system.reg:* _[Hardware\\Devicemap\\Serialcomm] 1231984861_ _"Serial0"="COM1"_ *Add yourself to the dialout group, then log out and back in.* *The serial port should now work in Wine.*
@Darkipod
@Darkipod 8 жыл бұрын
And why is this time so important? Oh! and what camera do you use for recording?
@NickF1227
@NickF1227 8 жыл бұрын
For what reason do you need time this accurate vs using a time server on the Internet
@cbremer83
@cbremer83 8 жыл бұрын
+NickF1227 Been wondering the same thing since the NTP video in the PFSense series. It is cool in a pure geeky kind of way. Just not sure what real world application this has for a home user. Would love to know though.
@TheUbuntuGuy
@TheUbuntuGuy 8 жыл бұрын
+Chad Bremer I don't really think there is a reason. This was purely for fun.
@cbremer83
@cbremer83 8 жыл бұрын
Mark Furneaux Fun and messing about is always good!
@GellyNose
@GellyNose 8 жыл бұрын
Trunk encryption between two devices comes to mind. Where timing is an important factor in the encryption algorithm. Two devices properly timed using the same algorithm and keys would be very secure.
@fizk
@fizk 8 жыл бұрын
"NTP will shit the bed". Nice :P
@alanmolox2095
@alanmolox2095 3 жыл бұрын
If you put MercuroClear on that left index finger nail (right corner) before you go to bed at night it heals much faster.
@Minshownow
@Minshownow Жыл бұрын
맞네아들
@hygri
@hygri 4 жыл бұрын
Aah haha yes... lose pps and all DOES shit the bed. Good times...
@TomR459
@TomR459 8 жыл бұрын
take deeznutz :D
@Stoney_Eagle
@Stoney_Eagle 6 жыл бұрын
Why do you need a second accurate time on your router. Like what are you doing that you need that accuracy? It's a cool project but a time server should suffice right. Haha I wasnt allowed to have internet on my computer as a kid when the 56k was a big deal. So I ran a coaxial cable from the phone wall socket to my room and plugged it in my computer😂 gave my parents huge bills tho😅 But for the love of electronics please use a freaking RJ45 connector to hook it up! 🤦‍♂️
Nanosecond clock sync with a Raspberry Pi
13:56
Jeff Geerling
Рет қаралды 170 М.
Build a Stratum 1 Time Server Using a Raspberry Pi Pico
19:53
Gary Explains
Рет қаралды 19 М.
Clowns abuse children#Short #Officer Rabbit #angel
00:51
兔子警官
Рет қаралды 77 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 8 МЛН
Now THIS is entertainment! 🤣
00:59
America's Got Talent
Рет қаралды 40 МЛН
Using a GPS module as variable frequency reference standard
40:48
Sync your project with GPS 1PPS
4:33
0033mer
Рет қаралды 25 М.
How They Build US Most Powerful Tank Ever Made
17:40
FRAME
Рет қаралды 32 М.
Using GPS with PPS to synchronize clocks over the network
20:16
Linux Tech School
Рет қаралды 10 М.
The most accurate Raspberry Pi atomic clock IN THE WORLD!
11:20
Jeff Geerling
Рет қаралды 161 М.
Using NTP with pfSense to sync your device clocks
11:38
TechBytes with Ron Nutter
Рет қаралды 5 М.
Tour of My Home Network/Homelab
21:03
Mark Furneaux
Рет қаралды 80 М.
How To Silence a Supermicro 4U Server (or Really Any Server)
37:47
Mark Furneaux
Рет қаралды 45 М.
iPhone socket cleaning #Fixit
0:30
Tamar DB (mt)
Рет қаралды 16 МЛН
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 2,7 МЛН