GNSS-backed RPi CM4 Timeserver - Page 1
Forum section: electronics / projects

author: space55
author_rank: Newbie
timestamp: November 11, 2024, 03:13:24 am
content: Hi, allI'm new to the forum here but have been lurking for a little while. I figured I'd share my latestobsessionproject. Loosely, I'm trying to build a grandmaster clock, backed by a GPS chip, running chrony on a Raspberry Pi CM4. These servers are expensive in the wild, so I figured I'd do it myself for twice the price and a thousand times the effort.My current parts list for verifying the core idea here is as such:- Trimble Thunderbolt for getting a relatively good understanding of how GPSDOs work, how they're interfaced, etc. (note: this Thunderbolt is _not_ having a good time, he's stuck behind a metallized window in an apartment building)- A few Raspberry Pi's with GPS HATs, running Chrony (they work like a charm)- Some various servers that I can run clients and tests on- A set of boards being manufactured right now that have some NEO-M9N chips on them, with CM4 sockets, power, ethernet, etc., all on a Mini-ITX footprint (note: these boards are definitely using the wrong chip, I'm going to switch to an F9T at some point)I'm a software guy with tons of DevOps experience, so I have zero fears about everything OS-level upwards. I'm relatively new to PCB design (only designed a half dozen or so boards thus far), and very afraid of the prices of some of these parts, such as the nearly $300 RCB-F9T I want to use longer term.Some questions for the community:1. This is a personal project, as therefore has no real deadline or value, but am I doing something that I _should_ just be purchasing instead? I've seen Open TimeCards, TimeBeat parts, etc., but I kinda wanted to do it myself for fun. Still - is this a silly endeavor?2. Are there gotchas I should be worried about, especially with regards to the PPS output of the GPS chip feeding into the CM4? I've learned it is sort of possible to run PTP & hardware timestamping on the CM4, but it's dependent on reading documentation (my favorite...)3. For the RCB-F9T board specifically, is there somewhere I can get a footprint? I'm really hesitant to make one myself, as I don't want to be off by 1mm on the connector and have to have a new set of boards made4. What other features should this "server" have? Anything you wish you had in a homelab?If this project doesn't get dropped by me in two months, I may do a larger run of boards for anyone that wants one, but that's going to be a future endeavor. I have only barely lost my sanity so far! There's more left to lose!Thanks, all

author: myeevblog
author_rank: Newbie
timestamp: November 17, 2024, 12:00:23 am
content: Hi,I usually lurk on here as well, but this post is right up my alley.I maintain the Time Card and design a lot of the designs contributed by OCP TAP, our github is here:https://github.com/opencomputeproject/Time-Appliance-Project.The designs you mentioned are almost all lifted from our designs, including the CM4 designs. We have the open source versions listed on our website, which are the originals, not the rebranded ones.1. CM4 sandwich with OCXO / GPS ->https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Incubation/Hardware/Time4CM4_Sandwich2. Time Card itself ->https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Time-Card3. RCB-F9T, M.2 of F9T also available ->https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Time-Card/GNSS/UBlox/RCB-F9T4. RCB Neo-M9N, M.2 of Neo-M9N also available ->https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Time-Card/GNSS/UBlox/NEO-M9N5. OCXO daughter card for Time Card ->https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Time-Card/OSC/OCXO%20DaughtercardWe also designed multiple NICs that can consume 1PPS or even host GNSS modules, with different interfaces and for different kinds of hosts.1. Timehat with I225 that can sit on RPI5 with PCIe and has a M.2 slot for GNSS ->https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Incubation/Hardware/TimeHAT2. USB to ethernet with ASIX chipset, supports PTP and 1PPS input or output ->https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Incubation/Hardware/TimeStick3. TimeNIC, a PCIe I225 NIC with SMA for PPS input and output exposed to PCIe front panel ->https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Incubation/Hardware/TimeNICA question about your goal, chrony (NTP) will degrade performance anyways, so ZED-F9T will be overkill unless you use PTP. Are you looking for PTP? Or just an NTP server?Also, are you looking for holdover (i.e. you lost GPS)? Or just something that works when GPS is present? Are you interested in a GPSDO for frequency as well? Or just for timing?More than happy to help with timing problems, it's a very fun field to design in!

