<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title><![CDATA[Dobrica Pavlinušić's random unstructured stuff: NTP]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?ntp</link>
<description></description>
<pubDate>Tue, 30 Jan 2018 14:43:33 -0000</pubDate>
<webMaster>root@saturn.ffzg.hr</webMaster>
<generator>Socialtext Workspace v2.19.0.2</generator>

<item>
<title><![CDATA[NTP]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?ntp</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div class="wiki">
<p>
Installing Stratum II NTP server on <a href="https://saturn.ffzg.hr/rot13/index.cgi?raspberrypi" title="(99 months)  file mount-rpi-image.sh toc tag_list raspberrypi Interestring projects TODO test them out and write...">RaspberryPi</a> using <a href="https://saturn.ffzg.hr/rot13/index.cgi?sirf_star_iii" title="(106 months)  connect .pre root@eeepy hcitool scan Scanning ... 00 02 78 10 A2 32 SJ GPS root@eeepy sdptool add c...">SiRF STAR III</a> gps</p>
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [Dobrica Pavlinušić's random unstructured stuff]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#links">Dobrica Pavlinušić's random unstructured stuff (Links)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Links} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#raspbian_installation">Dobrica Pavlinušić's random unstructured stuff (Raspbian installation)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Raspbian installation} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#gpsd">Dobrica Pavlinušić's random unstructured stuff (gpsd)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] gpsd} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#ntp_server">Dobrica Pavlinušić's random unstructured stuff (ntp server)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] ntp server} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><h1 id="links">Links</h1>
<ul>
<li><a target="_blank" title="(external link)" href="http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html">http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html</a></li>
<li><a target="_blank" title="(external link)" href="https://www.raspberrypi.org/forums/viewtopic.php?t=191050">https://www.raspberrypi.org/forums/viewtopic.php?t=191050</a></li>
</ul>
<h1 id="raspbian_installation">Raspbian installation</h1>
<pre>
root@ntpi:/home/pi# systemctl start ssh

root@ntpi:/home/pi# systemctl enable ssh

pi@ntpi:~ $ grep pps /boot/config.txt 
dtoverlay=pps-gpio,gpiopin=18

pi@ntpi:~ $ sudo apt-get install pps-tools

# reboot, after it:

pi@ntpi:~ $ dmesg | grep pps
[   30.331047] pps_core: LinuxPPS API ver. 1 registered
[   30.331066] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti &lt;giometti@linux.it&gt;
[   30.352868] pps pps0: new PPS source pps.-1
[   30.352966] pps pps0: Registered IRQ 178 as PPS source





root@ntpi:~# systemctl disable systemd-timesyncd
root@ntpi:~# systemctl stop systemd-timesyncd

pi@ntpi:~ $ hcitool scan
Scanning ...
        00:02:78:10:A2:32       SJ GPS

root@ntpi:/home/pi# ppstest /dev/pps0 
trying PPS source &quot;/dev/pps0&quot;
found PPS source &quot;/dev/pps0&quot;
ok, found 1 source(s), now start fetching data...
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
time_pps_fetch() error -1 (Connection timed out)
</pre>
<br /><p>
fail, gps module is powered off without bluetooth connection</p>
<pre>
root@ntpi:/home/pi# grep rfcomm /etc/rc.local 
rfcomm bind rfcomm0 00:02:78:10:A2:32



</pre>
<br /><p>
fix pps signal from this GPS and test again</p>
<pre>
root@ntpi:/home/pi# grep pps /boot/config.txt 
dtoverlay=pps-gpio,gpiopin=18,assert_falling_edge
root@ntpi:/home/pi# ppstest /dev/pps0 | head
trying PPS source &quot;/dev/pps0&quot;
found PPS source &quot;/dev/pps0&quot;
ok, found 1 source(s), now start fetching data...
source 0 - assert 1516805100.156350675, sequence: 70193 - clear  0.000000000, sequence: 0
source 0 - assert 1516805100.176368675, sequence: 70195 - clear  0.000000000, sequence: 0
source 0 - assert 1516805100.196339675, sequence: 70196 - clear  0.000000000, sequence: 0
source 0 - assert 1516805100.216363675, sequence: 70198 - clear  0.000000000, sequence: 0
source 0 - assert 1516805100.236378675, sequence: 70200 - clear  0.000000000, sequence: 0
source 0 - assert 1516805100.256385675, sequence: 70202 - clear  0.000000000, sequence: 0
source 0 - assert 1516805100.276392675, sequence: 70204 - clear  0.000000000, sequence: 0


</pre>
<br /><p>
This doesn't work, we need one event per second</p>
<pre>
# make pin 18 pull-down
root@ntpi:/home/pi# raspi-gpio set 18 ip pd

root@ntpi:/home/pi# grep pps /boot/config.txt 
dtoverlay=pps-gpio,gpiopin=18,assert_falling_edge

root@ntpi:/home/pi# ppstest /dev/pps0 
trying PPS source &quot;/dev/pps0&quot;
found PPS source &quot;/dev/pps0&quot;
ok, found 1 source(s), now start fetching data...
source 0 - assert 1517323262.001232132, sequence: 697469 - clear  0.000000000, sequence: 0
source 0 - assert 1517323263.001229640, sequence: 697470 - clear  0.000000000, sequence: 0
source 0 - assert 1517323264.001227157, sequence: 697471 - clear  0.000000000, sequence: 0
source 0 - assert 1517323265.001224685, sequence: 697472 - clear  0.000000000, sequence: 0
source 0 - assert 1517323265.788526615, sequence: 697474 - clear  0.000000000, sequence: 0
source 0 - assert 1517323266.001222221, sequence: 697475 - clear  0.000000000, sequence: 0

# works!



</pre>
<br /><h1 id="gpsd">gpsd</h1>
<pre>

pi@ntpi:~ $ sudo apt-get install gpsd


</pre>
<br /><h1 id="ntp_server">ntp server</h1>
<pre>
root@ntpi:/home/pi# apt-get install ntp





</pre>
</div>
]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category></category>
<guid isPermaLink="true">https://saturn.ffzg.hr/rot13/index.cgi?ntp</guid>
<pubDate>Tue, 30 Jan 2018 14:43:33 -0000</pubDate>
</item>
</channel>
</rss>