I use my old android phone as stratum 1 NTP server with phone gps as time source, but I discovered that my NTP server time offset kept at around 50ms, could you explain the reason behind?Is it because the gps signal at home is too weak and cannot fix time accurately?
The monitor is correct. The server reports reference ID=LOCL.
Network Time Protocol (NTP Version 4, server)
Reference ID: uncalibrated local clock
Reference Timestamp: May 27, 2020 07:41:34.264999999 UTC
An NTP pool server should never use an undisciplined source.
But I reaily have gps for calibration, then what is the problem
Is my gps not working?
Simply turning on GPS on a phone doesn’t mean that is the time source it syncs to. Typically a cell phone pings its network provider for the time, so it depends on how accurate the cell tower is or whatever upstream time source they use.
The NTP server configuration is unclear. I’ll assume it is a typical cellphone with a 4G (LTE) connection.
An Apple iPhone typically queries time.apple.com over the 4G airlink and uses that to set the cellphone local clock. The 4G airlink delay can be quite variable and asymmetric.
If you describe your hardware and software in more detail we can provide a better explanation.
Unless you have a separate GPS with PPS that can interface with the cellphone + system software it is unlikely that this can provide an accurate time source.
OS: Android 6.0.1(rooted)
CPU: 4core 2.15GHz
Hard Disk: 128GB
Server Software: Server ultimate pro
Bandwidth: 2.1Mbps for both upload and download
Maybe try another app which support ntp server with GNSS support.
IIRC this one can do it: https://play.google.com/store/apps/details?id=app.timeserver
I know this app, I want to install it but my android system doesn’t support this app
You should install, or develop, software that can directly access the GPS, including the PPS.
I don’t know how that is done on Android.
From a monitoring point near Tokyo the server was in error by an estimated 30-50 msec. The reported dispersion (error estimate) was 0 msec. This is consistent with the LTE phone being synchronized from a remote NTP server. If this is true, then the phone should report being stratum 2, not stratum 1.