author: space55
author_rank: Newbie
timestamp: November 17, 2024, 03:37:42 am
content: Wow! I'm flattered to have you in this thread!Let me reply last-to-first. My primary goal by the end of this project is two-fold:1. A good GNSS-backed NTP server (though having PTP support would be awesome, it is not a requirement)2. Learning how all of this stuff worksBy those standards, it makes sense how chrony could get in my way. Ultimately, I'm doing this with Linux, and so I can imagine that due to OS-level timing inconsistencies and jitter, I would never be able to get *too* precise. I could probably write some custom firmware for a microcontroller that would do better, but that's well beyond the scope of what I want to do right now. For this project, maintaining a platform that I know and understand has a lot of benefits, which more than outweigh any potential precision I could gain by going a more PTP-focused route.For holdover, I'm not particularly worried beyond if the antenna gets bumped. I specifically want to exclude mobile applications from my goals. The server is going in a rack and it's staying there, for all intents and purposes. In terms of personal interest, having a GPSDO for frequency is awesome, but I don't expect that the chips I'm working with for this board would be able to give me the 10MHz output stability (I'm told "phase noise" is the phrase to use) one would come to expect from even a $200 GPSDO. I'm happy to be wrong, though.I definitely took some heavy inspiration from the Open Time Card. I actually looked through some of the designs in GitHub, especially for the RCB-F9T, but I don't have Altium, so I wasn't able to go too far. The idea of modularity, and using a standard design for the ublox chip, is something I'd like to target, and so I'm likely going to redesign the board I'm having built (it's still being manufactured) using one of those modules. Means I don't have to learn much RF engineering.It is reassuring to hear that the ZED-F9T is overkill, as it means I get to keep the cost down. I'll take a look at the NEO-M9N variant, it should be a pretty easy replacement for my current design.When I get the boards, I'll post some images and details as to how well it is (or isn't) working.Again, I really appreciate your post!

author: myeevblog
author_rank: Newbie
timestamp: November 19, 2024, 01:46:54 am
content: I found a good tutorial on making a GPS backed NTP server from a Raspberry Pi. Apparently, you can configure pins on the Raspberry Pi as PPS inputs and use that.https://blog.networkprofile.org/gps-backed-local-ntp-server/Using that combined with different Sparkfun or other vendor's GPS breakout boards, you could probably make the entire solution. It would have wires and separate boards, but you could at least experiment and see how the whole setup works.Custom boards are fun of course, a dedicated HAT is of course possible too, and wouldn't take too much effort to make either, but also then you're locked in to whatever GPS footprint you put on the HAT. You also have to make sure to have impedance matching and DC bias on the antenna port to power GPS antennas, and some other kind of house keeping things we did on the RCB designs.What do you think?

author: space55
author_rank: Newbie
timestamp: November 19, 2024, 04:03:15 am
content: I actually have two proof-of-concepts running with different GPS boards (one via a small breakout board and associated header wires, one via a Waveshare GPS HAT) that fit the bill perfectly. The thing I'm trying to do is build it all into one main board that you can just plug a CM4 into, rather than slip a HAT on top of. I really like the rackmount form factor as well, and so am trying to chase that as best I can. The RCB design's impedance matching and DC bias is one of the reasons I'm interested in the RCB boards specifically.Definitely agree, though, that doing small PoCs and stuff is a good way to test this all out. It's how I've confirmed the software works so far, but there's a difference between the CM4 and the Pi 4B that allows hardware timestamping on the CM4 only. Hence the super simple board that is a jumping-off point towards something more complicated.Is there somewhere I can buy an RCB-format board with a NEO-M9N chip on it, rather than the $250 ZED-F9T board from ublox?

author: myeevblog
author_rank: Newbie
timestamp: November 20, 2024, 03:19:40 am
content: For the RCB Neo-M9N, the design is on the github. Makerfabs makes it and includes it in the Time Card when you buy it from them,https://www.makerfabs.com/ocp-tap-time-card.html. I'm asking them about listing the RCB separately, but no guarantees at this point, I'll post back anything I hear back on that part.Good to know you want to base around CM4. That's also a group of designs Mike Lambeta made for our repo:https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Incubation/Hardware/Time4CM4_Sandwichhttps://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Incubation/Hardware/Time4CM4https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Incubation/Hardware/Time4Pi_CarrierIt's designed as a sandwich interposer board, that sits between the CM4 and say the CM4 IO board, and allows you to add OCXO to it, or to add GPS modules as well.And this design, which looks like a HAT for raspberry pi supporting lots of GPS form factors. I forget exactly:https://github.com/opencomputeproject/Time-Appliance-Project/tree/master/Incubation/Hardware/TimePi_HWAlso worth noting, the BeagleY-AI board, using the TI AM67A part, supports PTP as well, and PTM (PTP over PCIe basically). It's a newer board and may need more bring-up but it's a fun board I've been watching and playing with.

author: Solder_Junkie
author_rank: Frequent Contributor
timestamp: November 20, 2024, 03:52:19 pm
content: Several of us around this forum have built GPS disciplined oscillators, they are reasonably straightforward and can work well with a cheap ($10) Chinese clone GPS board fitted with a fake 6M (navigation) module and a $5 Chinese 10 MHz oven oscillator. Both these are available from several eBay sources.While easier projects than a precision time server, a GPSDO has a lot in common with one…By using a genuine Ublox M8T board and an outdoor “mushroom” antenna, you should be able to obtain the stability of the 1pps shown in the Ublox datasheet. If you check the various data sheets, you can pick a suitable timing accuracy/cost point. Given that you might not want better than a few mS accuracy, it doesn’t make sense to spend upwards of $80 (typical M8T board assembly) to get 20 nS accurate 1 pps.Details of my build of a Lars/Murray GPSDO are here:https://www.qsl.net/g4aon/gpsdo/SJ

author: space55
author_rank: Newbie
timestamp: November 21, 2024, 02:27:43 am
content: I'll probably pull the RCB NEO-M9N board and have it assembled. Should I throw them up on Tindie or something?The BeagleY-AI board looks interesting if it can do PTM/PTP. Looks like I have another project lined up after this one!For building a GPSDO, if it's that easy... maybe I should try building one into this. There's more than enough space on the board I had manufactured. It's finally being shipped, woo!Much appreciated, both!

author: Solder_Junkie
author_rank: Frequent Contributor
timestamp: November 21, 2024, 08:23:44 am
content: Quote from: space55 on November 21, 2024, 02:27:43 amIt's a slippery slope. I have 4 GPSDOs, a TinyPFA and a rubidiumI did consider building a time server, but have no use for one as my only use would be to set amateur radio data software time and a few tens of millisecond accuracy is more than enough for that via the internet time servers.SJ

author: space55
author_rank: Newbie
timestamp: November 23, 2024, 04:13:32 am
content: The boards have arrived!I have good news and bad news.The bad:- In my infinite wisdom, I connected RX to RX and TX to TX for UART on the NEO-M8N chip. This can't easily be fixed (with my skills, at least) by bodge wires between the traces, so another round of boards may need to be done.- I neglected to include a power status LED. That's silly of me.- The CM4 needs to be pre-imaged to work properly in the board, as there is no display out anywhere.- I managed to screw up the power connector, but that's easily fixed with a bodge wire.The good:- The NEO-M8N is sending NMEA data, as I checked with an oscilloscope.- The CM4 connectors work, provide power, and are the right distance apart.- The board only draws a few hundred mA, which is pleasantly lower than my expectations.- The activity LED works.- The ethernet port works.- The USB port works.What's next:- Update my designs to include some changes I've been noting, such as a +5V LED, some PPS connections, and maybe shift the CM4 to one side. I like it in the middle, though, it looks more balanced that way.- Get some RCB-M9N boards manufactured, if I can figure out how to migrate them from Altium to Kicad (reliably). Or just buy them if someone wants to sell me a few.- Try to figure out how in the *world* I'm going to get a case manufactured for these for under $1k per unit (Protolabs pricing).If anyone has suggestions on that last point, please, let me know. I've been thinking of using SendCutSend, but then I have to design up a full case in Fusion 360. Which I'm not opposed to, just not quite looking forward to.Will attach pictures of the boards in (insert resulting unit of time here).Thanks!

author: space55
author_rank: Newbie
timestamp: November 23, 2024, 05:47:35 pm
content: Finally took the photo of the board. Or, two, more accurately.They're... basic. But oh well, they're designed to be mini-ITX compatible, so I guess that's what I get.

author: space55
author_rank: Newbie
timestamp: February 26, 2025, 10:09:54 pm
content: I can happily announce that the board I designed worked! The second time around, that is. So I've already spent more than it costs to buy an equivalent product, I think...But otherwise, I now have a Mini-ITX board that - once connected to a GPS antenna - is able to act as a chrony server and I can sync to it across the network.Some interesting questions have come up, though. Namely:1. Should I support both active & passive antennas? Just connect voltage to the RF pin via a switch of some port? I assume filtering _should_ be in place, but that's something to google a little more.2. Throwing an OCXO on the board to discipline the oscillator sounds like a relatively large task. Are there resources I can use to learn a bit more about design, so I can begin to piece it all together?3. Is the additional cost of switching to an RCB-style board worth it? At the moment, the GPS (NEO-M9N) chip is ~$20, whereas I'd imagine something like the RCB-F9T (with an M9N chip instead) would be significantly more expensive. But, I guess it would make sense if you're aiming to build the ability to use a significantly more accurate chip.I'm going to work on designing the case next, because boy do I want this in a rack _badly_.If anyone has any questions, feel free to ask!

author: Solder_Junkie
author_rank: Frequent Contributor
timestamp: February 27, 2025, 10:08:12 am
content: Quote from: space55 on February 26, 2025, 10:09:54 pmYou could take your 1pps GPS output and feed it into a GPSDO board to control one of those cheap Chinese ovened oscillators (CTI type), or something better if you can obtain one for a reasonable cost. This is the basic idea, although there are others:https://www.qsl.net/zl1bpu/PROJ/NGPSDO/New%20GPSDO.htmI built one based on the above, note the author and Lars are sadly both no longer around. This is my version, note the clock is not derived from GPS and you do not need the clock display, and the "lock" can be just an LED:https://www.qsl.net/g4aon/gpsdo/SJ

author: space55
author_rank: Newbie
timestamp: March 15, 2025, 12:47:07 am
content: Case is done, and it looks mighty fine in my opinion.Annoyingly, I mistakenly had the chassis manufactured inside-out, and so I need to have it remade. In addition, I need a power switch in the rear, and the board needs work and some fixes. Onto the next revision I go.