0
Bingo

Solved - OrangePI One - 1-PPS NTP Server

Recommended Posts

Doohh ... User error - 1PPS wasn't enabled on the GPS.

The OPIO Kernel works fine w. 1-PPS

$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1524154630.697340907, sequence: 6793 - clear 0.000000000, sequence: 0
source 0 - assert 1524154631.697261112, sequence: 6794 - clear 0.000000000, sequence: 0
source 0 - assert 1524154632.697166525, sequence: 6795 - clear 0.000000000, sequence: 0
source 0 - assert 1524154633.697084896, sequence: 6796 - clear 0.000000000, sequence: 0
source 0 - assert 1524154634.697017267, sequence: 6797 - clear 0.000000000, sequence: 0
source 0 - assert 1524154635.696924515, sequence: 6798 - clear 0.000000000, sequence: 0
source 0 - assert 1524154636.696832013, sequence: 6799 - clear 0.000000000, sequence: 0
source 0 - assert 1524154637.696757469, sequence: 6800 - clear 0.000000000, sequence: 0

Ps: The 1-PPS ticks are NOT from the GPS yet , it was from a STM32-Bluepill where i just whipped up a quick 1-PPS pulse

/Bingo

*** Original post ***

Gents

I would like to use a OrangePI One as a NTP Server w. 1-PPS support.

And i'm using this "recipe" for a OPIZ
https://forum.armbian.com/topic/4944-opi-zero-gps-ntpserver/

But i seem to have some problems getting the 1-PPS to work on the OPIO.

I'm not experienced in the new Linux IO setup (Those overlays) , and i could miss something there.
I was hoping that the kernel for the OPIO had the same stuff enabled as the OPIZ (according to the url above)

Could this be an "IO Overlay" problem ??

Setup:

I have downloaded the "latest Debian server image , and it runs fine.
Armbian_5.38_Orangepione_Debian_stretch_next_4.14.14.7z

$ uname -a
Linux opio1 4.14.18-sunxi #24 SMP Fri Feb 9 16:24:32 CET 2018 armv7l GNU/Linux


I have added the overlay_prefix & param_pps_pin to the below file.

$ cat /boot/armbianEnv.txt
verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=a769471e-a787-40d3-8298-d31c195f1bb9
rootfstype=ext4
overlays=uart1 pps-gpio
param_pps_pin=PA7

usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u



And have this output during boot:
$ dmesg | grep pps
[ 3.178515] pps_core: LinuxPPS API ver. 1 registered
[ 3.178519] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti
[ 10.787644] pps pps0: new PPS source pps@0.-1
[ 10.787698] pps pps0: Registered IRQ 56 as PPS source


I have connected my 1-PPS tp PA7 (OPIO pin 29) but according to the below url (ppstest) , it (OPIO) doesn't react

I am following this one , for testing etc.
https://ava.upuaut.net/?p=726

sudo ppstest /dev/pps0



I have a feeling that there is a simple soluton/explanation for this , but i'm a bit lost.

If anyone could help out i would be gratefull


TIA
/Bingo

Share this post


Link to post
Share on other sites

Another question

Does anyone know if 1-PPS support is enabled in the NTPdaemon that is in the armbian repos ?

I suppose it is , since the OPIZ description doesn't mention that one have to build an own ntpd.

But if anyone knows for sure, it would be a nice info

/Bingo

Share this post


Link to post
Share on other sites

Bingo: Thanks for the tip that I needed to overcome my own obstacle (mentioned in post in this same subforum).  I am curious where you got the info to add the 'param_pps_pin' parameter to '/boot/armbianEnv.txt'?  After I did so, and rebooted, I finally got the '/dev/pps0' device required -- and my PPS time server now seems to be working!

 

I cannot be certain at this point, but 'no', it does appear as though the default 'ntp' daemon that is available does not support PPS i.e. I got no entries at all for my server until I compiled/installed the 'ntpsec' package myself (the one that contains 'ntpmon', which I find useful to use).

 

e.g.

     remote           refid      st t when poll reach   delay   offset   jitter
 127.127.1.0     .LOCL.          10 u  672   64    0    0.000    0.000    0.001
 127.127.28.0    .GPS.            0 u    -   16    0    0.000    0.000    0.000
o127.127.22.0    .PPS.            0 u   14   16  377    0.000   -0.063    0.098
*zero.gotroot.ca 30.114.5.31      2 u    9   64   17   38.907    1.213   39.990
-cloud1.pifts.ne 138.39.23.13     2 u    3   64   17   49.976    7.628   35.855
+james.kirk.hung 184.107.35.228   2 u    3   64  377   42.356    0.067    0.370
+mirror3.rafal.c 139.41.49.38     2 u   57   64  377   34.326    0.067    0.319
ntpd 4.2.8p10@1.3728-o Sun Feb 25 22:00:44 UTC 2018 (1)Updated: 2018-04-25T14:14:30 (8)
 lstint avgint rstr r m v  count rport remote address
      4     26  1d0 . 4 4      9   123 cloud1.pifts.net
      4     45  1d0 . 4 4     16   123 174.142.39.145 (james.kirk.hungrycats.or
     10     25  1d0 . 4 4      9   123 zero.gotroot.ca
     58     44  1d0 . 4 4     15   123 mirror3.rafal.ca

 

Share this post


Link to post
Share on other sites

@darethehair

I got the parameters from this post (OPIZ)
https://forum.armbian.com/topic/4944-opi-zero-gps-ntpserver/

Would you mind providing a short recipe for getting & compiling the ntp daemon that works ?

Well basically just point me to the source you used

/Bingo

Share this post


Link to post
Share on other sites
16 hours ago, Bingo said:

@darethehair

I got the parameters from this post (OPIZ)
https://forum.armbian.com/topic/4944-opi-zero-gps-ntpserver/

Would you mind providing a short recipe for getting & compiling the ntp daemon that works ?

Well basically just point me to the source you used

/Bingo
 

Look for the 'ntpsec' section on my page:

 

http://darethehair.net/gps_time_server.html

 

If you have the time, maybe also comment on whether you find anything in the Orange Pi section of this page confusing or incomplete :)

 

