GNU General Public License v3.0

项目介绍

tiagofreire-pt/rpi_uputronics_stratum1_chrony 是一个托管在 GitHub 上的开源项目,主要使用 Shell 编写,采用 GNU General Public License v3.0 许可证,目前获得 64 个 Star、5 次 Fork。

仓库全名
tiagofreire-pt/rpi_uputronics_stratum1_chrony
开源许可证
GNU General Public License v3.0
Star 数
64
Fork 数
5
未关闭 Issue
2

README 摘要

Raspberry Pi 5B NTP Server - Stratum 1 (with Uputronics GPS HAT) A straightforward and highly optimized approach to achieve a cost-effective (€200) and high performance Stratum 1 NTP server, disciplined with highly precise PPS (Pulse Per Second) sourced from the GNSS radio service plus NTP public servers across the internet to get the absolute time reference. Can be prepared to be used with off-the-grid applications…

完整内容见 GitHub 原始 README 或本页 。

常见问题

rpi_uputronics_stratum1_chrony 用什么语言开发?

主要使用 Shell 编写,采用 GNU General Public License v3.0 许可证,目前有 64 个 Star。

rpi_uputronics_stratum1_chrony 可以免费商用吗?

仓库标注的许可证为 GNU General Public License v3.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 rpi_uputronics_stratum1_chrony 的源码?

可以直接克隆仓库:git clone https://github.com/tiagofreire-pt/rpi_uputronics_stratum1_chrony.git,默认分支为 main;安装与运行步骤见仓库 README。

rpi_uputronics_stratum1_chrony 最近还在维护吗?

仓库最近一次更新为 2024年12月16日,当前有 2 个未关闭 Issue;Star 数为 64,可作为社区活跃度的参考。

关于

A straightforward and highly optimized approach to achieve a cost-effective Stratum 1 NTP server using a Raspberry Pi 5B and an Uputronics GPS HAT

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
79
价值分
40
活跃状态
活跃

语言占比

Shell

README

Raspberry Pi 5B NTP Server - Stratum 1 (with Uputronics GPS HAT)

A straightforward and highly optimized approach to achieve a cost-effective (€200) and high performance Stratum 1 NTP server, disciplined with highly precise PPS (Pulse Per Second) sourced from the GNSS radio service plus NTP public servers across the internet to get the absolute time reference.

Can be prepared to be used with off-the-grid applications such as IoT in remote locations/air-gapped systems or WAN connected IoT ones (as presented here).

The end result with a fully assembled Raspberry Pi 5B and an Uputronics GPS/RTC HAT Ublox M8 engine vs 6.4:

The Server Fully Assembled

This is my recipe for Raspberry Pi OS lite version Bookworm, freshly installed, with kernel 6.1.73-1+rpt1.

Index

Achievements @ January 2024:

Scope Achievement Value
Timekeeping Precision ~ 2^(-26) s
Timekeeping PPS Jitter < 400 ns
Timekeeping Frequency < 200 ppb
Service Clients > 160
Service RMS offset < 100 ns

Optimizations @ January 2024:

(non exaustive)

  • Chrony software optimization:
    • Enabled DSCP higher priority packet stamping for reduced latency and jitter over the network time distribution;
    • Enabled Hardware Timestamping over the ethernet BCM54213 PHY;
    • Enabled directive to lock chronyd into RAM;
    • Implemented temperature compensation, aiming reduced frequency value and its lower jitter.
  • Hardware optimization:
    • Low latency hardware UART for NMEA messages;
    • Forced constantly CPU clock and governor to its higher frequency for higher timekeeping resolution;
    • Disabled WiFi and Bluetooth radios aiming lower eletromagnetic interferance against the GNSS radio;
    • Reduced to the minimum coalescence values on the ethernet interface, for lower latency and jitter over the network time distribution;
    • Enabled the usage of the ethernet PHC clock, as a secondary high precision reflock;
    • Designed a custom case, with better hot airflow output and with higher thermal insulation for the oscilators on the Rpi 5B buttom face.
  • Operating system fine tuning:
    • Disabled linux kernel power saving method, aiming reduced processes scheduling latency and jitter;
    • Increased Chrony services to -10 nice value, aiming higher process schedule priority for better timekeeping;
    • Disabled unnecessary services, reducing CPU time consumption, latency and jitter;
    • Disabled SWAP partition usage for lower file system and memory latency, over the SD Card.
  • Ublox M8 chip fine tuning:
    • Enabled support for GALILEO GNSS for better UTC time reference;
    • Disabled support for SBAS (reducing PPS jitter) and GLONASS GNSS (#slavaukraini);
    • Enabled jamming/interferance monitoring for superior GNSS continuity;
    • Enabled stationary dynamic model aiming reduced NMEA and PPS latency and jitter;
    • Set the power management to full power, reducing latency and jitter;
    • Set the antenna cable lenght latency for a better PPS time sync accuracy against UTC reference time.

Sample metrics:

Chrony vs 4.5 server tracking statistics after several days of uptime:

Chrony tracking after several days of uptime

Chrony vs 4.0 client tracking statistics after several days of uptime:

Chrony tracking after several days of uptime

Chrony vs 4.0 client tracking ntpdata of this server, after 1 day of uptime:

Chrony ntpdata after 1 day of uptime

List of materials and tools needed

Mandatory:

  • 40 pin header 10mm spacer (if using the genuine active cooler)
  • SD Card with 8GB or more
  • USB SD Card reader or other similar device to install Raspberry Pi OS on the SD Card.
  • Raspberry Pi 5B, with a suitable power adaptor
  • Uputronics GPS HAT
  • RJ45 Ethernet CAT5 (or better) cable with proper lenght

Optional :

  • 3D printed case for housing the fully assembled server (RPi 5B):

    I suggest this custom made case. Rpi 5b custom case PLA or PETG are generally appropriate, depending on the ambient temperature and environment you`ll apply this server in.

  • Outdoor GPS active antenna with 28dB Gain, inline powered at 3-5V DC, with 5 meters of cable lenght and SMA male connector

Step-by-step tutorial

For this tutorial, you have 3 major steps. Being the last 2 of them optional, but highly recommended, as achieves huge and superior accuracy and precision.

  1. Setup the server
  2. Advanced Ublox M8 tuning
  3. Advanced system tuning

Acknowledgments

  1. Conor Robinson, for his cooperation and shared knowledge
  2. Anthony Stirk, for his openess to help and cooperate on a further hardware improvement (stay tuned!)

References

评论

暂无评论