One thing that I am confused about is whether or not the 'regular' NTP should be installed (or not) in order for the 'NTPsec' version to work properly.  Hmmm...

 

UPDATE: My two Orange Pi's with GPS are currently indoors, and unreliable for whether or not they can get a reliable GPS fix.  As well, the temperature variations that occur when the heating goes on causes some fluctuations.  So right now my NTPsec graphs are being driven by the statistics generated from my Raspberry Pi outside:

 

http://darethehair.net/ntpgraphs/

 

Share this post


Link to post
Share on other sites

@darethehair

Nice page you have made :-)
But i decided to go with plain ntp , and have just built ntp-4.2.8p11 w. refclocks (PPS) enabled.

I'm actually going to use a GPSDO connected to an active 4-chan GPS-antenna splitter , connected to an outside 26dB timing antenna.
The splitter ia already driving a Trimble Thunderbolt , and a HP Z3801A , and occationally a Motorola M12+ timing receiver that diciplines my PRS-10 Rubidium clock.



My latest GPSDO had to be used for something else (too) , and i decided for NTP.

The GPSDO has 10MHz and 1-PPS outputs , and i'm going to "snag a copy" of the 1-PPS pulse to feed the OPI-One board.
The OPI board will (besides NTP) also run "Lady Heather" to dicipline the GPSDO.

I have just installed LXDE + VNC on the OPI , in order to be able to see the LH output.

The 10MHz out will be connected to a TAPR-1 , 6-Chan 10MHz distribution board , that will be used as an instrument "External Osc" reference.

Right now i'm struggling w. the chassis for the various boards , but i hope to have it running within a week or two.


Rgds
Bingo (A certified Time-Nut ...) :-)


Ps:

I Love the generated Graphs , and would consider building ntpsec , just for snipping ntpviz.

Would you mind showing your ntpwiz config file ?

And is the only logging used for those graphs , these lines in ntp.conf ?
# stats
enable stats
statistics loopstats

Share this post


Link to post
Share on other sites
54 minutes ago, Bingo said:

@darethehair

Nice page you have made :-)
But i decided to go with plain ntp , and have just built ntp-4.2.8p11 w. refclocks (PPS) enabled.

I'm actually going to use a GPSDO connected to an active 4-chan GPS-antenna splitter , connected to an outside 26dB timing antenna.
The splitter ia already driving a Trimble Thunderbolt , and a HP Z3801A , and occationally a Motorola M12+ timing receiver that diciplines my PRS-10 Rubidium clock.



My latest GPSDO had to be used for something else (too) , and i decided for NTP.

The GPSDO has 10MHz and 1-PPS outputs , and i'm going to "snag a copy" of the 1-PPS pulse to feed the OPI-One board.
The OPI board will (besides NTP) also run "Lady Heather" to dicipline the GPSDO.

I have just installed LXDE + VNC on the OPI , in order to be able to see the LH output.

The 10MHz out will be connected to a TAPR-1 , 6-Chan 10MHz distribution board , that will be used as an instrument "External Osc" reference.

Right now i'm struggling w. the chassis for the various boards , but i hope to have it running within a week or two.


Rgds
Bingo (A certified Time-Nut ...) :-)


Ps:

I Love the generated Graphs , and would consider building ntpsec , just for snipping ntpviz.

Would you mind showing your ntpwiz config file ?

And is the only logging used for those graphs , these lines in ntp.conf ?
# stats
enable stats
statistics loopstats

Wow!  Compared to you, I am just a Time 'dabbler' -- and you are a Time 'master'! ;)  I spend $4 (or now even $10) on a PPS-enabled GPS module, and you (apparently) have spend hundreds of dollars on your stuff?!

Please create a website showing off all your stuff, including photos of your equipment, so that people like me can be wowed :) 

 

So, just to be clear, in order to use the 'regular' version of NTP, you still had to compile from source yourself in order for PPS stuff to work?  That is the impression that I have (i.e. that it needs to be 'patched') and so that is what I say on my web page.

 

To answer your questions:

My entries at the end of '/etc/ntp.conf' are:

# Stats
enable stats
statistics loopstats
statsdir /var/log/ntp/
filegen loopstats file loopstats type day link enable

Make sure that you create the empty '/var/log/ntp' ahead of time, with the 'open' permissions, as mentioned on my page.  I also have an entry in '/etc/rc.local' to re-create this on every re-boot:

mkdir /var/log/ntp
chmod 777 /var/log/ntp

exit 0

Finally, in order to generate the graphs, I have a root-based 'cron' entry that calls a simple script -- which generates the graphs, and also transfers the directory to my webserver (rather than running a webserver on my Pi directly, I run the 'master' webserver on a Chromebook):

#!/bin/bash

cd /var/log/ntp
/usr/local/bin/ntpviz -d /var/log/ntp -p 1 -n "Dare's NTP GPS/PPS Stratum 1 Timeserver Statistics Page" -w s -c
/usr/bin/scp -r /var/log/ntp/ntpgraphs darren@frodo4:/tmp

 

Share this post


Link to post
Share on other sites

@darren

I actually have no idea if a "own" build of ntp is required , in order to enable PPS support - On Armbian.
But i saw that they recently released a new version , so i just build that one w. PPS support to be sure.

Thank you for the info about the "viz" , will give it a try.

Btw: Seems line ntpviz is a python program that's included in the git repos , no need to build anything

Bingo

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
0