{"version":"1.1","schema_version":"1.1.0","plugin_version":"1.1.2","url":"https://tutos-gameserver.fr/2019/10/05/construire-un-serveur-ntp-stratum-1-stratum-pi-serveur-dimpression-2/","llm_html_url":"https://tutos-gameserver.fr/2019/10/05/construire-un-serveur-ntp-stratum-1-stratum-pi-serveur-dimpression-2/llm","llm_json_url":"https://tutos-gameserver.fr/2019/10/05/construire-un-serveur-ntp-stratum-1-stratum-pi-serveur-dimpression-2/llm.json","manifest_url":"https://tutos-gameserver.fr/llm-endpoints-manifest.json","language":"fr-FR","locale":"fr_FR","title":"Construire un serveur NTP Stratum-1 Stratum-Pi\n &#8211; Serveur d&rsquo;impression","site":{"name":"Tutos GameServer","url":"https://tutos-gameserver.fr/"},"author":{"id":1,"name":"Titanfall","url":"https://tutos-gameserver.fr/author/titanfall/"},"published_at":"2019-10-05T04:54:07+00:00","modified_at":"2019-10-05T04:54:07+00:00","word_count":15972,"reading_time_seconds":4792,"summary":"A titre d’expérience, j’ai acheté l’un des modèles à faible coût taille de carte de crédit Framboise Pi ordinateurs, et l’ont configuré pour exécuter NTP (Network Time Protocol). J&#39;ai également utilisé cette carte avec un récepteur GPS avec une sortie impulsions par seconde (PPS) pour Stratum-1 serveur NTP, mais comme je connais peu de Linux, [&hellip;]","summary_points":["A titre d’expérience, j’ai acheté l’un des modèles à faible coût\ntaille de carte de crédit Framboise\nPi ordinateurs, et l’ont configuré pour exécuter NTP (Network Time Protocol).","J&#39;ai également utilisé cette carte avec un récepteur GPS avec une sortie impulsions par seconde (PPS) pour\nStratum-1 serveur NTP, mais comme je connais peu de Linux, il a fallu un certain temps pour\natteindre cet objectif!","Il y a quelques commandes utiles Linux dispersées à travers\ncette page.","Ces notes sont presque autant pour mes propres disques pour\nla prochaine fois que je devrai visiter ce projet, mais j’espère qu’ils pourront vous aider."],"topics":["Serveur d'impression"],"entities":[],"entities_metadata":[{"id":10,"name":"Serveur d'impression","slug":"serveur-dimpression","taxonomy":"category","count":3907,"url":"https://tutos-gameserver.fr/category/serveur-dimpression/"}],"tags":["Serveur d'impression"],"content_hash":"9a7f1640dfcb7a90966ad52117b77411","plain_text":"A titre d’expérience, j’ai acheté l’un des modèles à faible coût\ntaille de carte de crédit Framboise\nPi ordinateurs, et l’ont configuré pour exécuter NTP (Network Time Protocol).\nJ&#39;ai également utilisé cette carte avec un récepteur GPS avec une sortie impulsions par seconde (PPS) pour\nStratum-1 serveur NTP, mais comme je connais peu de Linux, il a fallu un certain temps pour\natteindre cet objectif! Il y a quelques commandes utiles Linux dispersées à travers\ncette page. Ces notes sont presque autant pour mes propres disques pour\nla prochaine fois que je devrai visiter ce projet, mais j’espère qu’ils pourront vous aider.\nautres.\nSi vous voulez commencer rapidement avec les meilleurs résultats pour\nminimum de bruit, s&#39;il vous plaît voir mon Raspberry Pi NTP\nentrée rapide page. S&#39;il vous plaît voir aussi cette\npage pour des problèmes avec la version de Jessie de Linux, et avec la plus récente\nRaspberry Pi modèle 3.\nJe commence par décrire comment faire fonctionner le Raspberry Pi avec\njuste une connexion LAN &#8211; sans écran, clavier ou souris &#8211; un soi-disant sans tête\nopération. Je décris ensuite comment configurer NTP pour votre environnement, et\najout d&#39;un récepteur GPS / PPS pour convertir votre boîte en un serveur NTP de strate-1\ny compris les mises à jour du système d&#39;exploitation nécessaires. Ensuite, je note quelques\nJ&#39;ai eu des problèmes avec le premier récepteur GPS que j&#39;ai essayé et comment j&#39;ai guéri ceux qui avaient un\nrécepteur GPS différent pour produire un serveur NTP strate-1 consommant environ 4\nwatts. L&#39;approche la plus simple avec de bonnes performances est décrite ici.  \nDepuis le début de cette page, deux développements ont eu lieu\nqui facilitent quelque peu le processus &#8211; un programme a été développé qui\npermet l&#39;utilisation d&#39;un système d&#39;exploitation non modifié en travaillant en mode utilisateur\nplutôt que PPS en mode noyau, et un module est maintenant disponible qui se branche directement\nsur l&#39;en-tête GPIO à 26 broches du Raspberry Pi, afin non\nla soudure est impliquée. Mes remerciements à Folkert van Heusden et Anthony\nStirk pour ces développements.\n  Notez que le GPS Hat Adafruit utilise GPIO 4, broche physique 7,\nvous devrez donc changer les commandes données dans ce document. Les ajouts ultérieurs ont inclus la télécommande surveillance\ndu serveur NTP performance, et surveillance plus générale de la framboise\nPi en utilisant les fonctions standard SNMP, avec un supplément\nCPU\nTempérature surveillance add-on. Mon principal Framboise\nPage Pi peut également être d&#39;intérêt.\nNotez que de bonnes performances dépendent du fait que l’unité GPS a\nune vue dégagée du ciel, en particulier la partie sud du ciel si vous êtes en\nl&#39;hémisphère nord. Avec les anciens récepteurs GPS, cela nécessitait une installation extérieure.\nantenne, mais des unités plus modernes telles que celles mentionnées ici pourraient bien fonctionner\nà l’intérieur à condition que du ciel soit visible, peut-être au dernier étage de la\nbâtiment (comme je suis). Si vous avez un toit &quot;résistant aux RF&quot; (plombé,\npeut-être?!) ou certaines fenêtres avec une doublure pour arrêter la chaleur entrante, ou la construction du mur\ny compris le métal, vous aurez peut-être encore besoin d’une antenne extérieure, et presque certainement si\nvous vivez dans un sous-sol! Alors que le temps aura normalement seulement une petite\neffet dans le signal &#8211; par ex. forte pluie &#8211; il est possible qu&#39;une couche de neige\npourrait atténuer suffisamment le signal pour empêcher le GPS de recevoir suffisamment de signal.\nLe suivi des performances peut vous aider à détecter ces problèmes. (Merci à Joe,\nHB9DRT pour l&#39;information sur la neige &#8211; Je n&#39;ai vu ce problème qu&#39;une fois ici\npendant un hiver exceptionnellement froid).\nintroduction\nLe Raspberry Pi est un ordinateur au format carte de crédit.\ndisponible chez les distributeurs du monde entier. J&#39;ai acheté un bleu attrayant\nboîtier et alimentation 5 V, 2 A de ModMyPi.\nVous pouvez voir le fil Ethernet à gauche et la carte SD de 4 Go avec le\nsystème d’exploitation à droite, ainsi que le cordon d’alimentation micro-USB.\nIl existe un modèle B (illustré et utilisé ci-dessous) et un modèle A de spécification inférieure qui peut\ndevenir disponible à un moment dans l’avenir. J&#39;utilise le modèle B de 512 Mo,\nintroduit à l&#39;automne 2012.\n\nCi-dessous, les résultats offset avec le Raspberry Pi en\ntrois configurations: avec des connexions WAN uniquement synchronisées sur Internet (comme\npourrait trouver une situation typique de la maison), avec\nConnexions LAN à un serveur local de strate 1 et agissant en tant que\nle serveur Stratum-1 avec deux petits récepteurs GPS / PPS différents comme horloge de référence. Tout\nproblèmes dans les données en direct sont susceptibles d&#39;être le résultat de mon redémarrage, rendant la configuration\nchangements, ou le signal GPS étant inférieur à la normale. La configuration NTP normale est listée ici.\nComme prévu, la synchronisation depuis le réseau local produit de meilleurs résultats que depuis Internet.\n(WAN), et en transformant le périphérique en serveur de la strate 1, le résultat est encore plus bas.\ncompensations.\nLe décalage zéro correspond à la ligne médiane du graphique, comme\nl&#39;utilité que j&#39;utilise est incapable de tracer des valeurs négatives. J&#39;ajoute donc\nla moitié de la plage de l’axe Y aux valeurs réelles avant de tracer.  Remarque: celles-ci\nles graphiques sont  ne pas tous à la même échelle verticale! \nDécalage utilisant uniquement des serveurs Internet &#8211; échelle milliseconde\n  La performance qui en résulte est bonne, mais cela dépendra à la fois du chargement du lien entre moi et\nle FAI, et la charge générale sur le réseau du FAI et l&#39;Internet général.\nLes décalages seraient d’environ +/- 5 millisecondes (et donc hors échelle).\nune fois sur le graphique ci-dessous). Les quatre lignes ntp.conf\nen cours d’utilisation est indiqué sous le graphique.\n\n\n\n\n      Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation WANéchelle milliseconde\n\n\n\n\n# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\npool fr.pool.ntp.org iburst\n\nDécalage à l&#39;aide de serveurs LAN locaux interrogés toutes les 32 secondes &#8211; échelle en microsecondes\nLe passage à un couplage étroit avec un serveur de strate 1 local sur le réseau local produit beaucoup mieux\nrésultats, avec un chronométrage de l’ordre de 30 microsecondes. J&#39;ai ajouté un\ndeuxième graphique avec une échelle de +/- 500 microsecondes pour montrer les excursions les plus importantes.\n\n\n\nRaspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation de réseau localéchelle de précision\n\n\n\n\nMêmes données mais sur unéchelle microseconde\n\n\n\n# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst\n\nDécalage à l&#39;aide du module GPS de synchronisation Trimble Resolution-SMT\nDes résultats bien meilleurs sont obtenus avec un Trimble Resolution SMT\nModule GPS, avec sa broche PPS connectée à la broche GPIO 24 pour un mode noyau\n&quot;ATOM&quot; horloge de référence. Cette unité est un GPS &quot;de synchronisation&quot;, avec 15\nns précision spécifiée pour le signal PPS. Chaque seconde sur le GPIO\npin provoque une interruption dans laquelle l’horloge de la CPU est notée, puis utilisée par NTP pour\nfaire des ajustements fins à la vitesse d&#39;horloge du logiciel. le\ntransitoires d’une amplitude de quelques microsecondes d’une durée d’une heure environ peuvent être dus à une\nchangements de température ambiante affectant le cristal utilisé par l&#39;horloge de la carte\nGénérateur. Non indiqué sur le graphique, mais le décalage dû à une tâche gourmande en ressources processeur (recompilation de NTP à partir de la source,\nenviron 25 minutes) a entraîné une excursion positive de 20 µs,\nsuivi d&#39;une excursion négative de 10 µs avec le refroidissement des températures et du NTP\nrétabli.\n\n\n\nRaspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS du noyauRésolution Trimble SMTchronométrage récepteur GPS\n\n\n\n\nDécalage lors du passage à un module GPS NEO-6M u-blox\nLors de l&#39;utilisation d&#39;un GPS u-blox MEO-6M\nmodule, avec sa broche PPS connectée à la broche GPIO 24 pour un mode en mode noyau\n&quot;ATOM&quot;, on obtient des résultats similaires. Le transitoire au milieu du graphique est\nlorsqu’un deuxième appareil était connecté à la ligne 5 V de l’USB. Cette unité\nest un GPS de &quot;navigation&quot;, où le PPS est spécifié à environ 100 ns, plutôt\nqu&#39;un &quot;timing&quot; GPS &#8211; mais\nla différence entre les deux unités est le plus souvent masquée par les autres variations du\nsystème.\n\n\n\nRaspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\n\n      Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation\n\n\n\nPlus tard, il a été remarqué que le décalage variait\npériodiquement, ce qui est un résultat inattendu. Ci-dessous un exemple des 19 au 21 décembre 2012, avec les moins stables\npériode débutant le 19 décembre 2012 et se terminant le 20 décembre.\nUn examen plus détaillé des données de loopstats montre une période réelle d’un peu plus de 100\nsecondes, et il est alias par l&#39;échantillon de 5 minutes de MRTG.\n\n\n\nRaspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\n\n      Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation\n\n\n\nPour tester, j&#39;avais changé le récepteur GPS d&#39;U-blox 6M à Adafruit MTK3339\nmodule de navigation GPS, puis modifié à nouveau du module de navigation à\nun module GPS de chronométrage basé sur le U-blox\nLEA-6T, pour voir si l’oscillation était affectée. Ces changements\nn&#39;a fait aucune différence ni pour l&#39;amplitude ni pour la période de l&#39;oscillation,\net l&#39;amplitude de l&#39;oscillation était considérablement plus grande que ce qui serait\nattendu même d&#39;un récepteur GPS &quot;de navigation&quot;. Donc mon plus tôt\nThéories sur la navigation par rapport à la synchronisation, les modules GPS, le chargement USB et les E / S série\nle chargement était incorrect. Ce problème a finalement été résolu par un firmware\nmise à jour sur Raspberry Pi # 1, de la version 337601 à la version 346337. \n\n\nPerformance actuelle &#8211; cliquez sur un graphique pour accéder à la page de performance de chaque ordinateur.\nJ&#39;ai ajouté un deuxième ordinateur Raspberry Pi et j&#39;ai maintenant les deux\nconnectés aux deux récepteurs GPS / PPS mentionnés ci-dessus, mais avec le\nantennes pour ces récepteurs dans un emplacement intérieur similaire. Ci-dessous est un\ncomparaison de la performance. Raspberry Pi # 1 est situé dans un endroit non chauffé\nchambre avec un mur orienté au nord. Raspberry Pi # 3 est également dans le bureau, mais situé\nun peu plus près d&#39;un radiateur, fournissant les transitoires quotidiens. Mi-novembre\n2013, je suis passé à un nouveau noyau qui a été compilé localement avec une option pour\naméliorer les performances NTP.\n\n\n\nRaspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationdans une pièce non chauffée\n\n&lt;! &#8211;\n\n\nRaspberry Pi # 2512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationen environnement de bureau\n\n-&gt;\n\n\nRaspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigationRécepteur GPSen environnement de bureau\n\n\n\n\nRaspberry Pi # 4512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 5S navigationRécepteur GPSdans une pièce non chauffée\n\n\n\n\nRaspberry Pi # 5512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauCalendrier U-blox 7QRécepteur GPSen environnement de bureau\n\n\n\net voici une façon légèrement différente de regarder la valeur du décalage,\ntracer la valeur absolue du décalage, le rouge pour les décalages positifs et le bleu pour\ncompensations négatives. Les événements transitoires tels que les redémarrages ont été supprimés.\n\n\n\nRaspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigation Récepteur GPS dans une pièce non chauffée\n\n&lt;! &#8211;\n\n\nRaspberry Pi # 2512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigationRécepteur GPS\n      en environnement de bureau\n\n-&gt;\n\n\nRaspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigation\n GPS receveur\n      en environnement de bureau\n\n\n\n\nRaspberry Pi # 4512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyauU-blox 5S navigation\n GPS receveur\n      dans une pièce non chauffée\n\n\n\n\nRaspberry Pi # 5512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyau\n      Calendrier U-blox 7Q\n GPS receveur\n      en environnement de bureau\n\n\n\n \nCréation d&#39;une carte SD avec le système d&#39;exploitation\nVous pouvez acheter une carte SD avec le système d&#39;exploitation Linux installé et prêt\naller. Sachant que je devrais apporter des modifications au système d’exploitation, j’ai acheté un\ncarte SD prête à être programmée au cas où, mais j’ai fabriqué la mienne par\nen suivant les étapes ici: http://www.raspberrypi.org/downloads\n\nTéléchargez une image de système d&#39;exploitation pour la carte SD &#8211; 2012-09-18-wheezy-raspbian.zip \nDécompressez le contenu de l&#39;archive Zip dans un fichier .IMG \nTéléchargez le programme d&#39;écriture de carte SD: Win32DiskImager \nUtilisez l’imageur de disque pour écrire l’image du système d’exploitation sur la carte SD.\n\nJ&#39;ai ensuite branché la carte SD au Raspberry Pi, connecté\nau réseau, et le pouvoir appliqué &#8230;\n\nBeaucoup de gens ont demandé d&#39;ajouter un GPS à\nle Raspberry Pi sans avoir besoin de soudure, et maintenant cela est devenu une réalité grâce à la NTPI\nGPS Addon Board produit par Nevis Computers Ltd au Royaume-Uni. J&#39;ai utilisé le rpi_gpio_ntp\nprogramme a été développé par Folkert van Heusden et annoncé\ndans la liste de diffusion Time-Nuts, qui permet de travailler en mode utilisateur avec PPS\nsignal, ne nécessitant donc pas de version spéciale du système d’exploitation.\nLes versions actuelles de Raspbian n&#39;en ont plus besoin.\nC’est ce que vous obtenez dans la boîte du GPS NTPI Raspberry Pi\nCarte d&#39;extension (avec l&#39;option antenne puck):\n\nUne carte avec le périphérique GPS de qualité de synchronisation et le connecteur SMA\n    qui se branche sur le connecteur GPIO à 26 broches du Pi.\nUn  optionnel antenne GPS à rondelle magnétique, ou vous pouvez utiliser votre propre\n    antenne avec un connecteur SMA.\nVous aurez peut-être également besoin de: Une pile de secours CR2032, qui s’ajuste sur la face inférieure\n    de la carte.\n\n(Notez que l’antenne est une option supplémentaire et que vous devez acheter\nvotre propre batterie)\nPour que cela fonctionne avec un Raspberry Pi, voici les étapes que je\na pris. J&#39;ai inclus les étapes pour ajouter la surveillance MRTG et le fichier distant\naccès à partir de systèmes Windows, mais vous pouvez les omettre si vous n&#39;en avez pas besoin.\n\nConfigurer mon routeur pour réserver une adresse IP au Raspberry\n    Pi\nModification du nom de l&#39;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nNTP mis à jour pour le développement actuel\n    version (j&#39;ai utilisé une copie FTP d&#39;un autre Pi).\nConfigurez les E / S série sur le\n    Tarte aux framboises.\nGpsd installé et configuré et ses utilitaires.\nNTP configuré pour utiliser la mémoire partagée pendant un temps approximatif\n    (type de pilote 28.0).\nInstallé les outils PPS (sudo apt-get install pps-tools)\nInstallé le rpi_gpio_ntp\n    programme de Folkert van Heusden (seulement pour très tôt Raspbian\n    versions).\nNTP configuré pour utiliser le partagé\n    mémoire pour PPS (type de pilote 28.1).\nSNMP installé et configuré\n    divers collecteurs de données MRTG (facultatif).\nSNMP configuré pour surveiller la  CPU\n    Température (optionnel).\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC (facultatif).\nConfigurer le PC pour la mise en réseau sans fil\n    Clé USB Wi-Fi (en option).\n\n\n\nInstallé sur le Raspberry Pila carte ressemble à ceci. lele fil d&#39;antenne peut être retiréà travers un trou dans le boîtier près du connecteur Ethernet.\nNotez que cette carte utilise GPIO 18 pour son signal PPS, donc tout logiciel doit être configuré de manière appropriée.\n\n\n\n\nVous pouvez demander à quel point ce mode utilisateur fonctionne correctement. bien\nc&#39;est plutôt bien, mais pas assez aussi bon que le mode noyau, mais plus\nque suffisant pour la précision offerte par le Raspberry Pi. Peut-être le\nmieux que le Pi pourrait faire sinon serait la synchronisation via une connexion LAN à un\nStratum-1 serveur NTP. La comparaison de tracé ci-dessous montre le Pi synchronisé\nsur un serveur de strate-1 mais sur Wi-Fi, puis sur les performances après l&#39;installation\nle panneau d&#39;addition GPS NTPI. Un terrain idéal serait une ligne droite à la\nNiveau 500 microsecondes sur ce graphique (je dois ajouter un décalage car MRTG ne peut pas tracer\nnombres négatifs). La gigue moyenne sur 6 heures rapportée par NTP est passée de\n100-150 microsecondes à moins de 4 microsecondes. L&#39;amélioration de la marche\nde la synchronisation Wi-Fi à la synchronisation PPS, c&#39;est évident!\n\n \n\nMise à jour vers la dernière version de Raspbian Linux\nLa version de Linux que vous utilisez est affichée lorsque vous vous connectez, mais vous\npeut également utiliser la commande:\n  $ uname -a\npour montrer quelle version est en cours d&#39;exécution. J&#39;ai commencé avec:  Linux raspberrypi 3.12.26+ # 702 PREEMPT Wed Aug 6 17:43:49 BST 2014 armv6l GNU / Linux\nPour mettre à jour mon logiciel, j&#39;ai exécuté les commandes:\n  $ sudo apt-get update  $ sudo apt-get dist-upgrade  $ sudo rpi-update\net après le redémarrage, j&#39;ai terminé par:  Linux raspberrypi 3.12.32+ # 721 PREEMPT Fri Nov 7 16:50:31 GMT 2014 armv6l \nConfiguration de Linux pour PPS sur le port GPIO\nGrâce aux courriels de Olav Andrarde et Timo Kokkonen, j&#39;ai découvert que\nLe support PPS a été ajouté à Linux disponible pour le Raspberry Pi,\nbien que vous ayez besoin d&#39;ajouter quelques lignes à la configuration pour l&#39;activer.\nComme Raspbian évolue continuellement, la méthode exacte pour effectuer ces changements\névolue également, donc en fonction du moment où vous avez téléchargé Raspbian, vous devez suivre\nsoit le novembre 2014 ou le février\n2015 sections ci-dessous. J&#39;ai mis les informations les plus récentes en premier,\nbien que je préfère normalement que les choses soient énumérées dans l’ordre chronologique, comme dans un\njournal intime!\n    Versions Raspbian vers février 2015\nAprès avoir mis à jour un autre Raspberry Pi vers le dernier Raspbian &#8211; pour un nouveau\nRaspberry Pi 2 que j&#39;avais acheté &#8211; j&#39;ai découvert que les choses avaient changé une fois\nencore. Ces détails de mon démarrage rapide\npage. Versions de Linux: 3.18.6+ 3.18.7-v7\n  $ sudo nano /boot/config.txt\n&#8211; Ajouter dtoverlay = pps-gpio, gpiopin = 18\nsur une nouvelle ligne.\n   Si vous avez précédemment ajouté bcm2708.pps_gpio_pin = 18 à la fin de\ncmdline.txt, supprimez-le.   Sauver et fermer.\n  $ sudo nano\n/ etc / modules &#8211; Ajouter pps-gpio\nsur une nouvelle ligne.   Enregistrez, fermez et redémarrez.\nMaintenant, vérifiez que PPS fonctionne.\n    Versions Raspbian vers novembre 2014\nPour activer PPS sur le port GPIO, vous devez suivre deux étapes: l’une pour indiquer au\nnoyau pour inclure le support, et un pour amener le module de support à\nêtre chargé. Tout d’abord, indiquez au noyau que la broche 18 de GPIO doit être utilisée.\nCela active la prise en charge de PPS-GPIO dans le noyau. Ajouter ce texte au\nFichier /boot/cmdline.txt:\n  $ sudo nano /boot/cmdline.txt    ajouter:        bcm2708.pps_gpio_pin = 18    à la  fin de la ligne.    Ce doit être sur le même ligne, pas sur un Nouveau ligne,\ncomme l&#39;a découvert Ray Hunter!\nEnsuite, vous devez dire au noyau de charger le module qui fournit cette information.\nsoutien. Pourquoi cela ne peut pas être automatique, je ne sais pas! Ajouter le\nnom du module à la fin du fichier / etc / modules.\n  $ sudo nano / etc / modules    ajouter:       \npps-gpio     à la fin si la liste, et redémarrez. \nVérifier que PPS fonctionne\nPour vérifier que le module est chargé, vous pouvez utiliser la commande lsmod, par exemple\nexemple:\n  $ lsmod | grep pps\nLa sortie devrait être semblable à:\n  pps_gpio 2529 1  pps_core 7943 2 pps_gpio\nVous devriez maintenant pouvoir exécuter la commande ppstest et voir les transitions\nune fois par seconde, par exemple:\n$ sudo ppstest / dev / pps0 # appuyez sur Ctrl-C pour annuler .. essayer le source PPS &quot;/ dev / pps0&quot; a trouvé la source PPS &quot;/ dev / pps0&quot; ok, trouvé 1 source (s), commencez maintenant à récupérer les données &#8230; source 0 &#8211; assert 1351501153.999956346, séquence: 47481 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501154.999954601, séquence: 47482 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501155.999951856, séquence: 47483 &#8211; effacé 0,000000000, séquence: 0 ^ C\n\nNotez qu&#39;il n&#39;y a pas de valeur donnée pour le temps &quot;clair&quot;. Gary\nE Miller rapporte que le pilote pps-gpio ne cherche qu’un seul avantage, le positif\nbord allant. Si vous utilisez un appareil GPS différent de ceux mentionnés\nDans ce cas, vous aurez peut-être besoin d’un onduleur de sortie de 3,3 volts dans la ligne PPS du GPS. \n\n  L&#39;approche de Hauke ​​Lampe\nUniquement des informations historiques: Depuis que j&#39;ai écrit cette page pour la première fois, Hauke ​​Lampe a\ndisponible une image préconfigurée de Raspberry Pi OS ici.\nSon article est basé sur sa version d’un GPS série comme je le décris ici, mais vous devez le faire.\naucun des travaux de construction et de configuration que je mentionne ici. Ma framboise\nLa Pi # 3 fonctionne à partir de cette image de système d&#39;exploitation et je développe l&#39;installation GPS à l&#39;adresse\nle moment. Les commentaires et les changements jusqu&#39;à présent:\n\nModification de l&#39;adresse IP du port Ethernet en un numéro fixe\n    adresse (statique) &#8211; Comment\n    à.Remarque: Si vous faites cela, vous devrez peut-être éditer le fichier hosts sur votre ordinateur.\n    systèmes pour permettre l&#39;accès à l&#39;appareil par nom plutôt que par IP\n    adresse. Ajouter une ligne telle que:  192.168.0.51\n    framboise-pi-1 \n    au fichier (avec l&#39;adresse et le nom de votre RPi, bien sûr). Sur\n    Windows-8, notez que Windows Defender peut essayer de remplacer un hôte modifié\n    fichier avec celui par défaut, supprimant ainsi vos modifications! Sous Windows, le\n    Le fichier à modifier est  Windows  system32  drivers  etc  hosts, et vous devrez peut-être\n    Accès de niveau administrateur pour éditer ce fichier.\nModification du nom de l&#39;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nSNMP installé et configuré\n    divers collecteurs de données MRTG.\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC.\nConfigurer le PC pour la mise en réseau sans fil avec un ancien NetGear\n    Clé USB Wi-Fi (remplacée plus tard par une unité Edimax).\n\nQuelques utilitaires &quot;standard&quot; de Raspberry Pi\nne sont pas présents dans cette image de système d&#39;exploitation, et devront être téléchargés séparément avec\napt-get. Voici à quoi cela ressemble pour le moment. L&#39;antenne patch\nest attaché au ModMyPi blanc\navec du ruban adhésif double face, et la carte réceptrice avec un écrou simple et\nboulon. Les dérivations provenaient également de ModMyPi et la longueur de 150 mm n’est pas\nnécessaire ici! Le dongle Wi-Fi est à gauche. Graphiques de performance\nsont ici.\n\n\nComme mon application d’essai est pour un serveur NTP, je n’ai pas besoin de\nafficher sur le Raspberry Pi, ou d&#39;ailleurs un clavier et une souris connectés en permanence. Tous mes\nl&#39;interaction se fera via un terminal, et même cela sera émulé via programme\nfonctionnant sur un ordinateur distant, avec une connectivité via le port Ethernet du\nTarte aux framboises. Une telle opération est communément appelée un serveur sans tête.\nUn bloc d&#39;alimentation et un boîtier sont les seuls éléments que j&#39;ai ajoutés au Raspberry fourni\nPi. Il y a quelques conseils pour courir sans tête ici: http://glynrob.com/hardware/raspberry-pi-headless/\nVous avez besoin d’un programme terminal qui fonctionnera en mode SSH &#8211; I\nmastic utilisé\nsur un PC Windows XP.\nJ&#39;ai regardé sur mon routeur qui exécute DD-WRT pour voir l&#39;adresse IP\nqui avait été affecté au Pi, et j&#39;ai ensuite utilisé cette adresse pour exécuter\nPUTTY en mode SSH. J&#39;ai tout de suite une connexion avec l&#39;utilisateur par défaut\nnom et mot de passe. Vous pouvez enregistrer les paramètres du Pi depuis PUTTY.\n(J&#39;ai appelé le mien &quot;RaspberryPi&quot;), et fais un raccourci Windows pour se connecter\nà votre Pi avec des valeurs telles que:\n\nCible: C:  Tools  PuTTY  PUTTY.EXE -load RaspberryPi\nCommencez dans: C:  Tools  PuTTY\n\nVotre chemin d&#39;accès et le nom des paramètres enregistrés seront différents.\nCommande Linux pour se déconnecter et se déconnecter:\nse déconnecter\nAu fait, en ajoutant un serveur X-windows\nprogramme tel que Xming sur votre PC, vous pouvez voir les graphiques du Raspberry Pi\naussi, si vous voulez, mais c&#39;est  ne pas nécessaire pour les opérations décrites\nici &#8211; vous pouvez tout faire directement à partir de la ligne de commande.  \nMise à jour du système d&#39;exploitation\nJ&#39;ai suivi le conseil ici\npour mettre à jour le système d&#39;exploitation, bien que je ne pense pas que c&#39;était vraiment nécessaire car le système d&#39;exploitation\ntéléchargé n&#39;avait qu&#39;un mois. Pour exécuter les commandes nécessite des privilèges\naccès, obtenu ici en préfixant la commande avec sudo.\nL’exécution de ces commandes prend beaucoup de temps et nécessite un accès Internet depuis\nvotre Pi. Prévoyez 30 à 45 minutes.\n\n\n$ sudo apt-get update\n\n\n$ sudo apt-get dist-upgrade\n\n\nVous devrez probablement redémarrer le système d&#39;exploitation après avoir apporté les modifications suivantes:\n\n\n$ sudo reboot\n\n\nSi vous souhaitez déterminer quelles mises à niveau sont en attente, essayez:\n\n\n$ sudo apt-get --just-print upgrade\n\n\net redirigez la sortie vers un fichier texte. Merci à Graham\ndans le comté de Durham, au Royaume-Uni, pour ce conseil. \nRéglage du fuseau horaire\nVous voudrez peut-être vérifier que le Raspberry Pi est configuré pour\nvous donner l&#39;heure dans votre fuseau horaire local: Utilisez la commande:\n\n$ sudo dpkg-reconfigure tzdata\n\net sélectionnez la région et la ville appropriées. Pour le Royaume-Uni,\nJ&#39;ai choisi l&#39;Europe / Londres. La procédure reflétera les données du fuseau horaire et\ndate et heure actuelles à l&#39;heure locale et à l&#39;heure UTC à la fin. \nBien qu’il existe une interface graphique avec laquelle\nconfigurer le Wi-Fi, cela ne semblait pas fonctionner pour moi. En tout cas, si vous\nfonctionnent sans tête, vous pouvez même ne pas avoir accès à l&#39;interface graphique. le\nadaptateur réseau que j&#39;ai utilisé était l&#39;adaptateur USB nano sans fil 150Mbps Edimax EW-7811UN\nunité, que j&#39;ai reçu d&#39;Amazon (juste prix et bonne livraison).\nIl semble y avoir trois étapes:\n\nConvertissez le mot de passe Wi-Fi en chaîne hexadécimale (cela peut être\n    optionnel):  $ sudo wpa_passphrase VotreSSID\n    Votre mot de passeVous obtiendrez un résultat hexadécimal tel que &quot;b7d90db3ddbd11d5ddb3dbfd81de&quot;\n    dont vous aurez besoin plus tard.  \nEditez le fichier /etc/wpa_supplicant/wpa_supplicant.conf  $ sudo nano /etc/wpa_supplicant/wpa_supplicant.confpour le faire ressembler à ceci:\nctrl_interface = DIR = / var / run / wpa_supplicant GROUP = netdevupdate_config = 1réseau = {ssid = &quot;YourSSID&quot;proto = WPA RSNscan_ssid = 1key_mgmt = WPA-PSKpaire par paire = CCMP TKIPgroupe = CCMP TKIPpsk = b7d90db3ddbd11d5ddb3dbfd81deNotez que le ssid doit être entre guillemets.  \n\nEditez le fichier / etc / network / interfaces   $ sudo nano / etc / network / interfacespour le faire ressembler à ceci:\nauto lo\niface lo inet loopbackiface eth0 inet dhcp\nallow-hotplug wlan0auto wlan0iface wlan0 inet dhcpWireless-Essid YourSSIDpre-up wpa_supplicant -B w -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.confKillall -q wpa_supplicant\niface default inet dhcp\n  \n\nVous pouvez ensuite utiliser le $ sudo ifdown\nwlan0 et $ sudo ifup wlan0 commandes à\nredémarrez le réseau sans fil. Je conseillerais également un redémarrage pour assurer\nque tout s&#39;est passé comme prévu. \nComment éditer la configuration NTP\nLe fichier de configuration NTP réside dans le répertoire / etc, de sorte que vous\npeut changer dans ce répertoire pour éditer le fichier. Parce que le fichier est un\nfichier système, vous devez  sudo commande permettant de sauvegarder la version modifiée du\nfichier, mais d’abord, j’ai fait une copie (cp) du fichier fourni juste au cas où je me suis planté\net a dû revenir à la configuration de travail NTP. J&#39;ai utilisé le  vi\néditeur qui est fourni avec le système d&#39;exploitation, et il y a des instructions pour vi ici,\net aussi à\nGuru99.com dans le cadre d&#39;un Linux / Unix\ntutoriel pour débutants.\nle  nano éditeur que j’ai découvert plus tard, et qui est fourni avec le Raspberry Pi, est un bien meilleur choix &#8211; beaucoup\nplus facile à utiliser!\n\n\n$ cd / etc\n\n\n$ sudo cp ntp.conf ntp-original.conf\n\n\n$ sudo nano ntp.conf\n \n\n\nJe voulais pouvoir surveiller NTP depuis un autre PC sur mon réseau local,\nplutôt que d’ajouter le programme de surveillance MRTG au Pi, mais il existe des\nlignes qui limitent l’accès au NTP fonctionnant sur le Pi par défaut\ninstallation. Ces lignes du fichier ntp.conf commencent par le mot clé\n&quot;restreindre&quot;. J&#39;ai supprimé ces restrictions en les commentant\nlignes &#8211; ce qui est réalisé en ajoutant un caractère de hachage au début de la\nligne. Par exemple:\n\nRemplacer:\n    restreindre -4 par défaut kod notrap nomodify nopeer noquery\n\nAvec:\n    # restreint -4 par défaut kod notrap nomodify nopeer noquery\n\nAprès avoir modifié ntp.conf, vous devez redémarrer le démon ntp:\n\n\n$ sudo /etc/init.d/ntp restart\n\n\nSi la sécurité sur votre réseau vous préoccupe, vous pouvez\nsouhaite être plus sélectif en modifiant les restrictions. \nBien que le contenu par défaut de ntp.conf fonctionne correctement\nDans la plupart des cas, ils ne profitent pas de la nouvelle directive NTP POOL pour\nspécifier les serveurs de pool. J&#39;ai également modifié le pool générique &quot;debian&quot;\nà la piscine plus locale &quot;UK&quot;. J&#39;ai donc changé le serveur\nbassin. lignes à une directive de pool unique:\n\nRemplacer:\nserveur 0.debian.pool.ntp.org iburst\nserveur 1.debian.pool.ntp.org iburst\nserveur 2.debian.pool.ntp.org iburst\nserveur 3.debian.pool.ntp.org iburst\nAvec:\npool fr.pool.ntp.org iburst\n\nMon propre réseau local possède trois serveurs NTP de strate 1, un sur FreeBSD et\ndeux exécutant Windows, alors j&#39;ai ajouté ceux\navant les serveurs de la piscine. Bien sûr, cela est spécifique à mon réseau local. Pour\nl&#39;offset minimum, j&#39;ai fait interroger NTP les serveurs locaux à 32 secondes (2 ^^ 5)\nintervalles, et n&#39;a pas permis que cela dérive vers le haut vers les 1024 secondes\nintervalle maximum que NTP atteindrait laissé à ses propres périphériques. j&#39;ai fait ça\navec les qualificatifs minpoll et maxpoll. Cependant, je ne voulais pas forcer\nles serveurs Internet à interroger que souvent (on considère au mieux\nau pire pourrait vous faire bloquer par un serveur), alors j&#39;ai donc fait\nl&#39;intervalle d&#39;interrogation minimal pour les serveurs Internet, 1024 secondes\n(2 ^^ 10). J&#39;ai enlevé les choses qui avaient été commentées pour simplifier le fichier,\net le rendre plus facile à comprendre. C&#39;est pourquoi mon fichier ntp.conf s&#39;est terminé comme suit:\n\n# /etc/ntp.conf, configuration pour ntpd; voir ntp.conf (5) pour obtenir de l&#39;aide\n\n# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n\n# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst\n\nN&#39;oubliez pas de redémarrer NTP après avoir apporté les modifications. De\nPC de surveillance Windows avec NTP installé\nJe vois maintenant:\n\nC: &gt; ntpq -p raspi\n     référence distante st t lorsque l&#39;interrogation atteint le décalage de retard de gigue\n=============================================== ============================\n* pixie .PPS. 1 u 26 32 377 0,467 -0,010 0,023\n+ feenix .PPS. 1 u 4 32 377 0,603 -0,226 0,039\n+ stamsund .PPS. 1 31 31 377 0,586 0,004 0,040\n-dns0.rmplc.co.u 193.62.22.74 2 707 1024 377 21.915 3.490 2.295\n-dns1.rmplc.co.u 193.62.22.74 2 u 177 1024 377 23.736 4.609 3.621\n-dawn.rt.uk.eu.o 193.79.237.14 2 277 1024 377 20.508 3.150 3.065\n-lyla.preshweb.c 129.215.42.240 3 u 544 1024 377 28.082 5.937 3.944\n\nC: &gt; ntpq -c rv raspi\nassocid = 0 status = 0615 leap_none, sync_ntp, 1 événement, clock_sync,\nversion = &quot;ntpd 4.2.6p5@1.2349-o ven. mai 18 20:30:57 UTC 2012 (1)&quot;,\nprocesseur = &quot;armv6l&quot;, système = &quot;Linux / 3.2.27 +&quot;, saut = 00, strate = 2,\nprecision = -20, rootdelay = 0.467, rootdisp = 2.387, refid = 192.168.0.3,\nreftime = d4365966.98133154 sam., 27 oct. 2012 14: 00: 22.594,\nclock = d4365984.f4e4138b sam. 27 oct. 2012 14: 00: 52.956, homologue = 49569, tc = 5,\nmintc = 3, offset = -0,010, fréquence = -43,888, sys_jitter = 0,023,\nclk_jitter = 0.015, clk_wander = 0.008\n\nUne approche pour que le NTP voie\nla partie série du flux de sortie du récepteur GPS (pour la partie grossière du\ntemps, les secondes) est d&#39;installer\nle pilote gpsd, et cela permet une vérification de la base\nconnectivité. Le GPS que j&#39;ai commencé à utiliser était un Trimble Resolution SMT,\npour lequel j&#39;ai réussi à obtenir à la fois une carte d&#39;évaluation et une carte d&#39;interface\nconverti la sortie série en RS-232 et USB. J&#39;ai utilisé le feuilleton\nvia USB plutôt que le RS-232 pour le Raspberry Pi.\n\n\n\nC&#39;est le GPS que j&#39;ai utilisé. Il\n      est une carte d’évaluation pour un récepteur de synchronisation GPS monté en surface, le\n      Trimble Resolution SMT. C&#39;est un peu inhabituel d&#39;avoir un format TSIP\n      sortie plutôt que le format NMEA standard, mais le gpsd Linux peut\n      reconnaître et accepter ce format. La sortie est sur un en-tête à 8 broches avec un non standard\n      espacement des broches! Il est assez sensible pour utiliser un support magnétique.\n      Rondelle GPS dans ma salle informatique à l&#39;étage supérieur.\n\n\n\nJuste comme j&#39;ai acquis le conseil,\n      il y avait une offre sur la liste de diffusion time-nuts pour un \n      interface prête à l&#39;emploi. Cela a un connecteur correspondant à 8 broches, et\n      fournit une sortie PPS, une sortie série aux niveaux RS-232 (non utilisé ici) et dispose d&#39;un convertisseur série-USB intégré! Idéal!\nFaites attention en utilisant d’autres unités GPS que vous n’aurez pas\n      dépasser +3,3 V sur le signal PPS transmis au Raspberry Pi, sous forme de signal 5 V\n      niveau sera  dommage le dispositif. J&#39;ai utilisé un diviseur résistif\n      (non représenté) pour réduire le niveau à une valeur nominale de 3,2 V.\nJ&#39;ai soudé un diviseur résistif 3k9 * + 6k8 au PPS\n      en-tête, puis a soudé un câble double alimenté en un en-tête de 0,1 pouce que j’ai eu à traîner.\n      Je l&#39;ai connecté à des broches\n      GND et GPIO-24 sur le 26 broches  Raspberry Pi GPIO\n      entête.* &#8211; incorrectement donné comme 1k0 plus tôt.\n\n\n\nTout d’abord, j’ai connecté l’appareil au port USB inférieur, puis\nvérifié ce qui était vu sur les ports USB.\n\n\n$ sudo lsusb\nPériphérique de bus 001: ID 1d6b: 0002 concentrateur racine Linux Foundation 2.0\nBus 001 Appareil 002: ID 0424: 9512 Standard Microsystems Corp.\nBus 001 Appareil 003: ID 0424: ec00 Standard Microsystems Corp.\nDispositif de bus 001 005: ID 04d8: 00df Microchip Technology, Inc.\n\n\nIl semble que mon GPS apparaisse sous le numéro 005 dans cette liste, mais\ncomment sera-t-il nommé? Pour vérifier cela, vous devez parcourir l’un des\nFichiers journaux Linux:\n\n\n$ more / var / log / syslog\n\n\net dans mon cas, au moment où j&#39;ai branché l&#39;appareil là-bas\nétait une référence à: ttyACM0:et j&#39;ai reconnu\ntty comme un port série (TeleType d&#39;il y a longtemps!). Si vous utilisez un vrai\npériphérique série, il apparaîtra comme ttyAMA0.\n  Les prochaines étapes sont à\ninstallez le logiciel gpsd et démarrez le service gpsd pointant sur l&#39;appareil\nnom vient de découvrir:\n\n\n$ sudo apt-get installez gpsd gpsd-clients python-gps\n\n\nÀ partir d&#39;un rapport que j&#39;ai reçu, si vous rencontrez des erreurs avec l&#39;étape ci-dessus, vous devrez peut-être exécuter une mise à jour vers apt-get:\n$ sudo apt-get update\net éventuellement alors:\n$ sudo apt-get upgrade\nqui peut mettre à niveau l&#39;ensemble du système d&#39;exploitation vers la version actuelle.\n\n\n$ sudo gpsd / dev / ttyACM0 -n -F /var/run/gpsd.sock\n\n\nÀ ce stade, vous devriez pouvoir voir une sortie en mode texte\ndepuis votre récepteur GPS en exécutant la commande &quot;cgps\n-s&quot;, quelque chose comme ce qui suit.\n\n\n$ cgps -s\n\n\n\nNotez qu’il s’agit d’un GPS en mode chronométrage, il préférera\nsatellites qui ont une altitude plus élevée, car ceux-ci sont moins susceptibles d&#39;avoir\neffets multi-chemins ou réflexions. Cependant, pour le niveau de précision de\nque nous visons (microsecondes, pas nanosecondes), ce raffinement n’est pas\nessentiel, et je ne pouvais voir aucune différence significative entre un\n&quot;timing&quot; GPS and a &quot;position&quot; GPS on the microsecond level. \nNote that you will need to make gpsd start automatically at boot time,\nand to tell the configuration tool what device to use, and add the &quot;-n&quot;\noption for working with NTP. See the note later in this\ndocument. \nTelling NTP the seconds from the GPS\nNow that gpsd is working, we can edit the NTP configuration to\nadd a type 28 reference clock which will make NTP look at the shared memory\ncreated by gpsd.  This can be done for both the coarse time (seconds) and\nthe fine time (PPS edge) with a 28.0 and a 28.1 driver, although I only use the\n28.0 driver here as the Raspberry Pi supports PPS via a kernel-mode driver (more\nlater).  The first step is\nto get the seconds alone, and be aware that this will ne pas be better than\nInternet time alone due to the offset of the serial/USB data from the true\nsecond, and because of the variability and drift in this offset.  We will\nneed to add a connection later between the PPS signal and one of the Raspberry Pi&#39;s I/O\npins to generate a PPS interrupt.  Here is my modified ntp.conf file. \nI&#39;ve used 0.000 for the time1 modifier to start with, so that we can determine\nan approximate value for the delay of the serial data from the GPS after ntp is\nup and running.  I changed the refid for the type 28 driver to &quot;SHM&quot;\nto indicate more clearly that the data is coming from the SHared Memory provided\nby gpsd.\nNote that I have marked more than one server as\n&quot;prefer&quot;.  This is because if the first preferred server goes\noffline, it appears that NTP will no longer accept the PPS data as valid (is\nthat wise?), so a second preferred server is configured to cover that\npossibility.  In my case, it happens because 192.168.0.3 sometimes has an\nNTP update, causing its NTP to go offline for some seconds, and hence causes a\nglitch in the connected servers.  Having more than one preferred server\nshould prevent that.\n\n# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.000 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst prefer\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst\n\nNote that when using a PPS source you doit have one\nother server marked &quot;prefer&quot;.  In the example above I have added\nprefer to the shared memory driver (type 28) so that the combination of PPS and\nGPSD would provide the correct time even with no Internet servers.  Looking at the output from ntpq -p after some time we might\nsee:\n\nC:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\nxSHM(0)          .SHM.           15 l   15   16  377    0.000  -353.23   1.277\n*pixie           .PPS.            1 u   25   32  377    0.484   -0.016   0.105\n+feenix          .PPS.            1 u   31   32  377    0.592   -0.120   0.044\n+stamsund        .PPS.            1 u   16   32  377    0.546   -0.037   0.083\nxns0.luns.net.uk 157.44.176.4     2 u 1656 1024  156   31.904    3.702   5.455\nxtime.videxio.ne 131.188.3.223    2 u  45m 1024   74   31.765    8.590   2.796\nxlyla.preshweb.c 129.215.42.240   3 u  510 1024  377   25.568    4.793   5.990\n-dawn.rt.uk.eu.o 193.67.79.202    2 u  492 1024  367   20.308    2.408   2.903\n\nand while the SHM driver is present and connected (reach =\n377), it has been rejected by NTP (the &quot;x&quot; in the first column),\nperhaps because its offset was consistently too great compared to the other\nservers.  That&#39;s the purpose of the time1 modifier in the &quot;fudge&quot;\ncommander. We can see that the SHM output is some 350 milliseconds later, so\nwe can use that value for time1 to bring the GPS output approximately into line\nwith UTC, as shown in the edited /etc/ntp.conf below.  (The time values in\nthe ntpq -p display are all in milliseconds).\nHint: if at this point the reach field for the SHM\ndevice stays at zero, likely the gpsd wasn&#39;t started with the &quot;-n&quot;\noption. You can make the gpsd always start at system boot time with that -n\noption as described later in this note.\n\n# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst\n\nThe output from ntpq -p then shows the offset for the SHM\ndriver to be much nearer to zero, and this /might/ be good enough for you if you\nare out in the field with no other reference.  But we can do better, and\nthe next step is to use the precise PPS signal from the GPS to improve the\naccuracy down to the microsecond level.\n\nC:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n-SHM(0)          .SHM.           15 l    1   16   17    0.000    1.766   0.943\n*pixie           .PPS.            1 u   13   32    3    0.421   -0.325   0.194\n+feenix          .PPS.            1 u   13   32    3    0.528   -0.644   0.969\n+stamsund        .PPS.            1 u   11   32    3    0.409   -0.336   0.145\n-dns0.rmplc.co.u 195.66.241.2     2 u   35 1024    1   22.872    3.604   5.037\n-mail1.itdojo.or 10.10.120.2      2 u   34 1024    1   38.472    3.324   7.084\n ntp.fundamental 193.62.22.82     2 u   33 1024    1   30.980    2.450   3.837\n 82.113.154.206  193.62.22.82     2 u   32 1024    1   19.219    0.683   5.880\n\nNote: if you are working stand-alone, without any Internet servers, you may\n  need an extra &quot;flag1 1&quot; in the fudge for the type 28\n  ref-clock.  Please see the notes here\n  for further information.  Thanks to Whitham D. Reeve Anchorage, Alaska USA\n  for the testing.\n \nBut my time is 16 seconds out!\nI did notice with the GPS unit that I have that it doesn&#39;t\nhave battery backup, so when it first starts it has to download quite a lot of data\nfrom the GPS satellites before it has full lock.  While the PPS signal\nis acquired quite quickly, it takes a few minutes for the receiver to determine\nthe number of seconds offset between GPS-time GPST) and the usual UTC.  As I\nwrite, that GPST-UTC offset is 16 seconds &#8211; the offset is because recent\nleap-seconds are not applied to GPS time &#8211; plus\ninformation. The implications of this are different\ndepending on what other servers you have configured in your ntp.conf file\n\nIf you have some Internet or LAN servers, ntp is clever\n    enough to ignore the obvious &quot;bad chimer&quot;, and may simply display a\n    large offset for the GPS in the  ntpq -p output when starting\n    up. Après\n    a few minutes, the offset will revert to the correct value.  The delay\n    is not a problem in this case. \nIf you have no other source than the GPS, then you should\n    probably wait a few minutes before assuming that even the coarse seconds\n    part of the time is correct.  I haven&#39;t checked how long it will take\n    NTP to step the clock by the 16 seconds needed after the GPS starts sending\n    UTC rather than GPS time.  If your GPS does this, consider adding some\n    sort of battery backup so that the GPS-UTC offset is stored while the unit\n    is down.\n\nQuite why I saw this issue while using gpsd\nis uncertain.  Since writing the above I have been in contact with the\nauteur de gpsd who tells me that protection is\nincorporated into the gpsd software whereby it\nwill not pass on the time to its shared memory until the output from the GPS\nreceiver has a (GPST-UTC) value in excess of 10 seconds.  So I should never\nhave seen the 16 seconds faster value at all.\nPlease note that this problem is likely peculiar to my\nparticular GPS receiver &#8211; an\nevaluation board with no battery backup.  Just be aware of this problem in\ncase it bites you!  It doesn&#39;t happen with the u-blox pure serial GPS\nreceiver I describe later, as this board has battery\nbackup.  &quot;Your mileage may vary&quot;, as they say! \nThe next step was to get the PPS working.  This requires\nupdating the Linux kernel for the Raspberry Pi, and while you can do that\nyourself, there is a ready-made kernel image and support modules available on\nthe Web.  Much of the information below is based on David K&#39;s Web page:\n  https://github.com/davidk/adafruit-raspberrypi-linux-pps\nYou can check the version of the kernel you are running at the moment by:\n\n\n$ uname -a\nLinux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux\n\n\nFirst you need to get the updated kernel image and\nmodules.  At the time of writing, these were available for the current\nversion of the OS from chrisprt as mentioned here:\nKernel image: https://docs.google.com/open?id=0BznvtPCGqrd3ZElKZHEtUDRpUEUModules: https://docs.google.com/open?id=0BznvtPCGqrd3VTZ2TmxFTktYM0E\nThese come down as Zip files and, as I wasn&#39;t sure about\ndownloading these from Google Docs directly on the Raspberry Pi, I downloaded\nthem to a local Windows FTP server first, and then installed an FTP client on the\nRaspberry Pi to drag the Zip files across in FTP image mode &#8211; i.e. binary files.\n\n\n# Installing an FTP client:\n$ sudo apt-get install ftp\n\n\nI could then use standard FTP command to drag the files from\nmy local FTP server to the Raspberry Pi.  I created a directory named pps\nbelow the home user directory for the files, and then unzipped the archives I\nhad copied:\n\n\n$ mkdir pps\n\n\n$ cd pps\n\n\n# FTP get 3.2.27-pps-g965b922-dirty.zip in binary (image) mode.\n# FTP get kernel-pps-gpio24.zip in binary (image) mode\n(substitute your own commands here).\n\n\n$ unzip kernel-pps-gpio24.zip\n\n\n$ unzip 3.2.27-pps-g965b922-dirty.zip\n\n\nIn the pps/kernel-pps-gpio24 directory you will find a file\nkernel-pps-gpio24.img.  This must be renamed and moved to the /boot/ directory, while we first\ntake a safety copy of the original kernel image.\n\n\n$ sudo mv /boot/kernel.img /boot/kernel.img.orig\n\n\n$ sudo cp kernel-pps-gpio24.img /boot/kernel.img\n\n\nNow we need to move the module files into the area where the\nnew kernel expects to find them.  I found the command on the Web page\neither confusing or wrong, as I ended up with the wrong structure to start\navec. What it appears to need is:\n\n/lib/modules/3.2.27+\n/lib/modules/3.2.27+/kernel\n/lib/modules/3.2.27+/modules.*\n/lib/modules/3.2.27-cutdown+\n/lib/modules/3.2.27-cutdown+/kernel\n/lib/modules/3.2.27-cutdown+/modules.*\n/lib/modules/3.2.27-pps-g965b922-dirty\n/lib/modules/3.2.27-pps-g965b922-dirty/kernel/\n/lib/modules/3.2.27-pps-g965b922-dirty/modules.*\n\nYou will find both the kernel directory and the modules files\nin the unzipped 3.2.27-pps-g965b922-dirty directory, so the following command\nmay work correctly for you.  I made a mess of this having followed the Web\npage verbatim, and not having made allowances for the differences in the file\nNom. Assuming you are now in the pps directory, move the required files to\nthe /lib/modules directory, and add the pps-gpio module to the module list:\n\n\n$ sudo mv 3.2.27-pps-g965b922-dirty /lib/modules/3.2.27-pps-g965b922-dirty\n\n\n$ echo &quot;pps-gpio&quot; | sudo tee -a /etc/modules\n(Command corrected, thanks Matthew Huxtable!  Alternatively edit \n /etc/modules using the nano editor to add the pps-gpio at the end.\n$ sudo nano /etc/modules\n\n\n$ sudo reboot  \n\n\nYou will see the changed kernel name at the next login,\n    and you can check with the uname -a command as before:\n  \n\n\n$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux\n \n\n\nAn aside &#8211; what is a module in Linux?\n\nYou may be used to the idea of device drivers for Windows &#8211;\nthose .SYS files &#8211; but what are &quot;modules&quot; in Linux and how do they\nrelate to device drivers?  I asked that question on the time-nuts list, and\ngot this reply from Michael Tharp:\n\n&quot;Linux modules are the same, although Linux modules almost always need to be\n  compiled against the specific kernel version while Windows drivers are typically only bound to which release you&#39;re running. \n  That is the reason you have to compile the kernel, rather than just plop down a driver\n  downloaded from the internet. \n&quot;That said, the reason your PPS driver is a module is that it makes it easier to tweak options. \n  Almost all modules that are part of the main kernel source (which PPS is, for a year or so)\n  can be compiled in rather than as a separate module, but you can pass options to a module as you load it while you cannot do that with a\n  built-in.  It also makes it possible to tweak the source, recompile just that module, and test it on the fly rather than recompiling the entire\n  kernel and rebooting.&quot;\n\nMany thanks, Michael. \nChecking the PPS is working\nTo check that you are running the new kernel and that the pps-gpio\nmodule is loaded, then install the pps-tools et\nrun it to see the changes on pin 24 (assuming you have a 3.3 V PPS signal\nconnected.  Warning: faire ne pas connect a 5 V signal to the GPIO pins!\n\n\n$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux\n\n\n$ dmesg | grep pps\n[ 0.000000] Linux version 3.2.27-pps-g965b922-dirty (root@bt) (gcc version 4.\n6.2 (Ubuntu/Linaro 4.6.2-14ubuntu2~ppa1) ) #1 PREEMPT Sat Sep 22 16:30:50 EDT 20\n12\n[ 1.866364] usb usb1: Manufacturer: Linux 3.2.27-pps-g965b922-dirty dwc_otg_h\nCD\n[ 12.797224] pps_core: LinuxPPS API ver. 1 registered\n[ 12.803850] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giome\ntti \n[ 12.824858]  pps pps0: new PPS source pps-gpio.-1\n[ 12.832182] pps pps0: Registered IRQ 194 as PPS source\n[ 133.043038] pps_ldisc: PPS line discipline registered\n[ 133.044841] pps pps1: new PPS source acm0\n[ 133.044879] pps pps1: source &quot;/dev/ttyACM0&quot; added\n\n\n$ sudo aptitude install pps-tools # may take some time\n\n\n$ sudo ppstest /dev/pps0 # press Ctrl-C to cancel.. \ntrying PPS source &quot;/dev/pps0&quot; \nfound PPS source &quot;/dev/pps0&quot; \nok, found 1 source(s), now start fetching data... \nsource 0 - assert 1351501153.999956346, sequence: 47481 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501154.999954601, sequence: 47482 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501155.999951856, sequence: 47483 - clear 0.000000000, sequence: 0 \n^C\n\n\nThe &quot;clear&quot; entries showing as zero is correct for\nthis driver implementation.  Note that if you don&#39;t have a PPS signal\nconnected to GPIO pin 24 the last three lines from the dmesg output may be\nmissing.  In the output above, the PPS source was only registered some 133\nseconds after startup, possibly the length of time it took the GPS to\nlock.  On a second system with no PPS connected the last three lines were\nmissing.\nThis test should still work even with NTP running and using the PPS signal.  \nUnfortunately, the version of NTP supplied with the Raspberry\nPi Linux does not support PPS.  Likely it has been compiled to minimise its\nmemory and disk footprint.  These are the steps to download, compile and\ninstall NTP (with help from jbeal&#39;s\nposting). You can choose between a release and a development version\nas shown in step 4 below. You could also use a copy of the development tarball on\nyour own local FTP server.  So from logging in, here are the steps. \nThe lines below are shown for development version ntp-dev-4.2.7p397, but you\nwill need to alter the version number to suit the version you wish to compile. \nThe two time-consuming steps (configure and make) appear to be CPU limited\nrather than SD-card I/O access limited. \nYou can see which version I am currently running here.\n\n\n$ mkdir ntp                  # make a convenient working directory, if you don&#39;t already have one\n\n\n$ cd ntp                     # enter that directory\n\n\n$ sudo apt-get install libcap-dev\t# once-off, required to prevent later file not found error\n$ sudo apt-get install libssl-dev\t# once-off, you may not need this, but reports suggest you might to build keygen\n\n\n# Get the desired tarball, current or development - use one of the following:\n$ wget http://archive.ntp.org/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz\t\t\t\t\t# release\n$ wget http://archive.ntp.org/ntp4/ntp-dev/ntp-dev-4.2.7p397.tar.gz\t\t\t# development\n \n(May redirect to:  https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz)\n\n\n$ tar xvfz ntp-4.2.8p10.tar.gz\n\n\n$ cd ntp-dev-4.2.8p10\n\n\n$ ./configure --enable-linuxcaps\t# takes 11-15 minutes\n\n# If your PPS doesn&#39;t work and you get a &quot;clock type 22 invalid&quot; message, be sure to install pps-tools\n# first, and clear out the directory:  cd ~/ntp, rm -r ntp-dev-4.2.7p397, and start again from step 5.\n\n# It seems that the --enable-linuxcaps flag may not be required on other Linux variants,\n# or on the RPi with later versions of Linux with PPS and pps-tools installed.\n# It is required for the more recent Raspbian Jessie (later 2015).\n\n\n$ make\t\t\t\t\t# takes 18-25 minutes\n(use &quot;make -j5&quot; for faster execution on the four-core Raspberry Pi 2/3.)\n\n\n# This removes the original NTP and installs the new.\n# Step may not be needed - see below.\n# Recommend: omit this step.\n$ sudo apt-get remove ntp    # get rid of previously existing install of ntpd\n\n\n$ sudo make install          # puts ntp* in /usr/local/bin/ntp*, takes 30-60 seconds\n\n\nIt is not entirely clear to me whether step 9 above is\nrequired.  It does not appear to be when updating from 4.2.7p304 to\n4.2.7p321, for example. je suis ne pas using step 9.\n  Once you have a new set of NTP\nbinaries, you first need to stop NTP, use super-user mode to copy the binaries\nto their final directory, and then restart NTP.  Once restarted, a simple\ncheck that it&#39;s working correctly.  I recommend these steps,\nalthough there are alternatives.  See the note below about step 2.\n\n\n$ sudo /etc/init.d/ntp stop\n\n\n$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/\n\n\n$ sudo /etc/init.d/ntp start\n\n\n$ ntpq -crv -pn\t\t# optional step to check for version and basic function\n\n\nRemarque:  on some more recent versions of Raspbian steps 1\nand 3 may require:\n \n\n\n$ sudo service ntp stop\n\n\n$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/\n\n\n$ sudo service ntp start\n\n\nRemarque: that on some systems the binary ntp* files will\nbe written to a mixture of /usr/local/bin et /usr/local/sbin,\naccording to the paths defined in sntp/loc.  I have been told that the\n&quot;sbin&quot; is for system files (i.e. ones not usually run by users such as\nservers and daemons, and the &quot;bin&quot; is for files usually executed by\nusers).  For Debian, for just the ntp* files, this is:\n \n\n# Debian installations and man page suffixes\nMDOC\nntp-keygen,sbin,8\nntp-wait,sbin,8\nntpd,sbin,8\nntpdate,sbin,8\nntpdc,bin,1\nntpdsim,sbin,8\nntpq,bin,1\nntpsnmpd,sbin,8\nntptime,sbin,8\nntptrace,bin,1\n\nso you may need to check both directories to get the most\nrecent files.  Check with &quot;ls -l&quot; which shows the file date.\n \nA confession: I did alter one system to\npoint the NTP start-up to the directory I preferred, rather than leaving it\npointing to an old version.  I suspect that in my own personal use, only\nthe ntpd and ntpq executables matter.  \n \nUpdating multiple Raspberry Pi cards\n \nIf, like me, you have multiple Raspberry Pi cards, you will\nnot want to waste almost an hour compiling and updating NTP on each card. \nFortunately, my experience so far using the development versions of NTP\n(4.2.7p&#8230;) suggests that simply copying the binaries from one Pi to another\nworks as expected.  This may be luck, or it may be because the OS\ndifferences between Linux/3.2.27+ and Linux/3.6.11+ are not that great. Si\nyou have access to an FTP server (I used a Windows PC running IIS) you may be\nable to use commands such as those below to save a compiled version from one Pi\nand load it onto another.  You may need to use  sudo\napt-get install ftp  if FTP is not already available. Step 5 is required once. Étape\n7 is required for each new version you save. \nReplace &quot;368&quot; in the steps below with the version number you have just\ncompiled.\n \nTo save the newly compiled versions:\n \n\n\n$ ftp \n\n\n(Login as Anonymous or known user)\n\n\nbin  (forces binary mode)\n\n\nmkdir RaspberryPi  (step only needed once)\n\n\ncd RaspberryPi\n\n\nmkdir 397-safe  (step needed once per new version)\n\n\ncd 397-safe\n\n\nprompt   (may disable prompting for steps 10 and 13)\n\n\nlcd /usr/local/bin\n\n\nmput ntp*\n\n\n(respond Y to the prompt for all the files)\n\n\nlcd /usr/local/sbin\n\n\nmput ntp*\n\n\nls -l  (to check that all eight files are there and have the date you expect)\n\n\nquitter\n \n\n\nTo load a new version onto another Raspberry Pi:\n \n\n\n$ cd /usr/local/bin\n\n\n$ sudo ftp \t# sudo allows writing to system directories\n\n\n(Login as Anonymous or known user)\n\n\nbin  (forces binary mode)\n\n\ncd RaspberryPi/397-safe\n\n\nls -l  (to check that the files there are correct and have the date you expect)\n\n\nmget ntp*\n\n\n(respond Y to the prompt for all the files)\n\n\nquitter\n\n\n$ sudo /etc/init.d/ntp stop\n\n\n$ sudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/\n\n\n$ sudo /etc/init.d/ntp start\n\n\n$ ntpq -crv -pn  # to check the NTP version, and that it is still working\n\n\nSee the discussion above about the combined commands in\n    step 11.  An alternative to steps 1 to 9 might be, if you are brave:\n\n\nsudo wget -P /usr/local/bin -N ftp:///RaspberryPi/397-safe/ntp*\n \n\n\nMaking updating other cards even easier &#8211; use a fixed directory name:\nAfter storing the working version on your FTP server, copy it\non the FTP server to a directory with a fixed name such as:\n\n/RaspberryPi/ntp/\n\nYou can then write a script for updating other Raspberry Pi\ncards something like this:\n\n$ nano update-ntp\n\nwith the following contents:\n\nsudo wget --no-passive-ftp -P /usr/local/bin -N ftp:///RaspberryPi/ntp/ntp*\nsudo /etc/init.d/ntp stop\nsleep 1\nsudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/\nsleep 1\nsudo /etc/init.d/ntp start\nsleep 4\nntpq -crv -pn\n\nremplaçant  with the name or IP address\n    of your own FTP server.  With a Microsoft FTP server, I found that I\n    needed to add &#8211;no-passive-ftp  after the wget command, as shown above.  Remember to make the script executable:\n\n$ chmod +x update-ntp\n\nand run it from your local directory:\n\n$ ./update-ntp\n\nYou can tell another Raspberry Pi to run the update by using the SSH command\nthus:\n\n$ ssh pi@the-other-raspi &quot;./update-ntp&quot;\n\nYou will need to enter the password for the user &quot;pi&quot;, although\nthis can be avoided (I am told) by using public key based authentication, if that fits with your security model. \nOnce you have managed to copy your key\tto the second machine (man ssh-copy-id) you need no password either. \nI&#39;m afraid I don&#39;t know how to do that, though.  \nTo get NTP to use the PPS data which is now available to it,\nthe timestamps of the transitions on the GPIO pin, we need to add another\nrefclock (server) line to the ntp.conf file.  The server we use is a type\n22 server called the ATOM refclock, and we can give it a reference ID of\n&quot;PPS&quot;.  I also changed the reference ID of the serial data to\n&quot;GPS&quot;.  Note that with a type 22 clock you doit have one\nother server marked as &quot;prefer&quot;.\n\n# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n\n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n\n# coarse time ref-clock, not really needed here as we have LAN &amp; WAN servers\nserver 127.127.28.0  minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid GPS  stratum 15\n\n# Kernel-mode PPS ref-clock for the precise seconds\nserver 127.127.22.0 minpoll 4 maxpoll 4\nfudge 127.127.22.0  refid PPS\n\n# LAN servers\nserver 192.168.0.3  minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2  minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7  minpoll 5 maxpoll 5 iburst\n\n# WAN servers, &quot;pool&quot; will expand the number of servers to suit\npool uk.pool.ntp.org  minpoll 10  iburst\n\nRemarque: when using the ATOM (type 22) refclock, one of the other servers\ndoit be marked as prefer.  This is because the type 22 clock only\nsupplies the timing dans the second, and another server is required to\ndetermine the courant second.\n \nChecking that NTP is seeing the PPS data\nWhen you have restarted NTP with the new binaries, you\n    should see a new line in the output from an ntpq -p command, and the word\n    &quot;kern&quot; should be present in the output of an ntpq -c rv command:\n\nC:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPS.           15 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            0 l   12   16  377    0.000    0.002   0.002\n*pixie           .PPS.            1 u   18   32  377    0.498   -0.030   0.025\n+feenix          .PPS.            1 u    5   32  377    0.619   -0.078   0.035\n+stamsund        .PPS.            1 u   29   32  377    0.614   -0.017   0.051\n uk.pool.ntp.org .POOL.          16 p    - 1024    0    0.000    0.000   0.002\n-ntp.uk.syrahost 192.93.2.20      2 u  405 1024  377   30.031    8.487   0.274\n-ntp2.exa-networ 195.66.241.10    2 u  217 1024  377   26.263    3.167   1.277\n-resntp-a-vip.lo 182.7.208.171    3 u   49 1024  377   17.854    2.828   1.460\n-time.shf.uk.as4 91.208.177.20    3 u   75 1024  377   18.825    0.680   1.974\n\nC:&gt;ntpq -c rv raspi\nassocid=0 status=011d leap_none, sync_pps, 1 event, kern,\nversion=&quot;ntpd 4.2.7p314@1.2483 Mon Oct 29 15:30:42 UTC 2012 (3)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.2.27-pps-g965b922-dirty&quot;, leap=00,\nstratum=1, precision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d439fe8b.16dba50f  Tue, Oct 30 2012  7:21:47.089,\nclock=d439fe97.4d7ac44d  Tue, Oct 30 2012  7:21:59.302, peer=63905, tc=4,\nmintc=3, offset=0.001547, frequency=-45.081, sys_jitter=0.001907,\nclk_jitter=0.000, clk_wander=0.000\n\n\nYou may find that by adding the directive &quot;nohz=off&quot; to the end of\nyour /boot/cmdline.txt that jitter is decreased by up to 50%.  Try it and\nsee for yourself.  Some systems it helps, and others it does not,\ndepending, I suspect, on which OS and firmware versions you have. Comme\nguide, you may get to average jitter in the range:\n\n\n\nModèle\nAveraged jitter\n\n\nRaspberry Pi B \n3.9 us, but may be better\n\n\nRaspberry Pi B+\n4.2 µs\n\n\nRaspberry Pi 2 B\n2 µs\n\n\nRaspberry Pi 3 B    \n1 µs\n\n\n\nThanks to the folks here\nfor their help. \nWith the replaced version of NTP we lose the automatic running\nde ntpd at startup which was present in the\noriginal install.  We also need to start gpsd\nso that the coarse time is available to NTP.\n\n\n# To configure gpsd to auto-start, try: \n$ sudo dpkg-reconfigure gpsd\n\n\nThis seems to work as expected, and allows the gpsd\nto automatically start up.  To check that, I rebooted, and logged in, and\ncould run cgps -s right away.  However, NTP\nwon&#39;t see the time from the GPS until après    cgps -s is run. \nThis is fixed as follows (thanks to A Carver):  by default, gpsd\nwon&#39;t connect to the GPS receiver until there is client software such as cgps\nwith requires it.  This allows for some power-saving in the GPS\nreceiver.  To circumvent this, the gpsd needs to be started with the\n&quot;-n&quot; option.  These options are set in the directory\n/etc/default, so you need to edit the file /etc/default/gpsd to change the\nline: GPSD_OPTIONS=&quot;&quot; to GPSD_OPTIONS=&quot;-n&quot;.  Method A\nis to do this through dpkg-reconfigure gpsd, method B is to edit the file\ndirectly.\n\n\n$ sudo nano /etc/default/gpsd\n\n\nNTP will auto-start after a reboot with either Method A or\nMethod B above.\nThere is a cut-out area in the ModMyPi case which will allow\nconnections to the GPIO connector such as ribbon cable which you can easily\nbreak out and file down to a neat edge.  The sharp-eyed amongst you will\nnotice that three wires are shown &#8211; this is because the surplus header had three\nwires connected, but I only used two &#8211; ground (blue) and GPIO 24 (red). \nThe black lead would be GPIO 23 but it is unused and not connected.\n\nGPS Receiver Issues\nThere are two issues which are now becoming apparent with the\nparticular GPS receiver I have and the Raspberry Pi.\n\nIt seems that after a power-down reboot, the GPS receiver\n    isn&#39;t correctly detected, and need a disconnect/reconnect of its USB\n    connector before it is seen by gpsd.\n    The pulse-per-second signal still comes through,\n    though, so the precise seconds are working, but the coarse seconds are\n    ne pas. This is clearly unacceptable as you would not get the correct\n    time unless you also had an Internet NTP server available.It is possible that a power-up followed by a reboot mai resolve this\n    problème. \nDuring the booting of the GPS receiver (if it does not have\n    a battery) it mai output GPS time (which is 16 seconds adrift from\n    UTC at the time of writing). Bien que gpsd est\n    supposed to catch this situation, it could mean that the Raspberry Pi will\n    not know what the correct time is for some time after booting, and even then\n    it could take 10-20 minutes to be sure that the correct time was actually\n    being sent by the GPS and for NTP to make the 16 seconds step correction\n    required.\n\nIf your receiver has this 16-second ambiguity, be sure you have a source\nof coarse time available such as an Internet NTP server. \nBecause of the problem (1) above, I bought a serial GPS\nreceiver from China.  By following the instructions here\nI was able to make the serial port available on the Raspberry Pi independent of\nits use as a login or boot-up terminal port. \n\n\n(make a safety coppy of the file we are about to edit)\n$ sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt\n\n\n$ sudo nano /boot/cmdline.txt\n(remove the parameter including the string &quot;ttyAMA0&quot;:\nconsole=ttyAMA0,115200\nIn Raspbian Wheezy there are two parameters:\n console=ttyAMA0,115200 kgdboc=ttyAMA0,115200)\n\n\n$ sudo nano /etc/inittab\n(Comment out the line like &quot;2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100&quot;\n by putting a hash (#) at the start of the line.  Note that the line was not \n 2:23 on my version of Linux, so be sure to look for the actual line with ttyAMA0.\n It was the last line of the file, as it happens).\n\n\n(You need to reboot to bring these changes into effect)\n$ sudo reboot\n\n\n(Minicom then works - to exit minicom, Ctrl-A, release, Q or X.)\n$ minicom -b 9600 -o -D /dev/ttyAMA0\n\n\n(If minicom gives command not found, you need to install it:)\n$ sudo apt-get install minicom\n\n\nNote that the Raspberry Pi requires 3.3 V signals on the serial\npins &#8211; ne pas  RS-232 level which will damage the device. Toi\nshould now be able to configure gpsd to talk to ttyAMA0 (using sudo\ndpkg-reconfigure gpsd), and the cgps -s\ncommand should work as above. \n3.3 V GPS receiver\nI found a 3.3 V I/O very compact GPS receiver board here\ndescribed as: &quot;GPS Receiver u-blox NEO-6M Module with Antenna USART TTL &amp; IIC Interface&quot;. \nIt includes the patch antenna and cost less than £20.  Such modules seem to be a\nstandard for flight control for model aircraft and similar applications.  It does require one minor modification, which is to solder a wire\nto pin 3 of the NEO-6M module to extract the PPS signal.  This unit\nwas later replaced by a Adafruit\n    Ultimate GPS Breakout which requires no additional soldering, and has a\nbuilt-in antenna.\n\n\n\nThe U-blox board from China and supplied antenna under test.\n\n\nThe Adafruit GPS mated to the Raspberry Pi.  Only\n      le GPS Tx =&gt; Pi Rx lead (yellow) is connected, and thesecond ground lead (blue) isn&#39;t connected either.\n\n\n\n\nRaspberry Pi #2 with its Adafruit GPS. Red/brown are+5V/0, orange the GPS Tx, and yellow the PPS. \n\n\n\nOne the left is the receiver undergoing initial tests. Vous pouvez\nsee the patch antenna on the left raised on a block of foam so that it can\n&quot;see&quot; past the clutter of the receiver, the receiver itself on the blue PCB mounted vertically in the\nbreadboard, and you might just see the orange-pink wire at the top-right corner\nof the receiver which has been carefully soldered to pin 3 of the NEO-6M to get\nthe PPS signal.  The wire is anchored in the top-right mounting hole for\nstrain relief.  You don&#39;t need surface-mount tools to make this connection,\nmais toi faire need a very fine soldering tip and considerable care! \nLike the TX/RX signals from this module, the PPS signal is at 3.3 V level and\ntherefore ideal for feeding the Raspberry Pi.  The board will accept either\n3.3 V or 5 V power while retaining 3.3V I/O levels, and I&#39;m using 5 V to power the\nboard to reduce the load on the 3.3 V regulator on the Raspberry Pi board. \nThe U-blox device is specified at less than 50 mA supply current.\nFor the final installation, the Adafruit module was used as\nits single package was more convenient.  Not all the leads are connected as\nthere is only one place to connect ground on the module (so the blue is left\nopen), and for simplicity the green Pi Tx =&gt; GPS Rx was not connected. \nJudge the size of the Raspberry Pi by the Ethernet connector on the left!\nThe next step was to set up the Raspberry Pi to talk to the new module, use serial\nGPS data via  gpsd for the coarse time,\nand to use its PPS\nline to provide precise time just as described above.  To preset the serial line\nspeed to 9600 at Linux start-up, edit the file  /boot/config.txt\nto include the line:\n        init_uart_baud=9600\nas it says in: http://elinux.org/RPi_config.txt. \nYou can check using the command:\n\nstty -F /dev/ttyAMA0\n\nI found that the speed was already set to 9600 on a recent\nRaspberry Pi installed from the NOOBS software.  I gather that on a typical Linux system you might use the\ncommand: stty -F /dev/ttyAMA0 9600. \nRaspberry Pi GPIO multi-pin connector\nThis time , not only were PPS and ground connections required,\nbut also the serial port and the +5 V line, so I used a piece of 6-way ribbon cable to connect between\nthe Raspberry Pi and my serial GPS device.  I happened to have a 10-pin\nheader which fitted the GPIO connector, so these are the connections I chose to\nmake:\n\n\nmacable\nTarte aux framboisesconnecteur\nCommentaire\nGPS moduleconnecteur\n\n\nrouge\n+ 5V\nMy unit takes less than 50 mA\n1 +5V\n\n\n \n+ 5V\n \n \n\n\nBleu\nSol\nOne of two ground connections\n2 GND\n\n\nvert\nTXD\nNot connected, see below\n \n\n\nJaune\nRXD\nReceives serial data sent from the GPS\n3 TXD\n\n\n \nGPIO 18\n \n \n\n\n \n Sol\n \n \n\n\n \nGPIO 23\n \n \n\n\nblanc\nGPIO 24\nReceives the PPS sent from the GPS\nPPS pin on u-blox device\n\n\nNoir\nGnd\nOne of two ground connections\n6 GND\n\n\nI actually didn&#39;t connect the TXD lead to the GPS module in the first instance,\nas the GPS receiver powers up sending data in the correct format, so there is\nnothing which the computer Besoins to control.  There is a description\nof the GPIO pin header here. \nAgain, please note that 3.3 V signals are required,  ne pas the 5 V level, and\nabsolument  ne pas the RS-232 level! \nConverting from USB to native serial &#8211; software changes\nWe need to tell gpsd to look for input from a different\nsource: ttyAMA0 instead of ttyACM0\n\n\n$ sudo nano /etc/default/gpsd\n\n\nand change the DEVICES= to point to\n&quot;/dev/ttyAMA0&quot;.  You could use &quot;sudo\ndpkg-reconfigure\ngpsd&quot; instead.  You may also find that the delay between PPS and TXD\non the serial line is different from that over USB, so you may wish to edit your\nntp.conf  accordingly &#8211; it makes the output look nicer at least and may make\nprediction of the nearest second more accurate during the initial acquisition. \nIn my case I needed to change the 0.35 second offset seen in the earlier device\nto the 0.13 second offset seen with the U-blox device, hence the following\nchanger ntp.conf, from\n\nfudge 127.127.28.0 time1 +0.350 refid SHM stratum 15\n\nà:\n\nfudge 127.127.28.0 time1 +0.130 refid SHM stratum 15\n\nThis configuration has been running since\n  Friday, November 09, 2012.  \n \nOn reflection, I am unsure why I chose to make the stratum 15\nin the example above,  Possible stratum 2 or 3 might be better, otherwise\nNTP may think that the source is of very poor quality and fail to sync to it.\n \nRobin Scwab notes that you could try using the value of\n&quot;Time offset&quot; displayed in cgps -s as the starting value for the time1\nparameter.  This sounds to be a gooo idea, except that on one system here I\nhappened to check Time Offset was about 0.640 seconds, but the best value for\ntime1 (i.e. the value resulting in the smallest average offset) was 0.130\nseconds.  Where did the extra 0.5 seconds come from? \n \nNumber of NTP clients which can be handled\n \nSomeone asked: &quot;How many NTP clients can it\nhandle?&quot;  Well, I have not done any extensive testing on how many clients this\nNTP server can handle (as it will easily be enough for use on a LAN, and it&#39;s\nnot fit for public use in its present security date).  I did manage to\nlocate one NTP stress-testing program here,\nbut the maximum rate I could get it to produce on my PC was about 75 packets per\nsecond, and the Raspberry Pi can handle that rate with ease.  With NTP\nclient PCs polling at 64 second intervals (the fastest normally used), that&#39;s\n4800 clients, so easily enough for a small organisation.  If you were using\nthis for a small organisation, I would recommend using two or three stratum-1\nservers so that you are covered in the event of failure &#8211; perhaps mark one of the\nservers &quot;prefer&quot; on the client PCs to avoid NTP from\n&quot;clock-hopping&quot;.  If you have better\nstress-test data, as Kasper Pedersen did, please let me know and I can publish it here.\n \nKasper Pedersen notes:\n \nI did one a few years ago that goes a bit faster (Linux):\n \nhttp://n1.taur.dk/permanent/ntpload.c\n \nTo test a Raspberry Pi you need 4 instances running, at which point the\nPi runs out of CPU, and settles on 3520/s.  That ought to be enough for most small homes.. 🙂 \n \nThese are brief notes only, on an alternative approach which\ndoes not require a modified kernel with PPS support in the OS, nor does it\nrequire a recompiled NTP, but which produces\nslightly less accurate timekeeping.  It may, however, be quite good enough\nfor most purposes.  The program was developed by Folkert van Heusden, see: http://vanheusden.com/time/rpi_gpio_ntp/ \nand announced\nin the Time-Nuts mailing list.\n \nBase installation &#8211; check you meet these requirements\n \nYou can start here assuming that you have your Raspberry Pi\nbasically working with GPSD and NTP, meaning that:\n \n\nYou have installed the current operating system and any\n    updates.\nYou have made any optional IP address or computer name\n    changes.\nYou have got NTP working, preferably connected to your\n    country&#39;s pool servers.\nYou have recompiled\n    and installed NTP to get a full version (is a re-compile required?).\nYou have the PPS signal from the GPS receiver connected to\n    the GPIO, e.g. GPIO-8 (pin 24), or GPIO 18 for the no-soldering\n    planche.\nYou have  installed and configured the gpsd Logiciel\n    and utilities, and made gpsd auto-start.\nYou have a GPS device connected either via a serial or a\n    USB connection.\nle cgps -s command produces a correct display.\nYou have configured NTP to talk to the type 28.0 shared\n    memory driver, and can see the GPSD output in ntpq -pn.\n\nOptional first step &#8211; to determine the offset of your GPS serial data from\nthe exact second\n \nThe objective is to determine the offset between the PPS\nsignal from your GPS and the serial data which typically follows some hundred or\nmore milliseconds later.  NTP can use that offset either to make a better\nsync when using just a GPS receiver with no PPS, or to present a slightly less\ndéroutant ntpq -p output when using PPS.  To measure what offset\nshould be specified for the time1 factor when using a GPS receiver (type 28\nreference clock driver), we can use NTP as a measuring tool by making it sync to\nexisting servers and have it monitor the\nshared memory #0 written by  gpsd.  I.e. NTP will not use server\n28.0 for timekeeping, but it volonté display the offset in the ntpq\n-p  commander. To do this, you add these\nlines to your ntp.conf (if they are not already there):\n \n\n# Server to be monitored only, not selected for syncing\nserver 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.000 refid GPSD\n\nWatch the results from  ntpq\n-pn, and look at the offset for the server with the refid GPSD.  On one of my RPi cards it varied between -322 and -336 (units are\nms in the ntpq report). \nTake an average of those values, and replace the 0.000 after time1 with that average.  In this case, the average was -329 ms, so try:\n \n\nserver 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.329 refid GPSD\n\ni.e. if the reported offset is negative, you need to make\ntime1 a positive value.  Now you should see much smaller offsets for the GPSD server. \nCe n&#39;est pas\nessential to do this, but it gives you confidence that things are working as\nexpected, it may help NTP in the early startup, and it produces a less\ndéroutant  ntpq display.  Don&#39;t forget to remove the noselect\nwhen you have the best value for the offset, and set the flags to include préféré\nso that NTP knows it can use that source as a seconds provider! Là\nmust be at least one préférer for PPS to work.  This now has the NTP daemon seeing the GPSD device, and\nthe next step is to\nadd in some PPS support.\n \n\nserver 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.329 refid GPSD\n \n\nGetting the average value for time1 automatically\n \nAngelo Mileto writes: What I did to get a good sample of data for the  time1 value was let the ntpq -p command run for a period of time and capture the results. \nThen, using awk, calculate the average/mean of the values collected.  If you look at the static ntpq -p output, you will see something like this:\n \n          remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPSD.           2 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            2 l   12   32  377    0.000    0.002   0.002\nalong with other pool/server entries.  As noted above, you need to ensure you have a good preferred source for the comparison to work. \nTo capture your data, execute the following at the command line from your user&#39;s home directory:\n \n\nwatch -n0.5 &quot;ntpq -pn | grep &#39;.GPSD. 2 1 1&#39; | tee --append GPSD_Offset.txt&quot;\n\nPay attention to the single and double quotes in that command.  If you notice, the grep is looking for the exact line from the ntpq -p output that contains your GPSD\nrefid.  So if you named it something different, that would replace the .GPSD. in the command. \nAlso, notice the &quot;2 1 1&quot;, that is the stratum, t and when fields.  The stratum is whatever you set it to in the ntp.conf; the t should always be a 1 and the when is going to capture the output\nseulement when the timer reaches 1 meaning that it just updated the value. \nThere is no sense in capturing data every .5 seconds for data that doesn&#39;t\nchange!  So the easiest way to get the value to grep for is to manually run the ntpq -p and copy from your refid through the when fields and that&#39;s what will be grepped for.\n \nLet that run for a good while &#8211; probably not really needed &#8211; but that&#39;s the point of getting a good sample size. \nThis will capture the output from the ntpq command filtering to just your SHM/GPSD. \nThis will all be saved to a file GPSD_Offset.txt in the current directory &#8211; that&#39;s what the &quot;tee &#8211;append GPSD_Offset.txt&quot; does. \nYou can tail -f that file if you want while the watch command is running to see what is going into that file. \nNOTE: If you need to restart the process because you changed some setting and want to start over, delete any existing GPSD_Offset.txt file first.\n \nOnce you have a sufficient sample size, you can then use the following command to get the actual value for the average/mean:\n \n\nawk &#39;total=total+$9; count=count+1 END print &quot;Total:&quot;total; print &quot;Count:&quot;count; print &quot; Avg:&quot;total/count&#39; GPSD_Offset.txt\n\nThis steps through every line of the GPSD_Offset.txt file and totals up all of the offset values. \nIt will also count how many lines/values are there.  Finally it just prints the information: Total, count and average. \nThe average value is what you would put into the  time1 value as noted above. \nDon&#39;t forget to change the noselect to prefer when you are in there to add the time1 value.\nAngelo Mileto\n \nDJT: This is somewhat beyond my Linux, so my thanks to Angelo for the scripts and the\ndetailed explanation.  Angelo can be contacted here.\nDownloading and compiling Folkert van Heusden&#39;s program\n \nAs of 2013-Jun-18, rpi_gpio_ntp-0.3 was the current version,\nbut thanks to Thomas Erthner I know that version 1.5 is now available, so I&#39;ve\nupdated the lines below.  However, I&#39;ve only tested version 0.3, not\nversion 1.5.  For more details, please see Folkert&#39;s\npage.\n \n\n$ wget http:\n//vanheusden.\ncom/time/rpi_gpio_ntp/rpi_gpio\n_ntp-1.5.\ntgz\n\n$ tar xvfz rpi_gpio_ntp-1.5.tgz\n$ cd rpi_gpio_ntp-1.5\n$ sudo make install\n\nThis places the resulting binary in /usr/local/bin/.\nYou don&#39;t need this for current Raspbian versions.\n \nTo test you are receiving a PPS signal, from GPIO pin 8:\n \n\n$ sudo rpi_gpio_ntp -g 8 -d\nrpi_gpio_ntp v0.2, (C) 2013 by folkert@vanheusden.com\n\nNTP unit: 0\nGPIO pin: 8\nFudge : 0.000000\n&quot;Fork into the background&quot; disabled because of debug mode.\n1371475664.752146325]poll() GPIO 8 interrupt occurred\n1371475665.000148935]poll() GPIO 8 interrupt occurred\n1371475666.000147203]poll() GPIO 8 interrupt occurred\n1371475667.000160470]poll() GPIO 8 interrupt occurred\n1371475668.000159739]poll() GPIO 8 interrupt occurred\n(Ctrl-C pressed)\n$\n\nRunning the program\n \nTo make NTP read the PPS timings on the GPSD shared memory, we need to use\nthis command to start the program, assuming the PPS signal is being sent to\nGPIO-8 (physical pin 24 &#8211; see here). \nUse pin 18 is you are using the no-soldering board.\n \n\n$ sudo rpi_gpio_ntp -N 1 -g 8\n\nand to edit the ntp.conf file, to include the shared memory driver, on section 1\nof the GPSD shared memory, replacing the earlier type 22 driver.  Add:\n \n\nserver 127.127.28.1 minpoll 4 prefer\nfudge 127.127.28.1 refid UPPS\n\nI suggest &quot;UPPS&quot; to show it&#39;s user-mode PPS (and not\nthe more accurate Kernel mode).  If you want to see the output pulse from the program, you can add the &quot;-p 7&quot;\nparameter:\n \n\nsudo rpi_gpio_ntp -N 1 -g 8 -p 7\n\nand you can then use an oscilloscope to compare the time of\nthe PPS rising edge with the toggling line from GPIO pin 7 (connector pin\n26). On my system, there was a variable delay of between 270 and 390\nmicroseconds between PPS and program response.\n \nAuto-start\n \nMore information to follow, for now, this from Folkert: \nmodifier  /etc/rc.local  and add the\nfollowing (BEFORE the exit 0 statement and AFTER the #!/bin/sh line):\n \n\n/usr/local/bin/rpi_gpio_ntp -N 1 -g 8\n\nReplace &#39;8&#39; by the gpio pin you are using, e.g. 18 for the no-soldering\nplanche.\n \nPerformance\n \nThe original documentation suggested using minpoll=1, however on testing using\nntpq -pn  it appeared that NTP will automatically accept 3 as the minimum value. Comme\nthe previous testing with kernel-mode PPS had been with minpoll=4, it seemed\nonly fair to test with that value.  You can see the change from minpoll=1\nto minpoll=4 just after 18:00 UTC.  Recall that 1 was replaced internally\nby 3, the lowest value NTP will accept.  With minpoll=4,\nboth the reported offset and the averaged jitter were reduced.  First, what it looks like in MRTG for comparison with the results\nabove:\n \n\n \nDon&#39;t get confused: the MRTG plot above covers rather more\nthan one day, whereas the plots below cover just under half a day. Sur le\nplot MRTG plot, you can see that the RPi was changed from kernel-mode PPS at\n13:00 UTC and run for a short while with Internet servers alone, visible as the\nlarger excursions on the plot above around 13:00).  \n \nFrom my NTPplotter\nprogram graphs below, you can see more clearly that at 13:30\nthe user-mode PPS was started, and the just after 18:00 the minpoll was changed\nfrom 1 (actually 3) to 4, resulting in a slight drop of RMS offset from around 5\nmicroseconds to 4 microseconds:\n \n\n \nThe jitter graph shows a drop in averaged jitter (green line) from just below 7 to just\nabove 5 microseconds after 18:00, when the minpoll was changed from 3 to 4. \nThe initial higher value of averaged jitter is the tail resulting from\nInternet-only sync.\n \n\n \nOn another Raspberry Pi you can see the dramatic difference between NTP sync\nover the network and that achieved with the user-mode PPS software. Dans\nthis case, network sync was to a local NTP stratum-1 server over a Wi-Fi\nconnection, and the PPS sync was with a U-blox 5S module.  User-mode PPS\nwas started just after 11:00 UTC in the middle of the graphs below.  RMS\noffset dropped from a rather variable 48-80 microseconds to around 2 microseconds,\nand jitter averaged over 6 hours dropped from around 80 microseconds to under\n2.5 microseconds.\n \n\n \nTo monitor NTP you can edit the ntp.conf file to turn on the generation\nof more detailed statistics data.  Note that this data maybe a megabyte or more per day, so think about keeping only a few days\nworth, and only enabling statistics collection when needed as the number of\nwrites to the SD card flash memory is limited.  The detailed information\ncan now be found here and I\noffer a program to plot the statistics data and produce offset and jitter graphs\nsuch as those above here.\n \n \nTransients\n \nI may have been unfortunate in locating one Raspberry Pi with an Adafruit\nmodule in a position where it was not getting as good a view of the sky as\nothers, or it may be that other devices connected to that RPi or software\ninstalled is an issue.  I have been seeing transient poor time-keeping\n(loss of GPS PPS signal) at intermittent times.  I did discover that\ndisconnections a lead to a USB hub connected to that RPi seemed to improve\ndes choses.\n \n If the problem was caused purely by unfortunate GPS satellite\nposition, I might have expected it to repeat in a near 24-hour pattern, which\ndoes appear to be the case.  Thanks to John Ryan for correcting me about the GPS\norbital period, I was originally thinking sidereal time and 4 minute earlier\neach day.  However, on the Time-Nuts mailing list, in connection with\nanother topic, Bob Camp commented:\n \n\n&quot;The GPS constellation repeats roughly once a day. \n  It is not at all uncommon to have a “worst case” satellite geometry for a given antenna location. \n  If you have one, it will repeat once a day and show up as a bump in the timing out of your GPS module&#8230;.&quot;\n \n\nAlthough the GPS satellites repeat position in just less than\n12 hours, there is also the rotation of the earth to take into account, so the\nposition repeats at your location every 24 hours (well, ~23 h 56 m).\n \n   On reflection, 2014 February 09, this is the only Raspberry\nPi with certain radio software installed, and the problem only seems to occur\nsome days after a reboot, so I think I will stop recording the problem\nici. I am editing out the transients as they affect the P/N timekeeping\ngraphs, but I leave the raw-graphs as-is.\n \n\n\nDate\nTransient\n\n\nDec 31\n20:00-20:45, 23:10-24:00\n\n\nJan-01\n20:14-20:37, 23:17-23:28\n\n\nJan-02\n01:29 02:45, 19:57..20:13, 20:14..20:29, 20:31, 23:13, 23:24 23:30..23:54\n\n\nJan-03\n02:39, 03:44, 20:12..20:22, 23:24..23:52\n\n\nJan-04\n02:37, 20:03..20:28, 23:06, 23:41..23:45\n\n\nJan-05\n02:31\n\n\n \nRemoved USB extension cable from RasPi-2\n\n\nJan-06\n19:33..1940, 19:54, 22:49..22:55\n\n\nJan-10\n20:30 22:07-22:17 22:37-22:45 23:03\n\n\nJan-11\n21:57-23:18\n\n\nJan-12\n22:01-22:54\n\n\nJan-13\n19:17-19:37 22:37-22:54\n\n\nJan-14\n01:46-01:47 19:30 19:40 22:46-22:51\n\n\nJan 15\n01:47 19:16-19:35 22:42-22:46 23:06\n\n\nJan-16\n19:05-19:32 22:24-22:41\n\n\nJan-17\n19:07-19:19 22:04-22:34\n\n\nJan-18\n19:11-19:16 21:55-21:57\n\n\nJan-19\n02:38-02:39\n\n\nJan-20\n19:04-20:06\n\n\nJan-21\n02:55-03:03 03:17 19:00 19:46 20:15 22:06\n\n\nJan-22\n02:56-03:05\n\n\nJan-23\n10:46 12:48\n\n\nJan-24\n02:48-02:53 07:21 07:44 12:46-12:48 17:11 19:20-19:36\n\n\nJan-25\n07:13 07:18 07:52-07:53 13:02-13:11\n\n\nJan-26\n02:50 03:26 18:06 18:31-18:36 21:59\n\n\nJan-27\n02:42 02:57-03:37 07:09 (reboot at 17:23)\n\n\nJan-31\n21:19-21:21\n\n\nFeb-05\n20:59 23:12 (is this something which starts days after boot?)\n\n\nFeb-07\n\t\t18:03 18:41 20:52\n\n\nFeb-08\n15:09 15:42 18:37 20:33 20:46 21:24\n\n\nFeb-09\n00:13 00:37-00:43 01:37\n\n\n \n \nIf you are operating completely alone, with no internet\nconnection and just the GPS, your NTP may need to be told about leap-seconds\nwhich change the offset between GPS time and wall-clock time every so\nsouvent. Some GPS receivers provide this information automatically, but this\ncan also be done by providing a file with the times of changes (in a standard format) and telling ntpd where to\nfind that file.  On my own\nsystems I have set up a Samba share on the NTP servers so that I can update the\nleap-seconds file from a central location.  To do this, add a new writeable share named &quot;ntp-leapseconds&quot;\nby adding lines to the end of smb.conf, and then restart Samba:\n \n\nsudo nano /etc/samba/smb.conf\n[ntp-leapseconds]\n\ncomment = NTP leapsecond.file\npath = /home/pi/ntp\nwriteable = yes\nguest ok = yes\n\nsudo /etc/init.d/samba restart\n\nI chose to put my leap-seconds file in the default user&#39;s\n&quot;ntp&quot; home directory, but you may prefer some where more secure! \nTo tell ntpd where to find the file,\tadd one line to the end of ntp.conf with\nnano, and restart NTP:\n \n\nsudo nano /etc/ntp.conf\nleapfile /home/pi/ntp/leap-seconds.file\nsudo /etc/init.d/ntp restart\n\nYou can get the leap-seconds file from a variety of locations,\nincluding:\n \n    ftp://utcnist.colorado.edu/pub/    ftp://tycho.usno.navy.mil/pub/ntp/\n \nand it will be named  leap-seconds.3582403200\nwith a different serial number as the information is updated (this file was found in December 2013). je\ncopy the file to a constant name:  leap-seconds.file\nso that I don&#39;t need to alter NTP each time.  I then have a small Windows\ncommand file to update all my systems &#8211; Windows, FreeBSD and Raspberry Pi\ncards.  Here&#39;s an extract:\n \n\nXCOPY /D /Y  leap-seconds.file  \\Altantpetc\nXCOPY /D /Y  leap-seconds.file  \\Stamsundntpetc\nXCOPY /D /Y  leap-seconds.file  \\Pixie-IIntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-1ntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-2ntp-leapseconds\nPAUSE\n\nYou can check whether NTP is using the file, and whether your\nfile is stale, with the:  ntpq -crv \ncommander:\n \n\nassocid=0 status=01fd leap_none, sync_pps, 15 events, kern,\nversion=&quot;ntpd 4.2.7p408@1.2483 Sun Dec 29 14:36:43 UTC 2013 (1)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.6.11&quot;, leap=00, stratum=1,\nprecision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d66b96d3.01b61b26  Mon, Dec 30 2013  6:53:07.006,\nclock=d66b96df.3df17b24  Mon, Dec 30 2013  6:53:19.241, peer=61352, tc=4,\nmintc=3, offset=0.000281, frequency=-34.180, sys_jitter=0.001907,\nclk_jitter=0.001, clk_wander=0.003, tai=35, leapsec=201207010000,\nexpire=201406010000\n\nLook at the two final lines.  leapsec shows the latest\nleap second (here is was on 2012 Jul 01), and when the leap-second file expires\n(here: 2014-Jun-01).  There will also be a warning if the file is stale.\n \nUpdate the file from time-to-time &#8211; say every six months &#8211; in\nMay and November as leap-second changes usually happen at the end of June or\nDecember.  There is more information here. \n \nIf you keep getting a different ntp.conf from that which you edited, your\nrouter may be the cause. It seems some routers give out NTP information in DHCP which the Pi by default uses over\n/etc/ntp.conf.\n \nThe fix I think is:\n \n\nrm /etc/dhcp/dhclient-exit-hooks.d/ntp\n\nand if you have the following file, remove it as well:\n \n\nrm /var/lib/ntp/ntp.conf.dhcp\n\nThen reboot.\nYou can produce real-time graphs like those below using MRTG\nand a simple script which can get the statistics from NTP remotely. Là\nis more information here.  I happen to run\nMRTG and the collection scripts on a Windows PC.\n \n\nRasPi-2\n \nRasPi-4 \n \n\nInformation on general SNMP monitoring may now be found here. \nThis allows monitoring of the network I/O on the card, and a number of other\nparameters which are exposed for measurement by the OS.  An example graph\nfollows:\n \n\nRasPi-3\n \n\nAs NTP tries to keep the clock on the card at a constant\nfrequency, it is often compensating for the effects of temperature changes which\ncause frequency changes.  It is therefore worthwhile monitoring the CPU temperature\nmonitoring as described here,\nalthough with a PPS signal and when used as a stratum-1 server, temperature\neffects may be less obvious.  Example graphs are shown below:\n \n\nRasPi-4\n \n\n \n\nThe MRTG monitoring scripts (which I actually run on a Windows PC\ncovering several Raspberry Pi cards) are in this Zip\narchive. \n \nI extended the SNMP pass function to allow monitoring of\nambient temperature using the DS18B20 &quot;single-wire&quot; device. Cette\nis well written up for use with the Raspberry Pi here,\nand the detailed description is now here. \nSample results:\n \n\n\n\nRasPi-4\nIndoor temperature °C\n\n\n\nOutdoor temperature °F\n\n\n\nMerci!\n \nMy thanks to Webshed for\nuploading the information about using the DS18B20. \n \nRunning a publicly accessible NTP server\n \nIf you are running a server which is accessible from the\npublic Internet &#8211; perhaps you are contributing to the NTP\nbassin project &#8211; there are some simple precautions you should take to ensure\nthat your server is not used as the source of an attack on other PCs. Remarque\nthat this doesn&#39;t apply to most end-user clients sitting on your local PC, you\nwould need to have specially opened a port in your firewall or router to allow\npublic incoming unsolicited UDP port 123 packets into your local network. \nIf you are using a development version (4.2.7p26 or later) you are already\nprotected.  The following notice explains more: \n \n\n\nNTP users are strongly urged to take immediate action to ensure that their NTP daemon is not susceptible to use in a reflected denial-of-service\n      (DRDoS) attack. Please see the\n       NTP Security Notice for vulnerability and mitigation details, and the\n      Réseau\n      Time Foundation Blog pour plus d&#39;informations. (January 2014)\n\n\n\n\n\nRaspberry Pi: 86 x 56 x 21 mm\nRaspberry Pi in its box: 91 x 62 x 29 mm\nTrimble evaluation board: 66 x 32 x 8 mm\nTrimble evaluation board with interface: 66 x 32 x 24 mm\nU-blox interface card: 39 x 22 x 6 mm (excluding connection\n    pins)\nPatch antenna supplied with interface card: 25 x 25 x 7 mm \n\nWhat else have I done with the Raspberry Pi?\n\nReceiving ADS-B signals on\n1.09 GHz with a cheap TV dongle and feeding the results to Plane\nPlotter over a Wi-Fi link.  This allows you to put the receiver right\nup close to the antenna, avoiding an expensive (or lossy) piece of cable, and\navoiding the need for a cable run at all.  Details are here. \nIt&#39;s not much more than following someone else&#39;s instructions, but at least I\ncan vouch for every command on that page, and perhaps you will find something\nuseful there.\nA Digital Wall clock\n    using the Raspberry Pi &#8211; synchronised with NTP, of course! \n\nAcknowledgments\nI would like to support NTP\n \nClick to rate this post!\r\n                                   \r\n                               [Total: 0  Average: 0]","paragraphs":["A titre d’expérience, j’ai acheté l’un des modèles à faible coût\ntaille de carte de crédit Framboise\nPi ordinateurs, et l’ont configuré pour exécuter NTP (Network Time Protocol).\nJ&#39;ai également utilisé cette carte avec un récepteur GPS avec une sortie impulsions par seconde (PPS) pour\nStratum-1 serveur NTP, mais comme je connais peu de Linux, il a fallu un certain temps pour\natteindre cet objectif! Il y a quelques commandes utiles Linux dispersées à travers\ncette page. Ces notes sont presque autant pour mes propres disques pour\nla prochaine fois que je devrai visiter ce projet, mais j’espère qu’ils pourront vous aider.\nautres.\nSi vous voulez commencer rapidement avec les meilleurs résultats pour\nminimum de bruit, s&#39;il vous plaît voir mon Raspberry Pi NTP\nentrée rapide page. S&#39;il vous plaît voir aussi cette\npage pour des problèmes avec la version de Jessie de Linux, et avec la plus récente\nRaspberry Pi modèle 3.\nJe commence par décrire comment faire fonctionner le Raspberry Pi avec\njuste une connexion LAN &#8211; sans écran, clavier ou souris &#8211; un soi-disant sans tête\nopération. Je décris ensuite comment configurer NTP pour votre environnement, et\najout d&#39;un récepteur GPS / PPS pour convertir votre boîte en un serveur NTP de strate-1\ny compris les mises à jour du système d&#39;exploitation nécessaires. Ensuite, je note quelques\nJ&#39;ai eu des problèmes avec le premier récepteur GPS que j&#39;ai essayé et comment j&#39;ai guéri ceux qui avaient un\nrécepteur GPS différent pour produire un serveur NTP strate-1 consommant environ 4\nwatts. L&#39;approche la plus simple avec de bonnes performances est décrite ici.  \nDepuis le début de cette page, deux développements ont eu lieu\nqui facilitent quelque peu le processus &#8211; un programme a été développé qui\npermet l&#39;utilisation d&#39;un système d&#39;exploitation non modifié en travaillant en mode utilisateur\nplutôt que PPS en mode noyau, et un module est maintenant disponible qui se branche directement\nsur l&#39;en-tête GPIO à 26 broches du Raspberry Pi, afin non\nla soudure est impliquée. Mes remerciements à Folkert van Heusden et Anthony\nStirk pour ces développements.\n  Notez que le GPS Hat Adafruit utilise GPIO 4, broche physique 7,\nvous devrez donc changer les commandes données dans ce document. Les ajouts ultérieurs ont inclus la télécommande surveillance\ndu serveur NTP performance, et surveillance plus générale de la framboise\nPi en utilisant les fonctions standard SNMP, avec un supplément\nCPU\nTempérature surveillance add-on. Mon principal Framboise\nPage Pi peut également être d&#39;intérêt.\nNotez que de bonnes performances dépendent du fait que l’unité GPS a\nune vue dégagée du ciel, en particulier la partie sud du ciel si vous êtes en\nl&#39;hémisphère nord. Avec les anciens récepteurs GPS, cela nécessitait une installation extérieure.\nantenne, mais des unités plus modernes telles que celles mentionnées ici pourraient bien fonctionner\nà l’intérieur à condition que du ciel soit visible, peut-être au dernier étage de la\nbâtiment (comme je suis). Si vous avez un toit &quot;résistant aux RF&quot; (plombé,\npeut-être?!) ou certaines fenêtres avec une doublure pour arrêter la chaleur entrante, ou la construction du mur\ny compris le métal, vous aurez peut-être encore besoin d’une antenne extérieure, et presque certainement si\nvous vivez dans un sous-sol! Alors que le temps aura normalement seulement une petite\neffet dans le signal &#8211; par ex. forte pluie &#8211; il est possible qu&#39;une couche de neige\npourrait atténuer suffisamment le signal pour empêcher le GPS de recevoir suffisamment de signal.\nLe suivi des performances peut vous aider à détecter ces problèmes. (Merci à Joe,\nHB9DRT pour l&#39;information sur la neige &#8211; Je n&#39;ai vu ce problème qu&#39;une fois ici\npendant un hiver exceptionnellement froid).\nintroduction\nLe Raspberry Pi est un ordinateur au format carte de crédit.\ndisponible chez les distributeurs du monde entier. J&#39;ai acheté un bleu attrayant\nboîtier et alimentation 5 V, 2 A de ModMyPi.\nVous pouvez voir le fil Ethernet à gauche et la carte SD de 4 Go avec le\nsystème d’exploitation à droite, ainsi que le cordon d’alimentation micro-USB.\nIl existe un modèle B (illustré et utilisé ci-dessous) et un modèle A de spécification inférieure qui peut\ndevenir disponible à un moment dans l’avenir. J&#39;utilise le modèle B de 512 Mo,\nintroduit à l&#39;automne 2012.","Ci-dessous, les résultats offset avec le Raspberry Pi en\ntrois configurations: avec des connexions WAN uniquement synchronisées sur Internet (comme\npourrait trouver une situation typique de la maison), avec\nConnexions LAN à un serveur local de strate 1 et agissant en tant que\nle serveur Stratum-1 avec deux petits récepteurs GPS / PPS différents comme horloge de référence. Tout\nproblèmes dans les données en direct sont susceptibles d&#39;être le résultat de mon redémarrage, rendant la configuration\nchangements, ou le signal GPS étant inférieur à la normale. La configuration NTP normale est listée ici.\nComme prévu, la synchronisation depuis le réseau local produit de meilleurs résultats que depuis Internet.\n(WAN), et en transformant le périphérique en serveur de la strate 1, le résultat est encore plus bas.\ncompensations.\nLe décalage zéro correspond à la ligne médiane du graphique, comme\nl&#39;utilité que j&#39;utilise est incapable de tracer des valeurs négatives. J&#39;ajoute donc\nla moitié de la plage de l’axe Y aux valeurs réelles avant de tracer.  Remarque: celles-ci\nles graphiques sont  ne pas tous à la même échelle verticale! \nDécalage utilisant uniquement des serveurs Internet &#8211; échelle milliseconde\n  La performance qui en résulte est bonne, mais cela dépendra à la fois du chargement du lien entre moi et\nle FAI, et la charge générale sur le réseau du FAI et l&#39;Internet général.\nLes décalages seraient d’environ +/- 5 millisecondes (et donc hors échelle).\nune fois sur le graphique ci-dessous). Les quatre lignes ntp.conf\nen cours d’utilisation est indiqué sous le graphique.","Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation WANéchelle milliseconde","# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\npool fr.pool.ntp.org iburst","Décalage à l&#39;aide de serveurs LAN locaux interrogés toutes les 32 secondes &#8211; échelle en microsecondes\nLe passage à un couplage étroit avec un serveur de strate 1 local sur le réseau local produit beaucoup mieux\nrésultats, avec un chronométrage de l’ordre de 30 microsecondes. J&#39;ai ajouté un\ndeuxième graphique avec une échelle de +/- 500 microsecondes pour montrer les excursions les plus importantes.","Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation de réseau localéchelle de précision","Mêmes données mais sur unéchelle microseconde","# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst","Décalage à l&#39;aide du module GPS de synchronisation Trimble Resolution-SMT\nDes résultats bien meilleurs sont obtenus avec un Trimble Resolution SMT\nModule GPS, avec sa broche PPS connectée à la broche GPIO 24 pour un mode noyau\n&quot;ATOM&quot; horloge de référence. Cette unité est un GPS &quot;de synchronisation&quot;, avec 15\nns précision spécifiée pour le signal PPS. Chaque seconde sur le GPIO\npin provoque une interruption dans laquelle l’horloge de la CPU est notée, puis utilisée par NTP pour\nfaire des ajustements fins à la vitesse d&#39;horloge du logiciel. le\ntransitoires d’une amplitude de quelques microsecondes d’une durée d’une heure environ peuvent être dus à une\nchangements de température ambiante affectant le cristal utilisé par l&#39;horloge de la carte\nGénérateur. Non indiqué sur le graphique, mais le décalage dû à une tâche gourmande en ressources processeur (recompilation de NTP à partir de la source,\nenviron 25 minutes) a entraîné une excursion positive de 20 µs,\nsuivi d&#39;une excursion négative de 10 µs avec le refroidissement des températures et du NTP\nrétabli.","Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS du noyauRésolution Trimble SMTchronométrage récepteur GPS","Décalage lors du passage à un module GPS NEO-6M u-blox\nLors de l&#39;utilisation d&#39;un GPS u-blox MEO-6M\nmodule, avec sa broche PPS connectée à la broche GPIO 24 pour un mode en mode noyau\n&quot;ATOM&quot;, on obtient des résultats similaires. Le transitoire au milieu du graphique est\nlorsqu’un deuxième appareil était connecté à la ligne 5 V de l’USB. Cette unité\nest un GPS de &quot;navigation&quot;, où le PPS est spécifié à environ 100 ns, plutôt\nqu&#39;un &quot;timing&quot; GPS &#8211; mais\nla différence entre les deux unités est le plus souvent masquée par les autres variations du\nsystème.","Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +","Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation","Plus tard, il a été remarqué que le décalage variait\npériodiquement, ce qui est un résultat inattendu. Ci-dessous un exemple des 19 au 21 décembre 2012, avec les moins stables\npériode débutant le 19 décembre 2012 et se terminant le 20 décembre.\nUn examen plus détaillé des données de loopstats montre une période réelle d’un peu plus de 100\nsecondes, et il est alias par l&#39;échantillon de 5 minutes de MRTG.","Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +","Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation","Pour tester, j&#39;avais changé le récepteur GPS d&#39;U-blox 6M à Adafruit MTK3339\nmodule de navigation GPS, puis modifié à nouveau du module de navigation à\nun module GPS de chronométrage basé sur le U-blox\nLEA-6T, pour voir si l’oscillation était affectée. Ces changements\nn&#39;a fait aucune différence ni pour l&#39;amplitude ni pour la période de l&#39;oscillation,\net l&#39;amplitude de l&#39;oscillation était considérablement plus grande que ce qui serait\nattendu même d&#39;un récepteur GPS &quot;de navigation&quot;. Donc mon plus tôt\nThéories sur la navigation par rapport à la synchronisation, les modules GPS, le chargement USB et les E / S série\nle chargement était incorrect. Ce problème a finalement été résolu par un firmware\nmise à jour sur Raspberry Pi # 1, de la version 337601 à la version 346337.","Performance actuelle &#8211; cliquez sur un graphique pour accéder à la page de performance de chaque ordinateur.\nJ&#39;ai ajouté un deuxième ordinateur Raspberry Pi et j&#39;ai maintenant les deux\nconnectés aux deux récepteurs GPS / PPS mentionnés ci-dessus, mais avec le\nantennes pour ces récepteurs dans un emplacement intérieur similaire. Ci-dessous est un\ncomparaison de la performance. Raspberry Pi # 1 est situé dans un endroit non chauffé\nchambre avec un mur orienté au nord. Raspberry Pi # 3 est également dans le bureau, mais situé\nun peu plus près d&#39;un radiateur, fournissant les transitoires quotidiens. Mi-novembre\n2013, je suis passé à un nouveau noyau qui a été compilé localement avec une option pour\naméliorer les performances NTP.","Raspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationdans une pièce non chauffée","&lt;! &#8211;","Raspberry Pi # 2512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationen environnement de bureau","-&gt;","Raspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigationRécepteur GPSen environnement de bureau","Raspberry Pi # 4512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 5S navigationRécepteur GPSdans une pièce non chauffée","Raspberry Pi # 5512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauCalendrier U-blox 7QRécepteur GPSen environnement de bureau","et voici une façon légèrement différente de regarder la valeur du décalage,\ntracer la valeur absolue du décalage, le rouge pour les décalages positifs et le bleu pour\ncompensations négatives. Les événements transitoires tels que les redémarrages ont été supprimés.","Raspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigation Récepteur GPS dans une pièce non chauffée","&lt;! &#8211;","Raspberry Pi # 2512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigationRécepteur GPS\n      en environnement de bureau","-&gt;","Raspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigation\n GPS receveur\n      en environnement de bureau","Raspberry Pi # 4512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyauU-blox 5S navigation\n GPS receveur\n      dans une pièce non chauffée","Raspberry Pi # 5512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyau\n      Calendrier U-blox 7Q\n GPS receveur\n      en environnement de bureau","Création d&#39;une carte SD avec le système d&#39;exploitation\nVous pouvez acheter une carte SD avec le système d&#39;exploitation Linux installé et prêt\naller. Sachant que je devrais apporter des modifications au système d’exploitation, j’ai acheté un\ncarte SD prête à être programmée au cas où, mais j’ai fabriqué la mienne par\nen suivant les étapes ici: http://www.raspberrypi.org/downloads","Téléchargez une image de système d&#39;exploitation pour la carte SD &#8211; 2012-09-18-wheezy-raspbian.zip \nDécompressez le contenu de l&#39;archive Zip dans un fichier .IMG \nTéléchargez le programme d&#39;écriture de carte SD: Win32DiskImager \nUtilisez l’imageur de disque pour écrire l’image du système d’exploitation sur la carte SD.","J&#39;ai ensuite branché la carte SD au Raspberry Pi, connecté\nau réseau, et le pouvoir appliqué &#8230;","Beaucoup de gens ont demandé d&#39;ajouter un GPS à\nle Raspberry Pi sans avoir besoin de soudure, et maintenant cela est devenu une réalité grâce à la NTPI\nGPS Addon Board produit par Nevis Computers Ltd au Royaume-Uni. J&#39;ai utilisé le rpi_gpio_ntp\nprogramme a été développé par Folkert van Heusden et annoncé\ndans la liste de diffusion Time-Nuts, qui permet de travailler en mode utilisateur avec PPS\nsignal, ne nécessitant donc pas de version spéciale du système d’exploitation.\nLes versions actuelles de Raspbian n&#39;en ont plus besoin.\nC’est ce que vous obtenez dans la boîte du GPS NTPI Raspberry Pi\nCarte d&#39;extension (avec l&#39;option antenne puck):","Une carte avec le périphérique GPS de qualité de synchronisation et le connecteur SMA\n    qui se branche sur le connecteur GPIO à 26 broches du Pi.\nUn  optionnel antenne GPS à rondelle magnétique, ou vous pouvez utiliser votre propre\n    antenne avec un connecteur SMA.\nVous aurez peut-être également besoin de: Une pile de secours CR2032, qui s’ajuste sur la face inférieure\n    de la carte.","(Notez que l’antenne est une option supplémentaire et que vous devez acheter\nvotre propre batterie)\nPour que cela fonctionne avec un Raspberry Pi, voici les étapes que je\na pris. J&#39;ai inclus les étapes pour ajouter la surveillance MRTG et le fichier distant\naccès à partir de systèmes Windows, mais vous pouvez les omettre si vous n&#39;en avez pas besoin.","Configurer mon routeur pour réserver une adresse IP au Raspberry\n    Pi\nModification du nom de l&#39;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nNTP mis à jour pour le développement actuel\n    version (j&#39;ai utilisé une copie FTP d&#39;un autre Pi).\nConfigurez les E / S série sur le\n    Tarte aux framboises.\nGpsd installé et configuré et ses utilitaires.\nNTP configuré pour utiliser la mémoire partagée pendant un temps approximatif\n    (type de pilote 28.0).\nInstallé les outils PPS (sudo apt-get install pps-tools)\nInstallé le rpi_gpio_ntp\n    programme de Folkert van Heusden (seulement pour très tôt Raspbian\n    versions).\nNTP configuré pour utiliser le partagé\n    mémoire pour PPS (type de pilote 28.1).\nSNMP installé et configuré\n    divers collecteurs de données MRTG (facultatif).\nSNMP configuré pour surveiller la  CPU\n    Température (optionnel).\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC (facultatif).\nConfigurer le PC pour la mise en réseau sans fil\n    Clé USB Wi-Fi (en option).","Installé sur le Raspberry Pila carte ressemble à ceci. lele fil d&#39;antenne peut être retiréà travers un trou dans le boîtier près du connecteur Ethernet.\nNotez que cette carte utilise GPIO 18 pour son signal PPS, donc tout logiciel doit être configuré de manière appropriée.","Vous pouvez demander à quel point ce mode utilisateur fonctionne correctement. bien\nc&#39;est plutôt bien, mais pas assez aussi bon que le mode noyau, mais plus\nque suffisant pour la précision offerte par le Raspberry Pi. Peut-être le\nmieux que le Pi pourrait faire sinon serait la synchronisation via une connexion LAN à un\nStratum-1 serveur NTP. La comparaison de tracé ci-dessous montre le Pi synchronisé\nsur un serveur de strate-1 mais sur Wi-Fi, puis sur les performances après l&#39;installation\nle panneau d&#39;addition GPS NTPI. Un terrain idéal serait une ligne droite à la\nNiveau 500 microsecondes sur ce graphique (je dois ajouter un décalage car MRTG ne peut pas tracer\nnombres négatifs). La gigue moyenne sur 6 heures rapportée par NTP est passée de\n100-150 microsecondes à moins de 4 microsecondes. L&#39;amélioration de la marche\nde la synchronisation Wi-Fi à la synchronisation PPS, c&#39;est évident!","Mise à jour vers la dernière version de Raspbian Linux\nLa version de Linux que vous utilisez est affichée lorsque vous vous connectez, mais vous\npeut également utiliser la commande:\n  $ uname -a\npour montrer quelle version est en cours d&#39;exécution. J&#39;ai commencé avec:  Linux raspberrypi 3.12.26+ # 702 PREEMPT Wed Aug 6 17:43:49 BST 2014 armv6l GNU / Linux\nPour mettre à jour mon logiciel, j&#39;ai exécuté les commandes:\n  $ sudo apt-get update  $ sudo apt-get dist-upgrade  $ sudo rpi-update\net après le redémarrage, j&#39;ai terminé par:  Linux raspberrypi 3.12.32+ # 721 PREEMPT Fri Nov 7 16:50:31 GMT 2014 armv6l \nConfiguration de Linux pour PPS sur le port GPIO\nGrâce aux courriels de Olav Andrarde et Timo Kokkonen, j&#39;ai découvert que\nLe support PPS a été ajouté à Linux disponible pour le Raspberry Pi,\nbien que vous ayez besoin d&#39;ajouter quelques lignes à la configuration pour l&#39;activer.\nComme Raspbian évolue continuellement, la méthode exacte pour effectuer ces changements\névolue également, donc en fonction du moment où vous avez téléchargé Raspbian, vous devez suivre\nsoit le novembre 2014 ou le février\n2015 sections ci-dessous. J&#39;ai mis les informations les plus récentes en premier,\nbien que je préfère normalement que les choses soient énumérées dans l’ordre chronologique, comme dans un\njournal intime!\n    Versions Raspbian vers février 2015\nAprès avoir mis à jour un autre Raspberry Pi vers le dernier Raspbian &#8211; pour un nouveau\nRaspberry Pi 2 que j&#39;avais acheté &#8211; j&#39;ai découvert que les choses avaient changé une fois\nencore. Ces détails de mon démarrage rapide\npage. Versions de Linux: 3.18.6+ 3.18.7-v7\n  $ sudo nano /boot/config.txt\n&#8211; Ajouter dtoverlay = pps-gpio, gpiopin = 18\nsur une nouvelle ligne.\n   Si vous avez précédemment ajouté bcm2708.pps_gpio_pin = 18 à la fin de\ncmdline.txt, supprimez-le.   Sauver et fermer.\n  $ sudo nano\n/ etc / modules &#8211; Ajouter pps-gpio\nsur une nouvelle ligne.   Enregistrez, fermez et redémarrez.\nMaintenant, vérifiez que PPS fonctionne.\n    Versions Raspbian vers novembre 2014\nPour activer PPS sur le port GPIO, vous devez suivre deux étapes: l’une pour indiquer au\nnoyau pour inclure le support, et un pour amener le module de support à\nêtre chargé. Tout d’abord, indiquez au noyau que la broche 18 de GPIO doit être utilisée.\nCela active la prise en charge de PPS-GPIO dans le noyau. Ajouter ce texte au\nFichier /boot/cmdline.txt:\n  $ sudo nano /boot/cmdline.txt    ajouter:        bcm2708.pps_gpio_pin = 18    à la  fin de la ligne.    Ce doit être sur le même ligne, pas sur un Nouveau ligne,\ncomme l&#39;a découvert Ray Hunter!\nEnsuite, vous devez dire au noyau de charger le module qui fournit cette information.\nsoutien. Pourquoi cela ne peut pas être automatique, je ne sais pas! Ajouter le\nnom du module à la fin du fichier / etc / modules.\n  $ sudo nano / etc / modules    ajouter:       \npps-gpio     à la fin si la liste, et redémarrez. \nVérifier que PPS fonctionne\nPour vérifier que le module est chargé, vous pouvez utiliser la commande lsmod, par exemple\nexemple:\n  $ lsmod | grep pps\nLa sortie devrait être semblable à:\n  pps_gpio 2529 1  pps_core 7943 2 pps_gpio\nVous devriez maintenant pouvoir exécuter la commande ppstest et voir les transitions\nune fois par seconde, par exemple:\n$ sudo ppstest / dev / pps0 # appuyez sur Ctrl-C pour annuler .. essayer le source PPS &quot;/ dev / pps0&quot; a trouvé la source PPS &quot;/ dev / pps0&quot; ok, trouvé 1 source (s), commencez maintenant à récupérer les données &#8230; source 0 &#8211; assert 1351501153.999956346, séquence: 47481 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501154.999954601, séquence: 47482 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501155.999951856, séquence: 47483 &#8211; effacé 0,000000000, séquence: 0 ^ C","Notez qu&#39;il n&#39;y a pas de valeur donnée pour le temps &quot;clair&quot;. Gary\nE Miller rapporte que le pilote pps-gpio ne cherche qu’un seul avantage, le positif\nbord allant. Si vous utilisez un appareil GPS différent de ceux mentionnés\nDans ce cas, vous aurez peut-être besoin d’un onduleur de sortie de 3,3 volts dans la ligne PPS du GPS.","L&#39;approche de Hauke ​​Lampe\nUniquement des informations historiques: Depuis que j&#39;ai écrit cette page pour la première fois, Hauke ​​Lampe a\ndisponible une image préconfigurée de Raspberry Pi OS ici.\nSon article est basé sur sa version d’un GPS série comme je le décris ici, mais vous devez le faire.\naucun des travaux de construction et de configuration que je mentionne ici. Ma framboise\nLa Pi # 3 fonctionne à partir de cette image de système d&#39;exploitation et je développe l&#39;installation GPS à l&#39;adresse\nle moment. Les commentaires et les changements jusqu&#39;à présent:","Modification de l&#39;adresse IP du port Ethernet en un numéro fixe\n    adresse (statique) &#8211; Comment\n    à.Remarque: Si vous faites cela, vous devrez peut-être éditer le fichier hosts sur votre ordinateur.\n    systèmes pour permettre l&#39;accès à l&#39;appareil par nom plutôt que par IP\n    adresse. Ajouter une ligne telle que:  192.168.0.51\n    framboise-pi-1 \n    au fichier (avec l&#39;adresse et le nom de votre RPi, bien sûr). Sur\n    Windows-8, notez que Windows Defender peut essayer de remplacer un hôte modifié\n    fichier avec celui par défaut, supprimant ainsi vos modifications! Sous Windows, le\n    Le fichier à modifier est  Windows  system32  drivers  etc  hosts, et vous devrez peut-être\n    Accès de niveau administrateur pour éditer ce fichier.\nModification du nom de l&#39;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nSNMP installé et configuré\n    divers collecteurs de données MRTG.\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC.\nConfigurer le PC pour la mise en réseau sans fil avec un ancien NetGear\n    Clé USB Wi-Fi (remplacée plus tard par une unité Edimax).","Quelques utilitaires &quot;standard&quot; de Raspberry Pi\nne sont pas présents dans cette image de système d&#39;exploitation, et devront être téléchargés séparément avec\napt-get. Voici à quoi cela ressemble pour le moment. L&#39;antenne patch\nest attaché au ModMyPi blanc\navec du ruban adhésif double face, et la carte réceptrice avec un écrou simple et\nboulon. Les dérivations provenaient également de ModMyPi et la longueur de 150 mm n’est pas\nnécessaire ici! Le dongle Wi-Fi est à gauche. Graphiques de performance\nsont ici.","Comme mon application d’essai est pour un serveur NTP, je n’ai pas besoin de\nafficher sur le Raspberry Pi, ou d&#39;ailleurs un clavier et une souris connectés en permanence. Tous mes\nl&#39;interaction se fera via un terminal, et même cela sera émulé via programme\nfonctionnant sur un ordinateur distant, avec une connectivité via le port Ethernet du\nTarte aux framboises. Une telle opération est communément appelée un serveur sans tête.\nUn bloc d&#39;alimentation et un boîtier sont les seuls éléments que j&#39;ai ajoutés au Raspberry fourni\nPi. Il y a quelques conseils pour courir sans tête ici: http://glynrob.com/hardware/raspberry-pi-headless/\nVous avez besoin d’un programme terminal qui fonctionnera en mode SSH &#8211; I\nmastic utilisé\nsur un PC Windows XP.\nJ&#39;ai regardé sur mon routeur qui exécute DD-WRT pour voir l&#39;adresse IP\nqui avait été affecté au Pi, et j&#39;ai ensuite utilisé cette adresse pour exécuter\nPUTTY en mode SSH. J&#39;ai tout de suite une connexion avec l&#39;utilisateur par défaut\nnom et mot de passe. Vous pouvez enregistrer les paramètres du Pi depuis PUTTY.\n(J&#39;ai appelé le mien &quot;RaspberryPi&quot;), et fais un raccourci Windows pour se connecter\nà votre Pi avec des valeurs telles que:","Cible: C:  Tools  PuTTY  PUTTY.EXE -load RaspberryPi\nCommencez dans: C:  Tools  PuTTY","Votre chemin d&#39;accès et le nom des paramètres enregistrés seront différents.\nCommande Linux pour se déconnecter et se déconnecter:\nse déconnecter\nAu fait, en ajoutant un serveur X-windows\nprogramme tel que Xming sur votre PC, vous pouvez voir les graphiques du Raspberry Pi\naussi, si vous voulez, mais c&#39;est  ne pas nécessaire pour les opérations décrites\nici &#8211; vous pouvez tout faire directement à partir de la ligne de commande.  \nMise à jour du système d&#39;exploitation\nJ&#39;ai suivi le conseil ici\npour mettre à jour le système d&#39;exploitation, bien que je ne pense pas que c&#39;était vraiment nécessaire car le système d&#39;exploitation\ntéléchargé n&#39;avait qu&#39;un mois. Pour exécuter les commandes nécessite des privilèges\naccès, obtenu ici en préfixant la commande avec sudo.\nL’exécution de ces commandes prend beaucoup de temps et nécessite un accès Internet depuis\nvotre Pi. Prévoyez 30 à 45 minutes.","$ sudo apt-get update","$ sudo apt-get dist-upgrade","Vous devrez probablement redémarrer le système d&#39;exploitation après avoir apporté les modifications suivantes:","$ sudo reboot","Si vous souhaitez déterminer quelles mises à niveau sont en attente, essayez:","$ sudo apt-get --just-print upgrade","et redirigez la sortie vers un fichier texte. Merci à Graham\ndans le comté de Durham, au Royaume-Uni, pour ce conseil. \nRéglage du fuseau horaire\nVous voudrez peut-être vérifier que le Raspberry Pi est configuré pour\nvous donner l&#39;heure dans votre fuseau horaire local: Utilisez la commande:","$ sudo dpkg-reconfigure tzdata","et sélectionnez la région et la ville appropriées. Pour le Royaume-Uni,\nJ&#39;ai choisi l&#39;Europe / Londres. La procédure reflétera les données du fuseau horaire et\ndate et heure actuelles à l&#39;heure locale et à l&#39;heure UTC à la fin. \nBien qu’il existe une interface graphique avec laquelle\nconfigurer le Wi-Fi, cela ne semblait pas fonctionner pour moi. En tout cas, si vous\nfonctionnent sans tête, vous pouvez même ne pas avoir accès à l&#39;interface graphique. le\nadaptateur réseau que j&#39;ai utilisé était l&#39;adaptateur USB nano sans fil 150Mbps Edimax EW-7811UN\nunité, que j&#39;ai reçu d&#39;Amazon (juste prix et bonne livraison).\nIl semble y avoir trois étapes:","Convertissez le mot de passe Wi-Fi en chaîne hexadécimale (cela peut être\n    optionnel):  $ sudo wpa_passphrase VotreSSID\n    Votre mot de passeVous obtiendrez un résultat hexadécimal tel que &quot;b7d90db3ddbd11d5ddb3dbfd81de&quot;\n    dont vous aurez besoin plus tard.  \nEditez le fichier /etc/wpa_supplicant/wpa_supplicant.conf  $ sudo nano /etc/wpa_supplicant/wpa_supplicant.confpour le faire ressembler à ceci:\nctrl_interface = DIR = / var / run / wpa_supplicant GROUP = netdevupdate_config = 1réseau = {ssid = &quot;YourSSID&quot;proto = WPA RSNscan_ssid = 1key_mgmt = WPA-PSKpaire par paire = CCMP TKIPgroupe = CCMP TKIPpsk = b7d90db3ddbd11d5ddb3dbfd81deNotez que le ssid doit être entre guillemets.","Editez le fichier / etc / network / interfaces   $ sudo nano / etc / network / interfacespour le faire ressembler à ceci:\nauto lo\niface lo inet loopbackiface eth0 inet dhcp\nallow-hotplug wlan0auto wlan0iface wlan0 inet dhcpWireless-Essid YourSSIDpre-up wpa_supplicant -B w -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.confKillall -q wpa_supplicant\niface default inet dhcp","Vous pouvez ensuite utiliser le $ sudo ifdown\nwlan0 et $ sudo ifup wlan0 commandes à\nredémarrez le réseau sans fil. Je conseillerais également un redémarrage pour assurer\nque tout s&#39;est passé comme prévu. \nComment éditer la configuration NTP\nLe fichier de configuration NTP réside dans le répertoire / etc, de sorte que vous\npeut changer dans ce répertoire pour éditer le fichier. Parce que le fichier est un\nfichier système, vous devez  sudo commande permettant de sauvegarder la version modifiée du\nfichier, mais d’abord, j’ai fait une copie (cp) du fichier fourni juste au cas où je me suis planté\net a dû revenir à la configuration de travail NTP. J&#39;ai utilisé le  vi\néditeur qui est fourni avec le système d&#39;exploitation, et il y a des instructions pour vi ici,\net aussi à\nGuru99.com dans le cadre d&#39;un Linux / Unix\ntutoriel pour débutants.\nle  nano éditeur que j’ai découvert plus tard, et qui est fourni avec le Raspberry Pi, est un bien meilleur choix &#8211; beaucoup\nplus facile à utiliser!","$ cd / etc","$ sudo cp ntp.conf ntp-original.conf","$ sudo nano ntp.conf","Je voulais pouvoir surveiller NTP depuis un autre PC sur mon réseau local,\nplutôt que d’ajouter le programme de surveillance MRTG au Pi, mais il existe des\nlignes qui limitent l’accès au NTP fonctionnant sur le Pi par défaut\ninstallation. Ces lignes du fichier ntp.conf commencent par le mot clé\n&quot;restreindre&quot;. J&#39;ai supprimé ces restrictions en les commentant\nlignes &#8211; ce qui est réalisé en ajoutant un caractère de hachage au début de la\nligne. Par exemple:","Remplacer:\n    restreindre -4 par défaut kod notrap nomodify nopeer noquery","Avec:\n    # restreint -4 par défaut kod notrap nomodify nopeer noquery","Après avoir modifié ntp.conf, vous devez redémarrer le démon ntp:","$ sudo /etc/init.d/ntp restart","Si la sécurité sur votre réseau vous préoccupe, vous pouvez\nsouhaite être plus sélectif en modifiant les restrictions. \nBien que le contenu par défaut de ntp.conf fonctionne correctement\nDans la plupart des cas, ils ne profitent pas de la nouvelle directive NTP POOL pour\nspécifier les serveurs de pool. J&#39;ai également modifié le pool générique &quot;debian&quot;\nà la piscine plus locale &quot;UK&quot;. J&#39;ai donc changé le serveur\nbassin. lignes à une directive de pool unique:","Remplacer:\nserveur 0.debian.pool.ntp.org iburst\nserveur 1.debian.pool.ntp.org iburst\nserveur 2.debian.pool.ntp.org iburst\nserveur 3.debian.pool.ntp.org iburst\nAvec:\npool fr.pool.ntp.org iburst","Mon propre réseau local possède trois serveurs NTP de strate 1, un sur FreeBSD et\ndeux exécutant Windows, alors j&#39;ai ajouté ceux\navant les serveurs de la piscine. Bien sûr, cela est spécifique à mon réseau local. Pour\nl&#39;offset minimum, j&#39;ai fait interroger NTP les serveurs locaux à 32 secondes (2 ^^ 5)\nintervalles, et n&#39;a pas permis que cela dérive vers le haut vers les 1024 secondes\nintervalle maximum que NTP atteindrait laissé à ses propres périphériques. j&#39;ai fait ça\navec les qualificatifs minpoll et maxpoll. Cependant, je ne voulais pas forcer\nles serveurs Internet à interroger que souvent (on considère au mieux\nau pire pourrait vous faire bloquer par un serveur), alors j&#39;ai donc fait\nl&#39;intervalle d&#39;interrogation minimal pour les serveurs Internet, 1024 secondes\n(2 ^^ 10). J&#39;ai enlevé les choses qui avaient été commentées pour simplifier le fichier,\net le rendre plus facile à comprendre. C&#39;est pourquoi mon fichier ntp.conf s&#39;est terminé comme suit:","# /etc/ntp.conf, configuration pour ntpd; voir ntp.conf (5) pour obtenir de l&#39;aide","# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift","# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst","N&#39;oubliez pas de redémarrer NTP après avoir apporté les modifications. De\nPC de surveillance Windows avec NTP installé\nJe vois maintenant:","C: &gt; ntpq -p raspi\n     référence distante st t lorsque l&#39;interrogation atteint le décalage de retard de gigue\n=============================================== ============================\n* pixie .PPS. 1 u 26 32 377 0,467 -0,010 0,023\n+ feenix .PPS. 1 u 4 32 377 0,603 -0,226 0,039\n+ stamsund .PPS. 1 31 31 377 0,586 0,004 0,040\n-dns0.rmplc.co.u 193.62.22.74 2 707 1024 377 21.915 3.490 2.295\n-dns1.rmplc.co.u 193.62.22.74 2 u 177 1024 377 23.736 4.609 3.621\n-dawn.rt.uk.eu.o 193.79.237.14 2 277 1024 377 20.508 3.150 3.065\n-lyla.preshweb.c 129.215.42.240 3 u 544 1024 377 28.082 5.937 3.944","C: &gt; ntpq -c rv raspi\nassocid = 0 status = 0615 leap_none, sync_ntp, 1 événement, clock_sync,\nversion = &quot;ntpd 4.2.6p5@1.2349-o ven. mai 18 20:30:57 UTC 2012 (1)&quot;,\nprocesseur = &quot;armv6l&quot;, système = &quot;Linux / 3.2.27 +&quot;, saut = 00, strate = 2,\nprecision = -20, rootdelay = 0.467, rootdisp = 2.387, refid = 192.168.0.3,\nreftime = d4365966.98133154 sam., 27 oct. 2012 14: 00: 22.594,\nclock = d4365984.f4e4138b sam. 27 oct. 2012 14: 00: 52.956, homologue = 49569, tc = 5,\nmintc = 3, offset = -0,010, fréquence = -43,888, sys_jitter = 0,023,\nclk_jitter = 0.015, clk_wander = 0.008","Une approche pour que le NTP voie\nla partie série du flux de sortie du récepteur GPS (pour la partie grossière du\ntemps, les secondes) est d&#39;installer\nle pilote gpsd, et cela permet une vérification de la base\nconnectivité. Le GPS que j&#39;ai commencé à utiliser était un Trimble Resolution SMT,\npour lequel j&#39;ai réussi à obtenir à la fois une carte d&#39;évaluation et une carte d&#39;interface\nconverti la sortie série en RS-232 et USB. J&#39;ai utilisé le feuilleton\nvia USB plutôt que le RS-232 pour le Raspberry Pi.","C&#39;est le GPS que j&#39;ai utilisé. Il\n      est une carte d’évaluation pour un récepteur de synchronisation GPS monté en surface, le\n      Trimble Resolution SMT. C&#39;est un peu inhabituel d&#39;avoir un format TSIP\n      sortie plutôt que le format NMEA standard, mais le gpsd Linux peut\n      reconnaître et accepter ce format. La sortie est sur un en-tête à 8 broches avec un non standard\n      espacement des broches! Il est assez sensible pour utiliser un support magnétique.\n      Rondelle GPS dans ma salle informatique à l&#39;étage supérieur.","Juste comme j&#39;ai acquis le conseil,\n      il y avait une offre sur la liste de diffusion time-nuts pour un \n      interface prête à l&#39;emploi. Cela a un connecteur correspondant à 8 broches, et\n      fournit une sortie PPS, une sortie série aux niveaux RS-232 (non utilisé ici) et dispose d&#39;un convertisseur série-USB intégré! Idéal!\nFaites attention en utilisant d’autres unités GPS que vous n’aurez pas\n      dépasser +3,3 V sur le signal PPS transmis au Raspberry Pi, sous forme de signal 5 V\n      niveau sera  dommage le dispositif. J&#39;ai utilisé un diviseur résistif\n      (non représenté) pour réduire le niveau à une valeur nominale de 3,2 V.\nJ&#39;ai soudé un diviseur résistif 3k9 * + 6k8 au PPS\n      en-tête, puis a soudé un câble double alimenté en un en-tête de 0,1 pouce que j’ai eu à traîner.\n      Je l&#39;ai connecté à des broches\n      GND et GPIO-24 sur le 26 broches  Raspberry Pi GPIO\n      entête.* &#8211; incorrectement donné comme 1k0 plus tôt.","Tout d’abord, j’ai connecté l’appareil au port USB inférieur, puis\nvérifié ce qui était vu sur les ports USB.","$ sudo lsusb\nPériphérique de bus 001: ID 1d6b: 0002 concentrateur racine Linux Foundation 2.0\nBus 001 Appareil 002: ID 0424: 9512 Standard Microsystems Corp.\nBus 001 Appareil 003: ID 0424: ec00 Standard Microsystems Corp.\nDispositif de bus 001 005: ID 04d8: 00df Microchip Technology, Inc.","Il semble que mon GPS apparaisse sous le numéro 005 dans cette liste, mais\ncomment sera-t-il nommé? Pour vérifier cela, vous devez parcourir l’un des\nFichiers journaux Linux:","$ more / var / log / syslog","et dans mon cas, au moment où j&#39;ai branché l&#39;appareil là-bas\nétait une référence à: ttyACM0:et j&#39;ai reconnu\ntty comme un port série (TeleType d&#39;il y a longtemps!). Si vous utilisez un vrai\npériphérique série, il apparaîtra comme ttyAMA0.\n  Les prochaines étapes sont à\ninstallez le logiciel gpsd et démarrez le service gpsd pointant sur l&#39;appareil\nnom vient de découvrir:","$ sudo apt-get installez gpsd gpsd-clients python-gps","À partir d&#39;un rapport que j&#39;ai reçu, si vous rencontrez des erreurs avec l&#39;étape ci-dessus, vous devrez peut-être exécuter une mise à jour vers apt-get:\n$ sudo apt-get update\net éventuellement alors:\n$ sudo apt-get upgrade\nqui peut mettre à niveau l&#39;ensemble du système d&#39;exploitation vers la version actuelle.","$ sudo gpsd / dev / ttyACM0 -n -F /var/run/gpsd.sock","À ce stade, vous devriez pouvoir voir une sortie en mode texte\ndepuis votre récepteur GPS en exécutant la commande &quot;cgps\n-s&quot;, quelque chose comme ce qui suit.","$ cgps -s","Notez qu’il s’agit d’un GPS en mode chronométrage, il préférera\nsatellites qui ont une altitude plus élevée, car ceux-ci sont moins susceptibles d&#39;avoir\neffets multi-chemins ou réflexions. Cependant, pour le niveau de précision de\nque nous visons (microsecondes, pas nanosecondes), ce raffinement n’est pas\nessentiel, et je ne pouvais voir aucune différence significative entre un\n&quot;timing&quot; GPS and a &quot;position&quot; GPS on the microsecond level. \nNote that you will need to make gpsd start automatically at boot time,\nand to tell the configuration tool what device to use, and add the &quot;-n&quot;\noption for working with NTP. See the note later in this\ndocument. \nTelling NTP the seconds from the GPS\nNow that gpsd is working, we can edit the NTP configuration to\nadd a type 28 reference clock which will make NTP look at the shared memory\ncreated by gpsd.  This can be done for both the coarse time (seconds) and\nthe fine time (PPS edge) with a 28.0 and a 28.1 driver, although I only use the\n28.0 driver here as the Raspberry Pi supports PPS via a kernel-mode driver (more\nlater).  The first step is\nto get the seconds alone, and be aware that this will ne pas be better than\nInternet time alone due to the offset of the serial/USB data from the true\nsecond, and because of the variability and drift in this offset.  We will\nneed to add a connection later between the PPS signal and one of the Raspberry Pi&#39;s I/O\npins to generate a PPS interrupt.  Here is my modified ntp.conf file. \nI&#39;ve used 0.000 for the time1 modifier to start with, so that we can determine\nan approximate value for the delay of the serial data from the GPS after ntp is\nup and running.  I changed the refid for the type 28 driver to &quot;SHM&quot;\nto indicate more clearly that the data is coming from the SHared Memory provided\nby gpsd.\nNote that I have marked more than one server as\n&quot;prefer&quot;.  This is because if the first preferred server goes\noffline, it appears that NTP will no longer accept the PPS data as valid (is\nthat wise?), so a second preferred server is configured to cover that\npossibility.  In my case, it happens because 192.168.0.3 sometimes has an\nNTP update, causing its NTP to go offline for some seconds, and hence causes a\nglitch in the connected servers.  Having more than one preferred server\nshould prevent that.","# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.000 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst prefer\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst","Note that when using a PPS source you doit have one\nother server marked &quot;prefer&quot;.  In the example above I have added\nprefer to the shared memory driver (type 28) so that the combination of PPS and\nGPSD would provide the correct time even with no Internet servers.  Looking at the output from ntpq -p after some time we might\nsee:","C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\nxSHM(0)          .SHM.           15 l   15   16  377    0.000  -353.23   1.277\n*pixie           .PPS.            1 u   25   32  377    0.484   -0.016   0.105\n+feenix          .PPS.            1 u   31   32  377    0.592   -0.120   0.044\n+stamsund        .PPS.            1 u   16   32  377    0.546   -0.037   0.083\nxns0.luns.net.uk 157.44.176.4     2 u 1656 1024  156   31.904    3.702   5.455\nxtime.videxio.ne 131.188.3.223    2 u  45m 1024   74   31.765    8.590   2.796\nxlyla.preshweb.c 129.215.42.240   3 u  510 1024  377   25.568    4.793   5.990\n-dawn.rt.uk.eu.o 193.67.79.202    2 u  492 1024  367   20.308    2.408   2.903","and while the SHM driver is present and connected (reach =\n377), it has been rejected by NTP (the &quot;x&quot; in the first column),\nperhaps because its offset was consistently too great compared to the other\nservers.  That&#39;s the purpose of the time1 modifier in the &quot;fudge&quot;\ncommander. We can see that the SHM output is some 350 milliseconds later, so\nwe can use that value for time1 to bring the GPS output approximately into line\nwith UTC, as shown in the edited /etc/ntp.conf below.  (The time values in\nthe ntpq -p display are all in milliseconds).\nHint: if at this point the reach field for the SHM\ndevice stays at zero, likely the gpsd wasn&#39;t started with the &quot;-n&quot;\noption. You can make the gpsd always start at system boot time with that -n\noption as described later in this note.","# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst","The output from ntpq -p then shows the offset for the SHM\ndriver to be much nearer to zero, and this /might/ be good enough for you if you\nare out in the field with no other reference.  But we can do better, and\nthe next step is to use the precise PPS signal from the GPS to improve the\naccuracy down to the microsecond level.","C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n-SHM(0)          .SHM.           15 l    1   16   17    0.000    1.766   0.943\n*pixie           .PPS.            1 u   13   32    3    0.421   -0.325   0.194\n+feenix          .PPS.            1 u   13   32    3    0.528   -0.644   0.969\n+stamsund        .PPS.            1 u   11   32    3    0.409   -0.336   0.145\n-dns0.rmplc.co.u 195.66.241.2     2 u   35 1024    1   22.872    3.604   5.037\n-mail1.itdojo.or 10.10.120.2      2 u   34 1024    1   38.472    3.324   7.084\n ntp.fundamental 193.62.22.82     2 u   33 1024    1   30.980    2.450   3.837\n 82.113.154.206  193.62.22.82     2 u   32 1024    1   19.219    0.683   5.880","Note: if you are working stand-alone, without any Internet servers, you may\n  need an extra &quot;flag1 1&quot; in the fudge for the type 28\n  ref-clock.  Please see the notes here\n  for further information.  Thanks to Whitham D. Reeve Anchorage, Alaska USA\n  for the testing.\n \nBut my time is 16 seconds out!\nI did notice with the GPS unit that I have that it doesn&#39;t\nhave battery backup, so when it first starts it has to download quite a lot of data\nfrom the GPS satellites before it has full lock.  While the PPS signal\nis acquired quite quickly, it takes a few minutes for the receiver to determine\nthe number of seconds offset between GPS-time GPST) and the usual UTC.  As I\nwrite, that GPST-UTC offset is 16 seconds &#8211; the offset is because recent\nleap-seconds are not applied to GPS time &#8211; plus\ninformation. The implications of this are different\ndepending on what other servers you have configured in your ntp.conf file","If you have some Internet or LAN servers, ntp is clever\n    enough to ignore the obvious &quot;bad chimer&quot;, and may simply display a\n    large offset for the GPS in the  ntpq -p output when starting\n    up. Après\n    a few minutes, the offset will revert to the correct value.  The delay\n    is not a problem in this case. \nIf you have no other source than the GPS, then you should\n    probably wait a few minutes before assuming that even the coarse seconds\n    part of the time is correct.  I haven&#39;t checked how long it will take\n    NTP to step the clock by the 16 seconds needed after the GPS starts sending\n    UTC rather than GPS time.  If your GPS does this, consider adding some\n    sort of battery backup so that the GPS-UTC offset is stored while the unit\n    is down.","Quite why I saw this issue while using gpsd\nis uncertain.  Since writing the above I have been in contact with the\nauteur de gpsd who tells me that protection is\nincorporated into the gpsd software whereby it\nwill not pass on the time to its shared memory until the output from the GPS\nreceiver has a (GPST-UTC) value in excess of 10 seconds.  So I should never\nhave seen the 16 seconds faster value at all.\nPlease note that this problem is likely peculiar to my\nparticular GPS receiver &#8211; an\nevaluation board with no battery backup.  Just be aware of this problem in\ncase it bites you!  It doesn&#39;t happen with the u-blox pure serial GPS\nreceiver I describe later, as this board has battery\nbackup.  &quot;Your mileage may vary&quot;, as they say! \nThe next step was to get the PPS working.  This requires\nupdating the Linux kernel for the Raspberry Pi, and while you can do that\nyourself, there is a ready-made kernel image and support modules available on\nthe Web.  Much of the information below is based on David K&#39;s Web page:\n  https://github.com/davidk/adafruit-raspberrypi-linux-pps\nYou can check the version of the kernel you are running at the moment by:","$ uname -a\nLinux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux","First you need to get the updated kernel image and\nmodules.  At the time of writing, these were available for the current\nversion of the OS from chrisprt as mentioned here:\nKernel image: https://docs.google.com/open?id=0BznvtPCGqrd3ZElKZHEtUDRpUEUModules: https://docs.google.com/open?id=0BznvtPCGqrd3VTZ2TmxFTktYM0E\nThese come down as Zip files and, as I wasn&#39;t sure about\ndownloading these from Google Docs directly on the Raspberry Pi, I downloaded\nthem to a local Windows FTP server first, and then installed an FTP client on the\nRaspberry Pi to drag the Zip files across in FTP image mode &#8211; i.e. binary files.","# Installing an FTP client:\n$ sudo apt-get install ftp","I could then use standard FTP command to drag the files from\nmy local FTP server to the Raspberry Pi.  I created a directory named pps\nbelow the home user directory for the files, and then unzipped the archives I\nhad copied:","$ mkdir pps","$ cd pps","# FTP get 3.2.27-pps-g965b922-dirty.zip in binary (image) mode.\n# FTP get kernel-pps-gpio24.zip in binary (image) mode\n(substitute your own commands here).","$ unzip kernel-pps-gpio24.zip","$ unzip 3.2.27-pps-g965b922-dirty.zip","In the pps/kernel-pps-gpio24 directory you will find a file\nkernel-pps-gpio24.img.  This must be renamed and moved to the /boot/ directory, while we first\ntake a safety copy of the original kernel image.","$ sudo mv /boot/kernel.img /boot/kernel.img.orig","$ sudo cp kernel-pps-gpio24.img /boot/kernel.img","Now we need to move the module files into the area where the\nnew kernel expects to find them.  I found the command on the Web page\neither confusing or wrong, as I ended up with the wrong structure to start\navec. What it appears to need is:","/lib/modules/3.2.27+\n/lib/modules/3.2.27+/kernel\n/lib/modules/3.2.27+/modules.*\n/lib/modules/3.2.27-cutdown+\n/lib/modules/3.2.27-cutdown+/kernel\n/lib/modules/3.2.27-cutdown+/modules.*\n/lib/modules/3.2.27-pps-g965b922-dirty\n/lib/modules/3.2.27-pps-g965b922-dirty/kernel/\n/lib/modules/3.2.27-pps-g965b922-dirty/modules.*","You will find both the kernel directory and the modules files\nin the unzipped 3.2.27-pps-g965b922-dirty directory, so the following command\nmay work correctly for you.  I made a mess of this having followed the Web\npage verbatim, and not having made allowances for the differences in the file\nNom. Assuming you are now in the pps directory, move the required files to\nthe /lib/modules directory, and add the pps-gpio module to the module list:","$ sudo mv 3.2.27-pps-g965b922-dirty /lib/modules/3.2.27-pps-g965b922-dirty","$ echo &quot;pps-gpio&quot; | sudo tee -a /etc/modules\n(Command corrected, thanks Matthew Huxtable!  Alternatively edit \n /etc/modules using the nano editor to add the pps-gpio at the end.\n$ sudo nano /etc/modules","$ sudo reboot","You will see the changed kernel name at the next login,\n    and you can check with the uname -a command as before:","$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux","An aside &#8211; what is a module in Linux?","You may be used to the idea of device drivers for Windows &#8211;\nthose .SYS files &#8211; but what are &quot;modules&quot; in Linux and how do they\nrelate to device drivers?  I asked that question on the time-nuts list, and\ngot this reply from Michael Tharp:","&quot;Linux modules are the same, although Linux modules almost always need to be\n  compiled against the specific kernel version while Windows drivers are typically only bound to which release you&#39;re running. \n  That is the reason you have to compile the kernel, rather than just plop down a driver\n  downloaded from the internet. \n&quot;That said, the reason your PPS driver is a module is that it makes it easier to tweak options. \n  Almost all modules that are part of the main kernel source (which PPS is, for a year or so)\n  can be compiled in rather than as a separate module, but you can pass options to a module as you load it while you cannot do that with a\n  built-in.  It also makes it possible to tweak the source, recompile just that module, and test it on the fly rather than recompiling the entire\n  kernel and rebooting.&quot;","Many thanks, Michael. \nChecking the PPS is working\nTo check that you are running the new kernel and that the pps-gpio\nmodule is loaded, then install the pps-tools et\nrun it to see the changes on pin 24 (assuming you have a 3.3 V PPS signal\nconnected.  Warning: faire ne pas connect a 5 V signal to the GPIO pins!","$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux","$ dmesg | grep pps\n[ 0.000000] Linux version 3.2.27-pps-g965b922-dirty (root@bt) (gcc version 4.\n6.2 (Ubuntu/Linaro 4.6.2-14ubuntu2~ppa1) ) #1 PREEMPT Sat Sep 22 16:30:50 EDT 20\n12\n[ 1.866364] usb usb1: Manufacturer: Linux 3.2.27-pps-g965b922-dirty dwc_otg_h\nCD\n[ 12.797224] pps_core: LinuxPPS API ver. 1 registered\n[ 12.803850] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giome\ntti \n[ 12.824858]  pps pps0: new PPS source pps-gpio.-1\n[ 12.832182] pps pps0: Registered IRQ 194 as PPS source\n[ 133.043038] pps_ldisc: PPS line discipline registered\n[ 133.044841] pps pps1: new PPS source acm0\n[ 133.044879] pps pps1: source &quot;/dev/ttyACM0&quot; added","$ sudo aptitude install pps-tools # may take some time","$ sudo ppstest /dev/pps0 # press Ctrl-C to cancel.. \ntrying PPS source &quot;/dev/pps0&quot; \nfound PPS source &quot;/dev/pps0&quot; \nok, found 1 source(s), now start fetching data... \nsource 0 - assert 1351501153.999956346, sequence: 47481 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501154.999954601, sequence: 47482 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501155.999951856, sequence: 47483 - clear 0.000000000, sequence: 0 \n^C","The &quot;clear&quot; entries showing as zero is correct for\nthis driver implementation.  Note that if you don&#39;t have a PPS signal\nconnected to GPIO pin 24 the last three lines from the dmesg output may be\nmissing.  In the output above, the PPS source was only registered some 133\nseconds after startup, possibly the length of time it took the GPS to\nlock.  On a second system with no PPS connected the last three lines were\nmissing.\nThis test should still work even with NTP running and using the PPS signal.  \nUnfortunately, the version of NTP supplied with the Raspberry\nPi Linux does not support PPS.  Likely it has been compiled to minimise its\nmemory and disk footprint.  These are the steps to download, compile and\ninstall NTP (with help from jbeal&#39;s\nposting). You can choose between a release and a development version\nas shown in step 4 below. You could also use a copy of the development tarball on\nyour own local FTP server.  So from logging in, here are the steps. \nThe lines below are shown for development version ntp-dev-4.2.7p397, but you\nwill need to alter the version number to suit the version you wish to compile. \nThe two time-consuming steps (configure and make) appear to be CPU limited\nrather than SD-card I/O access limited. \nYou can see which version I am currently running here.","$ mkdir ntp                  # make a convenient working directory, if you don&#39;t already have one","$ cd ntp                     # enter that directory","$ sudo apt-get install libcap-dev\t# once-off, required to prevent later file not found error\n$ sudo apt-get install libssl-dev\t# once-off, you may not need this, but reports suggest you might to build keygen","# Get the desired tarball, current or development - use one of the following:\n$ wget http://archive.ntp.org/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz\t\t\t\t\t# release\n$ wget http://archive.ntp.org/ntp4/ntp-dev/ntp-dev-4.2.7p397.tar.gz\t\t\t# development\n \n(May redirect to:  https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz)","$ tar xvfz ntp-4.2.8p10.tar.gz","$ cd ntp-dev-4.2.8p10","$ ./configure --enable-linuxcaps\t# takes 11-15 minutes","# If your PPS doesn&#39;t work and you get a &quot;clock type 22 invalid&quot; message, be sure to install pps-tools\n# first, and clear out the directory:  cd ~/ntp, rm -r ntp-dev-4.2.7p397, and start again from step 5.","# It seems that the --enable-linuxcaps flag may not be required on other Linux variants,\n# or on the RPi with later versions of Linux with PPS and pps-tools installed.\n# It is required for the more recent Raspbian Jessie (later 2015).","$ make\t\t\t\t\t# takes 18-25 minutes\n(use &quot;make -j5&quot; for faster execution on the four-core Raspberry Pi 2/3.)","# This removes the original NTP and installs the new.\n# Step may not be needed - see below.\n# Recommend: omit this step.\n$ sudo apt-get remove ntp    # get rid of previously existing install of ntpd","$ sudo make install          # puts ntp* in /usr/local/bin/ntp*, takes 30-60 seconds","It is not entirely clear to me whether step 9 above is\nrequired.  It does not appear to be when updating from 4.2.7p304 to\n4.2.7p321, for example. je suis ne pas using step 9.\n  Once you have a new set of NTP\nbinaries, you first need to stop NTP, use super-user mode to copy the binaries\nto their final directory, and then restart NTP.  Once restarted, a simple\ncheck that it&#39;s working correctly.  I recommend these steps,\nalthough there are alternatives.  See the note below about step 2.","$ sudo /etc/init.d/ntp stop","$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/","$ sudo /etc/init.d/ntp start","$ ntpq -crv -pn\t\t# optional step to check for version and basic function","Remarque:  on some more recent versions of Raspbian steps 1\nand 3 may require:","$ sudo service ntp stop","$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/","$ sudo service ntp start","Remarque: that on some systems the binary ntp* files will\nbe written to a mixture of /usr/local/bin et /usr/local/sbin,\naccording to the paths defined in sntp/loc.  I have been told that the\n&quot;sbin&quot; is for system files (i.e. ones not usually run by users such as\nservers and daemons, and the &quot;bin&quot; is for files usually executed by\nusers).  For Debian, for just the ntp* files, this is:","# Debian installations and man page suffixes\nMDOC\nntp-keygen,sbin,8\nntp-wait,sbin,8\nntpd,sbin,8\nntpdate,sbin,8\nntpdc,bin,1\nntpdsim,sbin,8\nntpq,bin,1\nntpsnmpd,sbin,8\nntptime,sbin,8\nntptrace,bin,1","so you may need to check both directories to get the most\nrecent files.  Check with &quot;ls -l&quot; which shows the file date.\n \nA confession: I did alter one system to\npoint the NTP start-up to the directory I preferred, rather than leaving it\npointing to an old version.  I suspect that in my own personal use, only\nthe ntpd and ntpq executables matter.  \n \nUpdating multiple Raspberry Pi cards\n \nIf, like me, you have multiple Raspberry Pi cards, you will\nnot want to waste almost an hour compiling and updating NTP on each card. \nFortunately, my experience so far using the development versions of NTP\n(4.2.7p&#8230;) suggests that simply copying the binaries from one Pi to another\nworks as expected.  This may be luck, or it may be because the OS\ndifferences between Linux/3.2.27+ and Linux/3.6.11+ are not that great. Si\nyou have access to an FTP server (I used a Windows PC running IIS) you may be\nable to use commands such as those below to save a compiled version from one Pi\nand load it onto another.  You may need to use  sudo\napt-get install ftp  if FTP is not already available. Step 5 is required once. Étape\n7 is required for each new version you save. \nReplace &quot;368&quot; in the steps below with the version number you have just\ncompiled.\n \nTo save the newly compiled versions:","$ ftp","(Login as Anonymous or known user)","bin  (forces binary mode)","mkdir RaspberryPi  (step only needed once)","cd RaspberryPi","mkdir 397-safe  (step needed once per new version)","cd 397-safe","prompt   (may disable prompting for steps 10 and 13)","lcd /usr/local/bin","mput ntp*","(respond Y to the prompt for all the files)","lcd /usr/local/sbin","mput ntp*","ls -l  (to check that all eight files are there and have the date you expect)","quitter","To load a new version onto another Raspberry Pi:","$ cd /usr/local/bin","$ sudo ftp \t# sudo allows writing to system directories","(Login as Anonymous or known user)","bin  (forces binary mode)","cd RaspberryPi/397-safe","ls -l  (to check that the files there are correct and have the date you expect)","mget ntp*","(respond Y to the prompt for all the files)","quitter","$ sudo /etc/init.d/ntp stop","$ sudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/","$ sudo /etc/init.d/ntp start","$ ntpq -crv -pn  # to check the NTP version, and that it is still working","See the discussion above about the combined commands in\n    step 11.  An alternative to steps 1 to 9 might be, if you are brave:","sudo wget -P /usr/local/bin -N ftp:///RaspberryPi/397-safe/ntp*","Making updating other cards even easier &#8211; use a fixed directory name:\nAfter storing the working version on your FTP server, copy it\non the FTP server to a directory with a fixed name such as:","/RaspberryPi/ntp/","You can then write a script for updating other Raspberry Pi\ncards something like this:","$ nano update-ntp","with the following contents:","sudo wget --no-passive-ftp -P /usr/local/bin -N ftp:///RaspberryPi/ntp/ntp*\nsudo /etc/init.d/ntp stop\nsleep 1\nsudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/\nsleep 1\nsudo /etc/init.d/ntp start\nsleep 4\nntpq -crv -pn","remplaçant  with the name or IP address\n    of your own FTP server.  With a Microsoft FTP server, I found that I\n    needed to add &#8211;no-passive-ftp  after the wget command, as shown above.  Remember to make the script executable:","$ chmod +x update-ntp","and run it from your local directory:","$ ./update-ntp","You can tell another Raspberry Pi to run the update by using the SSH command\nthus:","$ ssh pi@the-other-raspi &quot;./update-ntp&quot;","You will need to enter the password for the user &quot;pi&quot;, although\nthis can be avoided (I am told) by using public key based authentication, if that fits with your security model. \nOnce you have managed to copy your key\tto the second machine (man ssh-copy-id) you need no password either. \nI&#39;m afraid I don&#39;t know how to do that, though.  \nTo get NTP to use the PPS data which is now available to it,\nthe timestamps of the transitions on the GPIO pin, we need to add another\nrefclock (server) line to the ntp.conf file.  The server we use is a type\n22 server called the ATOM refclock, and we can give it a reference ID of\n&quot;PPS&quot;.  I also changed the reference ID of the serial data to\n&quot;GPS&quot;.  Note that with a type 22 clock you doit have one\nother server marked as &quot;prefer&quot;.","# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help","# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift","# coarse time ref-clock, not really needed here as we have LAN &amp; WAN servers\nserver 127.127.28.0  minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid GPS  stratum 15","# Kernel-mode PPS ref-clock for the precise seconds\nserver 127.127.22.0 minpoll 4 maxpoll 4\nfudge 127.127.22.0  refid PPS","# LAN servers\nserver 192.168.0.3  minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2  minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7  minpoll 5 maxpoll 5 iburst","# WAN servers, &quot;pool&quot; will expand the number of servers to suit\npool uk.pool.ntp.org  minpoll 10  iburst","Remarque: when using the ATOM (type 22) refclock, one of the other servers\ndoit be marked as prefer.  This is because the type 22 clock only\nsupplies the timing dans the second, and another server is required to\ndetermine the courant second.\n \nChecking that NTP is seeing the PPS data\nWhen you have restarted NTP with the new binaries, you\n    should see a new line in the output from an ntpq -p command, and the word\n    &quot;kern&quot; should be present in the output of an ntpq -c rv command:","C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPS.           15 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            0 l   12   16  377    0.000    0.002   0.002\n*pixie           .PPS.            1 u   18   32  377    0.498   -0.030   0.025\n+feenix          .PPS.            1 u    5   32  377    0.619   -0.078   0.035\n+stamsund        .PPS.            1 u   29   32  377    0.614   -0.017   0.051\n uk.pool.ntp.org .POOL.          16 p    - 1024    0    0.000    0.000   0.002\n-ntp.uk.syrahost 192.93.2.20      2 u  405 1024  377   30.031    8.487   0.274\n-ntp2.exa-networ 195.66.241.10    2 u  217 1024  377   26.263    3.167   1.277\n-resntp-a-vip.lo 182.7.208.171    3 u   49 1024  377   17.854    2.828   1.460\n-time.shf.uk.as4 91.208.177.20    3 u   75 1024  377   18.825    0.680   1.974","C:&gt;ntpq -c rv raspi\nassocid=0 status=011d leap_none, sync_pps, 1 event, kern,\nversion=&quot;ntpd 4.2.7p314@1.2483 Mon Oct 29 15:30:42 UTC 2012 (3)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.2.27-pps-g965b922-dirty&quot;, leap=00,\nstratum=1, precision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d439fe8b.16dba50f  Tue, Oct 30 2012  7:21:47.089,\nclock=d439fe97.4d7ac44d  Tue, Oct 30 2012  7:21:59.302, peer=63905, tc=4,\nmintc=3, offset=0.001547, frequency=-45.081, sys_jitter=0.001907,\nclk_jitter=0.000, clk_wander=0.000","You may find that by adding the directive &quot;nohz=off&quot; to the end of\nyour /boot/cmdline.txt that jitter is decreased by up to 50%.  Try it and\nsee for yourself.  Some systems it helps, and others it does not,\ndepending, I suspect, on which OS and firmware versions you have. Comme\nguide, you may get to average jitter in the range:","Modèle\nAveraged jitter","Raspberry Pi B \n3.9 us, but may be better","Raspberry Pi B+\n4.2 µs","Raspberry Pi 2 B\n2 µs","Raspberry Pi 3 B    \n1 µs","Thanks to the folks here\nfor their help. \nWith the replaced version of NTP we lose the automatic running\nde ntpd at startup which was present in the\noriginal install.  We also need to start gpsd\nso that the coarse time is available to NTP.","# To configure gpsd to auto-start, try: \n$ sudo dpkg-reconfigure gpsd","This seems to work as expected, and allows the gpsd\nto automatically start up.  To check that, I rebooted, and logged in, and\ncould run cgps -s right away.  However, NTP\nwon&#39;t see the time from the GPS until après    cgps -s is run. \nThis is fixed as follows (thanks to A Carver):  by default, gpsd\nwon&#39;t connect to the GPS receiver until there is client software such as cgps\nwith requires it.  This allows for some power-saving in the GPS\nreceiver.  To circumvent this, the gpsd needs to be started with the\n&quot;-n&quot; option.  These options are set in the directory\n/etc/default, so you need to edit the file /etc/default/gpsd to change the\nline: GPSD_OPTIONS=&quot;&quot; to GPSD_OPTIONS=&quot;-n&quot;.  Method A\nis to do this through dpkg-reconfigure gpsd, method B is to edit the file\ndirectly.","$ sudo nano /etc/default/gpsd","NTP will auto-start after a reboot with either Method A or\nMethod B above.\nThere is a cut-out area in the ModMyPi case which will allow\nconnections to the GPIO connector such as ribbon cable which you can easily\nbreak out and file down to a neat edge.  The sharp-eyed amongst you will\nnotice that three wires are shown &#8211; this is because the surplus header had three\nwires connected, but I only used two &#8211; ground (blue) and GPIO 24 (red). \nThe black lead would be GPIO 23 but it is unused and not connected.","GPS Receiver Issues\nThere are two issues which are now becoming apparent with the\nparticular GPS receiver I have and the Raspberry Pi.","It seems that after a power-down reboot, the GPS receiver\n    isn&#39;t correctly detected, and need a disconnect/reconnect of its USB\n    connector before it is seen by gpsd.\n    The pulse-per-second signal still comes through,\n    though, so the precise seconds are working, but the coarse seconds are\n    ne pas. This is clearly unacceptable as you would not get the correct\n    time unless you also had an Internet NTP server available.It is possible that a power-up followed by a reboot mai resolve this\n    problème. \nDuring the booting of the GPS receiver (if it does not have\n    a battery) it mai output GPS time (which is 16 seconds adrift from\n    UTC at the time of writing). Bien que gpsd est\n    supposed to catch this situation, it could mean that the Raspberry Pi will\n    not know what the correct time is for some time after booting, and even then\n    it could take 10-20 minutes to be sure that the correct time was actually\n    being sent by the GPS and for NTP to make the 16 seconds step correction\n    required.","If your receiver has this 16-second ambiguity, be sure you have a source\nof coarse time available such as an Internet NTP server. \nBecause of the problem (1) above, I bought a serial GPS\nreceiver from China.  By following the instructions here\nI was able to make the serial port available on the Raspberry Pi independent of\nits use as a login or boot-up terminal port.","(make a safety coppy of the file we are about to edit)\n$ sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt","$ sudo nano /boot/cmdline.txt\n(remove the parameter including the string &quot;ttyAMA0&quot;:\nconsole=ttyAMA0,115200\nIn Raspbian Wheezy there are two parameters:\n console=ttyAMA0,115200 kgdboc=ttyAMA0,115200)","$ sudo nano /etc/inittab\n(Comment out the line like &quot;2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100&quot;\n by putting a hash (#) at the start of the line.  Note that the line was not \n 2:23 on my version of Linux, so be sure to look for the actual line with ttyAMA0.\n It was the last line of the file, as it happens).","(You need to reboot to bring these changes into effect)\n$ sudo reboot","(Minicom then works - to exit minicom, Ctrl-A, release, Q or X.)\n$ minicom -b 9600 -o -D /dev/ttyAMA0","(If minicom gives command not found, you need to install it:)\n$ sudo apt-get install minicom","Note that the Raspberry Pi requires 3.3 V signals on the serial\npins &#8211; ne pas  RS-232 level which will damage the device. Toi\nshould now be able to configure gpsd to talk to ttyAMA0 (using sudo\ndpkg-reconfigure gpsd), and the cgps -s\ncommand should work as above. \n3.3 V GPS receiver\nI found a 3.3 V I/O very compact GPS receiver board here\ndescribed as: &quot;GPS Receiver u-blox NEO-6M Module with Antenna USART TTL &amp; IIC Interface&quot;. \nIt includes the patch antenna and cost less than £20.  Such modules seem to be a\nstandard for flight control for model aircraft and similar applications.  It does require one minor modification, which is to solder a wire\nto pin 3 of the NEO-6M module to extract the PPS signal.  This unit\nwas later replaced by a Adafruit\n    Ultimate GPS Breakout which requires no additional soldering, and has a\nbuilt-in antenna.","The U-blox board from China and supplied antenna under test.","The Adafruit GPS mated to the Raspberry Pi.  Only\n      le GPS Tx =&gt; Pi Rx lead (yellow) is connected, and thesecond ground lead (blue) isn&#39;t connected either.","Raspberry Pi #2 with its Adafruit GPS. Red/brown are+5V/0, orange the GPS Tx, and yellow the PPS.","One the left is the receiver undergoing initial tests. Vous pouvez\nsee the patch antenna on the left raised on a block of foam so that it can\n&quot;see&quot; past the clutter of the receiver, the receiver itself on the blue PCB mounted vertically in the\nbreadboard, and you might just see the orange-pink wire at the top-right corner\nof the receiver which has been carefully soldered to pin 3 of the NEO-6M to get\nthe PPS signal.  The wire is anchored in the top-right mounting hole for\nstrain relief.  You don&#39;t need surface-mount tools to make this connection,\nmais toi faire need a very fine soldering tip and considerable care! \nLike the TX/RX signals from this module, the PPS signal is at 3.3 V level and\ntherefore ideal for feeding the Raspberry Pi.  The board will accept either\n3.3 V or 5 V power while retaining 3.3V I/O levels, and I&#39;m using 5 V to power the\nboard to reduce the load on the 3.3 V regulator on the Raspberry Pi board. \nThe U-blox device is specified at less than 50 mA supply current.\nFor the final installation, the Adafruit module was used as\nits single package was more convenient.  Not all the leads are connected as\nthere is only one place to connect ground on the module (so the blue is left\nopen), and for simplicity the green Pi Tx =&gt; GPS Rx was not connected. \nJudge the size of the Raspberry Pi by the Ethernet connector on the left!\nThe next step was to set up the Raspberry Pi to talk to the new module, use serial\nGPS data via  gpsd for the coarse time,\nand to use its PPS\nline to provide precise time just as described above.  To preset the serial line\nspeed to 9600 at Linux start-up, edit the file  /boot/config.txt\nto include the line:\n        init_uart_baud=9600\nas it says in: http://elinux.org/RPi_config.txt. \nYou can check using the command:","stty -F /dev/ttyAMA0","I found that the speed was already set to 9600 on a recent\nRaspberry Pi installed from the NOOBS software.  I gather that on a typical Linux system you might use the\ncommand: stty -F /dev/ttyAMA0 9600. \nRaspberry Pi GPIO multi-pin connector\nThis time , not only were PPS and ground connections required,\nbut also the serial port and the +5 V line, so I used a piece of 6-way ribbon cable to connect between\nthe Raspberry Pi and my serial GPS device.  I happened to have a 10-pin\nheader which fitted the GPIO connector, so these are the connections I chose to\nmake:","macable\nTarte aux framboisesconnecteur\nCommentaire\nGPS moduleconnecteur","rouge\n+ 5V\nMy unit takes less than 50 mA\n1 +5V","+ 5V","Bleu\nSol\nOne of two ground connections\n2 GND","vert\nTXD\nNot connected, see below","Jaune\nRXD\nReceives serial data sent from the GPS\n3 TXD","GPIO 18","Sol","GPIO 23","blanc\nGPIO 24\nReceives the PPS sent from the GPS\nPPS pin on u-blox device","Noir\nGnd\nOne of two ground connections\n6 GND","I actually didn&#39;t connect the TXD lead to the GPS module in the first instance,\nas the GPS receiver powers up sending data in the correct format, so there is\nnothing which the computer Besoins to control.  There is a description\nof the GPIO pin header here. \nAgain, please note that 3.3 V signals are required,  ne pas the 5 V level, and\nabsolument  ne pas the RS-232 level! \nConverting from USB to native serial &#8211; software changes\nWe need to tell gpsd to look for input from a different\nsource: ttyAMA0 instead of ttyACM0","$ sudo nano /etc/default/gpsd","and change the DEVICES= to point to\n&quot;/dev/ttyAMA0&quot;.  You could use &quot;sudo\ndpkg-reconfigure\ngpsd&quot; instead.  You may also find that the delay between PPS and TXD\non the serial line is different from that over USB, so you may wish to edit your\nntp.conf  accordingly &#8211; it makes the output look nicer at least and may make\nprediction of the nearest second more accurate during the initial acquisition. \nIn my case I needed to change the 0.35 second offset seen in the earlier device\nto the 0.13 second offset seen with the U-blox device, hence the following\nchanger ntp.conf, from","fudge 127.127.28.0 time1 +0.350 refid SHM stratum 15","à:","fudge 127.127.28.0 time1 +0.130 refid SHM stratum 15","This configuration has been running since\n  Friday, November 09, 2012.  \n \nOn reflection, I am unsure why I chose to make the stratum 15\nin the example above,  Possible stratum 2 or 3 might be better, otherwise\nNTP may think that the source is of very poor quality and fail to sync to it.\n \nRobin Scwab notes that you could try using the value of\n&quot;Time offset&quot; displayed in cgps -s as the starting value for the time1\nparameter.  This sounds to be a gooo idea, except that on one system here I\nhappened to check Time Offset was about 0.640 seconds, but the best value for\ntime1 (i.e. the value resulting in the smallest average offset) was 0.130\nseconds.  Where did the extra 0.5 seconds come from? \n \nNumber of NTP clients which can be handled\n \nSomeone asked: &quot;How many NTP clients can it\nhandle?&quot;  Well, I have not done any extensive testing on how many clients this\nNTP server can handle (as it will easily be enough for use on a LAN, and it&#39;s\nnot fit for public use in its present security date).  I did manage to\nlocate one NTP stress-testing program here,\nbut the maximum rate I could get it to produce on my PC was about 75 packets per\nsecond, and the Raspberry Pi can handle that rate with ease.  With NTP\nclient PCs polling at 64 second intervals (the fastest normally used), that&#39;s\n4800 clients, so easily enough for a small organisation.  If you were using\nthis for a small organisation, I would recommend using two or three stratum-1\nservers so that you are covered in the event of failure &#8211; perhaps mark one of the\nservers &quot;prefer&quot; on the client PCs to avoid NTP from\n&quot;clock-hopping&quot;.  If you have better\nstress-test data, as Kasper Pedersen did, please let me know and I can publish it here.\n \nKasper Pedersen notes:\n \nI did one a few years ago that goes a bit faster (Linux):\n \nhttp://n1.taur.dk/permanent/ntpload.c\n \nTo test a Raspberry Pi you need 4 instances running, at which point the\nPi runs out of CPU, and settles on 3520/s.  That ought to be enough for most small homes.. 🙂 \n \nThese are brief notes only, on an alternative approach which\ndoes not require a modified kernel with PPS support in the OS, nor does it\nrequire a recompiled NTP, but which produces\nslightly less accurate timekeeping.  It may, however, be quite good enough\nfor most purposes.  The program was developed by Folkert van Heusden, see: http://vanheusden.com/time/rpi_gpio_ntp/ \nand announced\nin the Time-Nuts mailing list.\n \nBase installation &#8211; check you meet these requirements\n \nYou can start here assuming that you have your Raspberry Pi\nbasically working with GPSD and NTP, meaning that:","You have installed the current operating system and any\n    updates.\nYou have made any optional IP address or computer name\n    changes.\nYou have got NTP working, preferably connected to your\n    country&#39;s pool servers.\nYou have recompiled\n    and installed NTP to get a full version (is a re-compile required?).\nYou have the PPS signal from the GPS receiver connected to\n    the GPIO, e.g. GPIO-8 (pin 24), or GPIO 18 for the no-soldering\n    planche.\nYou have  installed and configured the gpsd Logiciel\n    and utilities, and made gpsd auto-start.\nYou have a GPS device connected either via a serial or a\n    USB connection.\nle cgps -s command produces a correct display.\nYou have configured NTP to talk to the type 28.0 shared\n    memory driver, and can see the GPSD output in ntpq -pn.","Optional first step &#8211; to determine the offset of your GPS serial data from\nthe exact second\n \nThe objective is to determine the offset between the PPS\nsignal from your GPS and the serial data which typically follows some hundred or\nmore milliseconds later.  NTP can use that offset either to make a better\nsync when using just a GPS receiver with no PPS, or to present a slightly less\ndéroutant ntpq -p output when using PPS.  To measure what offset\nshould be specified for the time1 factor when using a GPS receiver (type 28\nreference clock driver), we can use NTP as a measuring tool by making it sync to\nexisting servers and have it monitor the\nshared memory #0 written by  gpsd.  I.e. NTP will not use server\n28.0 for timekeeping, but it volonté display the offset in the ntpq\n-p  commander. To do this, you add these\nlines to your ntp.conf (if they are not already there):","# Server to be monitored only, not selected for syncing\nserver 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.000 refid GPSD","Watch the results from  ntpq\n-pn, and look at the offset for the server with the refid GPSD.  On one of my RPi cards it varied between -322 and -336 (units are\nms in the ntpq report). \nTake an average of those values, and replace the 0.000 after time1 with that average.  In this case, the average was -329 ms, so try:","server 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.329 refid GPSD","i.e. if the reported offset is negative, you need to make\ntime1 a positive value.  Now you should see much smaller offsets for the GPSD server. \nCe n&#39;est pas\nessential to do this, but it gives you confidence that things are working as\nexpected, it may help NTP in the early startup, and it produces a less\ndéroutant  ntpq display.  Don&#39;t forget to remove the noselect\nwhen you have the best value for the offset, and set the flags to include préféré\nso that NTP knows it can use that source as a seconds provider! Là\nmust be at least one préférer for PPS to work.  This now has the NTP daemon seeing the GPSD device, and\nthe next step is to\nadd in some PPS support.","server 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.329 refid GPSD","Getting the average value for time1 automatically\n \nAngelo Mileto writes: What I did to get a good sample of data for the  time1 value was let the ntpq -p command run for a period of time and capture the results. \nThen, using awk, calculate the average/mean of the values collected.  If you look at the static ntpq -p output, you will see something like this:\n \n          remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPSD.           2 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            2 l   12   32  377    0.000    0.002   0.002\nalong with other pool/server entries.  As noted above, you need to ensure you have a good preferred source for the comparison to work. \nTo capture your data, execute the following at the command line from your user&#39;s home directory:","watch -n0.5 &quot;ntpq -pn | grep &#39;.GPSD. 2 1 1&#39; | tee --append GPSD_Offset.txt&quot;","Pay attention to the single and double quotes in that command.  If you notice, the grep is looking for the exact line from the ntpq -p output that contains your GPSD\nrefid.  So if you named it something different, that would replace the .GPSD. in the command. \nAlso, notice the &quot;2 1 1&quot;, that is the stratum, t and when fields.  The stratum is whatever you set it to in the ntp.conf; the t should always be a 1 and the when is going to capture the output\nseulement when the timer reaches 1 meaning that it just updated the value. \nThere is no sense in capturing data every .5 seconds for data that doesn&#39;t\nchange!  So the easiest way to get the value to grep for is to manually run the ntpq -p and copy from your refid through the when fields and that&#39;s what will be grepped for.\n \nLet that run for a good while &#8211; probably not really needed &#8211; but that&#39;s the point of getting a good sample size. \nThis will capture the output from the ntpq command filtering to just your SHM/GPSD. \nThis will all be saved to a file GPSD_Offset.txt in the current directory &#8211; that&#39;s what the &quot;tee &#8211;append GPSD_Offset.txt&quot; does. \nYou can tail -f that file if you want while the watch command is running to see what is going into that file. \nNOTE: If you need to restart the process because you changed some setting and want to start over, delete any existing GPSD_Offset.txt file first.\n \nOnce you have a sufficient sample size, you can then use the following command to get the actual value for the average/mean:","awk &#39;total=total+$9; count=count+1 END print &quot;Total:&quot;total; print &quot;Count:&quot;count; print &quot; Avg:&quot;total/count&#39; GPSD_Offset.txt","This steps through every line of the GPSD_Offset.txt file and totals up all of the offset values. \nIt will also count how many lines/values are there.  Finally it just prints the information: Total, count and average. \nThe average value is what you would put into the  time1 value as noted above. \nDon&#39;t forget to change the noselect to prefer when you are in there to add the time1 value.\nAngelo Mileto\n \nDJT: This is somewhat beyond my Linux, so my thanks to Angelo for the scripts and the\ndetailed explanation.  Angelo can be contacted here.\nDownloading and compiling Folkert van Heusden&#39;s program\n \nAs of 2013-Jun-18, rpi_gpio_ntp-0.3 was the current version,\nbut thanks to Thomas Erthner I know that version 1.5 is now available, so I&#39;ve\nupdated the lines below.  However, I&#39;ve only tested version 0.3, not\nversion 1.5.  For more details, please see Folkert&#39;s\npage.","$ wget http:\n//vanheusden.\ncom/time/rpi_gpio_ntp/rpi_gpio\n_ntp-1.5.\ntgz","$ tar xvfz rpi_gpio_ntp-1.5.tgz\n$ cd rpi_gpio_ntp-1.5\n$ sudo make install","This places the resulting binary in /usr/local/bin/.\nYou don&#39;t need this for current Raspbian versions.\n \nTo test you are receiving a PPS signal, from GPIO pin 8:","$ sudo rpi_gpio_ntp -g 8 -d\nrpi_gpio_ntp v0.2, (C) 2013 by folkert@vanheusden.com","NTP unit: 0\nGPIO pin: 8\nFudge : 0.000000\n&quot;Fork into the background&quot; disabled because of debug mode.\n1371475664.752146325]poll() GPIO 8 interrupt occurred\n1371475665.000148935]poll() GPIO 8 interrupt occurred\n1371475666.000147203]poll() GPIO 8 interrupt occurred\n1371475667.000160470]poll() GPIO 8 interrupt occurred\n1371475668.000159739]poll() GPIO 8 interrupt occurred\n(Ctrl-C pressed)\n$","Running the program\n \nTo make NTP read the PPS timings on the GPSD shared memory, we need to use\nthis command to start the program, assuming the PPS signal is being sent to\nGPIO-8 (physical pin 24 &#8211; see here). \nUse pin 18 is you are using the no-soldering board.","$ sudo rpi_gpio_ntp -N 1 -g 8","and to edit the ntp.conf file, to include the shared memory driver, on section 1\nof the GPSD shared memory, replacing the earlier type 22 driver.  Add:","server 127.127.28.1 minpoll 4 prefer\nfudge 127.127.28.1 refid UPPS","I suggest &quot;UPPS&quot; to show it&#39;s user-mode PPS (and not\nthe more accurate Kernel mode).  If you want to see the output pulse from the program, you can add the &quot;-p 7&quot;\nparameter:","sudo rpi_gpio_ntp -N 1 -g 8 -p 7","and you can then use an oscilloscope to compare the time of\nthe PPS rising edge with the toggling line from GPIO pin 7 (connector pin\n26). On my system, there was a variable delay of between 270 and 390\nmicroseconds between PPS and program response.\n \nAuto-start\n \nMore information to follow, for now, this from Folkert: \nmodifier  /etc/rc.local  and add the\nfollowing (BEFORE the exit 0 statement and AFTER the #!/bin/sh line):","/usr/local/bin/rpi_gpio_ntp -N 1 -g 8","Replace &#39;8&#39; by the gpio pin you are using, e.g. 18 for the no-soldering\nplanche.\n \nPerformance\n \nThe original documentation suggested using minpoll=1, however on testing using\nntpq -pn  it appeared that NTP will automatically accept 3 as the minimum value. Comme\nthe previous testing with kernel-mode PPS had been with minpoll=4, it seemed\nonly fair to test with that value.  You can see the change from minpoll=1\nto minpoll=4 just after 18:00 UTC.  Recall that 1 was replaced internally\nby 3, the lowest value NTP will accept.  With minpoll=4,\nboth the reported offset and the averaged jitter were reduced.  First, what it looks like in MRTG for comparison with the results\nabove:","Don&#39;t get confused: the MRTG plot above covers rather more\nthan one day, whereas the plots below cover just under half a day. Sur le\nplot MRTG plot, you can see that the RPi was changed from kernel-mode PPS at\n13:00 UTC and run for a short while with Internet servers alone, visible as the\nlarger excursions on the plot above around 13:00).  \n \nFrom my NTPplotter\nprogram graphs below, you can see more clearly that at 13:30\nthe user-mode PPS was started, and the just after 18:00 the minpoll was changed\nfrom 1 (actually 3) to 4, resulting in a slight drop of RMS offset from around 5\nmicroseconds to 4 microseconds:","The jitter graph shows a drop in averaged jitter (green line) from just below 7 to just\nabove 5 microseconds after 18:00, when the minpoll was changed from 3 to 4. \nThe initial higher value of averaged jitter is the tail resulting from\nInternet-only sync.","On another Raspberry Pi you can see the dramatic difference between NTP sync\nover the network and that achieved with the user-mode PPS software. Dans\nthis case, network sync was to a local NTP stratum-1 server over a Wi-Fi\nconnection, and the PPS sync was with a U-blox 5S module.  User-mode PPS\nwas started just after 11:00 UTC in the middle of the graphs below.  RMS\noffset dropped from a rather variable 48-80 microseconds to around 2 microseconds,\nand jitter averaged over 6 hours dropped from around 80 microseconds to under\n2.5 microseconds.","To monitor NTP you can edit the ntp.conf file to turn on the generation\nof more detailed statistics data.  Note that this data maybe a megabyte or more per day, so think about keeping only a few days\nworth, and only enabling statistics collection when needed as the number of\nwrites to the SD card flash memory is limited.  The detailed information\ncan now be found here and I\noffer a program to plot the statistics data and produce offset and jitter graphs\nsuch as those above here.\n \n \nTransients\n \nI may have been unfortunate in locating one Raspberry Pi with an Adafruit\nmodule in a position where it was not getting as good a view of the sky as\nothers, or it may be that other devices connected to that RPi or software\ninstalled is an issue.  I have been seeing transient poor time-keeping\n(loss of GPS PPS signal) at intermittent times.  I did discover that\ndisconnections a lead to a USB hub connected to that RPi seemed to improve\ndes choses.\n \n If the problem was caused purely by unfortunate GPS satellite\nposition, I might have expected it to repeat in a near 24-hour pattern, which\ndoes appear to be the case.  Thanks to John Ryan for correcting me about the GPS\norbital period, I was originally thinking sidereal time and 4 minute earlier\neach day.  However, on the Time-Nuts mailing list, in connection with\nanother topic, Bob Camp commented:","&quot;The GPS constellation repeats roughly once a day. \n  It is not at all uncommon to have a “worst case” satellite geometry for a given antenna location. \n  If you have one, it will repeat once a day and show up as a bump in the timing out of your GPS module&#8230;.&quot;","Although the GPS satellites repeat position in just less than\n12 hours, there is also the rotation of the earth to take into account, so the\nposition repeats at your location every 24 hours (well, ~23 h 56 m).\n \n   On reflection, 2014 February 09, this is the only Raspberry\nPi with certain radio software installed, and the problem only seems to occur\nsome days after a reboot, so I think I will stop recording the problem\nici. I am editing out the transients as they affect the P/N timekeeping\ngraphs, but I leave the raw-graphs as-is.","Date\nTransient","Dec 31\n20:00-20:45, 23:10-24:00","Jan-01\n20:14-20:37, 23:17-23:28","Jan-02\n01:29 02:45, 19:57..20:13, 20:14..20:29, 20:31, 23:13, 23:24 23:30..23:54","Jan-03\n02:39, 03:44, 20:12..20:22, 23:24..23:52","Jan-04\n02:37, 20:03..20:28, 23:06, 23:41..23:45","Jan-05\n02:31","Removed USB extension cable from RasPi-2","Jan-06\n19:33..1940, 19:54, 22:49..22:55","Jan-10\n20:30 22:07-22:17 22:37-22:45 23:03","Jan-11\n21:57-23:18","Jan-12\n22:01-22:54","Jan-13\n19:17-19:37 22:37-22:54","Jan-14\n01:46-01:47 19:30 19:40 22:46-22:51","Jan 15\n01:47 19:16-19:35 22:42-22:46 23:06","Jan-16\n19:05-19:32 22:24-22:41","Jan-17\n19:07-19:19 22:04-22:34","Jan-18\n19:11-19:16 21:55-21:57","Jan-19\n02:38-02:39","Jan-20\n19:04-20:06","Jan-21\n02:55-03:03 03:17 19:00 19:46 20:15 22:06","Jan-22\n02:56-03:05","Jan-23\n10:46 12:48","Jan-24\n02:48-02:53 07:21 07:44 12:46-12:48 17:11 19:20-19:36","Jan-25\n07:13 07:18 07:52-07:53 13:02-13:11","Jan-26\n02:50 03:26 18:06 18:31-18:36 21:59","Jan-27\n02:42 02:57-03:37 07:09 (reboot at 17:23)","Jan-31\n21:19-21:21","Feb-05\n20:59 23:12 (is this something which starts days after boot?)","Feb-07\n\t\t18:03 18:41 20:52","Feb-08\n15:09 15:42 18:37 20:33 20:46 21:24","Feb-09\n00:13 00:37-00:43 01:37","If you are operating completely alone, with no internet\nconnection and just the GPS, your NTP may need to be told about leap-seconds\nwhich change the offset between GPS time and wall-clock time every so\nsouvent. Some GPS receivers provide this information automatically, but this\ncan also be done by providing a file with the times of changes (in a standard format) and telling ntpd where to\nfind that file.  On my own\nsystems I have set up a Samba share on the NTP servers so that I can update the\nleap-seconds file from a central location.  To do this, add a new writeable share named &quot;ntp-leapseconds&quot;\nby adding lines to the end of smb.conf, and then restart Samba:","sudo nano /etc/samba/smb.conf\n[ntp-leapseconds]","comment = NTP leapsecond.file\npath = /home/pi/ntp\nwriteable = yes\nguest ok = yes","sudo /etc/init.d/samba restart","I chose to put my leap-seconds file in the default user&#39;s\n&quot;ntp&quot; home directory, but you may prefer some where more secure! \nTo tell ntpd where to find the file,\tadd one line to the end of ntp.conf with\nnano, and restart NTP:","sudo nano /etc/ntp.conf\nleapfile /home/pi/ntp/leap-seconds.file\nsudo /etc/init.d/ntp restart","You can get the leap-seconds file from a variety of locations,\nincluding:\n \n    ftp://utcnist.colorado.edu/pub/    ftp://tycho.usno.navy.mil/pub/ntp/\n \nand it will be named  leap-seconds.3582403200\nwith a different serial number as the information is updated (this file was found in December 2013). je\ncopy the file to a constant name:  leap-seconds.file\nso that I don&#39;t need to alter NTP each time.  I then have a small Windows\ncommand file to update all my systems &#8211; Windows, FreeBSD and Raspberry Pi\ncards.  Here&#39;s an extract:","XCOPY /D /Y  leap-seconds.file  \\Altantpetc\nXCOPY /D /Y  leap-seconds.file  \\Stamsundntpetc\nXCOPY /D /Y  leap-seconds.file  \\Pixie-IIntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-1ntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-2ntp-leapseconds\nPAUSE","You can check whether NTP is using the file, and whether your\nfile is stale, with the:  ntpq -crv \ncommander:","associd=0 status=01fd leap_none, sync_pps, 15 events, kern,\nversion=&quot;ntpd 4.2.7p408@1.2483 Sun Dec 29 14:36:43 UTC 2013 (1)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.6.11&quot;, leap=00, stratum=1,\nprecision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d66b96d3.01b61b26  Mon, Dec 30 2013  6:53:07.006,\nclock=d66b96df.3df17b24  Mon, Dec 30 2013  6:53:19.241, peer=61352, tc=4,\nmintc=3, offset=0.000281, frequency=-34.180, sys_jitter=0.001907,\nclk_jitter=0.001, clk_wander=0.003, tai=35, leapsec=201207010000,\nexpire=201406010000","Look at the two final lines.  leapsec shows the latest\nleap second (here is was on 2012 Jul 01), and when the leap-second file expires\n(here: 2014-Jun-01).  There will also be a warning if the file is stale.\n \nUpdate the file from time-to-time &#8211; say every six months &#8211; in\nMay and November as leap-second changes usually happen at the end of June or\nDecember.  There is more information here. \n \nIf you keep getting a different ntp.conf from that which you edited, your\nrouter may be the cause. It seems some routers give out NTP information in DHCP which the Pi by default uses over\n/etc/ntp.conf.\n \nThe fix I think is:","rm /etc/dhcp/dhclient-exit-hooks.d/ntp","and if you have the following file, remove it as well:","rm /var/lib/ntp/ntp.conf.dhcp","Then reboot.\nYou can produce real-time graphs like those below using MRTG\nand a simple script which can get the statistics from NTP remotely. Là\nis more information here.  I happen to run\nMRTG and the collection scripts on a Windows PC.","RasPi-2\n \nRasPi-4","Information on general SNMP monitoring may now be found here. \nThis allows monitoring of the network I/O on the card, and a number of other\nparameters which are exposed for measurement by the OS.  An example graph\nfollows:","RasPi-3","As NTP tries to keep the clock on the card at a constant\nfrequency, it is often compensating for the effects of temperature changes which\ncause frequency changes.  It is therefore worthwhile monitoring the CPU temperature\nmonitoring as described here,\nalthough with a PPS signal and when used as a stratum-1 server, temperature\neffects may be less obvious.  Example graphs are shown below:","RasPi-4","The MRTG monitoring scripts (which I actually run on a Windows PC\ncovering several Raspberry Pi cards) are in this Zip\narchive. \n \nI extended the SNMP pass function to allow monitoring of\nambient temperature using the DS18B20 &quot;single-wire&quot; device. Cette\nis well written up for use with the Raspberry Pi here,\nand the detailed description is now here. \nSample results:","RasPi-4\nIndoor temperature °C","Outdoor temperature °F","Merci!\n \nMy thanks to Webshed for\nuploading the information about using the DS18B20. \n \nRunning a publicly accessible NTP server\n \nIf you are running a server which is accessible from the\npublic Internet &#8211; perhaps you are contributing to the NTP\nbassin project &#8211; there are some simple precautions you should take to ensure\nthat your server is not used as the source of an attack on other PCs. Remarque\nthat this doesn&#39;t apply to most end-user clients sitting on your local PC, you\nwould need to have specially opened a port in your firewall or router to allow\npublic incoming unsolicited UDP port 123 packets into your local network. \nIf you are using a development version (4.2.7p26 or later) you are already\nprotected.  The following notice explains more:","NTP users are strongly urged to take immediate action to ensure that their NTP daemon is not susceptible to use in a reflected denial-of-service\n      (DRDoS) attack. Please see the\n       NTP Security Notice for vulnerability and mitigation details, and the\n      Réseau\n      Time Foundation Blog pour plus d&#39;informations. (January 2014)","Raspberry Pi: 86 x 56 x 21 mm\nRaspberry Pi in its box: 91 x 62 x 29 mm\nTrimble evaluation board: 66 x 32 x 8 mm\nTrimble evaluation board with interface: 66 x 32 x 24 mm\nU-blox interface card: 39 x 22 x 6 mm (excluding connection\n    pins)\nPatch antenna supplied with interface card: 25 x 25 x 7 mm","What else have I done with the Raspberry Pi?","Receiving ADS-B signals on\n1.09 GHz with a cheap TV dongle and feeding the results to Plane\nPlotter over a Wi-Fi link.  This allows you to put the receiver right\nup close to the antenna, avoiding an expensive (or lossy) piece of cable, and\navoiding the need for a cable run at all.  Details are here. \nIt&#39;s not much more than following someone else&#39;s instructions, but at least I\ncan vouch for every command on that page, and perhaps you will find something\nuseful there.\nA Digital Wall clock\n    using the Raspberry Pi &#8211; synchronised with NTP, of course!","Acknowledgments\nI would like to support NTP\n \nClick to rate this post!\n                                   \n                               [Total: 0  Average: 0]"],"content_blocks":[{"id":"text-1","type":"text","heading":"","plain_text":"A titre d’expérience, j’ai acheté l’un des modèles à faible coût\ntaille de carte de crédit Framboise\nPi ordinateurs, et l’ont configuré pour exécuter NTP (Network Time Protocol).\nJ&#39;ai également utilisé cette carte avec un récepteur GPS avec une sortie impulsions par seconde (PPS) pour\nStratum-1 serveur NTP, mais comme je connais peu de Linux, il a fallu un certain temps pour\natteindre cet objectif! Il y a quelques commandes utiles Linux dispersées à travers\ncette page. Ces notes sont presque autant pour mes propres disques pour\nla prochaine fois que je devrai visiter ce projet, mais j’espère qu’ils pourront vous aider.\nautres.\nSi vous voulez commencer rapidement avec les meilleurs résultats pour\nminimum de bruit, s&#39;il vous plaît voir mon Raspberry Pi NTP\nentrée rapide page. S&#39;il vous plaît voir aussi cette\npage pour des problèmes avec la version de Jessie de Linux, et avec la plus récente\nRaspberry Pi modèle 3.\nJe commence par décrire comment faire fonctionner le Raspberry Pi avec\njuste une connexion LAN &#8211; sans écran, clavier ou souris &#8211; un soi-disant sans tête\nopération. Je décris ensuite comment configurer NTP pour votre environnement, et\najout d&#39;un récepteur GPS / PPS pour convertir votre boîte en un serveur NTP de strate-1\ny compris les mises à jour du système d&#39;exploitation nécessaires. Ensuite, je note quelques\nJ&#39;ai eu des problèmes avec le premier récepteur GPS que j&#39;ai essayé et comment j&#39;ai guéri ceux qui avaient un\nrécepteur GPS différent pour produire un serveur NTP strate-1 consommant environ 4\nwatts. L&#39;approche la plus simple avec de bonnes performances est décrite ici.  \nDepuis le début de cette page, deux développements ont eu lieu\nqui facilitent quelque peu le processus &#8211; un programme a été développé qui\npermet l&#39;utilisation d&#39;un système d&#39;exploitation non modifié en travaillant en mode utilisateur\nplutôt que PPS en mode noyau, et un module est maintenant disponible qui se branche directement\nsur l&#39;en-tête GPIO à 26 broches du Raspberry Pi, afin non\nla soudure est impliquée. Mes remerciements à Folkert van Heusden et Anthony\nStirk pour ces développements.\n  Notez que le GPS Hat Adafruit utilise GPIO 4, broche physique 7,\nvous devrez donc changer les commandes données dans ce document. Les ajouts ultérieurs ont inclus la télécommande surveillance\ndu serveur NTP performance, et surveillance plus générale de la framboise\nPi en utilisant les fonctions standard SNMP, avec un supplément\nCPU\nTempérature surveillance add-on. Mon principal Framboise\nPage Pi peut également être d&#39;intérêt.\nNotez que de bonnes performances dépendent du fait que l’unité GPS a\nune vue dégagée du ciel, en particulier la partie sud du ciel si vous êtes en\nl&#39;hémisphère nord. Avec les anciens récepteurs GPS, cela nécessitait une installation extérieure.\nantenne, mais des unités plus modernes telles que celles mentionnées ici pourraient bien fonctionner\nà l’intérieur à condition que du ciel soit visible, peut-être au dernier étage de la\nbâtiment (comme je suis). Si vous avez un toit &quot;résistant aux RF&quot; (plombé,\npeut-être?!) ou certaines fenêtres avec une doublure pour arrêter la chaleur entrante, ou la construction du mur\ny compris le métal, vous aurez peut-être encore besoin d’une antenne extérieure, et presque certainement si\nvous vivez dans un sous-sol! Alors que le temps aura normalement seulement une petite\neffet dans le signal &#8211; par ex. forte pluie &#8211; il est possible qu&#39;une couche de neige\npourrait atténuer suffisamment le signal pour empêcher le GPS de recevoir suffisamment de signal.\nLe suivi des performances peut vous aider à détecter ces problèmes. (Merci à Joe,\nHB9DRT pour l&#39;information sur la neige &#8211; Je n&#39;ai vu ce problème qu&#39;une fois ici\npendant un hiver exceptionnellement froid).\nintroduction\nLe Raspberry Pi est un ordinateur au format carte de crédit.\ndisponible chez les distributeurs du monde entier. J&#39;ai acheté un bleu attrayant\nboîtier et alimentation 5 V, 2 A de ModMyPi.\nVous pouvez voir le fil Ethernet à gauche et la carte SD de 4 Go avec le\nsystème d’exploitation à droite, ainsi que le cordon d’alimentation micro-USB.\nIl existe un modèle B (illustré et utilisé ci-dessous) et un modèle A de spécification inférieure qui peut\ndevenir disponible à un moment dans l’avenir. J&#39;utilise le modèle B de 512 Mo,\nintroduit à l&#39;automne 2012.","html":"<p>A titre d’expérience, j’ai acheté l’un des modèles à faible coût\ntaille de carte de crédit Framboise\nPi ordinateurs, et l’ont configuré pour exécuter NTP (Network Time Protocol).\nJ&#039;ai également utilisé cette carte avec un récepteur GPS avec une sortie impulsions par seconde (PPS) pour\nStratum-1 serveur NTP, mais comme je connais peu de Linux, il a fallu un certain temps pour\natteindre cet objectif! Il y a quelques commandes utiles Linux dispersées à travers\ncette page. Ces notes sont presque autant pour mes propres disques pour\nla prochaine fois que je devrai visiter ce projet, mais j’espère qu’ils pourront vous aider.\nautres.\nSi vous voulez commencer rapidement avec les meilleurs résultats pour\nminimum de bruit, s&#039;il vous plaît voir mon Raspberry Pi NTP\nentrée rapide page. S&#039;il vous plaît voir aussi cette\npage pour des problèmes avec la version de Jessie de Linux, et avec la plus récente\nRaspberry Pi modèle 3.\nJe commence par décrire comment faire fonctionner le Raspberry Pi avec\njuste une connexion LAN &#8211; sans écran, clavier ou souris &#8211; un soi-disant sans tête\nopération. Je décris ensuite comment configurer NTP pour votre environnement, et\najout d&#039;un récepteur GPS / PPS pour convertir votre boîte en un serveur NTP de strate-1\ny compris les mises à jour du système d&#039;exploitation nécessaires. Ensuite, je note quelques\nJ&#039;ai eu des problèmes avec le premier récepteur GPS que j&#039;ai essayé et comment j&#039;ai guéri ceux qui avaient un\nrécepteur GPS différent pour produire un serveur NTP strate-1 consommant environ 4\nwatts. L&#039;approche la plus simple avec de bonnes performances est décrite ici.  \nDepuis le début de cette page, deux développements ont eu lieu\nqui facilitent quelque peu le processus &#8211; un programme a été développé qui\npermet l&#039;utilisation d&#039;un système d&#039;exploitation non modifié en travaillant en mode utilisateur\nplutôt que PPS en mode noyau, et un module est maintenant disponible qui se branche directement\nsur l&#039;en-tête GPIO à 26 broches du Raspberry Pi, afin non\nla soudure est impliquée. Mes remerciements à Folkert van Heusden et Anthony\nStirk pour ces développements.\n  Notez que le GPS Hat Adafruit utilise GPIO 4, broche physique 7,\nvous devrez donc changer les commandes données dans ce document. Les ajouts ultérieurs ont inclus la télécommande surveillance\ndu serveur NTP performance, et surveillance plus générale de la framboise\nPi en utilisant les fonctions standard SNMP, avec un supplément\nCPU\nTempérature surveillance add-on. Mon principal Framboise\nPage Pi peut également être d&#039;intérêt.\nNotez que de bonnes performances dépendent du fait que l’unité GPS a\nune vue dégagée du ciel, en particulier la partie sud du ciel si vous êtes en\nl&#039;hémisphère nord. Avec les anciens récepteurs GPS, cela nécessitait une installation extérieure.\nantenne, mais des unités plus modernes telles que celles mentionnées ici pourraient bien fonctionner\nà l’intérieur à condition que du ciel soit visible, peut-être au dernier étage de la\nbâtiment (comme je suis). Si vous avez un toit &quot;résistant aux RF&quot; (plombé,\npeut-être?!) ou certaines fenêtres avec une doublure pour arrêter la chaleur entrante, ou la construction du mur\ny compris le métal, vous aurez peut-être encore besoin d’une antenne extérieure, et presque certainement si\nvous vivez dans un sous-sol! Alors que le temps aura normalement seulement une petite\neffet dans le signal &#8211; par ex. forte pluie &#8211; il est possible qu&#039;une couche de neige\npourrait atténuer suffisamment le signal pour empêcher le GPS de recevoir suffisamment de signal.\nLe suivi des performances peut vous aider à détecter ces problèmes. (Merci à Joe,\nHB9DRT pour l&#039;information sur la neige &#8211; Je n&#039;ai vu ce problème qu&#039;une fois ici\npendant un hiver exceptionnellement froid).\nintroduction\nLe Raspberry Pi est un ordinateur au format carte de crédit.\ndisponible chez les distributeurs du monde entier. J&#039;ai acheté un bleu attrayant\nboîtier et alimentation 5 V, 2 A de ModMyPi.\nVous pouvez voir le fil Ethernet à gauche et la carte SD de 4 Go avec le\nsystème d’exploitation à droite, ainsi que le cordon d’alimentation micro-USB.\nIl existe un modèle B (illustré et utilisé ci-dessous) et un modèle A de spécification inférieure qui peut\ndevenir disponible à un moment dans l’avenir. J&#039;utilise le modèle B de 512 Mo,\nintroduit à l&#039;automne 2012.</p>"},{"id":"text-2","type":"text","heading":"","plain_text":"Ci-dessous, les résultats offset avec le Raspberry Pi en\ntrois configurations: avec des connexions WAN uniquement synchronisées sur Internet (comme\npourrait trouver une situation typique de la maison), avec\nConnexions LAN à un serveur local de strate 1 et agissant en tant que\nle serveur Stratum-1 avec deux petits récepteurs GPS / PPS différents comme horloge de référence. Tout\nproblèmes dans les données en direct sont susceptibles d&#39;être le résultat de mon redémarrage, rendant la configuration\nchangements, ou le signal GPS étant inférieur à la normale. La configuration NTP normale est listée ici.\nComme prévu, la synchronisation depuis le réseau local produit de meilleurs résultats que depuis Internet.\n(WAN), et en transformant le périphérique en serveur de la strate 1, le résultat est encore plus bas.\ncompensations.\nLe décalage zéro correspond à la ligne médiane du graphique, comme\nl&#39;utilité que j&#39;utilise est incapable de tracer des valeurs négatives. J&#39;ajoute donc\nla moitié de la plage de l’axe Y aux valeurs réelles avant de tracer.  Remarque: celles-ci\nles graphiques sont  ne pas tous à la même échelle verticale! \nDécalage utilisant uniquement des serveurs Internet &#8211; échelle milliseconde\n  La performance qui en résulte est bonne, mais cela dépendra à la fois du chargement du lien entre moi et\nle FAI, et la charge générale sur le réseau du FAI et l&#39;Internet général.\nLes décalages seraient d’environ +/- 5 millisecondes (et donc hors échelle).\nune fois sur le graphique ci-dessous). Les quatre lignes ntp.conf\nen cours d’utilisation est indiqué sous le graphique.","html":"<p>Ci-dessous, les résultats offset avec le Raspberry Pi en\ntrois configurations: avec des connexions WAN uniquement synchronisées sur Internet (comme\npourrait trouver une situation typique de la maison), avec\nConnexions LAN à un serveur local de strate 1 et agissant en tant que\nle serveur Stratum-1 avec deux petits récepteurs GPS / PPS différents comme horloge de référence. Tout\nproblèmes dans les données en direct sont susceptibles d&#039;être le résultat de mon redémarrage, rendant la configuration\nchangements, ou le signal GPS étant inférieur à la normale. La configuration NTP normale est listée ici.\nComme prévu, la synchronisation depuis le réseau local produit de meilleurs résultats que depuis Internet.\n(WAN), et en transformant le périphérique en serveur de la strate 1, le résultat est encore plus bas.\ncompensations.\nLe décalage zéro correspond à la ligne médiane du graphique, comme\nl&#039;utilité que j&#039;utilise est incapable de tracer des valeurs négatives. J&#039;ajoute donc\nla moitié de la plage de l’axe Y aux valeurs réelles avant de tracer.  Remarque: celles-ci\nles graphiques sont  ne pas tous à la même échelle verticale! \nDécalage utilisant uniquement des serveurs Internet &#8211; échelle milliseconde\n  La performance qui en résulte est bonne, mais cela dépendra à la fois du chargement du lien entre moi et\nle FAI, et la charge générale sur le réseau du FAI et l&#039;Internet général.\nLes décalages seraient d’environ +/- 5 millisecondes (et donc hors échelle).\nune fois sur le graphique ci-dessous). Les quatre lignes ntp.conf\nen cours d’utilisation est indiqué sous le graphique.</p>"},{"id":"text-3","type":"text","heading":"","plain_text":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation WANéchelle milliseconde","html":"<p>Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation WANéchelle milliseconde</p>"},{"id":"text-4","type":"text","heading":"","plain_text":"# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\npool fr.pool.ntp.org iburst","html":"<p># Fichier de dérive pour mémoriser la fréquence d&#039;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\npool fr.pool.ntp.org iburst</p>"},{"id":"text-5","type":"text","heading":"","plain_text":"Décalage à l&#39;aide de serveurs LAN locaux interrogés toutes les 32 secondes &#8211; échelle en microsecondes\nLe passage à un couplage étroit avec un serveur de strate 1 local sur le réseau local produit beaucoup mieux\nrésultats, avec un chronométrage de l’ordre de 30 microsecondes. J&#39;ai ajouté un\ndeuxième graphique avec une échelle de +/- 500 microsecondes pour montrer les excursions les plus importantes.","html":"<p>Décalage à l&#039;aide de serveurs LAN locaux interrogés toutes les 32 secondes &#8211; échelle en microsecondes\nLe passage à un couplage étroit avec un serveur de strate 1 local sur le réseau local produit beaucoup mieux\nrésultats, avec un chronométrage de l’ordre de 30 microsecondes. J&#039;ai ajouté un\ndeuxième graphique avec une échelle de +/- 500 microsecondes pour montrer les excursions les plus importantes.</p>"},{"id":"text-6","type":"text","heading":"","plain_text":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation de réseau localéchelle de précision","html":"<p>Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation de réseau localéchelle de précision</p>"},{"id":"text-7","type":"text","heading":"","plain_text":"Mêmes données mais sur unéchelle microseconde","html":"<p>Mêmes données mais sur unéchelle microseconde</p>"},{"id":"text-8","type":"text","heading":"","plain_text":"# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst","html":"<p># Fichier de dérive pour mémoriser la fréquence d&#039;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst</p>"},{"id":"text-9","type":"text","heading":"","plain_text":"Décalage à l&#39;aide du module GPS de synchronisation Trimble Resolution-SMT\nDes résultats bien meilleurs sont obtenus avec un Trimble Resolution SMT\nModule GPS, avec sa broche PPS connectée à la broche GPIO 24 pour un mode noyau\n&quot;ATOM&quot; horloge de référence. Cette unité est un GPS &quot;de synchronisation&quot;, avec 15\nns précision spécifiée pour le signal PPS. Chaque seconde sur le GPIO\npin provoque une interruption dans laquelle l’horloge de la CPU est notée, puis utilisée par NTP pour\nfaire des ajustements fins à la vitesse d&#39;horloge du logiciel. le\ntransitoires d’une amplitude de quelques microsecondes d’une durée d’une heure environ peuvent être dus à une\nchangements de température ambiante affectant le cristal utilisé par l&#39;horloge de la carte\nGénérateur. Non indiqué sur le graphique, mais le décalage dû à une tâche gourmande en ressources processeur (recompilation de NTP à partir de la source,\nenviron 25 minutes) a entraîné une excursion positive de 20 µs,\nsuivi d&#39;une excursion négative de 10 µs avec le refroidissement des températures et du NTP\nrétabli.","html":"<p>Décalage à l&#039;aide du module GPS de synchronisation Trimble Resolution-SMT\nDes résultats bien meilleurs sont obtenus avec un Trimble Resolution SMT\nModule GPS, avec sa broche PPS connectée à la broche GPIO 24 pour un mode noyau\n&quot;ATOM&quot; horloge de référence. Cette unité est un GPS &quot;de synchronisation&quot;, avec 15\nns précision spécifiée pour le signal PPS. Chaque seconde sur le GPIO\npin provoque une interruption dans laquelle l’horloge de la CPU est notée, puis utilisée par NTP pour\nfaire des ajustements fins à la vitesse d&#039;horloge du logiciel. le\ntransitoires d’une amplitude de quelques microsecondes d’une durée d’une heure environ peuvent être dus à une\nchangements de température ambiante affectant le cristal utilisé par l&#039;horloge de la carte\nGénérateur. Non indiqué sur le graphique, mais le décalage dû à une tâche gourmande en ressources processeur (recompilation de NTP à partir de la source,\nenviron 25 minutes) a entraîné une excursion positive de 20 µs,\nsuivi d&#039;une excursion négative de 10 µs avec le refroidissement des températures et du NTP\nrétabli.</p>"},{"id":"text-10","type":"text","heading":"","plain_text":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS du noyauRésolution Trimble SMTchronométrage récepteur GPS","html":"<p>Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS du noyauRésolution Trimble SMTchronométrage récepteur GPS</p>"},{"id":"text-11","type":"text","heading":"","plain_text":"Décalage lors du passage à un module GPS NEO-6M u-blox\nLors de l&#39;utilisation d&#39;un GPS u-blox MEO-6M\nmodule, avec sa broche PPS connectée à la broche GPIO 24 pour un mode en mode noyau\n&quot;ATOM&quot;, on obtient des résultats similaires. Le transitoire au milieu du graphique est\nlorsqu’un deuxième appareil était connecté à la ligne 5 V de l’USB. Cette unité\nest un GPS de &quot;navigation&quot;, où le PPS est spécifié à environ 100 ns, plutôt\nqu&#39;un &quot;timing&quot; GPS &#8211; mais\nla différence entre les deux unités est le plus souvent masquée par les autres variations du\nsystème.","html":"<p>Décalage lors du passage à un module GPS NEO-6M u-blox\nLors de l&#039;utilisation d&#039;un GPS u-blox MEO-6M\nmodule, avec sa broche PPS connectée à la broche GPIO 24 pour un mode en mode noyau\n&quot;ATOM&quot;, on obtient des résultats similaires. Le transitoire au milieu du graphique est\nlorsqu’un deuxième appareil était connecté à la ligne 5 V de l’USB. Cette unité\nest un GPS de &quot;navigation&quot;, où le PPS est spécifié à environ 100 ns, plutôt\nqu&#039;un &quot;timing&quot; GPS &#8211; mais\nla différence entre les deux unités est le plus souvent masquée par les autres variations du\nsystème.</p>"},{"id":"text-12","type":"text","heading":"","plain_text":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +","html":"<p>Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +</p>"},{"id":"text-13","type":"text","heading":"","plain_text":"Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation","html":"<p>Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation</p>"},{"id":"text-14","type":"text","heading":"","plain_text":"Plus tard, il a été remarqué que le décalage variait\npériodiquement, ce qui est un résultat inattendu. Ci-dessous un exemple des 19 au 21 décembre 2012, avec les moins stables\npériode débutant le 19 décembre 2012 et se terminant le 20 décembre.\nUn examen plus détaillé des données de loopstats montre une période réelle d’un peu plus de 100\nsecondes, et il est alias par l&#39;échantillon de 5 minutes de MRTG.","html":"<p>Plus tard, il a été remarqué que le décalage variait\npériodiquement, ce qui est un résultat inattendu. Ci-dessous un exemple des 19 au 21 décembre 2012, avec les moins stables\npériode débutant le 19 décembre 2012 et se terminant le 20 décembre.\nUn examen plus détaillé des données de loopstats montre une période réelle d’un peu plus de 100\nsecondes, et il est alias par l&#039;échantillon de 5 minutes de MRTG.</p>"},{"id":"text-15","type":"text","heading":"","plain_text":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +","html":"<p>Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +</p>"},{"id":"text-16","type":"text","heading":"","plain_text":"Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation","html":"<p>Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation</p>"},{"id":"text-17","type":"text","heading":"","plain_text":"Pour tester, j&#39;avais changé le récepteur GPS d&#39;U-blox 6M à Adafruit MTK3339\nmodule de navigation GPS, puis modifié à nouveau du module de navigation à\nun module GPS de chronométrage basé sur le U-blox\nLEA-6T, pour voir si l’oscillation était affectée. Ces changements\nn&#39;a fait aucune différence ni pour l&#39;amplitude ni pour la période de l&#39;oscillation,\net l&#39;amplitude de l&#39;oscillation était considérablement plus grande que ce qui serait\nattendu même d&#39;un récepteur GPS &quot;de navigation&quot;. Donc mon plus tôt\nThéories sur la navigation par rapport à la synchronisation, les modules GPS, le chargement USB et les E / S série\nle chargement était incorrect. Ce problème a finalement été résolu par un firmware\nmise à jour sur Raspberry Pi # 1, de la version 337601 à la version 346337.","html":"<p>Pour tester, j&#039;avais changé le récepteur GPS d&#039;U-blox 6M à Adafruit MTK3339\nmodule de navigation GPS, puis modifié à nouveau du module de navigation à\nun module GPS de chronométrage basé sur le U-blox\nLEA-6T, pour voir si l’oscillation était affectée. Ces changements\nn&#039;a fait aucune différence ni pour l&#039;amplitude ni pour la période de l&#039;oscillation,\net l&#039;amplitude de l&#039;oscillation était considérablement plus grande que ce qui serait\nattendu même d&#039;un récepteur GPS &quot;de navigation&quot;. Donc mon plus tôt\nThéories sur la navigation par rapport à la synchronisation, les modules GPS, le chargement USB et les E / S série\nle chargement était incorrect. Ce problème a finalement été résolu par un firmware\nmise à jour sur Raspberry Pi # 1, de la version 337601 à la version 346337.</p>"},{"id":"text-18","type":"text","heading":"","plain_text":"Performance actuelle &#8211; cliquez sur un graphique pour accéder à la page de performance de chaque ordinateur.\nJ&#39;ai ajouté un deuxième ordinateur Raspberry Pi et j&#39;ai maintenant les deux\nconnectés aux deux récepteurs GPS / PPS mentionnés ci-dessus, mais avec le\nantennes pour ces récepteurs dans un emplacement intérieur similaire. Ci-dessous est un\ncomparaison de la performance. Raspberry Pi # 1 est situé dans un endroit non chauffé\nchambre avec un mur orienté au nord. Raspberry Pi # 3 est également dans le bureau, mais situé\nun peu plus près d&#39;un radiateur, fournissant les transitoires quotidiens. Mi-novembre\n2013, je suis passé à un nouveau noyau qui a été compilé localement avec une option pour\naméliorer les performances NTP.","html":"<p>Performance actuelle &#8211; cliquez sur un graphique pour accéder à la page de performance de chaque ordinateur.\nJ&#039;ai ajouté un deuxième ordinateur Raspberry Pi et j&#039;ai maintenant les deux\nconnectés aux deux récepteurs GPS / PPS mentionnés ci-dessus, mais avec le\nantennes pour ces récepteurs dans un emplacement intérieur similaire. Ci-dessous est un\ncomparaison de la performance. Raspberry Pi # 1 est situé dans un endroit non chauffé\nchambre avec un mur orienté au nord. Raspberry Pi # 3 est également dans le bureau, mais situé\nun peu plus près d&#039;un radiateur, fournissant les transitoires quotidiens. Mi-novembre\n2013, je suis passé à un nouveau noyau qui a été compilé localement avec une option pour\naméliorer les performances NTP.</p>"},{"id":"text-19","type":"text","heading":"","plain_text":"Raspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationdans une pièce non chauffée","html":"<p>Raspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationdans une pièce non chauffée</p>"},{"id":"text-20","type":"text","heading":"","plain_text":"&lt;! &#8211;","html":"<p>&lt;! &#8211;</p>"},{"id":"text-21","type":"text","heading":"","plain_text":"Raspberry Pi # 2512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationen environnement de bureau","html":"<p>Raspberry Pi # 2512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationen environnement de bureau</p>"},{"id":"text-22","type":"text","heading":"","plain_text":"-&gt;","html":"<p>-&gt;</p>"},{"id":"text-23","type":"text","heading":"","plain_text":"Raspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigationRécepteur GPSen environnement de bureau","html":"<p>Raspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigationRécepteur GPSen environnement de bureau</p>"},{"id":"text-24","type":"text","heading":"","plain_text":"Raspberry Pi # 4512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 5S navigationRécepteur GPSdans une pièce non chauffée","html":"<p>Raspberry Pi # 4512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 5S navigationRécepteur GPSdans une pièce non chauffée</p>"},{"id":"text-25","type":"text","heading":"","plain_text":"Raspberry Pi # 5512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauCalendrier U-blox 7QRécepteur GPSen environnement de bureau","html":"<p>Raspberry Pi # 5512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauCalendrier U-blox 7QRécepteur GPSen environnement de bureau</p>"},{"id":"text-26","type":"text","heading":"","plain_text":"et voici une façon légèrement différente de regarder la valeur du décalage,\ntracer la valeur absolue du décalage, le rouge pour les décalages positifs et le bleu pour\ncompensations négatives. Les événements transitoires tels que les redémarrages ont été supprimés.","html":"<p>et voici une façon légèrement différente de regarder la valeur du décalage,\ntracer la valeur absolue du décalage, le rouge pour les décalages positifs et le bleu pour\ncompensations négatives. Les événements transitoires tels que les redémarrages ont été supprimés.</p>"},{"id":"text-27","type":"text","heading":"","plain_text":"Raspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigation Récepteur GPS dans une pièce non chauffée","html":"<p>Raspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigation Récepteur GPS dans une pièce non chauffée</p>"},{"id":"text-28","type":"text","heading":"","plain_text":"&lt;! &#8211;","html":"<p>&lt;! &#8211;</p>"},{"id":"text-29","type":"text","heading":"","plain_text":"Raspberry Pi # 2512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigationRécepteur GPS\n      en environnement de bureau","html":"<p>Raspberry Pi # 2512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigationRécepteur GPS\n      en environnement de bureau</p>"},{"id":"text-30","type":"text","heading":"","plain_text":"-&gt;","html":"<p>-&gt;</p>"},{"id":"text-31","type":"text","heading":"","plain_text":"Raspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigation\n GPS receveur\n      en environnement de bureau","html":"<p>Raspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigation\n GPS receveur\n      en environnement de bureau</p>"},{"id":"text-32","type":"text","heading":"","plain_text":"Raspberry Pi # 4512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyauU-blox 5S navigation\n GPS receveur\n      dans une pièce non chauffée","html":"<p>Raspberry Pi # 4512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyauU-blox 5S navigation\n GPS receveur\n      dans une pièce non chauffée</p>"},{"id":"text-33","type":"text","heading":"","plain_text":"Raspberry Pi # 5512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyau\n      Calendrier U-blox 7Q\n GPS receveur\n      en environnement de bureau","html":"<p>Raspberry Pi # 5512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyau\n      Calendrier U-blox 7Q\n GPS receveur\n      en environnement de bureau</p>"},{"id":"text-34","type":"text","heading":"","plain_text":"Création d&#39;une carte SD avec le système d&#39;exploitation\nVous pouvez acheter une carte SD avec le système d&#39;exploitation Linux installé et prêt\naller. Sachant que je devrais apporter des modifications au système d’exploitation, j’ai acheté un\ncarte SD prête à être programmée au cas où, mais j’ai fabriqué la mienne par\nen suivant les étapes ici: http://www.raspberrypi.org/downloads","html":"<p>Création d&#039;une carte SD avec le système d&#039;exploitation\nVous pouvez acheter une carte SD avec le système d&#039;exploitation Linux installé et prêt\naller. Sachant que je devrais apporter des modifications au système d’exploitation, j’ai acheté un\ncarte SD prête à être programmée au cas où, mais j’ai fabriqué la mienne par\nen suivant les étapes ici: http://www.raspberrypi.org/downloads</p>"},{"id":"text-35","type":"text","heading":"","plain_text":"Téléchargez une image de système d&#39;exploitation pour la carte SD &#8211; 2012-09-18-wheezy-raspbian.zip \nDécompressez le contenu de l&#39;archive Zip dans un fichier .IMG \nTéléchargez le programme d&#39;écriture de carte SD: Win32DiskImager \nUtilisez l’imageur de disque pour écrire l’image du système d’exploitation sur la carte SD.","html":"<p>Téléchargez une image de système d&#039;exploitation pour la carte SD &#8211; 2012-09-18-wheezy-raspbian.zip \nDécompressez le contenu de l&#039;archive Zip dans un fichier .IMG \nTéléchargez le programme d&#039;écriture de carte SD: Win32DiskImager \nUtilisez l’imageur de disque pour écrire l’image du système d’exploitation sur la carte SD.</p>"},{"id":"text-36","type":"text","heading":"","plain_text":"J&#39;ai ensuite branché la carte SD au Raspberry Pi, connecté\nau réseau, et le pouvoir appliqué &#8230;","html":"<p>J&#039;ai ensuite branché la carte SD au Raspberry Pi, connecté\nau réseau, et le pouvoir appliqué &#8230;</p>"},{"id":"text-37","type":"text","heading":"","plain_text":"Beaucoup de gens ont demandé d&#39;ajouter un GPS à\nle Raspberry Pi sans avoir besoin de soudure, et maintenant cela est devenu une réalité grâce à la NTPI\nGPS Addon Board produit par Nevis Computers Ltd au Royaume-Uni. J&#39;ai utilisé le rpi_gpio_ntp\nprogramme a été développé par Folkert van Heusden et annoncé\ndans la liste de diffusion Time-Nuts, qui permet de travailler en mode utilisateur avec PPS\nsignal, ne nécessitant donc pas de version spéciale du système d’exploitation.\nLes versions actuelles de Raspbian n&#39;en ont plus besoin.\nC’est ce que vous obtenez dans la boîte du GPS NTPI Raspberry Pi\nCarte d&#39;extension (avec l&#39;option antenne puck):","html":"<p>Beaucoup de gens ont demandé d&#039;ajouter un GPS à\nle Raspberry Pi sans avoir besoin de soudure, et maintenant cela est devenu une réalité grâce à la NTPI\nGPS Addon Board produit par Nevis Computers Ltd au Royaume-Uni. J&#039;ai utilisé le rpi_gpio_ntp\nprogramme a été développé par Folkert van Heusden et annoncé\ndans la liste de diffusion Time-Nuts, qui permet de travailler en mode utilisateur avec PPS\nsignal, ne nécessitant donc pas de version spéciale du système d’exploitation.\nLes versions actuelles de Raspbian n&#039;en ont plus besoin.\nC’est ce que vous obtenez dans la boîte du GPS NTPI Raspberry Pi\nCarte d&#039;extension (avec l&#039;option antenne puck):</p>"},{"id":"text-38","type":"text","heading":"","plain_text":"Une carte avec le périphérique GPS de qualité de synchronisation et le connecteur SMA\n    qui se branche sur le connecteur GPIO à 26 broches du Pi.\nUn  optionnel antenne GPS à rondelle magnétique, ou vous pouvez utiliser votre propre\n    antenne avec un connecteur SMA.\nVous aurez peut-être également besoin de: Une pile de secours CR2032, qui s’ajuste sur la face inférieure\n    de la carte.","html":"<p>Une carte avec le périphérique GPS de qualité de synchronisation et le connecteur SMA\n    qui se branche sur le connecteur GPIO à 26 broches du Pi.\nUn  optionnel antenne GPS à rondelle magnétique, ou vous pouvez utiliser votre propre\n    antenne avec un connecteur SMA.\nVous aurez peut-être également besoin de: Une pile de secours CR2032, qui s’ajuste sur la face inférieure\n    de la carte.</p>"},{"id":"text-39","type":"text","heading":"","plain_text":"(Notez que l’antenne est une option supplémentaire et que vous devez acheter\nvotre propre batterie)\nPour que cela fonctionne avec un Raspberry Pi, voici les étapes que je\na pris. J&#39;ai inclus les étapes pour ajouter la surveillance MRTG et le fichier distant\naccès à partir de systèmes Windows, mais vous pouvez les omettre si vous n&#39;en avez pas besoin.","html":"<p>(Notez que l’antenne est une option supplémentaire et que vous devez acheter\nvotre propre batterie)\nPour que cela fonctionne avec un Raspberry Pi, voici les étapes que je\na pris. J&#039;ai inclus les étapes pour ajouter la surveillance MRTG et le fichier distant\naccès à partir de systèmes Windows, mais vous pouvez les omettre si vous n&#039;en avez pas besoin.</p>"},{"id":"text-40","type":"text","heading":"","plain_text":"Configurer mon routeur pour réserver une adresse IP au Raspberry\n    Pi\nModification du nom de l&#39;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nNTP mis à jour pour le développement actuel\n    version (j&#39;ai utilisé une copie FTP d&#39;un autre Pi).\nConfigurez les E / S série sur le\n    Tarte aux framboises.\nGpsd installé et configuré et ses utilitaires.\nNTP configuré pour utiliser la mémoire partagée pendant un temps approximatif\n    (type de pilote 28.0).\nInstallé les outils PPS (sudo apt-get install pps-tools)\nInstallé le rpi_gpio_ntp\n    programme de Folkert van Heusden (seulement pour très tôt Raspbian\n    versions).\nNTP configuré pour utiliser le partagé\n    mémoire pour PPS (type de pilote 28.1).\nSNMP installé et configuré\n    divers collecteurs de données MRTG (facultatif).\nSNMP configuré pour surveiller la  CPU\n    Température (optionnel).\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC (facultatif).\nConfigurer le PC pour la mise en réseau sans fil\n    Clé USB Wi-Fi (en option).","html":"<p>Configurer mon routeur pour réserver une adresse IP au Raspberry\n    Pi\nModification du nom de l&#039;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nNTP mis à jour pour le développement actuel\n    version (j&#039;ai utilisé une copie FTP d&#039;un autre Pi).\nConfigurez les E / S série sur le\n    Tarte aux framboises.\nGpsd installé et configuré et ses utilitaires.\nNTP configuré pour utiliser la mémoire partagée pendant un temps approximatif\n    (type de pilote 28.0).\nInstallé les outils PPS (sudo apt-get install pps-tools)\nInstallé le rpi_gpio_ntp\n    programme de Folkert van Heusden (seulement pour très tôt Raspbian\n    versions).\nNTP configuré pour utiliser le partagé\n    mémoire pour PPS (type de pilote 28.1).\nSNMP installé et configuré\n    divers collecteurs de données MRTG (facultatif).\nSNMP configuré pour surveiller la  CPU\n    Température (optionnel).\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC (facultatif).\nConfigurer le PC pour la mise en réseau sans fil\n    Clé USB Wi-Fi (en option).</p>"},{"id":"text-41","type":"text","heading":"","plain_text":"Installé sur le Raspberry Pila carte ressemble à ceci. lele fil d&#39;antenne peut être retiréà travers un trou dans le boîtier près du connecteur Ethernet.\nNotez que cette carte utilise GPIO 18 pour son signal PPS, donc tout logiciel doit être configuré de manière appropriée.","html":"<p>Installé sur le Raspberry Pila carte ressemble à ceci. lele fil d&#039;antenne peut être retiréà travers un trou dans le boîtier près du connecteur Ethernet.\nNotez que cette carte utilise GPIO 18 pour son signal PPS, donc tout logiciel doit être configuré de manière appropriée.</p>"},{"id":"text-42","type":"text","heading":"","plain_text":"Vous pouvez demander à quel point ce mode utilisateur fonctionne correctement. bien\nc&#39;est plutôt bien, mais pas assez aussi bon que le mode noyau, mais plus\nque suffisant pour la précision offerte par le Raspberry Pi. Peut-être le\nmieux que le Pi pourrait faire sinon serait la synchronisation via une connexion LAN à un\nStratum-1 serveur NTP. La comparaison de tracé ci-dessous montre le Pi synchronisé\nsur un serveur de strate-1 mais sur Wi-Fi, puis sur les performances après l&#39;installation\nle panneau d&#39;addition GPS NTPI. Un terrain idéal serait une ligne droite à la\nNiveau 500 microsecondes sur ce graphique (je dois ajouter un décalage car MRTG ne peut pas tracer\nnombres négatifs). La gigue moyenne sur 6 heures rapportée par NTP est passée de\n100-150 microsecondes à moins de 4 microsecondes. L&#39;amélioration de la marche\nde la synchronisation Wi-Fi à la synchronisation PPS, c&#39;est évident!","html":"<p>Vous pouvez demander à quel point ce mode utilisateur fonctionne correctement. bien\nc&#039;est plutôt bien, mais pas assez aussi bon que le mode noyau, mais plus\nque suffisant pour la précision offerte par le Raspberry Pi. Peut-être le\nmieux que le Pi pourrait faire sinon serait la synchronisation via une connexion LAN à un\nStratum-1 serveur NTP. La comparaison de tracé ci-dessous montre le Pi synchronisé\nsur un serveur de strate-1 mais sur Wi-Fi, puis sur les performances après l&#039;installation\nle panneau d&#039;addition GPS NTPI. Un terrain idéal serait une ligne droite à la\nNiveau 500 microsecondes sur ce graphique (je dois ajouter un décalage car MRTG ne peut pas tracer\nnombres négatifs). La gigue moyenne sur 6 heures rapportée par NTP est passée de\n100-150 microsecondes à moins de 4 microsecondes. L&#039;amélioration de la marche\nde la synchronisation Wi-Fi à la synchronisation PPS, c&#039;est évident!</p>"},{"id":"text-43","type":"text","heading":"","plain_text":"Mise à jour vers la dernière version de Raspbian Linux\nLa version de Linux que vous utilisez est affichée lorsque vous vous connectez, mais vous\npeut également utiliser la commande:\n  $ uname -a\npour montrer quelle version est en cours d&#39;exécution. J&#39;ai commencé avec:  Linux raspberrypi 3.12.26+ # 702 PREEMPT Wed Aug 6 17:43:49 BST 2014 armv6l GNU / Linux\nPour mettre à jour mon logiciel, j&#39;ai exécuté les commandes:\n  $ sudo apt-get update  $ sudo apt-get dist-upgrade  $ sudo rpi-update\net après le redémarrage, j&#39;ai terminé par:  Linux raspberrypi 3.12.32+ # 721 PREEMPT Fri Nov 7 16:50:31 GMT 2014 armv6l \nConfiguration de Linux pour PPS sur le port GPIO\nGrâce aux courriels de Olav Andrarde et Timo Kokkonen, j&#39;ai découvert que\nLe support PPS a été ajouté à Linux disponible pour le Raspberry Pi,\nbien que vous ayez besoin d&#39;ajouter quelques lignes à la configuration pour l&#39;activer.\nComme Raspbian évolue continuellement, la méthode exacte pour effectuer ces changements\névolue également, donc en fonction du moment où vous avez téléchargé Raspbian, vous devez suivre\nsoit le novembre 2014 ou le février\n2015 sections ci-dessous. J&#39;ai mis les informations les plus récentes en premier,\nbien que je préfère normalement que les choses soient énumérées dans l’ordre chronologique, comme dans un\njournal intime!\n    Versions Raspbian vers février 2015\nAprès avoir mis à jour un autre Raspberry Pi vers le dernier Raspbian &#8211; pour un nouveau\nRaspberry Pi 2 que j&#39;avais acheté &#8211; j&#39;ai découvert que les choses avaient changé une fois\nencore. Ces détails de mon démarrage rapide\npage. Versions de Linux: 3.18.6+ 3.18.7-v7\n  $ sudo nano /boot/config.txt\n&#8211; Ajouter dtoverlay = pps-gpio, gpiopin = 18\nsur une nouvelle ligne.\n   Si vous avez précédemment ajouté bcm2708.pps_gpio_pin = 18 à la fin de\ncmdline.txt, supprimez-le.   Sauver et fermer.\n  $ sudo nano\n/ etc / modules &#8211; Ajouter pps-gpio\nsur une nouvelle ligne.   Enregistrez, fermez et redémarrez.\nMaintenant, vérifiez que PPS fonctionne.\n    Versions Raspbian vers novembre 2014\nPour activer PPS sur le port GPIO, vous devez suivre deux étapes: l’une pour indiquer au\nnoyau pour inclure le support, et un pour amener le module de support à\nêtre chargé. Tout d’abord, indiquez au noyau que la broche 18 de GPIO doit être utilisée.\nCela active la prise en charge de PPS-GPIO dans le noyau. Ajouter ce texte au\nFichier /boot/cmdline.txt:\n  $ sudo nano /boot/cmdline.txt    ajouter:        bcm2708.pps_gpio_pin = 18    à la  fin de la ligne.    Ce doit être sur le même ligne, pas sur un Nouveau ligne,\ncomme l&#39;a découvert Ray Hunter!\nEnsuite, vous devez dire au noyau de charger le module qui fournit cette information.\nsoutien. Pourquoi cela ne peut pas être automatique, je ne sais pas! Ajouter le\nnom du module à la fin du fichier / etc / modules.\n  $ sudo nano / etc / modules    ajouter:       \npps-gpio     à la fin si la liste, et redémarrez. \nVérifier que PPS fonctionne\nPour vérifier que le module est chargé, vous pouvez utiliser la commande lsmod, par exemple\nexemple:\n  $ lsmod | grep pps\nLa sortie devrait être semblable à:\n  pps_gpio 2529 1  pps_core 7943 2 pps_gpio\nVous devriez maintenant pouvoir exécuter la commande ppstest et voir les transitions\nune fois par seconde, par exemple:\n$ sudo ppstest / dev / pps0 # appuyez sur Ctrl-C pour annuler .. essayer le source PPS &quot;/ dev / pps0&quot; a trouvé la source PPS &quot;/ dev / pps0&quot; ok, trouvé 1 source (s), commencez maintenant à récupérer les données &#8230; source 0 &#8211; assert 1351501153.999956346, séquence: 47481 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501154.999954601, séquence: 47482 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501155.999951856, séquence: 47483 &#8211; effacé 0,000000000, séquence: 0 ^ C","html":"<p>Mise à jour vers la dernière version de Raspbian Linux\nLa version de Linux que vous utilisez est affichée lorsque vous vous connectez, mais vous\npeut également utiliser la commande:\n  $ uname -a\npour montrer quelle version est en cours d&#039;exécution. J&#039;ai commencé avec:  Linux raspberrypi 3.12.26+ # 702 PREEMPT Wed Aug 6 17:43:49 BST 2014 armv6l GNU / Linux\nPour mettre à jour mon logiciel, j&#039;ai exécuté les commandes:\n  $ sudo apt-get update  $ sudo apt-get dist-upgrade  $ sudo rpi-update\net après le redémarrage, j&#039;ai terminé par:  Linux raspberrypi 3.12.32+ # 721 PREEMPT Fri Nov 7 16:50:31 GMT 2014 armv6l \nConfiguration de Linux pour PPS sur le port GPIO\nGrâce aux courriels de Olav Andrarde et Timo Kokkonen, j&#039;ai découvert que\nLe support PPS a été ajouté à Linux disponible pour le Raspberry Pi,\nbien que vous ayez besoin d&#039;ajouter quelques lignes à la configuration pour l&#039;activer.\nComme Raspbian évolue continuellement, la méthode exacte pour effectuer ces changements\névolue également, donc en fonction du moment où vous avez téléchargé Raspbian, vous devez suivre\nsoit le novembre 2014 ou le février\n2015 sections ci-dessous. J&#039;ai mis les informations les plus récentes en premier,\nbien que je préfère normalement que les choses soient énumérées dans l’ordre chronologique, comme dans un\njournal intime!\n    Versions Raspbian vers février 2015\nAprès avoir mis à jour un autre Raspberry Pi vers le dernier Raspbian &#8211; pour un nouveau\nRaspberry Pi 2 que j&#039;avais acheté &#8211; j&#039;ai découvert que les choses avaient changé une fois\nencore. Ces détails de mon démarrage rapide\npage. Versions de Linux: 3.18.6+ 3.18.7-v7\n  $ sudo nano /boot/config.txt\n&#8211; Ajouter dtoverlay = pps-gpio, gpiopin = 18\nsur une nouvelle ligne.\n   Si vous avez précédemment ajouté bcm2708.pps_gpio_pin = 18 à la fin de\ncmdline.txt, supprimez-le.   Sauver et fermer.\n  $ sudo nano\n/ etc / modules &#8211; Ajouter pps-gpio\nsur une nouvelle ligne.   Enregistrez, fermez et redémarrez.\nMaintenant, vérifiez que PPS fonctionne.\n    Versions Raspbian vers novembre 2014\nPour activer PPS sur le port GPIO, vous devez suivre deux étapes: l’une pour indiquer au\nnoyau pour inclure le support, et un pour amener le module de support à\nêtre chargé. Tout d’abord, indiquez au noyau que la broche 18 de GPIO doit être utilisée.\nCela active la prise en charge de PPS-GPIO dans le noyau. Ajouter ce texte au\nFichier /boot/cmdline.txt:\n  $ sudo nano /boot/cmdline.txt    ajouter:        bcm2708.pps_gpio_pin = 18    à la  fin de la ligne.    Ce doit être sur le même ligne, pas sur un Nouveau ligne,\ncomme l&#039;a découvert Ray Hunter!\nEnsuite, vous devez dire au noyau de charger le module qui fournit cette information.\nsoutien. Pourquoi cela ne peut pas être automatique, je ne sais pas! Ajouter le\nnom du module à la fin du fichier / etc / modules.\n  $ sudo nano / etc / modules    ajouter:       \npps-gpio     à la fin si la liste, et redémarrez. \nVérifier que PPS fonctionne\nPour vérifier que le module est chargé, vous pouvez utiliser la commande lsmod, par exemple\nexemple:\n  $ lsmod | grep pps\nLa sortie devrait être semblable à:\n  pps_gpio 2529 1  pps_core 7943 2 pps_gpio\nVous devriez maintenant pouvoir exécuter la commande ppstest et voir les transitions\nune fois par seconde, par exemple:\n$ sudo ppstest / dev / pps0 # appuyez sur Ctrl-C pour annuler .. essayer le source PPS &quot;/ dev / pps0&quot; a trouvé la source PPS &quot;/ dev / pps0&quot; ok, trouvé 1 source (s), commencez maintenant à récupérer les données &#8230; source 0 &#8211; assert 1351501153.999956346, séquence: 47481 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501154.999954601, séquence: 47482 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501155.999951856, séquence: 47483 &#8211; effacé 0,000000000, séquence: 0 ^ C</p>"},{"id":"text-44","type":"text","heading":"","plain_text":"Notez qu&#39;il n&#39;y a pas de valeur donnée pour le temps &quot;clair&quot;. Gary\nE Miller rapporte que le pilote pps-gpio ne cherche qu’un seul avantage, le positif\nbord allant. Si vous utilisez un appareil GPS différent de ceux mentionnés\nDans ce cas, vous aurez peut-être besoin d’un onduleur de sortie de 3,3 volts dans la ligne PPS du GPS.","html":"<p>Notez qu&#039;il n&#039;y a pas de valeur donnée pour le temps &quot;clair&quot;. Gary\nE Miller rapporte que le pilote pps-gpio ne cherche qu’un seul avantage, le positif\nbord allant. Si vous utilisez un appareil GPS différent de ceux mentionnés\nDans ce cas, vous aurez peut-être besoin d’un onduleur de sortie de 3,3 volts dans la ligne PPS du GPS.</p>"},{"id":"text-45","type":"text","heading":"","plain_text":"L&#39;approche de Hauke ​​Lampe\nUniquement des informations historiques: Depuis que j&#39;ai écrit cette page pour la première fois, Hauke ​​Lampe a\ndisponible une image préconfigurée de Raspberry Pi OS ici.\nSon article est basé sur sa version d’un GPS série comme je le décris ici, mais vous devez le faire.\naucun des travaux de construction et de configuration que je mentionne ici. Ma framboise\nLa Pi # 3 fonctionne à partir de cette image de système d&#39;exploitation et je développe l&#39;installation GPS à l&#39;adresse\nle moment. Les commentaires et les changements jusqu&#39;à présent:","html":"<p>L&#039;approche de Hauke ​​Lampe\nUniquement des informations historiques: Depuis que j&#039;ai écrit cette page pour la première fois, Hauke ​​Lampe a\ndisponible une image préconfigurée de Raspberry Pi OS ici.\nSon article est basé sur sa version d’un GPS série comme je le décris ici, mais vous devez le faire.\naucun des travaux de construction et de configuration que je mentionne ici. Ma framboise\nLa Pi # 3 fonctionne à partir de cette image de système d&#039;exploitation et je développe l&#039;installation GPS à l&#039;adresse\nle moment. Les commentaires et les changements jusqu&#039;à présent:</p>"},{"id":"text-46","type":"text","heading":"","plain_text":"Modification de l&#39;adresse IP du port Ethernet en un numéro fixe\n    adresse (statique) &#8211; Comment\n    à.Remarque: Si vous faites cela, vous devrez peut-être éditer le fichier hosts sur votre ordinateur.\n    systèmes pour permettre l&#39;accès à l&#39;appareil par nom plutôt que par IP\n    adresse. Ajouter une ligne telle que:  192.168.0.51\n    framboise-pi-1 \n    au fichier (avec l&#39;adresse et le nom de votre RPi, bien sûr). Sur\n    Windows-8, notez que Windows Defender peut essayer de remplacer un hôte modifié\n    fichier avec celui par défaut, supprimant ainsi vos modifications! Sous Windows, le\n    Le fichier à modifier est  Windows  system32  drivers  etc  hosts, et vous devrez peut-être\n    Accès de niveau administrateur pour éditer ce fichier.\nModification du nom de l&#39;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nSNMP installé et configuré\n    divers collecteurs de données MRTG.\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC.\nConfigurer le PC pour la mise en réseau sans fil avec un ancien NetGear\n    Clé USB Wi-Fi (remplacée plus tard par une unité Edimax).","html":"<p>Modification de l&#039;adresse IP du port Ethernet en un numéro fixe\n    adresse (statique) &#8211; Comment\n    à.Remarque: Si vous faites cela, vous devrez peut-être éditer le fichier hosts sur votre ordinateur.\n    systèmes pour permettre l&#039;accès à l&#039;appareil par nom plutôt que par IP\n    adresse. Ajouter une ligne telle que:  192.168.0.51\n    framboise-pi-1 \n    au fichier (avec l&#039;adresse et le nom de votre RPi, bien sûr). Sur\n    Windows-8, notez que Windows Defender peut essayer de remplacer un hôte modifié\n    fichier avec celui par défaut, supprimant ainsi vos modifications! Sous Windows, le\n    Le fichier à modifier est  Windows  system32  drivers  etc  hosts, et vous devrez peut-être\n    Accès de niveau administrateur pour éditer ce fichier.\nModification du nom de l&#039;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nSNMP installé et configuré\n    divers collecteurs de données MRTG.\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC.\nConfigurer le PC pour la mise en réseau sans fil avec un ancien NetGear\n    Clé USB Wi-Fi (remplacée plus tard par une unité Edimax).</p>"},{"id":"text-47","type":"text","heading":"","plain_text":"Quelques utilitaires &quot;standard&quot; de Raspberry Pi\nne sont pas présents dans cette image de système d&#39;exploitation, et devront être téléchargés séparément avec\napt-get. Voici à quoi cela ressemble pour le moment. L&#39;antenne patch\nest attaché au ModMyPi blanc\navec du ruban adhésif double face, et la carte réceptrice avec un écrou simple et\nboulon. Les dérivations provenaient également de ModMyPi et la longueur de 150 mm n’est pas\nnécessaire ici! Le dongle Wi-Fi est à gauche. Graphiques de performance\nsont ici.","html":"<p>Quelques utilitaires &quot;standard&quot; de Raspberry Pi\nne sont pas présents dans cette image de système d&#039;exploitation, et devront être téléchargés séparément avec\napt-get. Voici à quoi cela ressemble pour le moment. L&#039;antenne patch\nest attaché au ModMyPi blanc\navec du ruban adhésif double face, et la carte réceptrice avec un écrou simple et\nboulon. Les dérivations provenaient également de ModMyPi et la longueur de 150 mm n’est pas\nnécessaire ici! Le dongle Wi-Fi est à gauche. Graphiques de performance\nsont ici.</p>"},{"id":"text-48","type":"text","heading":"","plain_text":"Comme mon application d’essai est pour un serveur NTP, je n’ai pas besoin de\nafficher sur le Raspberry Pi, ou d&#39;ailleurs un clavier et une souris connectés en permanence. Tous mes\nl&#39;interaction se fera via un terminal, et même cela sera émulé via programme\nfonctionnant sur un ordinateur distant, avec une connectivité via le port Ethernet du\nTarte aux framboises. Une telle opération est communément appelée un serveur sans tête.\nUn bloc d&#39;alimentation et un boîtier sont les seuls éléments que j&#39;ai ajoutés au Raspberry fourni\nPi. Il y a quelques conseils pour courir sans tête ici: http://glynrob.com/hardware/raspberry-pi-headless/\nVous avez besoin d’un programme terminal qui fonctionnera en mode SSH &#8211; I\nmastic utilisé\nsur un PC Windows XP.\nJ&#39;ai regardé sur mon routeur qui exécute DD-WRT pour voir l&#39;adresse IP\nqui avait été affecté au Pi, et j&#39;ai ensuite utilisé cette adresse pour exécuter\nPUTTY en mode SSH. J&#39;ai tout de suite une connexion avec l&#39;utilisateur par défaut\nnom et mot de passe. Vous pouvez enregistrer les paramètres du Pi depuis PUTTY.\n(J&#39;ai appelé le mien &quot;RaspberryPi&quot;), et fais un raccourci Windows pour se connecter\nà votre Pi avec des valeurs telles que:","html":"<p>Comme mon application d’essai est pour un serveur NTP, je n’ai pas besoin de\nafficher sur le Raspberry Pi, ou d&#039;ailleurs un clavier et une souris connectés en permanence. Tous mes\nl&#039;interaction se fera via un terminal, et même cela sera émulé via programme\nfonctionnant sur un ordinateur distant, avec une connectivité via le port Ethernet du\nTarte aux framboises. Une telle opération est communément appelée un serveur sans tête.\nUn bloc d&#039;alimentation et un boîtier sont les seuls éléments que j&#039;ai ajoutés au Raspberry fourni\nPi. Il y a quelques conseils pour courir sans tête ici: http://glynrob.com/hardware/raspberry-pi-headless/\nVous avez besoin d’un programme terminal qui fonctionnera en mode SSH &#8211; I\nmastic utilisé\nsur un PC Windows XP.\nJ&#039;ai regardé sur mon routeur qui exécute DD-WRT pour voir l&#039;adresse IP\nqui avait été affecté au Pi, et j&#039;ai ensuite utilisé cette adresse pour exécuter\nPUTTY en mode SSH. J&#039;ai tout de suite une connexion avec l&#039;utilisateur par défaut\nnom et mot de passe. Vous pouvez enregistrer les paramètres du Pi depuis PUTTY.\n(J&#039;ai appelé le mien &quot;RaspberryPi&quot;), et fais un raccourci Windows pour se connecter\nà votre Pi avec des valeurs telles que:</p>"},{"id":"text-49","type":"text","heading":"","plain_text":"Cible: C:  Tools  PuTTY  PUTTY.EXE -load RaspberryPi\nCommencez dans: C:  Tools  PuTTY","html":"<p>Cible: C:  Tools  PuTTY  PUTTY.EXE -load RaspberryPi\nCommencez dans: C:  Tools  PuTTY</p>"},{"id":"text-50","type":"text","heading":"","plain_text":"Votre chemin d&#39;accès et le nom des paramètres enregistrés seront différents.\nCommande Linux pour se déconnecter et se déconnecter:\nse déconnecter\nAu fait, en ajoutant un serveur X-windows\nprogramme tel que Xming sur votre PC, vous pouvez voir les graphiques du Raspberry Pi\naussi, si vous voulez, mais c&#39;est  ne pas nécessaire pour les opérations décrites\nici &#8211; vous pouvez tout faire directement à partir de la ligne de commande.  \nMise à jour du système d&#39;exploitation\nJ&#39;ai suivi le conseil ici\npour mettre à jour le système d&#39;exploitation, bien que je ne pense pas que c&#39;était vraiment nécessaire car le système d&#39;exploitation\ntéléchargé n&#39;avait qu&#39;un mois. Pour exécuter les commandes nécessite des privilèges\naccès, obtenu ici en préfixant la commande avec sudo.\nL’exécution de ces commandes prend beaucoup de temps et nécessite un accès Internet depuis\nvotre Pi. Prévoyez 30 à 45 minutes.","html":"<p>Votre chemin d&#039;accès et le nom des paramètres enregistrés seront différents.\nCommande Linux pour se déconnecter et se déconnecter:\nse déconnecter\nAu fait, en ajoutant un serveur X-windows\nprogramme tel que Xming sur votre PC, vous pouvez voir les graphiques du Raspberry Pi\naussi, si vous voulez, mais c&#039;est  ne pas nécessaire pour les opérations décrites\nici &#8211; vous pouvez tout faire directement à partir de la ligne de commande.  \nMise à jour du système d&#039;exploitation\nJ&#039;ai suivi le conseil ici\npour mettre à jour le système d&#039;exploitation, bien que je ne pense pas que c&#039;était vraiment nécessaire car le système d&#039;exploitation\ntéléchargé n&#039;avait qu&#039;un mois. Pour exécuter les commandes nécessite des privilèges\naccès, obtenu ici en préfixant la commande avec sudo.\nL’exécution de ces commandes prend beaucoup de temps et nécessite un accès Internet depuis\nvotre Pi. Prévoyez 30 à 45 minutes.</p>"},{"id":"text-51","type":"text","heading":"","plain_text":"$ sudo apt-get update","html":"<p>$ sudo apt-get update</p>"},{"id":"text-52","type":"text","heading":"","plain_text":"$ sudo apt-get dist-upgrade","html":"<p>$ sudo apt-get dist-upgrade</p>"},{"id":"text-53","type":"text","heading":"","plain_text":"Vous devrez probablement redémarrer le système d&#39;exploitation après avoir apporté les modifications suivantes:","html":"<p>Vous devrez probablement redémarrer le système d&#039;exploitation après avoir apporté les modifications suivantes:</p>"},{"id":"text-54","type":"text","heading":"","plain_text":"$ sudo reboot","html":"<p>$ sudo reboot</p>"},{"id":"text-55","type":"text","heading":"","plain_text":"Si vous souhaitez déterminer quelles mises à niveau sont en attente, essayez:","html":"<p>Si vous souhaitez déterminer quelles mises à niveau sont en attente, essayez:</p>"},{"id":"text-56","type":"text","heading":"","plain_text":"$ sudo apt-get --just-print upgrade","html":"<p>$ sudo apt-get --just-print upgrade</p>"},{"id":"text-57","type":"text","heading":"","plain_text":"et redirigez la sortie vers un fichier texte. Merci à Graham\ndans le comté de Durham, au Royaume-Uni, pour ce conseil. \nRéglage du fuseau horaire\nVous voudrez peut-être vérifier que le Raspberry Pi est configuré pour\nvous donner l&#39;heure dans votre fuseau horaire local: Utilisez la commande:","html":"<p>et redirigez la sortie vers un fichier texte. Merci à Graham\ndans le comté de Durham, au Royaume-Uni, pour ce conseil. \nRéglage du fuseau horaire\nVous voudrez peut-être vérifier que le Raspberry Pi est configuré pour\nvous donner l&#039;heure dans votre fuseau horaire local: Utilisez la commande:</p>"},{"id":"text-58","type":"text","heading":"","plain_text":"$ sudo dpkg-reconfigure tzdata","html":"<p>$ sudo dpkg-reconfigure tzdata</p>"},{"id":"text-59","type":"text","heading":"","plain_text":"et sélectionnez la région et la ville appropriées. Pour le Royaume-Uni,\nJ&#39;ai choisi l&#39;Europe / Londres. La procédure reflétera les données du fuseau horaire et\ndate et heure actuelles à l&#39;heure locale et à l&#39;heure UTC à la fin. \nBien qu’il existe une interface graphique avec laquelle\nconfigurer le Wi-Fi, cela ne semblait pas fonctionner pour moi. En tout cas, si vous\nfonctionnent sans tête, vous pouvez même ne pas avoir accès à l&#39;interface graphique. le\nadaptateur réseau que j&#39;ai utilisé était l&#39;adaptateur USB nano sans fil 150Mbps Edimax EW-7811UN\nunité, que j&#39;ai reçu d&#39;Amazon (juste prix et bonne livraison).\nIl semble y avoir trois étapes:","html":"<p>et sélectionnez la région et la ville appropriées. Pour le Royaume-Uni,\nJ&#039;ai choisi l&#039;Europe / Londres. La procédure reflétera les données du fuseau horaire et\ndate et heure actuelles à l&#039;heure locale et à l&#039;heure UTC à la fin. \nBien qu’il existe une interface graphique avec laquelle\nconfigurer le Wi-Fi, cela ne semblait pas fonctionner pour moi. En tout cas, si vous\nfonctionnent sans tête, vous pouvez même ne pas avoir accès à l&#039;interface graphique. le\nadaptateur réseau que j&#039;ai utilisé était l&#039;adaptateur USB nano sans fil 150Mbps Edimax EW-7811UN\nunité, que j&#039;ai reçu d&#039;Amazon (juste prix et bonne livraison).\nIl semble y avoir trois étapes:</p>"},{"id":"text-60","type":"text","heading":"","plain_text":"Convertissez le mot de passe Wi-Fi en chaîne hexadécimale (cela peut être\n    optionnel):  $ sudo wpa_passphrase VotreSSID\n    Votre mot de passeVous obtiendrez un résultat hexadécimal tel que &quot;b7d90db3ddbd11d5ddb3dbfd81de&quot;\n    dont vous aurez besoin plus tard.  \nEditez le fichier /etc/wpa_supplicant/wpa_supplicant.conf  $ sudo nano /etc/wpa_supplicant/wpa_supplicant.confpour le faire ressembler à ceci:\nctrl_interface = DIR = / var / run / wpa_supplicant GROUP = netdevupdate_config = 1réseau = {ssid = &quot;YourSSID&quot;proto = WPA RSNscan_ssid = 1key_mgmt = WPA-PSKpaire par paire = CCMP TKIPgroupe = CCMP TKIPpsk = b7d90db3ddbd11d5ddb3dbfd81deNotez que le ssid doit être entre guillemets.","html":"<p>Convertissez le mot de passe Wi-Fi en chaîne hexadécimale (cela peut être\n    optionnel):  $ sudo wpa_passphrase VotreSSID\n    Votre mot de passeVous obtiendrez un résultat hexadécimal tel que &quot;b7d90db3ddbd11d5ddb3dbfd81de&quot;\n    dont vous aurez besoin plus tard.  \nEditez le fichier /etc/wpa_supplicant/wpa_supplicant.conf  $ sudo nano /etc/wpa_supplicant/wpa_supplicant.confpour le faire ressembler à ceci:\nctrl_interface = DIR = / var / run / wpa_supplicant GROUP = netdevupdate_config = 1réseau = {ssid = &quot;YourSSID&quot;proto = WPA RSNscan_ssid = 1key_mgmt = WPA-PSKpaire par paire = CCMP TKIPgroupe = CCMP TKIPpsk = b7d90db3ddbd11d5ddb3dbfd81deNotez que le ssid doit être entre guillemets.</p>"},{"id":"text-61","type":"text","heading":"","plain_text":"Editez le fichier / etc / network / interfaces   $ sudo nano / etc / network / interfacespour le faire ressembler à ceci:\nauto lo\niface lo inet loopbackiface eth0 inet dhcp\nallow-hotplug wlan0auto wlan0iface wlan0 inet dhcpWireless-Essid YourSSIDpre-up wpa_supplicant -B w -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.confKillall -q wpa_supplicant\niface default inet dhcp","html":"<p>Editez le fichier / etc / network / interfaces   $ sudo nano / etc / network / interfacespour le faire ressembler à ceci:\nauto lo\niface lo inet loopbackiface eth0 inet dhcp\nallow-hotplug wlan0auto wlan0iface wlan0 inet dhcpWireless-Essid YourSSIDpre-up wpa_supplicant -B w -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.confKillall -q wpa_supplicant\niface default inet dhcp</p>"},{"id":"text-62","type":"text","heading":"","plain_text":"Vous pouvez ensuite utiliser le $ sudo ifdown\nwlan0 et $ sudo ifup wlan0 commandes à\nredémarrez le réseau sans fil. Je conseillerais également un redémarrage pour assurer\nque tout s&#39;est passé comme prévu. \nComment éditer la configuration NTP\nLe fichier de configuration NTP réside dans le répertoire / etc, de sorte que vous\npeut changer dans ce répertoire pour éditer le fichier. Parce que le fichier est un\nfichier système, vous devez  sudo commande permettant de sauvegarder la version modifiée du\nfichier, mais d’abord, j’ai fait une copie (cp) du fichier fourni juste au cas où je me suis planté\net a dû revenir à la configuration de travail NTP. J&#39;ai utilisé le  vi\néditeur qui est fourni avec le système d&#39;exploitation, et il y a des instructions pour vi ici,\net aussi à\nGuru99.com dans le cadre d&#39;un Linux / Unix\ntutoriel pour débutants.\nle  nano éditeur que j’ai découvert plus tard, et qui est fourni avec le Raspberry Pi, est un bien meilleur choix &#8211; beaucoup\nplus facile à utiliser!","html":"<p>Vous pouvez ensuite utiliser le $ sudo ifdown\nwlan0 et $ sudo ifup wlan0 commandes à\nredémarrez le réseau sans fil. Je conseillerais également un redémarrage pour assurer\nque tout s&#039;est passé comme prévu. \nComment éditer la configuration NTP\nLe fichier de configuration NTP réside dans le répertoire / etc, de sorte que vous\npeut changer dans ce répertoire pour éditer le fichier. Parce que le fichier est un\nfichier système, vous devez  sudo commande permettant de sauvegarder la version modifiée du\nfichier, mais d’abord, j’ai fait une copie (cp) du fichier fourni juste au cas où je me suis planté\net a dû revenir à la configuration de travail NTP. J&#039;ai utilisé le  vi\néditeur qui est fourni avec le système d&#039;exploitation, et il y a des instructions pour vi ici,\net aussi à\nGuru99.com dans le cadre d&#039;un Linux / Unix\ntutoriel pour débutants.\nle  nano éditeur que j’ai découvert plus tard, et qui est fourni avec le Raspberry Pi, est un bien meilleur choix &#8211; beaucoup\nplus facile à utiliser!</p>"},{"id":"text-63","type":"text","heading":"","plain_text":"$ cd / etc","html":"<p>$ cd / etc</p>"},{"id":"text-64","type":"text","heading":"","plain_text":"$ sudo cp ntp.conf ntp-original.conf","html":"<p>$ sudo cp ntp.conf ntp-original.conf</p>"},{"id":"text-65","type":"text","heading":"","plain_text":"$ sudo nano ntp.conf","html":"<p>$ sudo nano ntp.conf</p>"},{"id":"text-66","type":"text","heading":"","plain_text":"Je voulais pouvoir surveiller NTP depuis un autre PC sur mon réseau local,\nplutôt que d’ajouter le programme de surveillance MRTG au Pi, mais il existe des\nlignes qui limitent l’accès au NTP fonctionnant sur le Pi par défaut\ninstallation. Ces lignes du fichier ntp.conf commencent par le mot clé\n&quot;restreindre&quot;. J&#39;ai supprimé ces restrictions en les commentant\nlignes &#8211; ce qui est réalisé en ajoutant un caractère de hachage au début de la\nligne. Par exemple:","html":"<p>Je voulais pouvoir surveiller NTP depuis un autre PC sur mon réseau local,\nplutôt que d’ajouter le programme de surveillance MRTG au Pi, mais il existe des\nlignes qui limitent l’accès au NTP fonctionnant sur le Pi par défaut\ninstallation. Ces lignes du fichier ntp.conf commencent par le mot clé\n&quot;restreindre&quot;. J&#039;ai supprimé ces restrictions en les commentant\nlignes &#8211; ce qui est réalisé en ajoutant un caractère de hachage au début de la\nligne. Par exemple:</p>"},{"id":"text-67","type":"text","heading":"","plain_text":"Remplacer:\n    restreindre -4 par défaut kod notrap nomodify nopeer noquery","html":"<p>Remplacer:\n    restreindre -4 par défaut kod notrap nomodify nopeer noquery</p>"},{"id":"text-68","type":"text","heading":"","plain_text":"Avec:\n    # restreint -4 par défaut kod notrap nomodify nopeer noquery","html":"<p>Avec:\n    # restreint -4 par défaut kod notrap nomodify nopeer noquery</p>"},{"id":"text-69","type":"text","heading":"","plain_text":"Après avoir modifié ntp.conf, vous devez redémarrer le démon ntp:","html":"<p>Après avoir modifié ntp.conf, vous devez redémarrer le démon ntp:</p>"},{"id":"text-70","type":"text","heading":"","plain_text":"$ sudo /etc/init.d/ntp restart","html":"<p>$ sudo /etc/init.d/ntp restart</p>"},{"id":"text-71","type":"text","heading":"","plain_text":"Si la sécurité sur votre réseau vous préoccupe, vous pouvez\nsouhaite être plus sélectif en modifiant les restrictions. \nBien que le contenu par défaut de ntp.conf fonctionne correctement\nDans la plupart des cas, ils ne profitent pas de la nouvelle directive NTP POOL pour\nspécifier les serveurs de pool. J&#39;ai également modifié le pool générique &quot;debian&quot;\nà la piscine plus locale &quot;UK&quot;. J&#39;ai donc changé le serveur\nbassin. lignes à une directive de pool unique:","html":"<p>Si la sécurité sur votre réseau vous préoccupe, vous pouvez\nsouhaite être plus sélectif en modifiant les restrictions. \nBien que le contenu par défaut de ntp.conf fonctionne correctement\nDans la plupart des cas, ils ne profitent pas de la nouvelle directive NTP POOL pour\nspécifier les serveurs de pool. J&#039;ai également modifié le pool générique &quot;debian&quot;\nà la piscine plus locale &quot;UK&quot;. J&#039;ai donc changé le serveur\nbassin. lignes à une directive de pool unique:</p>"},{"id":"text-72","type":"text","heading":"","plain_text":"Remplacer:\nserveur 0.debian.pool.ntp.org iburst\nserveur 1.debian.pool.ntp.org iburst\nserveur 2.debian.pool.ntp.org iburst\nserveur 3.debian.pool.ntp.org iburst\nAvec:\npool fr.pool.ntp.org iburst","html":"<p>Remplacer:\nserveur 0.debian.pool.ntp.org iburst\nserveur 1.debian.pool.ntp.org iburst\nserveur 2.debian.pool.ntp.org iburst\nserveur 3.debian.pool.ntp.org iburst\nAvec:\npool fr.pool.ntp.org iburst</p>"},{"id":"text-73","type":"text","heading":"","plain_text":"Mon propre réseau local possède trois serveurs NTP de strate 1, un sur FreeBSD et\ndeux exécutant Windows, alors j&#39;ai ajouté ceux\navant les serveurs de la piscine. Bien sûr, cela est spécifique à mon réseau local. Pour\nl&#39;offset minimum, j&#39;ai fait interroger NTP les serveurs locaux à 32 secondes (2 ^^ 5)\nintervalles, et n&#39;a pas permis que cela dérive vers le haut vers les 1024 secondes\nintervalle maximum que NTP atteindrait laissé à ses propres périphériques. j&#39;ai fait ça\navec les qualificatifs minpoll et maxpoll. Cependant, je ne voulais pas forcer\nles serveurs Internet à interroger que souvent (on considère au mieux\nau pire pourrait vous faire bloquer par un serveur), alors j&#39;ai donc fait\nl&#39;intervalle d&#39;interrogation minimal pour les serveurs Internet, 1024 secondes\n(2 ^^ 10). J&#39;ai enlevé les choses qui avaient été commentées pour simplifier le fichier,\net le rendre plus facile à comprendre. C&#39;est pourquoi mon fichier ntp.conf s&#39;est terminé comme suit:","html":"<p>Mon propre réseau local possède trois serveurs NTP de strate 1, un sur FreeBSD et\ndeux exécutant Windows, alors j&#039;ai ajouté ceux\navant les serveurs de la piscine. Bien sûr, cela est spécifique à mon réseau local. Pour\nl&#039;offset minimum, j&#039;ai fait interroger NTP les serveurs locaux à 32 secondes (2 ^^ 5)\nintervalles, et n&#039;a pas permis que cela dérive vers le haut vers les 1024 secondes\nintervalle maximum que NTP atteindrait laissé à ses propres périphériques. j&#039;ai fait ça\navec les qualificatifs minpoll et maxpoll. Cependant, je ne voulais pas forcer\nles serveurs Internet à interroger que souvent (on considère au mieux\nau pire pourrait vous faire bloquer par un serveur), alors j&#039;ai donc fait\nl&#039;intervalle d&#039;interrogation minimal pour les serveurs Internet, 1024 secondes\n(2 ^^ 10). J&#039;ai enlevé les choses qui avaient été commentées pour simplifier le fichier,\net le rendre plus facile à comprendre. C&#039;est pourquoi mon fichier ntp.conf s&#039;est terminé comme suit:</p>"},{"id":"text-74","type":"text","heading":"","plain_text":"# /etc/ntp.conf, configuration pour ntpd; voir ntp.conf (5) pour obtenir de l&#39;aide","html":"<p># /etc/ntp.conf, configuration pour ntpd; voir ntp.conf (5) pour obtenir de l&#039;aide</p>"},{"id":"text-75","type":"text","heading":"","plain_text":"# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift","html":"<p># Fichier de dérive pour mémoriser la fréquence d&#039;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift</p>"},{"id":"text-76","type":"text","heading":"","plain_text":"# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst","html":"<p># Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst</p>"},{"id":"text-77","type":"text","heading":"","plain_text":"N&#39;oubliez pas de redémarrer NTP après avoir apporté les modifications. De\nPC de surveillance Windows avec NTP installé\nJe vois maintenant:","html":"<p>N&#039;oubliez pas de redémarrer NTP après avoir apporté les modifications. De\nPC de surveillance Windows avec NTP installé\nJe vois maintenant:</p>"},{"id":"text-78","type":"text","heading":"","plain_text":"C: &gt; ntpq -p raspi\n     référence distante st t lorsque l&#39;interrogation atteint le décalage de retard de gigue\n=============================================== ============================\n* pixie .PPS. 1 u 26 32 377 0,467 -0,010 0,023\n+ feenix .PPS. 1 u 4 32 377 0,603 -0,226 0,039\n+ stamsund .PPS. 1 31 31 377 0,586 0,004 0,040\n-dns0.rmplc.co.u 193.62.22.74 2 707 1024 377 21.915 3.490 2.295\n-dns1.rmplc.co.u 193.62.22.74 2 u 177 1024 377 23.736 4.609 3.621\n-dawn.rt.uk.eu.o 193.79.237.14 2 277 1024 377 20.508 3.150 3.065\n-lyla.preshweb.c 129.215.42.240 3 u 544 1024 377 28.082 5.937 3.944","html":"<p>C: &gt; ntpq -p raspi\n     référence distante st t lorsque l&#039;interrogation atteint le décalage de retard de gigue\n=============================================== ============================\n* pixie .PPS. 1 u 26 32 377 0,467 -0,010 0,023\n+ feenix .PPS. 1 u 4 32 377 0,603 -0,226 0,039\n+ stamsund .PPS. 1 31 31 377 0,586 0,004 0,040\n-dns0.rmplc.co.u 193.62.22.74 2 707 1024 377 21.915 3.490 2.295\n-dns1.rmplc.co.u 193.62.22.74 2 u 177 1024 377 23.736 4.609 3.621\n-dawn.rt.uk.eu.o 193.79.237.14 2 277 1024 377 20.508 3.150 3.065\n-lyla.preshweb.c 129.215.42.240 3 u 544 1024 377 28.082 5.937 3.944</p>"},{"id":"text-79","type":"text","heading":"","plain_text":"C: &gt; ntpq -c rv raspi\nassocid = 0 status = 0615 leap_none, sync_ntp, 1 événement, clock_sync,\nversion = &quot;ntpd 4.2.6p5@1.2349-o ven. mai 18 20:30:57 UTC 2012 (1)&quot;,\nprocesseur = &quot;armv6l&quot;, système = &quot;Linux / 3.2.27 +&quot;, saut = 00, strate = 2,\nprecision = -20, rootdelay = 0.467, rootdisp = 2.387, refid = 192.168.0.3,\nreftime = d4365966.98133154 sam., 27 oct. 2012 14: 00: 22.594,\nclock = d4365984.f4e4138b sam. 27 oct. 2012 14: 00: 52.956, homologue = 49569, tc = 5,\nmintc = 3, offset = -0,010, fréquence = -43,888, sys_jitter = 0,023,\nclk_jitter = 0.015, clk_wander = 0.008","html":"<p>C: &gt; ntpq -c rv raspi\nassocid = 0 status = 0615 leap_none, sync_ntp, 1 événement, clock_sync,\nversion = &quot;ntpd 4.2.6p5@1.2349-o ven. mai 18 20:30:57 UTC 2012 (1)&quot;,\nprocesseur = &quot;armv6l&quot;, système = &quot;Linux / 3.2.27 +&quot;, saut = 00, strate = 2,\nprecision = -20, rootdelay = 0.467, rootdisp = 2.387, refid = 192.168.0.3,\nreftime = d4365966.98133154 sam., 27 oct. 2012 14: 00: 22.594,\nclock = d4365984.f4e4138b sam. 27 oct. 2012 14: 00: 52.956, homologue = 49569, tc = 5,\nmintc = 3, offset = -0,010, fréquence = -43,888, sys_jitter = 0,023,\nclk_jitter = 0.015, clk_wander = 0.008</p>"},{"id":"text-80","type":"text","heading":"","plain_text":"Une approche pour que le NTP voie\nla partie série du flux de sortie du récepteur GPS (pour la partie grossière du\ntemps, les secondes) est d&#39;installer\nle pilote gpsd, et cela permet une vérification de la base\nconnectivité. Le GPS que j&#39;ai commencé à utiliser était un Trimble Resolution SMT,\npour lequel j&#39;ai réussi à obtenir à la fois une carte d&#39;évaluation et une carte d&#39;interface\nconverti la sortie série en RS-232 et USB. J&#39;ai utilisé le feuilleton\nvia USB plutôt que le RS-232 pour le Raspberry Pi.","html":"<p>Une approche pour que le NTP voie\nla partie série du flux de sortie du récepteur GPS (pour la partie grossière du\ntemps, les secondes) est d&#039;installer\nle pilote gpsd, et cela permet une vérification de la base\nconnectivité. Le GPS que j&#039;ai commencé à utiliser était un Trimble Resolution SMT,\npour lequel j&#039;ai réussi à obtenir à la fois une carte d&#039;évaluation et une carte d&#039;interface\nconverti la sortie série en RS-232 et USB. J&#039;ai utilisé le feuilleton\nvia USB plutôt que le RS-232 pour le Raspberry Pi.</p>"},{"id":"text-81","type":"text","heading":"","plain_text":"C&#39;est le GPS que j&#39;ai utilisé. Il\n      est une carte d’évaluation pour un récepteur de synchronisation GPS monté en surface, le\n      Trimble Resolution SMT. C&#39;est un peu inhabituel d&#39;avoir un format TSIP\n      sortie plutôt que le format NMEA standard, mais le gpsd Linux peut\n      reconnaître et accepter ce format. La sortie est sur un en-tête à 8 broches avec un non standard\n      espacement des broches! Il est assez sensible pour utiliser un support magnétique.\n      Rondelle GPS dans ma salle informatique à l&#39;étage supérieur.","html":"<p>C&#039;est le GPS que j&#039;ai utilisé. Il\n      est une carte d’évaluation pour un récepteur de synchronisation GPS monté en surface, le\n      Trimble Resolution SMT. C&#039;est un peu inhabituel d&#039;avoir un format TSIP\n      sortie plutôt que le format NMEA standard, mais le gpsd Linux peut\n      reconnaître et accepter ce format. La sortie est sur un en-tête à 8 broches avec un non standard\n      espacement des broches! Il est assez sensible pour utiliser un support magnétique.\n      Rondelle GPS dans ma salle informatique à l&#039;étage supérieur.</p>"},{"id":"text-82","type":"text","heading":"","plain_text":"Juste comme j&#39;ai acquis le conseil,\n      il y avait une offre sur la liste de diffusion time-nuts pour un \n      interface prête à l&#39;emploi. Cela a un connecteur correspondant à 8 broches, et\n      fournit une sortie PPS, une sortie série aux niveaux RS-232 (non utilisé ici) et dispose d&#39;un convertisseur série-USB intégré! Idéal!\nFaites attention en utilisant d’autres unités GPS que vous n’aurez pas\n      dépasser +3,3 V sur le signal PPS transmis au Raspberry Pi, sous forme de signal 5 V\n      niveau sera  dommage le dispositif. J&#39;ai utilisé un diviseur résistif\n      (non représenté) pour réduire le niveau à une valeur nominale de 3,2 V.\nJ&#39;ai soudé un diviseur résistif 3k9 * + 6k8 au PPS\n      en-tête, puis a soudé un câble double alimenté en un en-tête de 0,1 pouce que j’ai eu à traîner.\n      Je l&#39;ai connecté à des broches\n      GND et GPIO-24 sur le 26 broches  Raspberry Pi GPIO\n      entête.* &#8211; incorrectement donné comme 1k0 plus tôt.","html":"<p>Juste comme j&#039;ai acquis le conseil,\n      il y avait une offre sur la liste de diffusion time-nuts pour un \n      interface prête à l&#039;emploi. Cela a un connecteur correspondant à 8 broches, et\n      fournit une sortie PPS, une sortie série aux niveaux RS-232 (non utilisé ici) et dispose d&#039;un convertisseur série-USB intégré! Idéal!\nFaites attention en utilisant d’autres unités GPS que vous n’aurez pas\n      dépasser +3,3 V sur le signal PPS transmis au Raspberry Pi, sous forme de signal 5 V\n      niveau sera  dommage le dispositif. J&#039;ai utilisé un diviseur résistif\n      (non représenté) pour réduire le niveau à une valeur nominale de 3,2 V.\nJ&#039;ai soudé un diviseur résistif 3k9 * + 6k8 au PPS\n      en-tête, puis a soudé un câble double alimenté en un en-tête de 0,1 pouce que j’ai eu à traîner.\n      Je l&#039;ai connecté à des broches\n      GND et GPIO-24 sur le 26 broches  Raspberry Pi GPIO\n      entête.* &#8211; incorrectement donné comme 1k0 plus tôt.</p>"},{"id":"text-83","type":"text","heading":"","plain_text":"Tout d’abord, j’ai connecté l’appareil au port USB inférieur, puis\nvérifié ce qui était vu sur les ports USB.","html":"<p>Tout d’abord, j’ai connecté l’appareil au port USB inférieur, puis\nvérifié ce qui était vu sur les ports USB.</p>"},{"id":"text-84","type":"text","heading":"","plain_text":"$ sudo lsusb\nPériphérique de bus 001: ID 1d6b: 0002 concentrateur racine Linux Foundation 2.0\nBus 001 Appareil 002: ID 0424: 9512 Standard Microsystems Corp.\nBus 001 Appareil 003: ID 0424: ec00 Standard Microsystems Corp.\nDispositif de bus 001 005: ID 04d8: 00df Microchip Technology, Inc.","html":"<p>$ sudo lsusb\nPériphérique de bus 001: ID 1d6b: 0002 concentrateur racine Linux Foundation 2.0\nBus 001 Appareil 002: ID 0424: 9512 Standard Microsystems Corp.\nBus 001 Appareil 003: ID 0424: ec00 Standard Microsystems Corp.\nDispositif de bus 001 005: ID 04d8: 00df Microchip Technology, Inc.</p>"},{"id":"text-85","type":"text","heading":"","plain_text":"Il semble que mon GPS apparaisse sous le numéro 005 dans cette liste, mais\ncomment sera-t-il nommé? Pour vérifier cela, vous devez parcourir l’un des\nFichiers journaux Linux:","html":"<p>Il semble que mon GPS apparaisse sous le numéro 005 dans cette liste, mais\ncomment sera-t-il nommé? Pour vérifier cela, vous devez parcourir l’un des\nFichiers journaux Linux:</p>"},{"id":"text-86","type":"text","heading":"","plain_text":"$ more / var / log / syslog","html":"<p>$ more / var / log / syslog</p>"},{"id":"text-87","type":"text","heading":"","plain_text":"et dans mon cas, au moment où j&#39;ai branché l&#39;appareil là-bas\nétait une référence à: ttyACM0:et j&#39;ai reconnu\ntty comme un port série (TeleType d&#39;il y a longtemps!). Si vous utilisez un vrai\npériphérique série, il apparaîtra comme ttyAMA0.\n  Les prochaines étapes sont à\ninstallez le logiciel gpsd et démarrez le service gpsd pointant sur l&#39;appareil\nnom vient de découvrir:","html":"<p>et dans mon cas, au moment où j&#039;ai branché l&#039;appareil là-bas\nétait une référence à: ttyACM0:et j&#039;ai reconnu\ntty comme un port série (TeleType d&#039;il y a longtemps!). Si vous utilisez un vrai\npériphérique série, il apparaîtra comme ttyAMA0.\n  Les prochaines étapes sont à\ninstallez le logiciel gpsd et démarrez le service gpsd pointant sur l&#039;appareil\nnom vient de découvrir:</p>"},{"id":"text-88","type":"text","heading":"","plain_text":"$ sudo apt-get installez gpsd gpsd-clients python-gps","html":"<p>$ sudo apt-get installez gpsd gpsd-clients python-gps</p>"},{"id":"text-89","type":"text","heading":"","plain_text":"À partir d&#39;un rapport que j&#39;ai reçu, si vous rencontrez des erreurs avec l&#39;étape ci-dessus, vous devrez peut-être exécuter une mise à jour vers apt-get:\n$ sudo apt-get update\net éventuellement alors:\n$ sudo apt-get upgrade\nqui peut mettre à niveau l&#39;ensemble du système d&#39;exploitation vers la version actuelle.","html":"<p>À partir d&#039;un rapport que j&#039;ai reçu, si vous rencontrez des erreurs avec l&#039;étape ci-dessus, vous devrez peut-être exécuter une mise à jour vers apt-get:\n$ sudo apt-get update\net éventuellement alors:\n$ sudo apt-get upgrade\nqui peut mettre à niveau l&#039;ensemble du système d&#039;exploitation vers la version actuelle.</p>"},{"id":"text-90","type":"text","heading":"","plain_text":"$ sudo gpsd / dev / ttyACM0 -n -F /var/run/gpsd.sock","html":"<p>$ sudo gpsd / dev / ttyACM0 -n -F /var/run/gpsd.sock</p>"},{"id":"text-91","type":"text","heading":"","plain_text":"À ce stade, vous devriez pouvoir voir une sortie en mode texte\ndepuis votre récepteur GPS en exécutant la commande &quot;cgps\n-s&quot;, quelque chose comme ce qui suit.","html":"<p>À ce stade, vous devriez pouvoir voir une sortie en mode texte\ndepuis votre récepteur GPS en exécutant la commande &quot;cgps\n-s&quot;, quelque chose comme ce qui suit.</p>"},{"id":"text-92","type":"text","heading":"","plain_text":"$ cgps -s","html":"<p>$ cgps -s</p>"},{"id":"text-93","type":"text","heading":"","plain_text":"Notez qu’il s’agit d’un GPS en mode chronométrage, il préférera\nsatellites qui ont une altitude plus élevée, car ceux-ci sont moins susceptibles d&#39;avoir\neffets multi-chemins ou réflexions. Cependant, pour le niveau de précision de\nque nous visons (microsecondes, pas nanosecondes), ce raffinement n’est pas\nessentiel, et je ne pouvais voir aucune différence significative entre un\n&quot;timing&quot; GPS and a &quot;position&quot; GPS on the microsecond level. \nNote that you will need to make gpsd start automatically at boot time,\nand to tell the configuration tool what device to use, and add the &quot;-n&quot;\noption for working with NTP. See the note later in this\ndocument. \nTelling NTP the seconds from the GPS\nNow that gpsd is working, we can edit the NTP configuration to\nadd a type 28 reference clock which will make NTP look at the shared memory\ncreated by gpsd.  This can be done for both the coarse time (seconds) and\nthe fine time (PPS edge) with a 28.0 and a 28.1 driver, although I only use the\n28.0 driver here as the Raspberry Pi supports PPS via a kernel-mode driver (more\nlater).  The first step is\nto get the seconds alone, and be aware that this will ne pas be better than\nInternet time alone due to the offset of the serial/USB data from the true\nsecond, and because of the variability and drift in this offset.  We will\nneed to add a connection later between the PPS signal and one of the Raspberry Pi&#39;s I/O\npins to generate a PPS interrupt.  Here is my modified ntp.conf file. \nI&#39;ve used 0.000 for the time1 modifier to start with, so that we can determine\nan approximate value for the delay of the serial data from the GPS after ntp is\nup and running.  I changed the refid for the type 28 driver to &quot;SHM&quot;\nto indicate more clearly that the data is coming from the SHared Memory provided\nby gpsd.\nNote that I have marked more than one server as\n&quot;prefer&quot;.  This is because if the first preferred server goes\noffline, it appears that NTP will no longer accept the PPS data as valid (is\nthat wise?), so a second preferred server is configured to cover that\npossibility.  In my case, it happens because 192.168.0.3 sometimes has an\nNTP update, causing its NTP to go offline for some seconds, and hence causes a\nglitch in the connected servers.  Having more than one preferred server\nshould prevent that.","html":"<p>Notez qu’il s’agit d’un GPS en mode chronométrage, il préférera\nsatellites qui ont une altitude plus élevée, car ceux-ci sont moins susceptibles d&#039;avoir\neffets multi-chemins ou réflexions. Cependant, pour le niveau de précision de\nque nous visons (microsecondes, pas nanosecondes), ce raffinement n’est pas\nessentiel, et je ne pouvais voir aucune différence significative entre un\n&quot;timing&quot; GPS and a &quot;position&quot; GPS on the microsecond level. \nNote that you will need to make gpsd start automatically at boot time,\nand to tell the configuration tool what device to use, and add the &quot;-n&quot;\noption for working with NTP. See the note later in this\ndocument. \nTelling NTP the seconds from the GPS\nNow that gpsd is working, we can edit the NTP configuration to\nadd a type 28 reference clock which will make NTP look at the shared memory\ncreated by gpsd.  This can be done for both the coarse time (seconds) and\nthe fine time (PPS edge) with a 28.0 and a 28.1 driver, although I only use the\n28.0 driver here as the Raspberry Pi supports PPS via a kernel-mode driver (more\nlater).  The first step is\nto get the seconds alone, and be aware that this will ne pas be better than\nInternet time alone due to the offset of the serial/USB data from the true\nsecond, and because of the variability and drift in this offset.  We will\nneed to add a connection later between the PPS signal and one of the Raspberry Pi&#039;s I/O\npins to generate a PPS interrupt.  Here is my modified ntp.conf file. \nI&#039;ve used 0.000 for the time1 modifier to start with, so that we can determine\nan approximate value for the delay of the serial data from the GPS after ntp is\nup and running.  I changed the refid for the type 28 driver to &quot;SHM&quot;\nto indicate more clearly that the data is coming from the SHared Memory provided\nby gpsd.\nNote that I have marked more than one server as\n&quot;prefer&quot;.  This is because if the first preferred server goes\noffline, it appears that NTP will no longer accept the PPS data as valid (is\nthat wise?), so a second preferred server is configured to cover that\npossibility.  In my case, it happens because 192.168.0.3 sometimes has an\nNTP update, causing its NTP to go offline for some seconds, and hence causes a\nglitch in the connected servers.  Having more than one preferred server\nshould prevent that.</p>"},{"id":"text-94","type":"text","heading":"","plain_text":"# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.000 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst prefer\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst","html":"<p># /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.000 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst prefer\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst</p>"},{"id":"text-95","type":"text","heading":"","plain_text":"Note that when using a PPS source you doit have one\nother server marked &quot;prefer&quot;.  In the example above I have added\nprefer to the shared memory driver (type 28) so that the combination of PPS and\nGPSD would provide the correct time even with no Internet servers.  Looking at the output from ntpq -p after some time we might\nsee:","html":"<p>Note that when using a PPS source you doit have one\nother server marked &quot;prefer&quot;.  In the example above I have added\nprefer to the shared memory driver (type 28) so that the combination of PPS and\nGPSD would provide the correct time even with no Internet servers.  Looking at the output from ntpq -p after some time we might\nsee:</p>"},{"id":"text-96","type":"text","heading":"","plain_text":"C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\nxSHM(0)          .SHM.           15 l   15   16  377    0.000  -353.23   1.277\n*pixie           .PPS.            1 u   25   32  377    0.484   -0.016   0.105\n+feenix          .PPS.            1 u   31   32  377    0.592   -0.120   0.044\n+stamsund        .PPS.            1 u   16   32  377    0.546   -0.037   0.083\nxns0.luns.net.uk 157.44.176.4     2 u 1656 1024  156   31.904    3.702   5.455\nxtime.videxio.ne 131.188.3.223    2 u  45m 1024   74   31.765    8.590   2.796\nxlyla.preshweb.c 129.215.42.240   3 u  510 1024  377   25.568    4.793   5.990\n-dawn.rt.uk.eu.o 193.67.79.202    2 u  492 1024  367   20.308    2.408   2.903","html":"<p>C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\nxSHM(0)          .SHM.           15 l   15   16  377    0.000  -353.23   1.277\n*pixie           .PPS.            1 u   25   32  377    0.484   -0.016   0.105\n+feenix          .PPS.            1 u   31   32  377    0.592   -0.120   0.044\n+stamsund        .PPS.            1 u   16   32  377    0.546   -0.037   0.083\nxns0.luns.net.uk 157.44.176.4     2 u 1656 1024  156   31.904    3.702   5.455\nxtime.videxio.ne 131.188.3.223    2 u  45m 1024   74   31.765    8.590   2.796\nxlyla.preshweb.c 129.215.42.240   3 u  510 1024  377   25.568    4.793   5.990\n-dawn.rt.uk.eu.o 193.67.79.202    2 u  492 1024  367   20.308    2.408   2.903</p>"},{"id":"text-97","type":"text","heading":"","plain_text":"and while the SHM driver is present and connected (reach =\n377), it has been rejected by NTP (the &quot;x&quot; in the first column),\nperhaps because its offset was consistently too great compared to the other\nservers.  That&#39;s the purpose of the time1 modifier in the &quot;fudge&quot;\ncommander. We can see that the SHM output is some 350 milliseconds later, so\nwe can use that value for time1 to bring the GPS output approximately into line\nwith UTC, as shown in the edited /etc/ntp.conf below.  (The time values in\nthe ntpq -p display are all in milliseconds).\nHint: if at this point the reach field for the SHM\ndevice stays at zero, likely the gpsd wasn&#39;t started with the &quot;-n&quot;\noption. You can make the gpsd always start at system boot time with that -n\noption as described later in this note.","html":"<p>and while the SHM driver is present and connected (reach =\n377), it has been rejected by NTP (the &quot;x&quot; in the first column),\nperhaps because its offset was consistently too great compared to the other\nservers.  That&#039;s the purpose of the time1 modifier in the &quot;fudge&quot;\ncommander. We can see that the SHM output is some 350 milliseconds later, so\nwe can use that value for time1 to bring the GPS output approximately into line\nwith UTC, as shown in the edited /etc/ntp.conf below.  (The time values in\nthe ntpq -p display are all in milliseconds).\nHint: if at this point the reach field for the SHM\ndevice stays at zero, likely the gpsd wasn&#039;t started with the &quot;-n&quot;\noption. You can make the gpsd always start at system boot time with that -n\noption as described later in this note.</p>"},{"id":"text-98","type":"text","heading":"","plain_text":"# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst","html":"<p># /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst</p>"},{"id":"text-99","type":"text","heading":"","plain_text":"The output from ntpq -p then shows the offset for the SHM\ndriver to be much nearer to zero, and this /might/ be good enough for you if you\nare out in the field with no other reference.  But we can do better, and\nthe next step is to use the precise PPS signal from the GPS to improve the\naccuracy down to the microsecond level.","html":"<p>The output from ntpq -p then shows the offset for the SHM\ndriver to be much nearer to zero, and this /might/ be good enough for you if you\nare out in the field with no other reference.  But we can do better, and\nthe next step is to use the precise PPS signal from the GPS to improve the\naccuracy down to the microsecond level.</p>"},{"id":"text-100","type":"text","heading":"","plain_text":"C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n-SHM(0)          .SHM.           15 l    1   16   17    0.000    1.766   0.943\n*pixie           .PPS.            1 u   13   32    3    0.421   -0.325   0.194\n+feenix          .PPS.            1 u   13   32    3    0.528   -0.644   0.969\n+stamsund        .PPS.            1 u   11   32    3    0.409   -0.336   0.145\n-dns0.rmplc.co.u 195.66.241.2     2 u   35 1024    1   22.872    3.604   5.037\n-mail1.itdojo.or 10.10.120.2      2 u   34 1024    1   38.472    3.324   7.084\n ntp.fundamental 193.62.22.82     2 u   33 1024    1   30.980    2.450   3.837\n 82.113.154.206  193.62.22.82     2 u   32 1024    1   19.219    0.683   5.880","html":"<p>C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n-SHM(0)          .SHM.           15 l    1   16   17    0.000    1.766   0.943\n*pixie           .PPS.            1 u   13   32    3    0.421   -0.325   0.194\n+feenix          .PPS.            1 u   13   32    3    0.528   -0.644   0.969\n+stamsund        .PPS.            1 u   11   32    3    0.409   -0.336   0.145\n-dns0.rmplc.co.u 195.66.241.2     2 u   35 1024    1   22.872    3.604   5.037\n-mail1.itdojo.or 10.10.120.2      2 u   34 1024    1   38.472    3.324   7.084\n ntp.fundamental 193.62.22.82     2 u   33 1024    1   30.980    2.450   3.837\n 82.113.154.206  193.62.22.82     2 u   32 1024    1   19.219    0.683   5.880</p>"},{"id":"text-101","type":"text","heading":"","plain_text":"Note: if you are working stand-alone, without any Internet servers, you may\n  need an extra &quot;flag1 1&quot; in the fudge for the type 28\n  ref-clock.  Please see the notes here\n  for further information.  Thanks to Whitham D. Reeve Anchorage, Alaska USA\n  for the testing.\n \nBut my time is 16 seconds out!\nI did notice with the GPS unit that I have that it doesn&#39;t\nhave battery backup, so when it first starts it has to download quite a lot of data\nfrom the GPS satellites before it has full lock.  While the PPS signal\nis acquired quite quickly, it takes a few minutes for the receiver to determine\nthe number of seconds offset between GPS-time GPST) and the usual UTC.  As I\nwrite, that GPST-UTC offset is 16 seconds &#8211; the offset is because recent\nleap-seconds are not applied to GPS time &#8211; plus\ninformation. The implications of this are different\ndepending on what other servers you have configured in your ntp.conf file","html":"<p>Note: if you are working stand-alone, without any Internet servers, you may\n  need an extra &quot;flag1 1&quot; in the fudge for the type 28\n  ref-clock.  Please see the notes here\n  for further information.  Thanks to Whitham D. Reeve Anchorage, Alaska USA\n  for the testing.\n \nBut my time is 16 seconds out!\nI did notice with the GPS unit that I have that it doesn&#039;t\nhave battery backup, so when it first starts it has to download quite a lot of data\nfrom the GPS satellites before it has full lock.  While the PPS signal\nis acquired quite quickly, it takes a few minutes for the receiver to determine\nthe number of seconds offset between GPS-time GPST) and the usual UTC.  As I\nwrite, that GPST-UTC offset is 16 seconds &#8211; the offset is because recent\nleap-seconds are not applied to GPS time &#8211; plus\ninformation. The implications of this are different\ndepending on what other servers you have configured in your ntp.conf file</p>"},{"id":"text-102","type":"text","heading":"","plain_text":"If you have some Internet or LAN servers, ntp is clever\n    enough to ignore the obvious &quot;bad chimer&quot;, and may simply display a\n    large offset for the GPS in the  ntpq -p output when starting\n    up. Après\n    a few minutes, the offset will revert to the correct value.  The delay\n    is not a problem in this case. \nIf you have no other source than the GPS, then you should\n    probably wait a few minutes before assuming that even the coarse seconds\n    part of the time is correct.  I haven&#39;t checked how long it will take\n    NTP to step the clock by the 16 seconds needed after the GPS starts sending\n    UTC rather than GPS time.  If your GPS does this, consider adding some\n    sort of battery backup so that the GPS-UTC offset is stored while the unit\n    is down.","html":"<p>If you have some Internet or LAN servers, ntp is clever\n    enough to ignore the obvious &quot;bad chimer&quot;, and may simply display a\n    large offset for the GPS in the  ntpq -p output when starting\n    up. Après\n    a few minutes, the offset will revert to the correct value.  The delay\n    is not a problem in this case. \nIf you have no other source than the GPS, then you should\n    probably wait a few minutes before assuming that even the coarse seconds\n    part of the time is correct.  I haven&#039;t checked how long it will take\n    NTP to step the clock by the 16 seconds needed after the GPS starts sending\n    UTC rather than GPS time.  If your GPS does this, consider adding some\n    sort of battery backup so that the GPS-UTC offset is stored while the unit\n    is down.</p>"},{"id":"text-103","type":"text","heading":"","plain_text":"Quite why I saw this issue while using gpsd\nis uncertain.  Since writing the above I have been in contact with the\nauteur de gpsd who tells me that protection is\nincorporated into the gpsd software whereby it\nwill not pass on the time to its shared memory until the output from the GPS\nreceiver has a (GPST-UTC) value in excess of 10 seconds.  So I should never\nhave seen the 16 seconds faster value at all.\nPlease note that this problem is likely peculiar to my\nparticular GPS receiver &#8211; an\nevaluation board with no battery backup.  Just be aware of this problem in\ncase it bites you!  It doesn&#39;t happen with the u-blox pure serial GPS\nreceiver I describe later, as this board has battery\nbackup.  &quot;Your mileage may vary&quot;, as they say! \nThe next step was to get the PPS working.  This requires\nupdating the Linux kernel for the Raspberry Pi, and while you can do that\nyourself, there is a ready-made kernel image and support modules available on\nthe Web.  Much of the information below is based on David K&#39;s Web page:\n  https://github.com/davidk/adafruit-raspberrypi-linux-pps\nYou can check the version of the kernel you are running at the moment by:","html":"<p>Quite why I saw this issue while using gpsd\nis uncertain.  Since writing the above I have been in contact with the\nauteur de gpsd who tells me that protection is\nincorporated into the gpsd software whereby it\nwill not pass on the time to its shared memory until the output from the GPS\nreceiver has a (GPST-UTC) value in excess of 10 seconds.  So I should never\nhave seen the 16 seconds faster value at all.\nPlease note that this problem is likely peculiar to my\nparticular GPS receiver &#8211; an\nevaluation board with no battery backup.  Just be aware of this problem in\ncase it bites you!  It doesn&#039;t happen with the u-blox pure serial GPS\nreceiver I describe later, as this board has battery\nbackup.  &quot;Your mileage may vary&quot;, as they say! \nThe next step was to get the PPS working.  This requires\nupdating the Linux kernel for the Raspberry Pi, and while you can do that\nyourself, there is a ready-made kernel image and support modules available on\nthe Web.  Much of the information below is based on David K&#039;s Web page:\n  https://github.com/davidk/adafruit-raspberrypi-linux-pps\nYou can check the version of the kernel you are running at the moment by:</p>"},{"id":"text-104","type":"text","heading":"","plain_text":"$ uname -a\nLinux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux","html":"<p>$ uname -a\nLinux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux</p>"},{"id":"text-105","type":"text","heading":"","plain_text":"First you need to get the updated kernel image and\nmodules.  At the time of writing, these were available for the current\nversion of the OS from chrisprt as mentioned here:\nKernel image: https://docs.google.com/open?id=0BznvtPCGqrd3ZElKZHEtUDRpUEUModules: https://docs.google.com/open?id=0BznvtPCGqrd3VTZ2TmxFTktYM0E\nThese come down as Zip files and, as I wasn&#39;t sure about\ndownloading these from Google Docs directly on the Raspberry Pi, I downloaded\nthem to a local Windows FTP server first, and then installed an FTP client on the\nRaspberry Pi to drag the Zip files across in FTP image mode &#8211; i.e. binary files.","html":"<p>First you need to get the updated kernel image and\nmodules.  At the time of writing, these were available for the current\nversion of the OS from chrisprt as mentioned here:\nKernel image: https://docs.google.com/open?id=0BznvtPCGqrd3ZElKZHEtUDRpUEUModules: https://docs.google.com/open?id=0BznvtPCGqrd3VTZ2TmxFTktYM0E\nThese come down as Zip files and, as I wasn&#039;t sure about\ndownloading these from Google Docs directly on the Raspberry Pi, I downloaded\nthem to a local Windows FTP server first, and then installed an FTP client on the\nRaspberry Pi to drag the Zip files across in FTP image mode &#8211; i.e. binary files.</p>"},{"id":"text-106","type":"text","heading":"","plain_text":"# Installing an FTP client:\n$ sudo apt-get install ftp","html":"<p># Installing an FTP client:\n$ sudo apt-get install ftp</p>"},{"id":"text-107","type":"text","heading":"","plain_text":"I could then use standard FTP command to drag the files from\nmy local FTP server to the Raspberry Pi.  I created a directory named pps\nbelow the home user directory for the files, and then unzipped the archives I\nhad copied:","html":"<p>I could then use standard FTP command to drag the files from\nmy local FTP server to the Raspberry Pi.  I created a directory named pps\nbelow the home user directory for the files, and then unzipped the archives I\nhad copied:</p>"},{"id":"text-108","type":"text","heading":"","plain_text":"$ mkdir pps","html":"<p>$ mkdir pps</p>"},{"id":"text-109","type":"text","heading":"","plain_text":"$ cd pps","html":"<p>$ cd pps</p>"},{"id":"text-110","type":"text","heading":"","plain_text":"# FTP get 3.2.27-pps-g965b922-dirty.zip in binary (image) mode.\n# FTP get kernel-pps-gpio24.zip in binary (image) mode\n(substitute your own commands here).","html":"<p># FTP get 3.2.27-pps-g965b922-dirty.zip in binary (image) mode.\n# FTP get kernel-pps-gpio24.zip in binary (image) mode\n(substitute your own commands here).</p>"},{"id":"text-111","type":"text","heading":"","plain_text":"$ unzip kernel-pps-gpio24.zip","html":"<p>$ unzip kernel-pps-gpio24.zip</p>"},{"id":"text-112","type":"text","heading":"","plain_text":"$ unzip 3.2.27-pps-g965b922-dirty.zip","html":"<p>$ unzip 3.2.27-pps-g965b922-dirty.zip</p>"},{"id":"text-113","type":"text","heading":"","plain_text":"In the pps/kernel-pps-gpio24 directory you will find a file\nkernel-pps-gpio24.img.  This must be renamed and moved to the /boot/ directory, while we first\ntake a safety copy of the original kernel image.","html":"<p>In the pps/kernel-pps-gpio24 directory you will find a file\nkernel-pps-gpio24.img.  This must be renamed and moved to the /boot/ directory, while we first\ntake a safety copy of the original kernel image.</p>"},{"id":"text-114","type":"text","heading":"","plain_text":"$ sudo mv /boot/kernel.img /boot/kernel.img.orig","html":"<p>$ sudo mv /boot/kernel.img /boot/kernel.img.orig</p>"},{"id":"text-115","type":"text","heading":"","plain_text":"$ sudo cp kernel-pps-gpio24.img /boot/kernel.img","html":"<p>$ sudo cp kernel-pps-gpio24.img /boot/kernel.img</p>"},{"id":"text-116","type":"text","heading":"","plain_text":"Now we need to move the module files into the area where the\nnew kernel expects to find them.  I found the command on the Web page\neither confusing or wrong, as I ended up with the wrong structure to start\navec. What it appears to need is:","html":"<p>Now we need to move the module files into the area where the\nnew kernel expects to find them.  I found the command on the Web page\neither confusing or wrong, as I ended up with the wrong structure to start\navec. What it appears to need is:</p>"},{"id":"text-117","type":"text","heading":"","plain_text":"/lib/modules/3.2.27+\n/lib/modules/3.2.27+/kernel\n/lib/modules/3.2.27+/modules.*\n/lib/modules/3.2.27-cutdown+\n/lib/modules/3.2.27-cutdown+/kernel\n/lib/modules/3.2.27-cutdown+/modules.*\n/lib/modules/3.2.27-pps-g965b922-dirty\n/lib/modules/3.2.27-pps-g965b922-dirty/kernel/\n/lib/modules/3.2.27-pps-g965b922-dirty/modules.*","html":"<p>/lib/modules/3.2.27+\n/lib/modules/3.2.27+/kernel\n/lib/modules/3.2.27+/modules.*\n/lib/modules/3.2.27-cutdown+\n/lib/modules/3.2.27-cutdown+/kernel\n/lib/modules/3.2.27-cutdown+/modules.*\n/lib/modules/3.2.27-pps-g965b922-dirty\n/lib/modules/3.2.27-pps-g965b922-dirty/kernel/\n/lib/modules/3.2.27-pps-g965b922-dirty/modules.*</p>"},{"id":"text-118","type":"text","heading":"","plain_text":"You will find both the kernel directory and the modules files\nin the unzipped 3.2.27-pps-g965b922-dirty directory, so the following command\nmay work correctly for you.  I made a mess of this having followed the Web\npage verbatim, and not having made allowances for the differences in the file\nNom. Assuming you are now in the pps directory, move the required files to\nthe /lib/modules directory, and add the pps-gpio module to the module list:","html":"<p>You will find both the kernel directory and the modules files\nin the unzipped 3.2.27-pps-g965b922-dirty directory, so the following command\nmay work correctly for you.  I made a mess of this having followed the Web\npage verbatim, and not having made allowances for the differences in the file\nNom. Assuming you are now in the pps directory, move the required files to\nthe /lib/modules directory, and add the pps-gpio module to the module list:</p>"},{"id":"text-119","type":"text","heading":"","plain_text":"$ sudo mv 3.2.27-pps-g965b922-dirty /lib/modules/3.2.27-pps-g965b922-dirty","html":"<p>$ sudo mv 3.2.27-pps-g965b922-dirty /lib/modules/3.2.27-pps-g965b922-dirty</p>"},{"id":"text-120","type":"text","heading":"","plain_text":"$ echo &quot;pps-gpio&quot; | sudo tee -a /etc/modules\n(Command corrected, thanks Matthew Huxtable!  Alternatively edit \n /etc/modules using the nano editor to add the pps-gpio at the end.\n$ sudo nano /etc/modules","html":"<p>$ echo &quot;pps-gpio&quot; | sudo tee -a /etc/modules\n(Command corrected, thanks Matthew Huxtable!  Alternatively edit \n /etc/modules using the nano editor to add the pps-gpio at the end.\n$ sudo nano /etc/modules</p>"},{"id":"text-121","type":"text","heading":"","plain_text":"$ sudo reboot","html":"<p>$ sudo reboot</p>"},{"id":"text-122","type":"text","heading":"","plain_text":"You will see the changed kernel name at the next login,\n    and you can check with the uname -a command as before:","html":"<p>You will see the changed kernel name at the next login,\n    and you can check with the uname -a command as before:</p>"},{"id":"text-123","type":"text","heading":"","plain_text":"$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux","html":"<p>$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux</p>"},{"id":"text-124","type":"text","heading":"","plain_text":"An aside &#8211; what is a module in Linux?","html":"<p>An aside &#8211; what is a module in Linux?</p>"},{"id":"text-125","type":"text","heading":"","plain_text":"You may be used to the idea of device drivers for Windows &#8211;\nthose .SYS files &#8211; but what are &quot;modules&quot; in Linux and how do they\nrelate to device drivers?  I asked that question on the time-nuts list, and\ngot this reply from Michael Tharp:","html":"<p>You may be used to the idea of device drivers for Windows &#8211;\nthose .SYS files &#8211; but what are &quot;modules&quot; in Linux and how do they\nrelate to device drivers?  I asked that question on the time-nuts list, and\ngot this reply from Michael Tharp:</p>"},{"id":"text-126","type":"text","heading":"","plain_text":"&quot;Linux modules are the same, although Linux modules almost always need to be\n  compiled against the specific kernel version while Windows drivers are typically only bound to which release you&#39;re running. \n  That is the reason you have to compile the kernel, rather than just plop down a driver\n  downloaded from the internet. \n&quot;That said, the reason your PPS driver is a module is that it makes it easier to tweak options. \n  Almost all modules that are part of the main kernel source (which PPS is, for a year or so)\n  can be compiled in rather than as a separate module, but you can pass options to a module as you load it while you cannot do that with a\n  built-in.  It also makes it possible to tweak the source, recompile just that module, and test it on the fly rather than recompiling the entire\n  kernel and rebooting.&quot;","html":"<p>&quot;Linux modules are the same, although Linux modules almost always need to be\n  compiled against the specific kernel version while Windows drivers are typically only bound to which release you&#039;re running. \n  That is the reason you have to compile the kernel, rather than just plop down a driver\n  downloaded from the internet. \n&quot;That said, the reason your PPS driver is a module is that it makes it easier to tweak options. \n  Almost all modules that are part of the main kernel source (which PPS is, for a year or so)\n  can be compiled in rather than as a separate module, but you can pass options to a module as you load it while you cannot do that with a\n  built-in.  It also makes it possible to tweak the source, recompile just that module, and test it on the fly rather than recompiling the entire\n  kernel and rebooting.&quot;</p>"},{"id":"text-127","type":"text","heading":"","plain_text":"Many thanks, Michael. \nChecking the PPS is working\nTo check that you are running the new kernel and that the pps-gpio\nmodule is loaded, then install the pps-tools et\nrun it to see the changes on pin 24 (assuming you have a 3.3 V PPS signal\nconnected.  Warning: faire ne pas connect a 5 V signal to the GPIO pins!","html":"<p>Many thanks, Michael. \nChecking the PPS is working\nTo check that you are running the new kernel and that the pps-gpio\nmodule is loaded, then install the pps-tools et\nrun it to see the changes on pin 24 (assuming you have a 3.3 V PPS signal\nconnected.  Warning: faire ne pas connect a 5 V signal to the GPIO pins!</p>"},{"id":"text-128","type":"text","heading":"","plain_text":"$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux","html":"<p>$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux</p>"},{"id":"text-129","type":"text","heading":"","plain_text":"$ dmesg | grep pps\n[ 0.000000] Linux version 3.2.27-pps-g965b922-dirty (root@bt) (gcc version 4.\n6.2 (Ubuntu/Linaro 4.6.2-14ubuntu2~ppa1) ) #1 PREEMPT Sat Sep 22 16:30:50 EDT 20\n12\n[ 1.866364] usb usb1: Manufacturer: Linux 3.2.27-pps-g965b922-dirty dwc_otg_h\nCD\n[ 12.797224] pps_core: LinuxPPS API ver. 1 registered\n[ 12.803850] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giome\ntti \n[ 12.824858]  pps pps0: new PPS source pps-gpio.-1\n[ 12.832182] pps pps0: Registered IRQ 194 as PPS source\n[ 133.043038] pps_ldisc: PPS line discipline registered\n[ 133.044841] pps pps1: new PPS source acm0\n[ 133.044879] pps pps1: source &quot;/dev/ttyACM0&quot; added","html":"<p>$ dmesg | grep pps\n[ 0.000000] Linux version 3.2.27-pps-g965b922-dirty (root@bt) (gcc version 4.\n6.2 (Ubuntu/Linaro 4.6.2-14ubuntu2~ppa1) ) #1 PREEMPT Sat Sep 22 16:30:50 EDT 20\n12\n[ 1.866364] usb usb1: Manufacturer: Linux 3.2.27-pps-g965b922-dirty dwc_otg_h\nCD\n[ 12.797224] pps_core: LinuxPPS API ver. 1 registered\n[ 12.803850] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giome\ntti \n[ 12.824858]  pps pps0: new PPS source pps-gpio.-1\n[ 12.832182] pps pps0: Registered IRQ 194 as PPS source\n[ 133.043038] pps_ldisc: PPS line discipline registered\n[ 133.044841] pps pps1: new PPS source acm0\n[ 133.044879] pps pps1: source &quot;/dev/ttyACM0&quot; added</p>"},{"id":"text-130","type":"text","heading":"","plain_text":"$ sudo aptitude install pps-tools # may take some time","html":"<p>$ sudo aptitude install pps-tools # may take some time</p>"},{"id":"text-131","type":"text","heading":"","plain_text":"$ sudo ppstest /dev/pps0 # press Ctrl-C to cancel.. \ntrying PPS source &quot;/dev/pps0&quot; \nfound PPS source &quot;/dev/pps0&quot; \nok, found 1 source(s), now start fetching data... \nsource 0 - assert 1351501153.999956346, sequence: 47481 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501154.999954601, sequence: 47482 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501155.999951856, sequence: 47483 - clear 0.000000000, sequence: 0 \n^C","html":"<p>$ sudo ppstest /dev/pps0 # press Ctrl-C to cancel.. \ntrying PPS source &quot;/dev/pps0&quot; \nfound PPS source &quot;/dev/pps0&quot; \nok, found 1 source(s), now start fetching data... \nsource 0 - assert 1351501153.999956346, sequence: 47481 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501154.999954601, sequence: 47482 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501155.999951856, sequence: 47483 - clear 0.000000000, sequence: 0 \n^C</p>"},{"id":"text-132","type":"text","heading":"","plain_text":"The &quot;clear&quot; entries showing as zero is correct for\nthis driver implementation.  Note that if you don&#39;t have a PPS signal\nconnected to GPIO pin 24 the last three lines from the dmesg output may be\nmissing.  In the output above, the PPS source was only registered some 133\nseconds after startup, possibly the length of time it took the GPS to\nlock.  On a second system with no PPS connected the last three lines were\nmissing.\nThis test should still work even with NTP running and using the PPS signal.  \nUnfortunately, the version of NTP supplied with the Raspberry\nPi Linux does not support PPS.  Likely it has been compiled to minimise its\nmemory and disk footprint.  These are the steps to download, compile and\ninstall NTP (with help from jbeal&#39;s\nposting). You can choose between a release and a development version\nas shown in step 4 below. You could also use a copy of the development tarball on\nyour own local FTP server.  So from logging in, here are the steps. \nThe lines below are shown for development version ntp-dev-4.2.7p397, but you\nwill need to alter the version number to suit the version you wish to compile. \nThe two time-consuming steps (configure and make) appear to be CPU limited\nrather than SD-card I/O access limited. \nYou can see which version I am currently running here.","html":"<p>The &quot;clear&quot; entries showing as zero is correct for\nthis driver implementation.  Note that if you don&#039;t have a PPS signal\nconnected to GPIO pin 24 the last three lines from the dmesg output may be\nmissing.  In the output above, the PPS source was only registered some 133\nseconds after startup, possibly the length of time it took the GPS to\nlock.  On a second system with no PPS connected the last three lines were\nmissing.\nThis test should still work even with NTP running and using the PPS signal.  \nUnfortunately, the version of NTP supplied with the Raspberry\nPi Linux does not support PPS.  Likely it has been compiled to minimise its\nmemory and disk footprint.  These are the steps to download, compile and\ninstall NTP (with help from jbeal&#039;s\nposting). You can choose between a release and a development version\nas shown in step 4 below. You could also use a copy of the development tarball on\nyour own local FTP server.  So from logging in, here are the steps. \nThe lines below are shown for development version ntp-dev-4.2.7p397, but you\nwill need to alter the version number to suit the version you wish to compile. \nThe two time-consuming steps (configure and make) appear to be CPU limited\nrather than SD-card I/O access limited. \nYou can see which version I am currently running here.</p>"},{"id":"text-133","type":"text","heading":"","plain_text":"$ mkdir ntp                  # make a convenient working directory, if you don&#39;t already have one","html":"<p>$ mkdir ntp                  # make a convenient working directory, if you don&#039;t already have one</p>"},{"id":"text-134","type":"text","heading":"","plain_text":"$ cd ntp                     # enter that directory","html":"<p>$ cd ntp                     # enter that directory</p>"},{"id":"text-135","type":"text","heading":"","plain_text":"$ sudo apt-get install libcap-dev\t# once-off, required to prevent later file not found error\n$ sudo apt-get install libssl-dev\t# once-off, you may not need this, but reports suggest you might to build keygen","html":"<p>$ sudo apt-get install libcap-dev\t# once-off, required to prevent later file not found error\n$ sudo apt-get install libssl-dev\t# once-off, you may not need this, but reports suggest you might to build keygen</p>"},{"id":"text-136","type":"text","heading":"","plain_text":"# Get the desired tarball, current or development - use one of the following:\n$ wget http://archive.ntp.org/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz\t\t\t\t\t# release\n$ wget http://archive.ntp.org/ntp4/ntp-dev/ntp-dev-4.2.7p397.tar.gz\t\t\t# development\n \n(May redirect to:  https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz)","html":"<p># Get the desired tarball, current or development - use one of the following:\n$ wget http://archive.ntp.org/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz\t\t\t\t\t# release\n$ wget http://archive.ntp.org/ntp4/ntp-dev/ntp-dev-4.2.7p397.tar.gz\t\t\t# development\n \n(May redirect to:  https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz)</p>"},{"id":"text-137","type":"text","heading":"","plain_text":"$ tar xvfz ntp-4.2.8p10.tar.gz","html":"<p>$ tar xvfz ntp-4.2.8p10.tar.gz</p>"},{"id":"text-138","type":"text","heading":"","plain_text":"$ cd ntp-dev-4.2.8p10","html":"<p>$ cd ntp-dev-4.2.8p10</p>"},{"id":"text-139","type":"text","heading":"","plain_text":"$ ./configure --enable-linuxcaps\t# takes 11-15 minutes","html":"<p>$ ./configure --enable-linuxcaps\t# takes 11-15 minutes</p>"},{"id":"text-140","type":"text","heading":"","plain_text":"# If your PPS doesn&#39;t work and you get a &quot;clock type 22 invalid&quot; message, be sure to install pps-tools\n# first, and clear out the directory:  cd ~/ntp, rm -r ntp-dev-4.2.7p397, and start again from step 5.","html":"<p># If your PPS doesn&#039;t work and you get a &quot;clock type 22 invalid&quot; message, be sure to install pps-tools\n# first, and clear out the directory:  cd ~/ntp, rm -r ntp-dev-4.2.7p397, and start again from step 5.</p>"},{"id":"text-141","type":"text","heading":"","plain_text":"# It seems that the --enable-linuxcaps flag may not be required on other Linux variants,\n# or on the RPi with later versions of Linux with PPS and pps-tools installed.\n# It is required for the more recent Raspbian Jessie (later 2015).","html":"<p># It seems that the --enable-linuxcaps flag may not be required on other Linux variants,\n# or on the RPi with later versions of Linux with PPS and pps-tools installed.\n# It is required for the more recent Raspbian Jessie (later 2015).</p>"},{"id":"text-142","type":"text","heading":"","plain_text":"$ make\t\t\t\t\t# takes 18-25 minutes\n(use &quot;make -j5&quot; for faster execution on the four-core Raspberry Pi 2/3.)","html":"<p>$ make\t\t\t\t\t# takes 18-25 minutes\n(use &quot;make -j5&quot; for faster execution on the four-core Raspberry Pi 2/3.)</p>"},{"id":"text-143","type":"text","heading":"","plain_text":"# This removes the original NTP and installs the new.\n# Step may not be needed - see below.\n# Recommend: omit this step.\n$ sudo apt-get remove ntp    # get rid of previously existing install of ntpd","html":"<p># This removes the original NTP and installs the new.\n# Step may not be needed - see below.\n# Recommend: omit this step.\n$ sudo apt-get remove ntp    # get rid of previously existing install of ntpd</p>"},{"id":"text-144","type":"text","heading":"","plain_text":"$ sudo make install          # puts ntp* in /usr/local/bin/ntp*, takes 30-60 seconds","html":"<p>$ sudo make install          # puts ntp* in /usr/local/bin/ntp*, takes 30-60 seconds</p>"},{"id":"text-145","type":"text","heading":"","plain_text":"It is not entirely clear to me whether step 9 above is\nrequired.  It does not appear to be when updating from 4.2.7p304 to\n4.2.7p321, for example. je suis ne pas using step 9.\n  Once you have a new set of NTP\nbinaries, you first need to stop NTP, use super-user mode to copy the binaries\nto their final directory, and then restart NTP.  Once restarted, a simple\ncheck that it&#39;s working correctly.  I recommend these steps,\nalthough there are alternatives.  See the note below about step 2.","html":"<p>It is not entirely clear to me whether step 9 above is\nrequired.  It does not appear to be when updating from 4.2.7p304 to\n4.2.7p321, for example. je suis ne pas using step 9.\n  Once you have a new set of NTP\nbinaries, you first need to stop NTP, use super-user mode to copy the binaries\nto their final directory, and then restart NTP.  Once restarted, a simple\ncheck that it&#039;s working correctly.  I recommend these steps,\nalthough there are alternatives.  See the note below about step 2.</p>"},{"id":"text-146","type":"text","heading":"","plain_text":"$ sudo /etc/init.d/ntp stop","html":"<p>$ sudo /etc/init.d/ntp stop</p>"},{"id":"text-147","type":"text","heading":"","plain_text":"$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/","html":"<p>$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/</p>"},{"id":"text-148","type":"text","heading":"","plain_text":"$ sudo /etc/init.d/ntp start","html":"<p>$ sudo /etc/init.d/ntp start</p>"},{"id":"text-149","type":"text","heading":"","plain_text":"$ ntpq -crv -pn\t\t# optional step to check for version and basic function","html":"<p>$ ntpq -crv -pn\t\t# optional step to check for version and basic function</p>"},{"id":"text-150","type":"text","heading":"","plain_text":"Remarque:  on some more recent versions of Raspbian steps 1\nand 3 may require:","html":"<p>Remarque:  on some more recent versions of Raspbian steps 1\nand 3 may require:</p>"},{"id":"text-151","type":"text","heading":"","plain_text":"$ sudo service ntp stop","html":"<p>$ sudo service ntp stop</p>"},{"id":"text-152","type":"text","heading":"","plain_text":"$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/","html":"<p>$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/</p>"},{"id":"text-153","type":"text","heading":"","plain_text":"$ sudo service ntp start","html":"<p>$ sudo service ntp start</p>"},{"id":"text-154","type":"text","heading":"","plain_text":"Remarque: that on some systems the binary ntp* files will\nbe written to a mixture of /usr/local/bin et /usr/local/sbin,\naccording to the paths defined in sntp/loc.  I have been told that the\n&quot;sbin&quot; is for system files (i.e. ones not usually run by users such as\nservers and daemons, and the &quot;bin&quot; is for files usually executed by\nusers).  For Debian, for just the ntp* files, this is:","html":"<p>Remarque: that on some systems the binary ntp* files will\nbe written to a mixture of /usr/local/bin et /usr/local/sbin,\naccording to the paths defined in sntp/loc.  I have been told that the\n&quot;sbin&quot; is for system files (i.e. ones not usually run by users such as\nservers and daemons, and the &quot;bin&quot; is for files usually executed by\nusers).  For Debian, for just the ntp* files, this is:</p>"},{"id":"text-155","type":"text","heading":"","plain_text":"# Debian installations and man page suffixes\nMDOC\nntp-keygen,sbin,8\nntp-wait,sbin,8\nntpd,sbin,8\nntpdate,sbin,8\nntpdc,bin,1\nntpdsim,sbin,8\nntpq,bin,1\nntpsnmpd,sbin,8\nntptime,sbin,8\nntptrace,bin,1","html":"<p># Debian installations and man page suffixes\nMDOC\nntp-keygen,sbin,8\nntp-wait,sbin,8\nntpd,sbin,8\nntpdate,sbin,8\nntpdc,bin,1\nntpdsim,sbin,8\nntpq,bin,1\nntpsnmpd,sbin,8\nntptime,sbin,8\nntptrace,bin,1</p>"},{"id":"text-156","type":"text","heading":"","plain_text":"so you may need to check both directories to get the most\nrecent files.  Check with &quot;ls -l&quot; which shows the file date.\n \nA confession: I did alter one system to\npoint the NTP start-up to the directory I preferred, rather than leaving it\npointing to an old version.  I suspect that in my own personal use, only\nthe ntpd and ntpq executables matter.  \n \nUpdating multiple Raspberry Pi cards\n \nIf, like me, you have multiple Raspberry Pi cards, you will\nnot want to waste almost an hour compiling and updating NTP on each card. \nFortunately, my experience so far using the development versions of NTP\n(4.2.7p&#8230;) suggests that simply copying the binaries from one Pi to another\nworks as expected.  This may be luck, or it may be because the OS\ndifferences between Linux/3.2.27+ and Linux/3.6.11+ are not that great. Si\nyou have access to an FTP server (I used a Windows PC running IIS) you may be\nable to use commands such as those below to save a compiled version from one Pi\nand load it onto another.  You may need to use  sudo\napt-get install ftp  if FTP is not already available. Step 5 is required once. Étape\n7 is required for each new version you save. \nReplace &quot;368&quot; in the steps below with the version number you have just\ncompiled.\n \nTo save the newly compiled versions:","html":"<p>so you may need to check both directories to get the most\nrecent files.  Check with &quot;ls -l&quot; which shows the file date.\n \nA confession: I did alter one system to\npoint the NTP start-up to the directory I preferred, rather than leaving it\npointing to an old version.  I suspect that in my own personal use, only\nthe ntpd and ntpq executables matter.  \n \nUpdating multiple Raspberry Pi cards\n \nIf, like me, you have multiple Raspberry Pi cards, you will\nnot want to waste almost an hour compiling and updating NTP on each card. \nFortunately, my experience so far using the development versions of NTP\n(4.2.7p&#8230;) suggests that simply copying the binaries from one Pi to another\nworks as expected.  This may be luck, or it may be because the OS\ndifferences between Linux/3.2.27+ and Linux/3.6.11+ are not that great. Si\nyou have access to an FTP server (I used a Windows PC running IIS) you may be\nable to use commands such as those below to save a compiled version from one Pi\nand load it onto another.  You may need to use  sudo\napt-get install ftp  if FTP is not already available. Step 5 is required once. Étape\n7 is required for each new version you save. \nReplace &quot;368&quot; in the steps below with the version number you have just\ncompiled.\n \nTo save the newly compiled versions:</p>"},{"id":"text-157","type":"text","heading":"","plain_text":"$ ftp","html":"<p>$ ftp</p>"},{"id":"text-158","type":"text","heading":"","plain_text":"(Login as Anonymous or known user)","html":"<p>(Login as Anonymous or known user)</p>"},{"id":"text-159","type":"text","heading":"","plain_text":"bin  (forces binary mode)","html":"<p>bin  (forces binary mode)</p>"},{"id":"text-160","type":"text","heading":"","plain_text":"mkdir RaspberryPi  (step only needed once)","html":"<p>mkdir RaspberryPi  (step only needed once)</p>"},{"id":"text-161","type":"text","heading":"","plain_text":"cd RaspberryPi","html":"<p>cd RaspberryPi</p>"},{"id":"text-162","type":"text","heading":"","plain_text":"mkdir 397-safe  (step needed once per new version)","html":"<p>mkdir 397-safe  (step needed once per new version)</p>"},{"id":"text-163","type":"text","heading":"","plain_text":"cd 397-safe","html":"<p>cd 397-safe</p>"},{"id":"text-164","type":"text","heading":"","plain_text":"prompt   (may disable prompting for steps 10 and 13)","html":"<p>prompt   (may disable prompting for steps 10 and 13)</p>"},{"id":"text-165","type":"text","heading":"","plain_text":"lcd /usr/local/bin","html":"<p>lcd /usr/local/bin</p>"},{"id":"text-166","type":"text","heading":"","plain_text":"mput ntp*","html":"<p>mput ntp*</p>"},{"id":"text-167","type":"text","heading":"","plain_text":"(respond Y to the prompt for all the files)","html":"<p>(respond Y to the prompt for all the files)</p>"},{"id":"text-168","type":"text","heading":"","plain_text":"lcd /usr/local/sbin","html":"<p>lcd /usr/local/sbin</p>"},{"id":"text-169","type":"text","heading":"","plain_text":"mput ntp*","html":"<p>mput ntp*</p>"},{"id":"text-170","type":"text","heading":"","plain_text":"ls -l  (to check that all eight files are there and have the date you expect)","html":"<p>ls -l  (to check that all eight files are there and have the date you expect)</p>"},{"id":"text-171","type":"text","heading":"","plain_text":"quitter","html":"<p>quitter</p>"},{"id":"text-172","type":"text","heading":"","plain_text":"To load a new version onto another Raspberry Pi:","html":"<p>To load a new version onto another Raspberry Pi:</p>"},{"id":"text-173","type":"text","heading":"","plain_text":"$ cd /usr/local/bin","html":"<p>$ cd /usr/local/bin</p>"},{"id":"text-174","type":"text","heading":"","plain_text":"$ sudo ftp \t# sudo allows writing to system directories","html":"<p>$ sudo ftp \t# sudo allows writing to system directories</p>"},{"id":"text-175","type":"text","heading":"","plain_text":"(Login as Anonymous or known user)","html":"<p>(Login as Anonymous or known user)</p>"},{"id":"text-176","type":"text","heading":"","plain_text":"bin  (forces binary mode)","html":"<p>bin  (forces binary mode)</p>"},{"id":"text-177","type":"text","heading":"","plain_text":"cd RaspberryPi/397-safe","html":"<p>cd RaspberryPi/397-safe</p>"},{"id":"text-178","type":"text","heading":"","plain_text":"ls -l  (to check that the files there are correct and have the date you expect)","html":"<p>ls -l  (to check that the files there are correct and have the date you expect)</p>"},{"id":"text-179","type":"text","heading":"","plain_text":"mget ntp*","html":"<p>mget ntp*</p>"},{"id":"text-180","type":"text","heading":"","plain_text":"(respond Y to the prompt for all the files)","html":"<p>(respond Y to the prompt for all the files)</p>"},{"id":"text-181","type":"text","heading":"","plain_text":"quitter","html":"<p>quitter</p>"},{"id":"text-182","type":"text","heading":"","plain_text":"$ sudo /etc/init.d/ntp stop","html":"<p>$ sudo /etc/init.d/ntp stop</p>"},{"id":"text-183","type":"text","heading":"","plain_text":"$ sudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/","html":"<p>$ sudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/</p>"},{"id":"text-184","type":"text","heading":"","plain_text":"$ sudo /etc/init.d/ntp start","html":"<p>$ sudo /etc/init.d/ntp start</p>"},{"id":"text-185","type":"text","heading":"","plain_text":"$ ntpq -crv -pn  # to check the NTP version, and that it is still working","html":"<p>$ ntpq -crv -pn  # to check the NTP version, and that it is still working</p>"},{"id":"text-186","type":"text","heading":"","plain_text":"See the discussion above about the combined commands in\n    step 11.  An alternative to steps 1 to 9 might be, if you are brave:","html":"<p>See the discussion above about the combined commands in\n    step 11.  An alternative to steps 1 to 9 might be, if you are brave:</p>"},{"id":"text-187","type":"text","heading":"","plain_text":"sudo wget -P /usr/local/bin -N ftp:///RaspberryPi/397-safe/ntp*","html":"<p>sudo wget -P /usr/local/bin -N ftp:///RaspberryPi/397-safe/ntp*</p>"},{"id":"text-188","type":"text","heading":"","plain_text":"Making updating other cards even easier &#8211; use a fixed directory name:\nAfter storing the working version on your FTP server, copy it\non the FTP server to a directory with a fixed name such as:","html":"<p>Making updating other cards even easier &#8211; use a fixed directory name:\nAfter storing the working version on your FTP server, copy it\non the FTP server to a directory with a fixed name such as:</p>"},{"id":"text-189","type":"text","heading":"","plain_text":"/RaspberryPi/ntp/","html":"<p>/RaspberryPi/ntp/</p>"},{"id":"text-190","type":"text","heading":"","plain_text":"You can then write a script for updating other Raspberry Pi\ncards something like this:","html":"<p>You can then write a script for updating other Raspberry Pi\ncards something like this:</p>"},{"id":"text-191","type":"text","heading":"","plain_text":"$ nano update-ntp","html":"<p>$ nano update-ntp</p>"},{"id":"text-192","type":"text","heading":"","plain_text":"with the following contents:","html":"<p>with the following contents:</p>"},{"id":"text-193","type":"text","heading":"","plain_text":"sudo wget --no-passive-ftp -P /usr/local/bin -N ftp:///RaspberryPi/ntp/ntp*\nsudo /etc/init.d/ntp stop\nsleep 1\nsudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/\nsleep 1\nsudo /etc/init.d/ntp start\nsleep 4\nntpq -crv -pn","html":"<p>sudo wget --no-passive-ftp -P /usr/local/bin -N ftp:///RaspberryPi/ntp/ntp*\nsudo /etc/init.d/ntp stop\nsleep 1\nsudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/\nsleep 1\nsudo /etc/init.d/ntp start\nsleep 4\nntpq -crv -pn</p>"},{"id":"text-194","type":"text","heading":"","plain_text":"remplaçant  with the name or IP address\n    of your own FTP server.  With a Microsoft FTP server, I found that I\n    needed to add &#8211;no-passive-ftp  after the wget command, as shown above.  Remember to make the script executable:","html":"<p>remplaçant  with the name or IP address\n    of your own FTP server.  With a Microsoft FTP server, I found that I\n    needed to add &#8211;no-passive-ftp  after the wget command, as shown above.  Remember to make the script executable:</p>"},{"id":"text-195","type":"text","heading":"","plain_text":"$ chmod +x update-ntp","html":"<p>$ chmod +x update-ntp</p>"},{"id":"text-196","type":"text","heading":"","plain_text":"and run it from your local directory:","html":"<p>and run it from your local directory:</p>"},{"id":"text-197","type":"text","heading":"","plain_text":"$ ./update-ntp","html":"<p>$ ./update-ntp</p>"},{"id":"text-198","type":"text","heading":"","plain_text":"You can tell another Raspberry Pi to run the update by using the SSH command\nthus:","html":"<p>You can tell another Raspberry Pi to run the update by using the SSH command\nthus:</p>"},{"id":"text-199","type":"text","heading":"","plain_text":"$ ssh pi@the-other-raspi &quot;./update-ntp&quot;","html":"<p>$ ssh pi@the-other-raspi &quot;./update-ntp&quot;</p>"},{"id":"text-200","type":"text","heading":"","plain_text":"You will need to enter the password for the user &quot;pi&quot;, although\nthis can be avoided (I am told) by using public key based authentication, if that fits with your security model. \nOnce you have managed to copy your key\tto the second machine (man ssh-copy-id) you need no password either. \nI&#39;m afraid I don&#39;t know how to do that, though.  \nTo get NTP to use the PPS data which is now available to it,\nthe timestamps of the transitions on the GPIO pin, we need to add another\nrefclock (server) line to the ntp.conf file.  The server we use is a type\n22 server called the ATOM refclock, and we can give it a reference ID of\n&quot;PPS&quot;.  I also changed the reference ID of the serial data to\n&quot;GPS&quot;.  Note that with a type 22 clock you doit have one\nother server marked as &quot;prefer&quot;.","html":"<p>You will need to enter the password for the user &quot;pi&quot;, although\nthis can be avoided (I am told) by using public key based authentication, if that fits with your security model. \nOnce you have managed to copy your key\tto the second machine (man ssh-copy-id) you need no password either. \nI&#039;m afraid I don&#039;t know how to do that, though.  \nTo get NTP to use the PPS data which is now available to it,\nthe timestamps of the transitions on the GPIO pin, we need to add another\nrefclock (server) line to the ntp.conf file.  The server we use is a type\n22 server called the ATOM refclock, and we can give it a reference ID of\n&quot;PPS&quot;.  I also changed the reference ID of the serial data to\n&quot;GPS&quot;.  Note that with a type 22 clock you doit have one\nother server marked as &quot;prefer&quot;.</p>"},{"id":"text-201","type":"text","heading":"","plain_text":"# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help","html":"<p># /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help</p>"},{"id":"text-202","type":"text","heading":"","plain_text":"# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift","html":"<p># Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift</p>"},{"id":"text-203","type":"text","heading":"","plain_text":"# coarse time ref-clock, not really needed here as we have LAN &amp; WAN servers\nserver 127.127.28.0  minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid GPS  stratum 15","html":"<p># coarse time ref-clock, not really needed here as we have LAN &amp; WAN servers\nserver 127.127.28.0  minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid GPS  stratum 15</p>"},{"id":"text-204","type":"text","heading":"","plain_text":"# Kernel-mode PPS ref-clock for the precise seconds\nserver 127.127.22.0 minpoll 4 maxpoll 4\nfudge 127.127.22.0  refid PPS","html":"<p># Kernel-mode PPS ref-clock for the precise seconds\nserver 127.127.22.0 minpoll 4 maxpoll 4\nfudge 127.127.22.0  refid PPS</p>"},{"id":"text-205","type":"text","heading":"","plain_text":"# LAN servers\nserver 192.168.0.3  minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2  minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7  minpoll 5 maxpoll 5 iburst","html":"<p># LAN servers\nserver 192.168.0.3  minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2  minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7  minpoll 5 maxpoll 5 iburst</p>"},{"id":"text-206","type":"text","heading":"","plain_text":"# WAN servers, &quot;pool&quot; will expand the number of servers to suit\npool uk.pool.ntp.org  minpoll 10  iburst","html":"<p># WAN servers, &quot;pool&quot; will expand the number of servers to suit\npool uk.pool.ntp.org  minpoll 10  iburst</p>"},{"id":"text-207","type":"text","heading":"","plain_text":"Remarque: when using the ATOM (type 22) refclock, one of the other servers\ndoit be marked as prefer.  This is because the type 22 clock only\nsupplies the timing dans the second, and another server is required to\ndetermine the courant second.\n \nChecking that NTP is seeing the PPS data\nWhen you have restarted NTP with the new binaries, you\n    should see a new line in the output from an ntpq -p command, and the word\n    &quot;kern&quot; should be present in the output of an ntpq -c rv command:","html":"<p>Remarque: when using the ATOM (type 22) refclock, one of the other servers\ndoit be marked as prefer.  This is because the type 22 clock only\nsupplies the timing dans the second, and another server is required to\ndetermine the courant second.\n \nChecking that NTP is seeing the PPS data\nWhen you have restarted NTP with the new binaries, you\n    should see a new line in the output from an ntpq -p command, and the word\n    &quot;kern&quot; should be present in the output of an ntpq -c rv command:</p>"},{"id":"text-208","type":"text","heading":"","plain_text":"C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPS.           15 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            0 l   12   16  377    0.000    0.002   0.002\n*pixie           .PPS.            1 u   18   32  377    0.498   -0.030   0.025\n+feenix          .PPS.            1 u    5   32  377    0.619   -0.078   0.035\n+stamsund        .PPS.            1 u   29   32  377    0.614   -0.017   0.051\n uk.pool.ntp.org .POOL.          16 p    - 1024    0    0.000    0.000   0.002\n-ntp.uk.syrahost 192.93.2.20      2 u  405 1024  377   30.031    8.487   0.274\n-ntp2.exa-networ 195.66.241.10    2 u  217 1024  377   26.263    3.167   1.277\n-resntp-a-vip.lo 182.7.208.171    3 u   49 1024  377   17.854    2.828   1.460\n-time.shf.uk.as4 91.208.177.20    3 u   75 1024  377   18.825    0.680   1.974","html":"<p>C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPS.           15 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            0 l   12   16  377    0.000    0.002   0.002\n*pixie           .PPS.            1 u   18   32  377    0.498   -0.030   0.025\n+feenix          .PPS.            1 u    5   32  377    0.619   -0.078   0.035\n+stamsund        .PPS.            1 u   29   32  377    0.614   -0.017   0.051\n uk.pool.ntp.org .POOL.          16 p    - 1024    0    0.000    0.000   0.002\n-ntp.uk.syrahost 192.93.2.20      2 u  405 1024  377   30.031    8.487   0.274\n-ntp2.exa-networ 195.66.241.10    2 u  217 1024  377   26.263    3.167   1.277\n-resntp-a-vip.lo 182.7.208.171    3 u   49 1024  377   17.854    2.828   1.460\n-time.shf.uk.as4 91.208.177.20    3 u   75 1024  377   18.825    0.680   1.974</p>"},{"id":"text-209","type":"text","heading":"","plain_text":"C:&gt;ntpq -c rv raspi\nassocid=0 status=011d leap_none, sync_pps, 1 event, kern,\nversion=&quot;ntpd 4.2.7p314@1.2483 Mon Oct 29 15:30:42 UTC 2012 (3)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.2.27-pps-g965b922-dirty&quot;, leap=00,\nstratum=1, precision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d439fe8b.16dba50f  Tue, Oct 30 2012  7:21:47.089,\nclock=d439fe97.4d7ac44d  Tue, Oct 30 2012  7:21:59.302, peer=63905, tc=4,\nmintc=3, offset=0.001547, frequency=-45.081, sys_jitter=0.001907,\nclk_jitter=0.000, clk_wander=0.000","html":"<p>C:&gt;ntpq -c rv raspi\nassocid=0 status=011d leap_none, sync_pps, 1 event, kern,\nversion=&quot;ntpd 4.2.7p314@1.2483 Mon Oct 29 15:30:42 UTC 2012 (3)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.2.27-pps-g965b922-dirty&quot;, leap=00,\nstratum=1, precision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d439fe8b.16dba50f  Tue, Oct 30 2012  7:21:47.089,\nclock=d439fe97.4d7ac44d  Tue, Oct 30 2012  7:21:59.302, peer=63905, tc=4,\nmintc=3, offset=0.001547, frequency=-45.081, sys_jitter=0.001907,\nclk_jitter=0.000, clk_wander=0.000</p>"},{"id":"text-210","type":"text","heading":"","plain_text":"You may find that by adding the directive &quot;nohz=off&quot; to the end of\nyour /boot/cmdline.txt that jitter is decreased by up to 50%.  Try it and\nsee for yourself.  Some systems it helps, and others it does not,\ndepending, I suspect, on which OS and firmware versions you have. Comme\nguide, you may get to average jitter in the range:","html":"<p>You may find that by adding the directive &quot;nohz=off&quot; to the end of\nyour /boot/cmdline.txt that jitter is decreased by up to 50%.  Try it and\nsee for yourself.  Some systems it helps, and others it does not,\ndepending, I suspect, on which OS and firmware versions you have. Comme\nguide, you may get to average jitter in the range:</p>"},{"id":"text-211","type":"text","heading":"","plain_text":"Modèle\nAveraged jitter","html":"<p>Modèle\nAveraged jitter</p>"},{"id":"text-212","type":"text","heading":"","plain_text":"Raspberry Pi B \n3.9 us, but may be better","html":"<p>Raspberry Pi B \n3.9 us, but may be better</p>"},{"id":"text-213","type":"text","heading":"","plain_text":"Raspberry Pi B+\n4.2 µs","html":"<p>Raspberry Pi B+\n4.2 µs</p>"},{"id":"text-214","type":"text","heading":"","plain_text":"Raspberry Pi 2 B\n2 µs","html":"<p>Raspberry Pi 2 B\n2 µs</p>"},{"id":"text-215","type":"text","heading":"","plain_text":"Raspberry Pi 3 B    \n1 µs","html":"<p>Raspberry Pi 3 B    \n1 µs</p>"},{"id":"text-216","type":"text","heading":"","plain_text":"Thanks to the folks here\nfor their help. \nWith the replaced version of NTP we lose the automatic running\nde ntpd at startup which was present in the\noriginal install.  We also need to start gpsd\nso that the coarse time is available to NTP.","html":"<p>Thanks to the folks here\nfor their help. \nWith the replaced version of NTP we lose the automatic running\nde ntpd at startup which was present in the\noriginal install.  We also need to start gpsd\nso that the coarse time is available to NTP.</p>"},{"id":"text-217","type":"text","heading":"","plain_text":"# To configure gpsd to auto-start, try: \n$ sudo dpkg-reconfigure gpsd","html":"<p># To configure gpsd to auto-start, try: \n$ sudo dpkg-reconfigure gpsd</p>"},{"id":"text-218","type":"text","heading":"","plain_text":"This seems to work as expected, and allows the gpsd\nto automatically start up.  To check that, I rebooted, and logged in, and\ncould run cgps -s right away.  However, NTP\nwon&#39;t see the time from the GPS until après    cgps -s is run. \nThis is fixed as follows (thanks to A Carver):  by default, gpsd\nwon&#39;t connect to the GPS receiver until there is client software such as cgps\nwith requires it.  This allows for some power-saving in the GPS\nreceiver.  To circumvent this, the gpsd needs to be started with the\n&quot;-n&quot; option.  These options are set in the directory\n/etc/default, so you need to edit the file /etc/default/gpsd to change the\nline: GPSD_OPTIONS=&quot;&quot; to GPSD_OPTIONS=&quot;-n&quot;.  Method A\nis to do this through dpkg-reconfigure gpsd, method B is to edit the file\ndirectly.","html":"<p>This seems to work as expected, and allows the gpsd\nto automatically start up.  To check that, I rebooted, and logged in, and\ncould run cgps -s right away.  However, NTP\nwon&#039;t see the time from the GPS until après    cgps -s is run. \nThis is fixed as follows (thanks to A Carver):  by default, gpsd\nwon&#039;t connect to the GPS receiver until there is client software such as cgps\nwith requires it.  This allows for some power-saving in the GPS\nreceiver.  To circumvent this, the gpsd needs to be started with the\n&quot;-n&quot; option.  These options are set in the directory\n/etc/default, so you need to edit the file /etc/default/gpsd to change the\nline: GPSD_OPTIONS=&quot;&quot; to GPSD_OPTIONS=&quot;-n&quot;.  Method A\nis to do this through dpkg-reconfigure gpsd, method B is to edit the file\ndirectly.</p>"},{"id":"text-219","type":"text","heading":"","plain_text":"$ sudo nano /etc/default/gpsd","html":"<p>$ sudo nano /etc/default/gpsd</p>"},{"id":"text-220","type":"text","heading":"","plain_text":"NTP will auto-start after a reboot with either Method A or\nMethod B above.\nThere is a cut-out area in the ModMyPi case which will allow\nconnections to the GPIO connector such as ribbon cable which you can easily\nbreak out and file down to a neat edge.  The sharp-eyed amongst you will\nnotice that three wires are shown &#8211; this is because the surplus header had three\nwires connected, but I only used two &#8211; ground (blue) and GPIO 24 (red). \nThe black lead would be GPIO 23 but it is unused and not connected.","html":"<p>NTP will auto-start after a reboot with either Method A or\nMethod B above.\nThere is a cut-out area in the ModMyPi case which will allow\nconnections to the GPIO connector such as ribbon cable which you can easily\nbreak out and file down to a neat edge.  The sharp-eyed amongst you will\nnotice that three wires are shown &#8211; this is because the surplus header had three\nwires connected, but I only used two &#8211; ground (blue) and GPIO 24 (red). \nThe black lead would be GPIO 23 but it is unused and not connected.</p>"},{"id":"text-221","type":"text","heading":"","plain_text":"GPS Receiver Issues\nThere are two issues which are now becoming apparent with the\nparticular GPS receiver I have and the Raspberry Pi.","html":"<p>GPS Receiver Issues\nThere are two issues which are now becoming apparent with the\nparticular GPS receiver I have and the Raspberry Pi.</p>"},{"id":"text-222","type":"text","heading":"","plain_text":"It seems that after a power-down reboot, the GPS receiver\n    isn&#39;t correctly detected, and need a disconnect/reconnect of its USB\n    connector before it is seen by gpsd.\n    The pulse-per-second signal still comes through,\n    though, so the precise seconds are working, but the coarse seconds are\n    ne pas. This is clearly unacceptable as you would not get the correct\n    time unless you also had an Internet NTP server available.It is possible that a power-up followed by a reboot mai resolve this\n    problème. \nDuring the booting of the GPS receiver (if it does not have\n    a battery) it mai output GPS time (which is 16 seconds adrift from\n    UTC at the time of writing). Bien que gpsd est\n    supposed to catch this situation, it could mean that the Raspberry Pi will\n    not know what the correct time is for some time after booting, and even then\n    it could take 10-20 minutes to be sure that the correct time was actually\n    being sent by the GPS and for NTP to make the 16 seconds step correction\n    required.","html":"<p>It seems that after a power-down reboot, the GPS receiver\n    isn&#039;t correctly detected, and need a disconnect/reconnect of its USB\n    connector before it is seen by gpsd.\n    The pulse-per-second signal still comes through,\n    though, so the precise seconds are working, but the coarse seconds are\n    ne pas. This is clearly unacceptable as you would not get the correct\n    time unless you also had an Internet NTP server available.It is possible that a power-up followed by a reboot mai resolve this\n    problème. \nDuring the booting of the GPS receiver (if it does not have\n    a battery) it mai output GPS time (which is 16 seconds adrift from\n    UTC at the time of writing). Bien que gpsd est\n    supposed to catch this situation, it could mean that the Raspberry Pi will\n    not know what the correct time is for some time after booting, and even then\n    it could take 10-20 minutes to be sure that the correct time was actually\n    being sent by the GPS and for NTP to make the 16 seconds step correction\n    required.</p>"},{"id":"text-223","type":"text","heading":"","plain_text":"If your receiver has this 16-second ambiguity, be sure you have a source\nof coarse time available such as an Internet NTP server. \nBecause of the problem (1) above, I bought a serial GPS\nreceiver from China.  By following the instructions here\nI was able to make the serial port available on the Raspberry Pi independent of\nits use as a login or boot-up terminal port.","html":"<p>If your receiver has this 16-second ambiguity, be sure you have a source\nof coarse time available such as an Internet NTP server. \nBecause of the problem (1) above, I bought a serial GPS\nreceiver from China.  By following the instructions here\nI was able to make the serial port available on the Raspberry Pi independent of\nits use as a login or boot-up terminal port.</p>"},{"id":"text-224","type":"text","heading":"","plain_text":"(make a safety coppy of the file we are about to edit)\n$ sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt","html":"<p>(make a safety coppy of the file we are about to edit)\n$ sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt</p>"},{"id":"text-225","type":"text","heading":"","plain_text":"$ sudo nano /boot/cmdline.txt\n(remove the parameter including the string &quot;ttyAMA0&quot;:\nconsole=ttyAMA0,115200\nIn Raspbian Wheezy there are two parameters:\n console=ttyAMA0,115200 kgdboc=ttyAMA0,115200)","html":"<p>$ sudo nano /boot/cmdline.txt\n(remove the parameter including the string &quot;ttyAMA0&quot;:\nconsole=ttyAMA0,115200\nIn Raspbian Wheezy there are two parameters:\n console=ttyAMA0,115200 kgdboc=ttyAMA0,115200)</p>"},{"id":"text-226","type":"text","heading":"","plain_text":"$ sudo nano /etc/inittab\n(Comment out the line like &quot;2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100&quot;\n by putting a hash (#) at the start of the line.  Note that the line was not \n 2:23 on my version of Linux, so be sure to look for the actual line with ttyAMA0.\n It was the last line of the file, as it happens).","html":"<p>$ sudo nano /etc/inittab\n(Comment out the line like &quot;2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100&quot;\n by putting a hash (#) at the start of the line.  Note that the line was not \n 2:23 on my version of Linux, so be sure to look for the actual line with ttyAMA0.\n It was the last line of the file, as it happens).</p>"},{"id":"text-227","type":"text","heading":"","plain_text":"(You need to reboot to bring these changes into effect)\n$ sudo reboot","html":"<p>(You need to reboot to bring these changes into effect)\n$ sudo reboot</p>"},{"id":"text-228","type":"text","heading":"","plain_text":"(Minicom then works - to exit minicom, Ctrl-A, release, Q or X.)\n$ minicom -b 9600 -o -D /dev/ttyAMA0","html":"<p>(Minicom then works - to exit minicom, Ctrl-A, release, Q or X.)\n$ minicom -b 9600 -o -D /dev/ttyAMA0</p>"},{"id":"text-229","type":"text","heading":"","plain_text":"(If minicom gives command not found, you need to install it:)\n$ sudo apt-get install minicom","html":"<p>(If minicom gives command not found, you need to install it:)\n$ sudo apt-get install minicom</p>"},{"id":"text-230","type":"text","heading":"","plain_text":"Note that the Raspberry Pi requires 3.3 V signals on the serial\npins &#8211; ne pas  RS-232 level which will damage the device. Toi\nshould now be able to configure gpsd to talk to ttyAMA0 (using sudo\ndpkg-reconfigure gpsd), and the cgps -s\ncommand should work as above. \n3.3 V GPS receiver\nI found a 3.3 V I/O very compact GPS receiver board here\ndescribed as: &quot;GPS Receiver u-blox NEO-6M Module with Antenna USART TTL &amp; IIC Interface&quot;. \nIt includes the patch antenna and cost less than £20.  Such modules seem to be a\nstandard for flight control for model aircraft and similar applications.  It does require one minor modification, which is to solder a wire\nto pin 3 of the NEO-6M module to extract the PPS signal.  This unit\nwas later replaced by a Adafruit\n    Ultimate GPS Breakout which requires no additional soldering, and has a\nbuilt-in antenna.","html":"<p>Note that the Raspberry Pi requires 3.3 V signals on the serial\npins &#8211; ne pas  RS-232 level which will damage the device. Toi\nshould now be able to configure gpsd to talk to ttyAMA0 (using sudo\ndpkg-reconfigure gpsd), and the cgps -s\ncommand should work as above. \n3.3 V GPS receiver\nI found a 3.3 V I/O very compact GPS receiver board here\ndescribed as: &quot;GPS Receiver u-blox NEO-6M Module with Antenna USART TTL &amp; IIC Interface&quot;. \nIt includes the patch antenna and cost less than £20.  Such modules seem to be a\nstandard for flight control for model aircraft and similar applications.  It does require one minor modification, which is to solder a wire\nto pin 3 of the NEO-6M module to extract the PPS signal.  This unit\nwas later replaced by a Adafruit\n    Ultimate GPS Breakout which requires no additional soldering, and has a\nbuilt-in antenna.</p>"},{"id":"text-231","type":"text","heading":"","plain_text":"The U-blox board from China and supplied antenna under test.","html":"<p>The U-blox board from China and supplied antenna under test.</p>"},{"id":"text-232","type":"text","heading":"","plain_text":"The Adafruit GPS mated to the Raspberry Pi.  Only\n      le GPS Tx =&gt; Pi Rx lead (yellow) is connected, and thesecond ground lead (blue) isn&#39;t connected either.","html":"<p>The Adafruit GPS mated to the Raspberry Pi.  Only\n      le GPS Tx =&gt; Pi Rx lead (yellow) is connected, and thesecond ground lead (blue) isn&#039;t connected either.</p>"},{"id":"text-233","type":"text","heading":"","plain_text":"Raspberry Pi #2 with its Adafruit GPS. Red/brown are+5V/0, orange the GPS Tx, and yellow the PPS.","html":"<p>Raspberry Pi #2 with its Adafruit GPS. Red/brown are+5V/0, orange the GPS Tx, and yellow the PPS.</p>"},{"id":"text-234","type":"text","heading":"","plain_text":"One the left is the receiver undergoing initial tests. Vous pouvez\nsee the patch antenna on the left raised on a block of foam so that it can\n&quot;see&quot; past the clutter of the receiver, the receiver itself on the blue PCB mounted vertically in the\nbreadboard, and you might just see the orange-pink wire at the top-right corner\nof the receiver which has been carefully soldered to pin 3 of the NEO-6M to get\nthe PPS signal.  The wire is anchored in the top-right mounting hole for\nstrain relief.  You don&#39;t need surface-mount tools to make this connection,\nmais toi faire need a very fine soldering tip and considerable care! \nLike the TX/RX signals from this module, the PPS signal is at 3.3 V level and\ntherefore ideal for feeding the Raspberry Pi.  The board will accept either\n3.3 V or 5 V power while retaining 3.3V I/O levels, and I&#39;m using 5 V to power the\nboard to reduce the load on the 3.3 V regulator on the Raspberry Pi board. \nThe U-blox device is specified at less than 50 mA supply current.\nFor the final installation, the Adafruit module was used as\nits single package was more convenient.  Not all the leads are connected as\nthere is only one place to connect ground on the module (so the blue is left\nopen), and for simplicity the green Pi Tx =&gt; GPS Rx was not connected. \nJudge the size of the Raspberry Pi by the Ethernet connector on the left!\nThe next step was to set up the Raspberry Pi to talk to the new module, use serial\nGPS data via  gpsd for the coarse time,\nand to use its PPS\nline to provide precise time just as described above.  To preset the serial line\nspeed to 9600 at Linux start-up, edit the file  /boot/config.txt\nto include the line:\n        init_uart_baud=9600\nas it says in: http://elinux.org/RPi_config.txt. \nYou can check using the command:","html":"<p>One the left is the receiver undergoing initial tests. Vous pouvez\nsee the patch antenna on the left raised on a block of foam so that it can\n&quot;see&quot; past the clutter of the receiver, the receiver itself on the blue PCB mounted vertically in the\nbreadboard, and you might just see the orange-pink wire at the top-right corner\nof the receiver which has been carefully soldered to pin 3 of the NEO-6M to get\nthe PPS signal.  The wire is anchored in the top-right mounting hole for\nstrain relief.  You don&#039;t need surface-mount tools to make this connection,\nmais toi faire need a very fine soldering tip and considerable care! \nLike the TX/RX signals from this module, the PPS signal is at 3.3 V level and\ntherefore ideal for feeding the Raspberry Pi.  The board will accept either\n3.3 V or 5 V power while retaining 3.3V I/O levels, and I&#039;m using 5 V to power the\nboard to reduce the load on the 3.3 V regulator on the Raspberry Pi board. \nThe U-blox device is specified at less than 50 mA supply current.\nFor the final installation, the Adafruit module was used as\nits single package was more convenient.  Not all the leads are connected as\nthere is only one place to connect ground on the module (so the blue is left\nopen), and for simplicity the green Pi Tx =&gt; GPS Rx was not connected. \nJudge the size of the Raspberry Pi by the Ethernet connector on the left!\nThe next step was to set up the Raspberry Pi to talk to the new module, use serial\nGPS data via  gpsd for the coarse time,\nand to use its PPS\nline to provide precise time just as described above.  To preset the serial line\nspeed to 9600 at Linux start-up, edit the file  /boot/config.txt\nto include the line:\n        init_uart_baud=9600\nas it says in: http://elinux.org/RPi_config.txt. \nYou can check using the command:</p>"},{"id":"text-235","type":"text","heading":"","plain_text":"stty -F /dev/ttyAMA0","html":"<p>stty -F /dev/ttyAMA0</p>"},{"id":"text-236","type":"text","heading":"","plain_text":"I found that the speed was already set to 9600 on a recent\nRaspberry Pi installed from the NOOBS software.  I gather that on a typical Linux system you might use the\ncommand: stty -F /dev/ttyAMA0 9600. \nRaspberry Pi GPIO multi-pin connector\nThis time , not only were PPS and ground connections required,\nbut also the serial port and the +5 V line, so I used a piece of 6-way ribbon cable to connect between\nthe Raspberry Pi and my serial GPS device.  I happened to have a 10-pin\nheader which fitted the GPIO connector, so these are the connections I chose to\nmake:","html":"<p>I found that the speed was already set to 9600 on a recent\nRaspberry Pi installed from the NOOBS software.  I gather that on a typical Linux system you might use the\ncommand: stty -F /dev/ttyAMA0 9600. \nRaspberry Pi GPIO multi-pin connector\nThis time , not only were PPS and ground connections required,\nbut also the serial port and the +5 V line, so I used a piece of 6-way ribbon cable to connect between\nthe Raspberry Pi and my serial GPS device.  I happened to have a 10-pin\nheader which fitted the GPIO connector, so these are the connections I chose to\nmake:</p>"},{"id":"text-237","type":"text","heading":"","plain_text":"macable\nTarte aux framboisesconnecteur\nCommentaire\nGPS moduleconnecteur","html":"<p>macable\nTarte aux framboisesconnecteur\nCommentaire\nGPS moduleconnecteur</p>"},{"id":"text-238","type":"text","heading":"","plain_text":"rouge\n+ 5V\nMy unit takes less than 50 mA\n1 +5V","html":"<p>rouge\n+ 5V\nMy unit takes less than 50 mA\n1 +5V</p>"},{"id":"text-239","type":"text","heading":"","plain_text":"+ 5V","html":"<p>+ 5V</p>"},{"id":"text-240","type":"text","heading":"","plain_text":"Bleu\nSol\nOne of two ground connections\n2 GND","html":"<p>Bleu\nSol\nOne of two ground connections\n2 GND</p>"},{"id":"text-241","type":"text","heading":"","plain_text":"vert\nTXD\nNot connected, see below","html":"<p>vert\nTXD\nNot connected, see below</p>"},{"id":"text-242","type":"text","heading":"","plain_text":"Jaune\nRXD\nReceives serial data sent from the GPS\n3 TXD","html":"<p>Jaune\nRXD\nReceives serial data sent from the GPS\n3 TXD</p>"},{"id":"text-243","type":"text","heading":"","plain_text":"GPIO 18","html":"<p>GPIO 18</p>"},{"id":"text-244","type":"text","heading":"","plain_text":"Sol","html":"<p>Sol</p>"},{"id":"text-245","type":"text","heading":"","plain_text":"GPIO 23","html":"<p>GPIO 23</p>"},{"id":"text-246","type":"text","heading":"","plain_text":"blanc\nGPIO 24\nReceives the PPS sent from the GPS\nPPS pin on u-blox device","html":"<p>blanc\nGPIO 24\nReceives the PPS sent from the GPS\nPPS pin on u-blox device</p>"},{"id":"text-247","type":"text","heading":"","plain_text":"Noir\nGnd\nOne of two ground connections\n6 GND","html":"<p>Noir\nGnd\nOne of two ground connections\n6 GND</p>"},{"id":"text-248","type":"text","heading":"","plain_text":"I actually didn&#39;t connect the TXD lead to the GPS module in the first instance,\nas the GPS receiver powers up sending data in the correct format, so there is\nnothing which the computer Besoins to control.  There is a description\nof the GPIO pin header here. \nAgain, please note that 3.3 V signals are required,  ne pas the 5 V level, and\nabsolument  ne pas the RS-232 level! \nConverting from USB to native serial &#8211; software changes\nWe need to tell gpsd to look for input from a different\nsource: ttyAMA0 instead of ttyACM0","html":"<p>I actually didn&#039;t connect the TXD lead to the GPS module in the first instance,\nas the GPS receiver powers up sending data in the correct format, so there is\nnothing which the computer Besoins to control.  There is a description\nof the GPIO pin header here. \nAgain, please note that 3.3 V signals are required,  ne pas the 5 V level, and\nabsolument  ne pas the RS-232 level! \nConverting from USB to native serial &#8211; software changes\nWe need to tell gpsd to look for input from a different\nsource: ttyAMA0 instead of ttyACM0</p>"},{"id":"text-249","type":"text","heading":"","plain_text":"$ sudo nano /etc/default/gpsd","html":"<p>$ sudo nano /etc/default/gpsd</p>"},{"id":"text-250","type":"text","heading":"","plain_text":"and change the DEVICES= to point to\n&quot;/dev/ttyAMA0&quot;.  You could use &quot;sudo\ndpkg-reconfigure\ngpsd&quot; instead.  You may also find that the delay between PPS and TXD\non the serial line is different from that over USB, so you may wish to edit your\nntp.conf  accordingly &#8211; it makes the output look nicer at least and may make\nprediction of the nearest second more accurate during the initial acquisition. \nIn my case I needed to change the 0.35 second offset seen in the earlier device\nto the 0.13 second offset seen with the U-blox device, hence the following\nchanger ntp.conf, from","html":"<p>and change the DEVICES= to point to\n&quot;/dev/ttyAMA0&quot;.  You could use &quot;sudo\ndpkg-reconfigure\ngpsd&quot; instead.  You may also find that the delay between PPS and TXD\non the serial line is different from that over USB, so you may wish to edit your\nntp.conf  accordingly &#8211; it makes the output look nicer at least and may make\nprediction of the nearest second more accurate during the initial acquisition. \nIn my case I needed to change the 0.35 second offset seen in the earlier device\nto the 0.13 second offset seen with the U-blox device, hence the following\nchanger ntp.conf, from</p>"},{"id":"text-251","type":"text","heading":"","plain_text":"fudge 127.127.28.0 time1 +0.350 refid SHM stratum 15","html":"<p>fudge 127.127.28.0 time1 +0.350 refid SHM stratum 15</p>"},{"id":"text-252","type":"text","heading":"","plain_text":"à:","html":"<p>à:</p>"},{"id":"text-253","type":"text","heading":"","plain_text":"fudge 127.127.28.0 time1 +0.130 refid SHM stratum 15","html":"<p>fudge 127.127.28.0 time1 +0.130 refid SHM stratum 15</p>"},{"id":"text-254","type":"text","heading":"","plain_text":"This configuration has been running since\n  Friday, November 09, 2012.  \n \nOn reflection, I am unsure why I chose to make the stratum 15\nin the example above,  Possible stratum 2 or 3 might be better, otherwise\nNTP may think that the source is of very poor quality and fail to sync to it.\n \nRobin Scwab notes that you could try using the value of\n&quot;Time offset&quot; displayed in cgps -s as the starting value for the time1\nparameter.  This sounds to be a gooo idea, except that on one system here I\nhappened to check Time Offset was about 0.640 seconds, but the best value for\ntime1 (i.e. the value resulting in the smallest average offset) was 0.130\nseconds.  Where did the extra 0.5 seconds come from? \n \nNumber of NTP clients which can be handled\n \nSomeone asked: &quot;How many NTP clients can it\nhandle?&quot;  Well, I have not done any extensive testing on how many clients this\nNTP server can handle (as it will easily be enough for use on a LAN, and it&#39;s\nnot fit for public use in its present security date).  I did manage to\nlocate one NTP stress-testing program here,\nbut the maximum rate I could get it to produce on my PC was about 75 packets per\nsecond, and the Raspberry Pi can handle that rate with ease.  With NTP\nclient PCs polling at 64 second intervals (the fastest normally used), that&#39;s\n4800 clients, so easily enough for a small organisation.  If you were using\nthis for a small organisation, I would recommend using two or three stratum-1\nservers so that you are covered in the event of failure &#8211; perhaps mark one of the\nservers &quot;prefer&quot; on the client PCs to avoid NTP from\n&quot;clock-hopping&quot;.  If you have better\nstress-test data, as Kasper Pedersen did, please let me know and I can publish it here.\n \nKasper Pedersen notes:\n \nI did one a few years ago that goes a bit faster (Linux):\n \nhttp://n1.taur.dk/permanent/ntpload.c\n \nTo test a Raspberry Pi you need 4 instances running, at which point the\nPi runs out of CPU, and settles on 3520/s.  That ought to be enough for most small homes.. 🙂 \n \nThese are brief notes only, on an alternative approach which\ndoes not require a modified kernel with PPS support in the OS, nor does it\nrequire a recompiled NTP, but which produces\nslightly less accurate timekeeping.  It may, however, be quite good enough\nfor most purposes.  The program was developed by Folkert van Heusden, see: http://vanheusden.com/time/rpi_gpio_ntp/ \nand announced\nin the Time-Nuts mailing list.\n \nBase installation &#8211; check you meet these requirements\n \nYou can start here assuming that you have your Raspberry Pi\nbasically working with GPSD and NTP, meaning that:","html":"<p>This configuration has been running since\n  Friday, November 09, 2012.  \n \nOn reflection, I am unsure why I chose to make the stratum 15\nin the example above,  Possible stratum 2 or 3 might be better, otherwise\nNTP may think that the source is of very poor quality and fail to sync to it.\n \nRobin Scwab notes that you could try using the value of\n&quot;Time offset&quot; displayed in cgps -s as the starting value for the time1\nparameter.  This sounds to be a gooo idea, except that on one system here I\nhappened to check Time Offset was about 0.640 seconds, but the best value for\ntime1 (i.e. the value resulting in the smallest average offset) was 0.130\nseconds.  Where did the extra 0.5 seconds come from? \n \nNumber of NTP clients which can be handled\n \nSomeone asked: &quot;How many NTP clients can it\nhandle?&quot;  Well, I have not done any extensive testing on how many clients this\nNTP server can handle (as it will easily be enough for use on a LAN, and it&#039;s\nnot fit for public use in its present security date).  I did manage to\nlocate one NTP stress-testing program here,\nbut the maximum rate I could get it to produce on my PC was about 75 packets per\nsecond, and the Raspberry Pi can handle that rate with ease.  With NTP\nclient PCs polling at 64 second intervals (the fastest normally used), that&#039;s\n4800 clients, so easily enough for a small organisation.  If you were using\nthis for a small organisation, I would recommend using two or three stratum-1\nservers so that you are covered in the event of failure &#8211; perhaps mark one of the\nservers &quot;prefer&quot; on the client PCs to avoid NTP from\n&quot;clock-hopping&quot;.  If you have better\nstress-test data, as Kasper Pedersen did, please let me know and I can publish it here.\n \nKasper Pedersen notes:\n \nI did one a few years ago that goes a bit faster (Linux):\n \nhttp://n1.taur.dk/permanent/ntpload.c\n \nTo test a Raspberry Pi you need 4 instances running, at which point the\nPi runs out of CPU, and settles on 3520/s.  That ought to be enough for most small homes.. 🙂 \n \nThese are brief notes only, on an alternative approach which\ndoes not require a modified kernel with PPS support in the OS, nor does it\nrequire a recompiled NTP, but which produces\nslightly less accurate timekeeping.  It may, however, be quite good enough\nfor most purposes.  The program was developed by Folkert van Heusden, see: http://vanheusden.com/time/rpi_gpio_ntp/ \nand announced\nin the Time-Nuts mailing list.\n \nBase installation &#8211; check you meet these requirements\n \nYou can start here assuming that you have your Raspberry Pi\nbasically working with GPSD and NTP, meaning that:</p>"},{"id":"text-255","type":"text","heading":"","plain_text":"You have installed the current operating system and any\n    updates.\nYou have made any optional IP address or computer name\n    changes.\nYou have got NTP working, preferably connected to your\n    country&#39;s pool servers.\nYou have recompiled\n    and installed NTP to get a full version (is a re-compile required?).\nYou have the PPS signal from the GPS receiver connected to\n    the GPIO, e.g. GPIO-8 (pin 24), or GPIO 18 for the no-soldering\n    planche.\nYou have  installed and configured the gpsd Logiciel\n    and utilities, and made gpsd auto-start.\nYou have a GPS device connected either via a serial or a\n    USB connection.\nle cgps -s command produces a correct display.\nYou have configured NTP to talk to the type 28.0 shared\n    memory driver, and can see the GPSD output in ntpq -pn.","html":"<p>You have installed the current operating system and any\n    updates.\nYou have made any optional IP address or computer name\n    changes.\nYou have got NTP working, preferably connected to your\n    country&#039;s pool servers.\nYou have recompiled\n    and installed NTP to get a full version (is a re-compile required?).\nYou have the PPS signal from the GPS receiver connected to\n    the GPIO, e.g. GPIO-8 (pin 24), or GPIO 18 for the no-soldering\n    planche.\nYou have  installed and configured the gpsd Logiciel\n    and utilities, and made gpsd auto-start.\nYou have a GPS device connected either via a serial or a\n    USB connection.\nle cgps -s command produces a correct display.\nYou have configured NTP to talk to the type 28.0 shared\n    memory driver, and can see the GPSD output in ntpq -pn.</p>"},{"id":"text-256","type":"text","heading":"","plain_text":"Optional first step &#8211; to determine the offset of your GPS serial data from\nthe exact second\n \nThe objective is to determine the offset between the PPS\nsignal from your GPS and the serial data which typically follows some hundred or\nmore milliseconds later.  NTP can use that offset either to make a better\nsync when using just a GPS receiver with no PPS, or to present a slightly less\ndéroutant ntpq -p output when using PPS.  To measure what offset\nshould be specified for the time1 factor when using a GPS receiver (type 28\nreference clock driver), we can use NTP as a measuring tool by making it sync to\nexisting servers and have it monitor the\nshared memory #0 written by  gpsd.  I.e. NTP will not use server\n28.0 for timekeeping, but it volonté display the offset in the ntpq\n-p  commander. To do this, you add these\nlines to your ntp.conf (if they are not already there):","html":"<p>Optional first step &#8211; to determine the offset of your GPS serial data from\nthe exact second\n \nThe objective is to determine the offset between the PPS\nsignal from your GPS and the serial data which typically follows some hundred or\nmore milliseconds later.  NTP can use that offset either to make a better\nsync when using just a GPS receiver with no PPS, or to present a slightly less\ndéroutant ntpq -p output when using PPS.  To measure what offset\nshould be specified for the time1 factor when using a GPS receiver (type 28\nreference clock driver), we can use NTP as a measuring tool by making it sync to\nexisting servers and have it monitor the\nshared memory #0 written by  gpsd.  I.e. NTP will not use server\n28.0 for timekeeping, but it volonté display the offset in the ntpq\n-p  commander. To do this, you add these\nlines to your ntp.conf (if they are not already there):</p>"},{"id":"text-257","type":"text","heading":"","plain_text":"# Server to be monitored only, not selected for syncing\nserver 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.000 refid GPSD","html":"<p># Server to be monitored only, not selected for syncing\nserver 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.000 refid GPSD</p>"},{"id":"text-258","type":"text","heading":"","plain_text":"Watch the results from  ntpq\n-pn, and look at the offset for the server with the refid GPSD.  On one of my RPi cards it varied between -322 and -336 (units are\nms in the ntpq report). \nTake an average of those values, and replace the 0.000 after time1 with that average.  In this case, the average was -329 ms, so try:","html":"<p>Watch the results from  ntpq\n-pn, and look at the offset for the server with the refid GPSD.  On one of my RPi cards it varied between -322 and -336 (units are\nms in the ntpq report). \nTake an average of those values, and replace the 0.000 after time1 with that average.  In this case, the average was -329 ms, so try:</p>"},{"id":"text-259","type":"text","heading":"","plain_text":"server 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.329 refid GPSD","html":"<p>server 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.329 refid GPSD</p>"},{"id":"text-260","type":"text","heading":"","plain_text":"i.e. if the reported offset is negative, you need to make\ntime1 a positive value.  Now you should see much smaller offsets for the GPSD server. \nCe n&#39;est pas\nessential to do this, but it gives you confidence that things are working as\nexpected, it may help NTP in the early startup, and it produces a less\ndéroutant  ntpq display.  Don&#39;t forget to remove the noselect\nwhen you have the best value for the offset, and set the flags to include préféré\nso that NTP knows it can use that source as a seconds provider! Là\nmust be at least one préférer for PPS to work.  This now has the NTP daemon seeing the GPSD device, and\nthe next step is to\nadd in some PPS support.","html":"<p>i.e. if the reported offset is negative, you need to make\ntime1 a positive value.  Now you should see much smaller offsets for the GPSD server. \nCe n&#039;est pas\nessential to do this, but it gives you confidence that things are working as\nexpected, it may help NTP in the early startup, and it produces a less\ndéroutant  ntpq display.  Don&#039;t forget to remove the noselect\nwhen you have the best value for the offset, and set the flags to include préféré\nso that NTP knows it can use that source as a seconds provider! Là\nmust be at least one préférer for PPS to work.  This now has the NTP daemon seeing the GPSD device, and\nthe next step is to\nadd in some PPS support.</p>"},{"id":"text-261","type":"text","heading":"","plain_text":"server 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.329 refid GPSD","html":"<p>server 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.329 refid GPSD</p>"},{"id":"text-262","type":"text","heading":"","plain_text":"Getting the average value for time1 automatically\n \nAngelo Mileto writes: What I did to get a good sample of data for the  time1 value was let the ntpq -p command run for a period of time and capture the results. \nThen, using awk, calculate the average/mean of the values collected.  If you look at the static ntpq -p output, you will see something like this:\n \n          remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPSD.           2 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            2 l   12   32  377    0.000    0.002   0.002\nalong with other pool/server entries.  As noted above, you need to ensure you have a good preferred source for the comparison to work. \nTo capture your data, execute the following at the command line from your user&#39;s home directory:","html":"<p>Getting the average value for time1 automatically\n \nAngelo Mileto writes: What I did to get a good sample of data for the  time1 value was let the ntpq -p command run for a period of time and capture the results. \nThen, using awk, calculate the average/mean of the values collected.  If you look at the static ntpq -p output, you will see something like this:\n \n          remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPSD.           2 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            2 l   12   32  377    0.000    0.002   0.002\nalong with other pool/server entries.  As noted above, you need to ensure you have a good preferred source for the comparison to work. \nTo capture your data, execute the following at the command line from your user&#039;s home directory:</p>"},{"id":"text-263","type":"text","heading":"","plain_text":"watch -n0.5 &quot;ntpq -pn | grep &#39;.GPSD. 2 1 1&#39; | tee --append GPSD_Offset.txt&quot;","html":"<p>watch -n0.5 &quot;ntpq -pn | grep &#039;.GPSD. 2 1 1&#039; | tee --append GPSD_Offset.txt&quot;</p>"},{"id":"text-264","type":"text","heading":"","plain_text":"Pay attention to the single and double quotes in that command.  If you notice, the grep is looking for the exact line from the ntpq -p output that contains your GPSD\nrefid.  So if you named it something different, that would replace the .GPSD. in the command. \nAlso, notice the &quot;2 1 1&quot;, that is the stratum, t and when fields.  The stratum is whatever you set it to in the ntp.conf; the t should always be a 1 and the when is going to capture the output\nseulement when the timer reaches 1 meaning that it just updated the value. \nThere is no sense in capturing data every .5 seconds for data that doesn&#39;t\nchange!  So the easiest way to get the value to grep for is to manually run the ntpq -p and copy from your refid through the when fields and that&#39;s what will be grepped for.\n \nLet that run for a good while &#8211; probably not really needed &#8211; but that&#39;s the point of getting a good sample size. \nThis will capture the output from the ntpq command filtering to just your SHM/GPSD. \nThis will all be saved to a file GPSD_Offset.txt in the current directory &#8211; that&#39;s what the &quot;tee &#8211;append GPSD_Offset.txt&quot; does. \nYou can tail -f that file if you want while the watch command is running to see what is going into that file. \nNOTE: If you need to restart the process because you changed some setting and want to start over, delete any existing GPSD_Offset.txt file first.\n \nOnce you have a sufficient sample size, you can then use the following command to get the actual value for the average/mean:","html":"<p>Pay attention to the single and double quotes in that command.  If you notice, the grep is looking for the exact line from the ntpq -p output that contains your GPSD\nrefid.  So if you named it something different, that would replace the .GPSD. in the command. \nAlso, notice the &quot;2 1 1&quot;, that is the stratum, t and when fields.  The stratum is whatever you set it to in the ntp.conf; the t should always be a 1 and the when is going to capture the output\nseulement when the timer reaches 1 meaning that it just updated the value. \nThere is no sense in capturing data every .5 seconds for data that doesn&#039;t\nchange!  So the easiest way to get the value to grep for is to manually run the ntpq -p and copy from your refid through the when fields and that&#039;s what will be grepped for.\n \nLet that run for a good while &#8211; probably not really needed &#8211; but that&#039;s the point of getting a good sample size. \nThis will capture the output from the ntpq command filtering to just your SHM/GPSD. \nThis will all be saved to a file GPSD_Offset.txt in the current directory &#8211; that&#039;s what the &quot;tee &#8211;append GPSD_Offset.txt&quot; does. \nYou can tail -f that file if you want while the watch command is running to see what is going into that file. \nNOTE: If you need to restart the process because you changed some setting and want to start over, delete any existing GPSD_Offset.txt file first.\n \nOnce you have a sufficient sample size, you can then use the following command to get the actual value for the average/mean:</p>"},{"id":"text-265","type":"text","heading":"","plain_text":"awk &#39;total=total+$9; count=count+1 END print &quot;Total:&quot;total; print &quot;Count:&quot;count; print &quot; Avg:&quot;total/count&#39; GPSD_Offset.txt","html":"<p>awk &#039;total=total+$9; count=count+1 END print &quot;Total:&quot;total; print &quot;Count:&quot;count; print &quot; Avg:&quot;total/count&#039; GPSD_Offset.txt</p>"},{"id":"text-266","type":"text","heading":"","plain_text":"This steps through every line of the GPSD_Offset.txt file and totals up all of the offset values. \nIt will also count how many lines/values are there.  Finally it just prints the information: Total, count and average. \nThe average value is what you would put into the  time1 value as noted above. \nDon&#39;t forget to change the noselect to prefer when you are in there to add the time1 value.\nAngelo Mileto\n \nDJT: This is somewhat beyond my Linux, so my thanks to Angelo for the scripts and the\ndetailed explanation.  Angelo can be contacted here.\nDownloading and compiling Folkert van Heusden&#39;s program\n \nAs of 2013-Jun-18, rpi_gpio_ntp-0.3 was the current version,\nbut thanks to Thomas Erthner I know that version 1.5 is now available, so I&#39;ve\nupdated the lines below.  However, I&#39;ve only tested version 0.3, not\nversion 1.5.  For more details, please see Folkert&#39;s\npage.","html":"<p>This steps through every line of the GPSD_Offset.txt file and totals up all of the offset values. \nIt will also count how many lines/values are there.  Finally it just prints the information: Total, count and average. \nThe average value is what you would put into the  time1 value as noted above. \nDon&#039;t forget to change the noselect to prefer when you are in there to add the time1 value.\nAngelo Mileto\n \nDJT: This is somewhat beyond my Linux, so my thanks to Angelo for the scripts and the\ndetailed explanation.  Angelo can be contacted here.\nDownloading and compiling Folkert van Heusden&#039;s program\n \nAs of 2013-Jun-18, rpi_gpio_ntp-0.3 was the current version,\nbut thanks to Thomas Erthner I know that version 1.5 is now available, so I&#039;ve\nupdated the lines below.  However, I&#039;ve only tested version 0.3, not\nversion 1.5.  For more details, please see Folkert&#039;s\npage.</p>"},{"id":"text-267","type":"text","heading":"","plain_text":"$ wget http:\n//vanheusden.\ncom/time/rpi_gpio_ntp/rpi_gpio\n_ntp-1.5.\ntgz","html":"<p>$ wget http:\n//vanheusden.\ncom/time/rpi_gpio_ntp/rpi_gpio\n_ntp-1.5.\ntgz</p>"},{"id":"text-268","type":"text","heading":"","plain_text":"$ tar xvfz rpi_gpio_ntp-1.5.tgz\n$ cd rpi_gpio_ntp-1.5\n$ sudo make install","html":"<p>$ tar xvfz rpi_gpio_ntp-1.5.tgz\n$ cd rpi_gpio_ntp-1.5\n$ sudo make install</p>"},{"id":"text-269","type":"text","heading":"","plain_text":"This places the resulting binary in /usr/local/bin/.\nYou don&#39;t need this for current Raspbian versions.\n \nTo test you are receiving a PPS signal, from GPIO pin 8:","html":"<p>This places the resulting binary in /usr/local/bin/.\nYou don&#039;t need this for current Raspbian versions.\n \nTo test you are receiving a PPS signal, from GPIO pin 8:</p>"},{"id":"text-270","type":"text","heading":"","plain_text":"$ sudo rpi_gpio_ntp -g 8 -d\nrpi_gpio_ntp v0.2, (C) 2013 by folkert@vanheusden.com","html":"<p>$ sudo rpi_gpio_ntp -g 8 -d\nrpi_gpio_ntp v0.2, (C) 2013 by folkert@vanheusden.com</p>"},{"id":"text-271","type":"text","heading":"","plain_text":"NTP unit: 0\nGPIO pin: 8\nFudge : 0.000000\n&quot;Fork into the background&quot; disabled because of debug mode.\n1371475664.752146325]poll() GPIO 8 interrupt occurred\n1371475665.000148935]poll() GPIO 8 interrupt occurred\n1371475666.000147203]poll() GPIO 8 interrupt occurred\n1371475667.000160470]poll() GPIO 8 interrupt occurred\n1371475668.000159739]poll() GPIO 8 interrupt occurred\n(Ctrl-C pressed)\n$","html":"<p>NTP unit: 0\nGPIO pin: 8\nFudge : 0.000000\n&quot;Fork into the background&quot; disabled because of debug mode.\n1371475664.752146325]poll() GPIO 8 interrupt occurred\n1371475665.000148935]poll() GPIO 8 interrupt occurred\n1371475666.000147203]poll() GPIO 8 interrupt occurred\n1371475667.000160470]poll() GPIO 8 interrupt occurred\n1371475668.000159739]poll() GPIO 8 interrupt occurred\n(Ctrl-C pressed)\n$</p>"},{"id":"text-272","type":"text","heading":"","plain_text":"Running the program\n \nTo make NTP read the PPS timings on the GPSD shared memory, we need to use\nthis command to start the program, assuming the PPS signal is being sent to\nGPIO-8 (physical pin 24 &#8211; see here). \nUse pin 18 is you are using the no-soldering board.","html":"<p>Running the program\n \nTo make NTP read the PPS timings on the GPSD shared memory, we need to use\nthis command to start the program, assuming the PPS signal is being sent to\nGPIO-8 (physical pin 24 &#8211; see here). \nUse pin 18 is you are using the no-soldering board.</p>"},{"id":"text-273","type":"text","heading":"","plain_text":"$ sudo rpi_gpio_ntp -N 1 -g 8","html":"<p>$ sudo rpi_gpio_ntp -N 1 -g 8</p>"},{"id":"text-274","type":"text","heading":"","plain_text":"and to edit the ntp.conf file, to include the shared memory driver, on section 1\nof the GPSD shared memory, replacing the earlier type 22 driver.  Add:","html":"<p>and to edit the ntp.conf file, to include the shared memory driver, on section 1\nof the GPSD shared memory, replacing the earlier type 22 driver.  Add:</p>"},{"id":"text-275","type":"text","heading":"","plain_text":"server 127.127.28.1 minpoll 4 prefer\nfudge 127.127.28.1 refid UPPS","html":"<p>server 127.127.28.1 minpoll 4 prefer\nfudge 127.127.28.1 refid UPPS</p>"},{"id":"text-276","type":"text","heading":"","plain_text":"I suggest &quot;UPPS&quot; to show it&#39;s user-mode PPS (and not\nthe more accurate Kernel mode).  If you want to see the output pulse from the program, you can add the &quot;-p 7&quot;\nparameter:","html":"<p>I suggest &quot;UPPS&quot; to show it&#039;s user-mode PPS (and not\nthe more accurate Kernel mode).  If you want to see the output pulse from the program, you can add the &quot;-p 7&quot;\nparameter:</p>"},{"id":"text-277","type":"text","heading":"","plain_text":"sudo rpi_gpio_ntp -N 1 -g 8 -p 7","html":"<p>sudo rpi_gpio_ntp -N 1 -g 8 -p 7</p>"},{"id":"text-278","type":"text","heading":"","plain_text":"and you can then use an oscilloscope to compare the time of\nthe PPS rising edge with the toggling line from GPIO pin 7 (connector pin\n26). On my system, there was a variable delay of between 270 and 390\nmicroseconds between PPS and program response.\n \nAuto-start\n \nMore information to follow, for now, this from Folkert: \nmodifier  /etc/rc.local  and add the\nfollowing (BEFORE the exit 0 statement and AFTER the #!/bin/sh line):","html":"<p>and you can then use an oscilloscope to compare the time of\nthe PPS rising edge with the toggling line from GPIO pin 7 (connector pin\n26). On my system, there was a variable delay of between 270 and 390\nmicroseconds between PPS and program response.\n \nAuto-start\n \nMore information to follow, for now, this from Folkert: \nmodifier  /etc/rc.local  and add the\nfollowing (BEFORE the exit 0 statement and AFTER the #!/bin/sh line):</p>"},{"id":"text-279","type":"text","heading":"","plain_text":"/usr/local/bin/rpi_gpio_ntp -N 1 -g 8","html":"<p>/usr/local/bin/rpi_gpio_ntp -N 1 -g 8</p>"},{"id":"text-280","type":"text","heading":"","plain_text":"Replace &#39;8&#39; by the gpio pin you are using, e.g. 18 for the no-soldering\nplanche.\n \nPerformance\n \nThe original documentation suggested using minpoll=1, however on testing using\nntpq -pn  it appeared that NTP will automatically accept 3 as the minimum value. Comme\nthe previous testing with kernel-mode PPS had been with minpoll=4, it seemed\nonly fair to test with that value.  You can see the change from minpoll=1\nto minpoll=4 just after 18:00 UTC.  Recall that 1 was replaced internally\nby 3, the lowest value NTP will accept.  With minpoll=4,\nboth the reported offset and the averaged jitter were reduced.  First, what it looks like in MRTG for comparison with the results\nabove:","html":"<p>Replace &#039;8&#039; by the gpio pin you are using, e.g. 18 for the no-soldering\nplanche.\n \nPerformance\n \nThe original documentation suggested using minpoll=1, however on testing using\nntpq -pn  it appeared that NTP will automatically accept 3 as the minimum value. Comme\nthe previous testing with kernel-mode PPS had been with minpoll=4, it seemed\nonly fair to test with that value.  You can see the change from minpoll=1\nto minpoll=4 just after 18:00 UTC.  Recall that 1 was replaced internally\nby 3, the lowest value NTP will accept.  With minpoll=4,\nboth the reported offset and the averaged jitter were reduced.  First, what it looks like in MRTG for comparison with the results\nabove:</p>"},{"id":"text-281","type":"text","heading":"","plain_text":"Don&#39;t get confused: the MRTG plot above covers rather more\nthan one day, whereas the plots below cover just under half a day. Sur le\nplot MRTG plot, you can see that the RPi was changed from kernel-mode PPS at\n13:00 UTC and run for a short while with Internet servers alone, visible as the\nlarger excursions on the plot above around 13:00).  \n \nFrom my NTPplotter\nprogram graphs below, you can see more clearly that at 13:30\nthe user-mode PPS was started, and the just after 18:00 the minpoll was changed\nfrom 1 (actually 3) to 4, resulting in a slight drop of RMS offset from around 5\nmicroseconds to 4 microseconds:","html":"<p>Don&#039;t get confused: the MRTG plot above covers rather more\nthan one day, whereas the plots below cover just under half a day. Sur le\nplot MRTG plot, you can see that the RPi was changed from kernel-mode PPS at\n13:00 UTC and run for a short while with Internet servers alone, visible as the\nlarger excursions on the plot above around 13:00).  \n \nFrom my NTPplotter\nprogram graphs below, you can see more clearly that at 13:30\nthe user-mode PPS was started, and the just after 18:00 the minpoll was changed\nfrom 1 (actually 3) to 4, resulting in a slight drop of RMS offset from around 5\nmicroseconds to 4 microseconds:</p>"},{"id":"text-282","type":"text","heading":"","plain_text":"The jitter graph shows a drop in averaged jitter (green line) from just below 7 to just\nabove 5 microseconds after 18:00, when the minpoll was changed from 3 to 4. \nThe initial higher value of averaged jitter is the tail resulting from\nInternet-only sync.","html":"<p>The jitter graph shows a drop in averaged jitter (green line) from just below 7 to just\nabove 5 microseconds after 18:00, when the minpoll was changed from 3 to 4. \nThe initial higher value of averaged jitter is the tail resulting from\nInternet-only sync.</p>"},{"id":"text-283","type":"text","heading":"","plain_text":"On another Raspberry Pi you can see the dramatic difference between NTP sync\nover the network and that achieved with the user-mode PPS software. Dans\nthis case, network sync was to a local NTP stratum-1 server over a Wi-Fi\nconnection, and the PPS sync was with a U-blox 5S module.  User-mode PPS\nwas started just after 11:00 UTC in the middle of the graphs below.  RMS\noffset dropped from a rather variable 48-80 microseconds to around 2 microseconds,\nand jitter averaged over 6 hours dropped from around 80 microseconds to under\n2.5 microseconds.","html":"<p>On another Raspberry Pi you can see the dramatic difference between NTP sync\nover the network and that achieved with the user-mode PPS software. Dans\nthis case, network sync was to a local NTP stratum-1 server over a Wi-Fi\nconnection, and the PPS sync was with a U-blox 5S module.  User-mode PPS\nwas started just after 11:00 UTC in the middle of the graphs below.  RMS\noffset dropped from a rather variable 48-80 microseconds to around 2 microseconds,\nand jitter averaged over 6 hours dropped from around 80 microseconds to under\n2.5 microseconds.</p>"},{"id":"text-284","type":"text","heading":"","plain_text":"To monitor NTP you can edit the ntp.conf file to turn on the generation\nof more detailed statistics data.  Note that this data maybe a megabyte or more per day, so think about keeping only a few days\nworth, and only enabling statistics collection when needed as the number of\nwrites to the SD card flash memory is limited.  The detailed information\ncan now be found here and I\noffer a program to plot the statistics data and produce offset and jitter graphs\nsuch as those above here.\n \n \nTransients\n \nI may have been unfortunate in locating one Raspberry Pi with an Adafruit\nmodule in a position where it was not getting as good a view of the sky as\nothers, or it may be that other devices connected to that RPi or software\ninstalled is an issue.  I have been seeing transient poor time-keeping\n(loss of GPS PPS signal) at intermittent times.  I did discover that\ndisconnections a lead to a USB hub connected to that RPi seemed to improve\ndes choses.\n \n If the problem was caused purely by unfortunate GPS satellite\nposition, I might have expected it to repeat in a near 24-hour pattern, which\ndoes appear to be the case.  Thanks to John Ryan for correcting me about the GPS\norbital period, I was originally thinking sidereal time and 4 minute earlier\neach day.  However, on the Time-Nuts mailing list, in connection with\nanother topic, Bob Camp commented:","html":"<p>To monitor NTP you can edit the ntp.conf file to turn on the generation\nof more detailed statistics data.  Note that this data maybe a megabyte or more per day, so think about keeping only a few days\nworth, and only enabling statistics collection when needed as the number of\nwrites to the SD card flash memory is limited.  The detailed information\ncan now be found here and I\noffer a program to plot the statistics data and produce offset and jitter graphs\nsuch as those above here.\n \n \nTransients\n \nI may have been unfortunate in locating one Raspberry Pi with an Adafruit\nmodule in a position where it was not getting as good a view of the sky as\nothers, or it may be that other devices connected to that RPi or software\ninstalled is an issue.  I have been seeing transient poor time-keeping\n(loss of GPS PPS signal) at intermittent times.  I did discover that\ndisconnections a lead to a USB hub connected to that RPi seemed to improve\ndes choses.\n \n If the problem was caused purely by unfortunate GPS satellite\nposition, I might have expected it to repeat in a near 24-hour pattern, which\ndoes appear to be the case.  Thanks to John Ryan for correcting me about the GPS\norbital period, I was originally thinking sidereal time and 4 minute earlier\neach day.  However, on the Time-Nuts mailing list, in connection with\nanother topic, Bob Camp commented:</p>"},{"id":"text-285","type":"text","heading":"","plain_text":"&quot;The GPS constellation repeats roughly once a day. \n  It is not at all uncommon to have a “worst case” satellite geometry for a given antenna location. \n  If you have one, it will repeat once a day and show up as a bump in the timing out of your GPS module&#8230;.&quot;","html":"<p>&quot;The GPS constellation repeats roughly once a day. \n  It is not at all uncommon to have a “worst case” satellite geometry for a given antenna location. \n  If you have one, it will repeat once a day and show up as a bump in the timing out of your GPS module&#8230;.&quot;</p>"},{"id":"text-286","type":"text","heading":"","plain_text":"Although the GPS satellites repeat position in just less than\n12 hours, there is also the rotation of the earth to take into account, so the\nposition repeats at your location every 24 hours (well, ~23 h 56 m).\n \n   On reflection, 2014 February 09, this is the only Raspberry\nPi with certain radio software installed, and the problem only seems to occur\nsome days after a reboot, so I think I will stop recording the problem\nici. I am editing out the transients as they affect the P/N timekeeping\ngraphs, but I leave the raw-graphs as-is.","html":"<p>Although the GPS satellites repeat position in just less than\n12 hours, there is also the rotation of the earth to take into account, so the\nposition repeats at your location every 24 hours (well, ~23 h 56 m).\n \n   On reflection, 2014 February 09, this is the only Raspberry\nPi with certain radio software installed, and the problem only seems to occur\nsome days after a reboot, so I think I will stop recording the problem\nici. I am editing out the transients as they affect the P/N timekeeping\ngraphs, but I leave the raw-graphs as-is.</p>"},{"id":"text-287","type":"text","heading":"","plain_text":"Date\nTransient","html":"<p>Date\nTransient</p>"},{"id":"text-288","type":"text","heading":"","plain_text":"Dec 31\n20:00-20:45, 23:10-24:00","html":"<p>Dec 31\n20:00-20:45, 23:10-24:00</p>"},{"id":"text-289","type":"text","heading":"","plain_text":"Jan-01\n20:14-20:37, 23:17-23:28","html":"<p>Jan-01\n20:14-20:37, 23:17-23:28</p>"},{"id":"text-290","type":"text","heading":"","plain_text":"Jan-02\n01:29 02:45, 19:57..20:13, 20:14..20:29, 20:31, 23:13, 23:24 23:30..23:54","html":"<p>Jan-02\n01:29 02:45, 19:57..20:13, 20:14..20:29, 20:31, 23:13, 23:24 23:30..23:54</p>"},{"id":"text-291","type":"text","heading":"","plain_text":"Jan-03\n02:39, 03:44, 20:12..20:22, 23:24..23:52","html":"<p>Jan-03\n02:39, 03:44, 20:12..20:22, 23:24..23:52</p>"},{"id":"text-292","type":"text","heading":"","plain_text":"Jan-04\n02:37, 20:03..20:28, 23:06, 23:41..23:45","html":"<p>Jan-04\n02:37, 20:03..20:28, 23:06, 23:41..23:45</p>"},{"id":"text-293","type":"text","heading":"","plain_text":"Jan-05\n02:31","html":"<p>Jan-05\n02:31</p>"},{"id":"text-294","type":"text","heading":"","plain_text":"Removed USB extension cable from RasPi-2","html":"<p>Removed USB extension cable from RasPi-2</p>"},{"id":"text-295","type":"text","heading":"","plain_text":"Jan-06\n19:33..1940, 19:54, 22:49..22:55","html":"<p>Jan-06\n19:33..1940, 19:54, 22:49..22:55</p>"},{"id":"text-296","type":"text","heading":"","plain_text":"Jan-10\n20:30 22:07-22:17 22:37-22:45 23:03","html":"<p>Jan-10\n20:30 22:07-22:17 22:37-22:45 23:03</p>"},{"id":"text-297","type":"text","heading":"","plain_text":"Jan-11\n21:57-23:18","html":"<p>Jan-11\n21:57-23:18</p>"},{"id":"text-298","type":"text","heading":"","plain_text":"Jan-12\n22:01-22:54","html":"<p>Jan-12\n22:01-22:54</p>"},{"id":"text-299","type":"text","heading":"","plain_text":"Jan-13\n19:17-19:37 22:37-22:54","html":"<p>Jan-13\n19:17-19:37 22:37-22:54</p>"},{"id":"text-300","type":"text","heading":"","plain_text":"Jan-14\n01:46-01:47 19:30 19:40 22:46-22:51","html":"<p>Jan-14\n01:46-01:47 19:30 19:40 22:46-22:51</p>"},{"id":"text-301","type":"text","heading":"","plain_text":"Jan 15\n01:47 19:16-19:35 22:42-22:46 23:06","html":"<p>Jan 15\n01:47 19:16-19:35 22:42-22:46 23:06</p>"},{"id":"text-302","type":"text","heading":"","plain_text":"Jan-16\n19:05-19:32 22:24-22:41","html":"<p>Jan-16\n19:05-19:32 22:24-22:41</p>"},{"id":"text-303","type":"text","heading":"","plain_text":"Jan-17\n19:07-19:19 22:04-22:34","html":"<p>Jan-17\n19:07-19:19 22:04-22:34</p>"},{"id":"text-304","type":"text","heading":"","plain_text":"Jan-18\n19:11-19:16 21:55-21:57","html":"<p>Jan-18\n19:11-19:16 21:55-21:57</p>"},{"id":"text-305","type":"text","heading":"","plain_text":"Jan-19\n02:38-02:39","html":"<p>Jan-19\n02:38-02:39</p>"},{"id":"text-306","type":"text","heading":"","plain_text":"Jan-20\n19:04-20:06","html":"<p>Jan-20\n19:04-20:06</p>"},{"id":"text-307","type":"text","heading":"","plain_text":"Jan-21\n02:55-03:03 03:17 19:00 19:46 20:15 22:06","html":"<p>Jan-21\n02:55-03:03 03:17 19:00 19:46 20:15 22:06</p>"},{"id":"text-308","type":"text","heading":"","plain_text":"Jan-22\n02:56-03:05","html":"<p>Jan-22\n02:56-03:05</p>"},{"id":"text-309","type":"text","heading":"","plain_text":"Jan-23\n10:46 12:48","html":"<p>Jan-23\n10:46 12:48</p>"},{"id":"text-310","type":"text","heading":"","plain_text":"Jan-24\n02:48-02:53 07:21 07:44 12:46-12:48 17:11 19:20-19:36","html":"<p>Jan-24\n02:48-02:53 07:21 07:44 12:46-12:48 17:11 19:20-19:36</p>"},{"id":"text-311","type":"text","heading":"","plain_text":"Jan-25\n07:13 07:18 07:52-07:53 13:02-13:11","html":"<p>Jan-25\n07:13 07:18 07:52-07:53 13:02-13:11</p>"},{"id":"text-312","type":"text","heading":"","plain_text":"Jan-26\n02:50 03:26 18:06 18:31-18:36 21:59","html":"<p>Jan-26\n02:50 03:26 18:06 18:31-18:36 21:59</p>"},{"id":"text-313","type":"text","heading":"","plain_text":"Jan-27\n02:42 02:57-03:37 07:09 (reboot at 17:23)","html":"<p>Jan-27\n02:42 02:57-03:37 07:09 (reboot at 17:23)</p>"},{"id":"text-314","type":"text","heading":"","plain_text":"Jan-31\n21:19-21:21","html":"<p>Jan-31\n21:19-21:21</p>"},{"id":"text-315","type":"text","heading":"","plain_text":"Feb-05\n20:59 23:12 (is this something which starts days after boot?)","html":"<p>Feb-05\n20:59 23:12 (is this something which starts days after boot?)</p>"},{"id":"text-316","type":"text","heading":"","plain_text":"Feb-07\n\t\t18:03 18:41 20:52","html":"<p>Feb-07\n\t\t18:03 18:41 20:52</p>"},{"id":"text-317","type":"text","heading":"","plain_text":"Feb-08\n15:09 15:42 18:37 20:33 20:46 21:24","html":"<p>Feb-08\n15:09 15:42 18:37 20:33 20:46 21:24</p>"},{"id":"text-318","type":"text","heading":"","plain_text":"Feb-09\n00:13 00:37-00:43 01:37","html":"<p>Feb-09\n00:13 00:37-00:43 01:37</p>"},{"id":"text-319","type":"text","heading":"","plain_text":"If you are operating completely alone, with no internet\nconnection and just the GPS, your NTP may need to be told about leap-seconds\nwhich change the offset between GPS time and wall-clock time every so\nsouvent. Some GPS receivers provide this information automatically, but this\ncan also be done by providing a file with the times of changes (in a standard format) and telling ntpd where to\nfind that file.  On my own\nsystems I have set up a Samba share on the NTP servers so that I can update the\nleap-seconds file from a central location.  To do this, add a new writeable share named &quot;ntp-leapseconds&quot;\nby adding lines to the end of smb.conf, and then restart Samba:","html":"<p>If you are operating completely alone, with no internet\nconnection and just the GPS, your NTP may need to be told about leap-seconds\nwhich change the offset between GPS time and wall-clock time every so\nsouvent. Some GPS receivers provide this information automatically, but this\ncan also be done by providing a file with the times of changes (in a standard format) and telling ntpd where to\nfind that file.  On my own\nsystems I have set up a Samba share on the NTP servers so that I can update the\nleap-seconds file from a central location.  To do this, add a new writeable share named &quot;ntp-leapseconds&quot;\nby adding lines to the end of smb.conf, and then restart Samba:</p>"},{"id":"text-320","type":"text","heading":"","plain_text":"sudo nano /etc/samba/smb.conf\n[ntp-leapseconds]","html":"<p>sudo nano /etc/samba/smb.conf\n[ntp-leapseconds]</p>"},{"id":"text-321","type":"text","heading":"","plain_text":"comment = NTP leapsecond.file\npath = /home/pi/ntp\nwriteable = yes\nguest ok = yes","html":"<p>comment = NTP leapsecond.file\npath = /home/pi/ntp\nwriteable = yes\nguest ok = yes</p>"},{"id":"text-322","type":"text","heading":"","plain_text":"sudo /etc/init.d/samba restart","html":"<p>sudo /etc/init.d/samba restart</p>"},{"id":"text-323","type":"text","heading":"","plain_text":"I chose to put my leap-seconds file in the default user&#39;s\n&quot;ntp&quot; home directory, but you may prefer some where more secure! \nTo tell ntpd where to find the file,\tadd one line to the end of ntp.conf with\nnano, and restart NTP:","html":"<p>I chose to put my leap-seconds file in the default user&#039;s\n&quot;ntp&quot; home directory, but you may prefer some where more secure! \nTo tell ntpd where to find the file,\tadd one line to the end of ntp.conf with\nnano, and restart NTP:</p>"},{"id":"text-324","type":"text","heading":"","plain_text":"sudo nano /etc/ntp.conf\nleapfile /home/pi/ntp/leap-seconds.file\nsudo /etc/init.d/ntp restart","html":"<p>sudo nano /etc/ntp.conf\nleapfile /home/pi/ntp/leap-seconds.file\nsudo /etc/init.d/ntp restart</p>"},{"id":"text-325","type":"text","heading":"","plain_text":"You can get the leap-seconds file from a variety of locations,\nincluding:\n \n    ftp://utcnist.colorado.edu/pub/    ftp://tycho.usno.navy.mil/pub/ntp/\n \nand it will be named  leap-seconds.3582403200\nwith a different serial number as the information is updated (this file was found in December 2013). je\ncopy the file to a constant name:  leap-seconds.file\nso that I don&#39;t need to alter NTP each time.  I then have a small Windows\ncommand file to update all my systems &#8211; Windows, FreeBSD and Raspberry Pi\ncards.  Here&#39;s an extract:","html":"<p>You can get the leap-seconds file from a variety of locations,\nincluding:\n \n    ftp://utcnist.colorado.edu/pub/    ftp://tycho.usno.navy.mil/pub/ntp/\n \nand it will be named  leap-seconds.3582403200\nwith a different serial number as the information is updated (this file was found in December 2013). je\ncopy the file to a constant name:  leap-seconds.file\nso that I don&#039;t need to alter NTP each time.  I then have a small Windows\ncommand file to update all my systems &#8211; Windows, FreeBSD and Raspberry Pi\ncards.  Here&#039;s an extract:</p>"},{"id":"text-326","type":"text","heading":"","plain_text":"XCOPY /D /Y  leap-seconds.file  \\Altantpetc\nXCOPY /D /Y  leap-seconds.file  \\Stamsundntpetc\nXCOPY /D /Y  leap-seconds.file  \\Pixie-IIntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-1ntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-2ntp-leapseconds\nPAUSE","html":"<p>XCOPY /D /Y  leap-seconds.file  \\Altantpetc\nXCOPY /D /Y  leap-seconds.file  \\Stamsundntpetc\nXCOPY /D /Y  leap-seconds.file  \\Pixie-IIntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-1ntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-2ntp-leapseconds\nPAUSE</p>"},{"id":"text-327","type":"text","heading":"","plain_text":"You can check whether NTP is using the file, and whether your\nfile is stale, with the:  ntpq -crv \ncommander:","html":"<p>You can check whether NTP is using the file, and whether your\nfile is stale, with the:  ntpq -crv \ncommander:</p>"},{"id":"text-328","type":"text","heading":"","plain_text":"associd=0 status=01fd leap_none, sync_pps, 15 events, kern,\nversion=&quot;ntpd 4.2.7p408@1.2483 Sun Dec 29 14:36:43 UTC 2013 (1)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.6.11&quot;, leap=00, stratum=1,\nprecision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d66b96d3.01b61b26  Mon, Dec 30 2013  6:53:07.006,\nclock=d66b96df.3df17b24  Mon, Dec 30 2013  6:53:19.241, peer=61352, tc=4,\nmintc=3, offset=0.000281, frequency=-34.180, sys_jitter=0.001907,\nclk_jitter=0.001, clk_wander=0.003, tai=35, leapsec=201207010000,\nexpire=201406010000","html":"<p>associd=0 status=01fd leap_none, sync_pps, 15 events, kern,\nversion=&quot;ntpd 4.2.7p408@1.2483 Sun Dec 29 14:36:43 UTC 2013 (1)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.6.11&quot;, leap=00, stratum=1,\nprecision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d66b96d3.01b61b26  Mon, Dec 30 2013  6:53:07.006,\nclock=d66b96df.3df17b24  Mon, Dec 30 2013  6:53:19.241, peer=61352, tc=4,\nmintc=3, offset=0.000281, frequency=-34.180, sys_jitter=0.001907,\nclk_jitter=0.001, clk_wander=0.003, tai=35, leapsec=201207010000,\nexpire=201406010000</p>"},{"id":"text-329","type":"text","heading":"","plain_text":"Look at the two final lines.  leapsec shows the latest\nleap second (here is was on 2012 Jul 01), and when the leap-second file expires\n(here: 2014-Jun-01).  There will also be a warning if the file is stale.\n \nUpdate the file from time-to-time &#8211; say every six months &#8211; in\nMay and November as leap-second changes usually happen at the end of June or\nDecember.  There is more information here. \n \nIf you keep getting a different ntp.conf from that which you edited, your\nrouter may be the cause. It seems some routers give out NTP information in DHCP which the Pi by default uses over\n/etc/ntp.conf.\n \nThe fix I think is:","html":"<p>Look at the two final lines.  leapsec shows the latest\nleap second (here is was on 2012 Jul 01), and when the leap-second file expires\n(here: 2014-Jun-01).  There will also be a warning if the file is stale.\n \nUpdate the file from time-to-time &#8211; say every six months &#8211; in\nMay and November as leap-second changes usually happen at the end of June or\nDecember.  There is more information here. \n \nIf you keep getting a different ntp.conf from that which you edited, your\nrouter may be the cause. It seems some routers give out NTP information in DHCP which the Pi by default uses over\n/etc/ntp.conf.\n \nThe fix I think is:</p>"},{"id":"text-330","type":"text","heading":"","plain_text":"rm /etc/dhcp/dhclient-exit-hooks.d/ntp","html":"<p>rm /etc/dhcp/dhclient-exit-hooks.d/ntp</p>"},{"id":"text-331","type":"text","heading":"","plain_text":"and if you have the following file, remove it as well:","html":"<p>and if you have the following file, remove it as well:</p>"},{"id":"text-332","type":"text","heading":"","plain_text":"rm /var/lib/ntp/ntp.conf.dhcp","html":"<p>rm /var/lib/ntp/ntp.conf.dhcp</p>"},{"id":"text-333","type":"text","heading":"","plain_text":"Then reboot.\nYou can produce real-time graphs like those below using MRTG\nand a simple script which can get the statistics from NTP remotely. Là\nis more information here.  I happen to run\nMRTG and the collection scripts on a Windows PC.","html":"<p>Then reboot.\nYou can produce real-time graphs like those below using MRTG\nand a simple script which can get the statistics from NTP remotely. Là\nis more information here.  I happen to run\nMRTG and the collection scripts on a Windows PC.</p>"},{"id":"text-334","type":"text","heading":"","plain_text":"RasPi-2\n \nRasPi-4","html":"<p>RasPi-2\n \nRasPi-4</p>"},{"id":"text-335","type":"text","heading":"","plain_text":"Information on general SNMP monitoring may now be found here. \nThis allows monitoring of the network I/O on the card, and a number of other\nparameters which are exposed for measurement by the OS.  An example graph\nfollows:","html":"<p>Information on general SNMP monitoring may now be found here. \nThis allows monitoring of the network I/O on the card, and a number of other\nparameters which are exposed for measurement by the OS.  An example graph\nfollows:</p>"},{"id":"text-336","type":"text","heading":"","plain_text":"RasPi-3","html":"<p>RasPi-3</p>"},{"id":"text-337","type":"text","heading":"","plain_text":"As NTP tries to keep the clock on the card at a constant\nfrequency, it is often compensating for the effects of temperature changes which\ncause frequency changes.  It is therefore worthwhile monitoring the CPU temperature\nmonitoring as described here,\nalthough with a PPS signal and when used as a stratum-1 server, temperature\neffects may be less obvious.  Example graphs are shown below:","html":"<p>As NTP tries to keep the clock on the card at a constant\nfrequency, it is often compensating for the effects of temperature changes which\ncause frequency changes.  It is therefore worthwhile monitoring the CPU temperature\nmonitoring as described here,\nalthough with a PPS signal and when used as a stratum-1 server, temperature\neffects may be less obvious.  Example graphs are shown below:</p>"},{"id":"text-338","type":"text","heading":"","plain_text":"RasPi-4","html":"<p>RasPi-4</p>"},{"id":"text-339","type":"text","heading":"","plain_text":"The MRTG monitoring scripts (which I actually run on a Windows PC\ncovering several Raspberry Pi cards) are in this Zip\narchive. \n \nI extended the SNMP pass function to allow monitoring of\nambient temperature using the DS18B20 &quot;single-wire&quot; device. Cette\nis well written up for use with the Raspberry Pi here,\nand the detailed description is now here. \nSample results:","html":"<p>The MRTG monitoring scripts (which I actually run on a Windows PC\ncovering several Raspberry Pi cards) are in this Zip\narchive. \n \nI extended the SNMP pass function to allow monitoring of\nambient temperature using the DS18B20 &quot;single-wire&quot; device. Cette\nis well written up for use with the Raspberry Pi here,\nand the detailed description is now here. \nSample results:</p>"},{"id":"text-340","type":"text","heading":"","plain_text":"RasPi-4\nIndoor temperature °C","html":"<p>RasPi-4\nIndoor temperature °C</p>"},{"id":"text-341","type":"text","heading":"","plain_text":"Outdoor temperature °F","html":"<p>Outdoor temperature °F</p>"},{"id":"text-342","type":"text","heading":"","plain_text":"Merci!\n \nMy thanks to Webshed for\nuploading the information about using the DS18B20. \n \nRunning a publicly accessible NTP server\n \nIf you are running a server which is accessible from the\npublic Internet &#8211; perhaps you are contributing to the NTP\nbassin project &#8211; there are some simple precautions you should take to ensure\nthat your server is not used as the source of an attack on other PCs. Remarque\nthat this doesn&#39;t apply to most end-user clients sitting on your local PC, you\nwould need to have specially opened a port in your firewall or router to allow\npublic incoming unsolicited UDP port 123 packets into your local network. \nIf you are using a development version (4.2.7p26 or later) you are already\nprotected.  The following notice explains more:","html":"<p>Merci!\n \nMy thanks to Webshed for\nuploading the information about using the DS18B20. \n \nRunning a publicly accessible NTP server\n \nIf you are running a server which is accessible from the\npublic Internet &#8211; perhaps you are contributing to the NTP\nbassin project &#8211; there are some simple precautions you should take to ensure\nthat your server is not used as the source of an attack on other PCs. Remarque\nthat this doesn&#039;t apply to most end-user clients sitting on your local PC, you\nwould need to have specially opened a port in your firewall or router to allow\npublic incoming unsolicited UDP port 123 packets into your local network. \nIf you are using a development version (4.2.7p26 or later) you are already\nprotected.  The following notice explains more:</p>"},{"id":"text-343","type":"text","heading":"","plain_text":"NTP users are strongly urged to take immediate action to ensure that their NTP daemon is not susceptible to use in a reflected denial-of-service\n      (DRDoS) attack. Please see the\n       NTP Security Notice for vulnerability and mitigation details, and the\n      Réseau\n      Time Foundation Blog pour plus d&#39;informations. (January 2014)","html":"<p>NTP users are strongly urged to take immediate action to ensure that their NTP daemon is not susceptible to use in a reflected denial-of-service\n      (DRDoS) attack. Please see the\n       NTP Security Notice for vulnerability and mitigation details, and the\n      Réseau\n      Time Foundation Blog pour plus d&#039;informations. (January 2014)</p>"},{"id":"text-344","type":"text","heading":"","plain_text":"Raspberry Pi: 86 x 56 x 21 mm\nRaspberry Pi in its box: 91 x 62 x 29 mm\nTrimble evaluation board: 66 x 32 x 8 mm\nTrimble evaluation board with interface: 66 x 32 x 24 mm\nU-blox interface card: 39 x 22 x 6 mm (excluding connection\n    pins)\nPatch antenna supplied with interface card: 25 x 25 x 7 mm","html":"<p>Raspberry Pi: 86 x 56 x 21 mm\nRaspberry Pi in its box: 91 x 62 x 29 mm\nTrimble evaluation board: 66 x 32 x 8 mm\nTrimble evaluation board with interface: 66 x 32 x 24 mm\nU-blox interface card: 39 x 22 x 6 mm (excluding connection\n    pins)\nPatch antenna supplied with interface card: 25 x 25 x 7 mm</p>"},{"id":"text-345","type":"text","heading":"","plain_text":"What else have I done with the Raspberry Pi?","html":"<p>What else have I done with the Raspberry Pi?</p>"},{"id":"text-346","type":"text","heading":"","plain_text":"Receiving ADS-B signals on\n1.09 GHz with a cheap TV dongle and feeding the results to Plane\nPlotter over a Wi-Fi link.  This allows you to put the receiver right\nup close to the antenna, avoiding an expensive (or lossy) piece of cable, and\navoiding the need for a cable run at all.  Details are here. \nIt&#39;s not much more than following someone else&#39;s instructions, but at least I\ncan vouch for every command on that page, and perhaps you will find something\nuseful there.\nA Digital Wall clock\n    using the Raspberry Pi &#8211; synchronised with NTP, of course!","html":"<p>Receiving ADS-B signals on\n1.09 GHz with a cheap TV dongle and feeding the results to Plane\nPlotter over a Wi-Fi link.  This allows you to put the receiver right\nup close to the antenna, avoiding an expensive (or lossy) piece of cable, and\navoiding the need for a cable run at all.  Details are here. \nIt&#039;s not much more than following someone else&#039;s instructions, but at least I\ncan vouch for every command on that page, and perhaps you will find something\nuseful there.\nA Digital Wall clock\n    using the Raspberry Pi &#8211; synchronised with NTP, of course!</p>"},{"id":"text-347","type":"text","heading":"","plain_text":"Acknowledgments\nI would like to support NTP\n \nClick to rate this post!\n                                   \n                               [Total: 0  Average: 0]","html":"<p>Acknowledgments\nI would like to support NTP\n \nClick to rate this post!\n                                   \n                               [Total: 0  Average: 0]</p>"}],"sections":[{"id":"text-1","heading":"Text","content":"A titre d’expérience, j’ai acheté l’un des modèles à faible coût\ntaille de carte de crédit Framboise\nPi ordinateurs, et l’ont configuré pour exécuter NTP (Network Time Protocol).\nJ&#39;ai également utilisé cette carte avec un récepteur GPS avec une sortie impulsions par seconde (PPS) pour\nStratum-1 serveur NTP, mais comme je connais peu de Linux, il a fallu un certain temps pour\natteindre cet objectif! Il y a quelques commandes utiles Linux dispersées à travers\ncette page. Ces notes sont presque autant pour mes propres disques pour\nla prochaine fois que je devrai visiter ce projet, mais j’espère qu’ils pourront vous aider.\nautres.\nSi vous voulez commencer rapidement avec les meilleurs résultats pour\nminimum de bruit, s&#39;il vous plaît voir mon Raspberry Pi NTP\nentrée rapide page. S&#39;il vous plaît voir aussi cette\npage pour des problèmes avec la version de Jessie de Linux, et avec la plus récente\nRaspberry Pi modèle 3.\nJe commence par décrire comment faire fonctionner le Raspberry Pi avec\njuste une connexion LAN &#8211; sans écran, clavier ou souris &#8211; un soi-disant sans tête\nopération. Je décris ensuite comment configurer NTP pour votre environnement, et\najout d&#39;un récepteur GPS / PPS pour convertir votre boîte en un serveur NTP de strate-1\ny compris les mises à jour du système d&#39;exploitation nécessaires. Ensuite, je note quelques\nJ&#39;ai eu des problèmes avec le premier récepteur GPS que j&#39;ai essayé et comment j&#39;ai guéri ceux qui avaient un\nrécepteur GPS différent pour produire un serveur NTP strate-1 consommant environ 4\nwatts. L&#39;approche la plus simple avec de bonnes performances est décrite ici.  \nDepuis le début de cette page, deux développements ont eu lieu\nqui facilitent quelque peu le processus &#8211; un programme a été développé qui\npermet l&#39;utilisation d&#39;un système d&#39;exploitation non modifié en travaillant en mode utilisateur\nplutôt que PPS en mode noyau, et un module est maintenant disponible qui se branche directement\nsur l&#39;en-tête GPIO à 26 broches du Raspberry Pi, afin non\nla soudure est impliquée. Mes remerciements à Folkert van Heusden et Anthony\nStirk pour ces développements.\n  Notez que le GPS Hat Adafruit utilise GPIO 4, broche physique 7,\nvous devrez donc changer les commandes données dans ce document. Les ajouts ultérieurs ont inclus la télécommande surveillance\ndu serveur NTP performance, et surveillance plus générale de la framboise\nPi en utilisant les fonctions standard SNMP, avec un supplément\nCPU\nTempérature surveillance add-on. Mon principal Framboise\nPage Pi peut également être d&#39;intérêt.\nNotez que de bonnes performances dépendent du fait que l’unité GPS a\nune vue dégagée du ciel, en particulier la partie sud du ciel si vous êtes en\nl&#39;hémisphère nord. Avec les anciens récepteurs GPS, cela nécessitait une installation extérieure.\nantenne, mais des unités plus modernes telles que celles mentionnées ici pourraient bien fonctionner\nà l’intérieur à condition que du ciel soit visible, peut-être au dernier étage de la\nbâtiment (comme je suis). Si vous avez un toit &quot;résistant aux RF&quot; (plombé,\npeut-être?!) ou certaines fenêtres avec une doublure pour arrêter la chaleur entrante, ou la construction du mur\ny compris le métal, vous aurez peut-être encore besoin d’une antenne extérieure, et presque certainement si\nvous vivez dans un sous-sol! Alors que le temps aura normalement seulement une petite\neffet dans le signal &#8211; par ex. forte pluie &#8211; il est possible qu&#39;une couche de neige\npourrait atténuer suffisamment le signal pour empêcher le GPS de recevoir suffisamment de signal.\nLe suivi des performances peut vous aider à détecter ces problèmes. (Merci à Joe,\nHB9DRT pour l&#39;information sur la neige &#8211; Je n&#39;ai vu ce problème qu&#39;une fois ici\npendant un hiver exceptionnellement froid).\nintroduction\nLe Raspberry Pi est un ordinateur au format carte de crédit.\ndisponible chez les distributeurs du monde entier. J&#39;ai acheté un bleu attrayant\nboîtier et alimentation 5 V, 2 A de ModMyPi.\nVous pouvez voir le fil Ethernet à gauche et la carte SD de 4 Go avec le\nsystème d’exploitation à droite, ainsi que le cordon d’alimentation micro-USB.\nIl existe un modèle B (illustré et utilisé ci-dessous) et un modèle A de spécification inférieure qui peut\ndevenir disponible à un moment dans l’avenir. J&#39;utilise le modèle B de 512 Mo,\nintroduit à l&#39;automne 2012."},{"id":"text-2","heading":"Text","content":"Ci-dessous, les résultats offset avec le Raspberry Pi en\ntrois configurations: avec des connexions WAN uniquement synchronisées sur Internet (comme\npourrait trouver une situation typique de la maison), avec\nConnexions LAN à un serveur local de strate 1 et agissant en tant que\nle serveur Stratum-1 avec deux petits récepteurs GPS / PPS différents comme horloge de référence. Tout\nproblèmes dans les données en direct sont susceptibles d&#39;être le résultat de mon redémarrage, rendant la configuration\nchangements, ou le signal GPS étant inférieur à la normale. La configuration NTP normale est listée ici.\nComme prévu, la synchronisation depuis le réseau local produit de meilleurs résultats que depuis Internet.\n(WAN), et en transformant le périphérique en serveur de la strate 1, le résultat est encore plus bas.\ncompensations.\nLe décalage zéro correspond à la ligne médiane du graphique, comme\nl&#39;utilité que j&#39;utilise est incapable de tracer des valeurs négatives. J&#39;ajoute donc\nla moitié de la plage de l’axe Y aux valeurs réelles avant de tracer.  Remarque: celles-ci\nles graphiques sont  ne pas tous à la même échelle verticale! \nDécalage utilisant uniquement des serveurs Internet &#8211; échelle milliseconde\n  La performance qui en résulte est bonne, mais cela dépendra à la fois du chargement du lien entre moi et\nle FAI, et la charge générale sur le réseau du FAI et l&#39;Internet général.\nLes décalages seraient d’environ +/- 5 millisecondes (et donc hors échelle).\nune fois sur le graphique ci-dessous). Les quatre lignes ntp.conf\nen cours d’utilisation est indiqué sous le graphique."},{"id":"text-3","heading":"Text","content":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation WANéchelle milliseconde"},{"id":"text-4","heading":"Text","content":"# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\npool fr.pool.ntp.org iburst"},{"id":"text-5","heading":"Text","content":"Décalage à l&#39;aide de serveurs LAN locaux interrogés toutes les 32 secondes &#8211; échelle en microsecondes\nLe passage à un couplage étroit avec un serveur de strate 1 local sur le réseau local produit beaucoup mieux\nrésultats, avec un chronométrage de l’ordre de 30 microsecondes. J&#39;ai ajouté un\ndeuxième graphique avec une échelle de +/- 500 microsecondes pour montrer les excursions les plus importantes."},{"id":"text-6","heading":"Text","content":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation de réseau localéchelle de précision"},{"id":"text-7","heading":"Text","content":"Mêmes données mais sur unéchelle microseconde"},{"id":"text-8","heading":"Text","content":"# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift\n# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst"},{"id":"text-9","heading":"Text","content":"Décalage à l&#39;aide du module GPS de synchronisation Trimble Resolution-SMT\nDes résultats bien meilleurs sont obtenus avec un Trimble Resolution SMT\nModule GPS, avec sa broche PPS connectée à la broche GPIO 24 pour un mode noyau\n&quot;ATOM&quot; horloge de référence. Cette unité est un GPS &quot;de synchronisation&quot;, avec 15\nns précision spécifiée pour le signal PPS. Chaque seconde sur le GPIO\npin provoque une interruption dans laquelle l’horloge de la CPU est notée, puis utilisée par NTP pour\nfaire des ajustements fins à la vitesse d&#39;horloge du logiciel. le\ntransitoires d’une amplitude de quelques microsecondes d’une durée d’une heure environ peuvent être dus à une\nchangements de température ambiante affectant le cristal utilisé par l&#39;horloge de la carte\nGénérateur. Non indiqué sur le graphique, mais le décalage dû à une tâche gourmande en ressources processeur (recompilation de NTP à partir de la source,\nenviron 25 minutes) a entraîné une excursion positive de 20 µs,\nsuivi d&#39;une excursion négative de 10 µs avec le refroidissement des températures et du NTP\nrétabli."},{"id":"text-10","heading":"Text","content":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS du noyauRésolution Trimble SMTchronométrage récepteur GPS"},{"id":"text-11","heading":"Text","content":"Décalage lors du passage à un module GPS NEO-6M u-blox\nLors de l&#39;utilisation d&#39;un GPS u-blox MEO-6M\nmodule, avec sa broche PPS connectée à la broche GPIO 24 pour un mode en mode noyau\n&quot;ATOM&quot;, on obtient des résultats similaires. Le transitoire au milieu du graphique est\nlorsqu’un deuxième appareil était connecté à la ligne 5 V de l’USB. Cette unité\nest un GPS de &quot;navigation&quot;, où le PPS est spécifié à environ 100 ns, plutôt\nqu&#39;un &quot;timing&quot; GPS &#8211; mais\nla différence entre les deux unités est le plus souvent masquée par les autres variations du\nsystème."},{"id":"text-12","heading":"Text","content":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +"},{"id":"text-13","heading":"Text","content":"Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation"},{"id":"text-14","heading":"Text","content":"Plus tard, il a été remarqué que le décalage variait\npériodiquement, ce qui est un résultat inattendu. Ci-dessous un exemple des 19 au 21 décembre 2012, avec les moins stables\npériode débutant le 19 décembre 2012 et se terminant le 20 décembre.\nUn examen plus détaillé des données de loopstats montre une période réelle d’un peu plus de 100\nsecondes, et il est alias par l&#39;échantillon de 5 minutes de MRTG."},{"id":"text-15","heading":"Text","content":"Raspberry Pi # 1512 Mo,\n      Linux / 3.2.27 +"},{"id":"text-16","heading":"Text","content":"Synchronisation PPS du noyauModule U-blox 6Mrécepteur GPS de navigation"},{"id":"text-17","heading":"Text","content":"Pour tester, j&#39;avais changé le récepteur GPS d&#39;U-blox 6M à Adafruit MTK3339\nmodule de navigation GPS, puis modifié à nouveau du module de navigation à\nun module GPS de chronométrage basé sur le U-blox\nLEA-6T, pour voir si l’oscillation était affectée. Ces changements\nn&#39;a fait aucune différence ni pour l&#39;amplitude ni pour la période de l&#39;oscillation,\net l&#39;amplitude de l&#39;oscillation était considérablement plus grande que ce qui serait\nattendu même d&#39;un récepteur GPS &quot;de navigation&quot;. Donc mon plus tôt\nThéories sur la navigation par rapport à la synchronisation, les modules GPS, le chargement USB et les E / S série\nle chargement était incorrect. Ce problème a finalement été résolu par un firmware\nmise à jour sur Raspberry Pi # 1, de la version 337601 à la version 346337."},{"id":"text-18","heading":"Text","content":"Performance actuelle &#8211; cliquez sur un graphique pour accéder à la page de performance de chaque ordinateur.\nJ&#39;ai ajouté un deuxième ordinateur Raspberry Pi et j&#39;ai maintenant les deux\nconnectés aux deux récepteurs GPS / PPS mentionnés ci-dessus, mais avec le\nantennes pour ces récepteurs dans un emplacement intérieur similaire. Ci-dessous est un\ncomparaison de la performance. Raspberry Pi # 1 est situé dans un endroit non chauffé\nchambre avec un mur orienté au nord. Raspberry Pi # 3 est également dans le bureau, mais situé\nun peu plus près d&#39;un radiateur, fournissant les transitoires quotidiens. Mi-novembre\n2013, je suis passé à un nouveau noyau qui a été compilé localement avec une option pour\naméliorer les performances NTP."},{"id":"text-19","heading":"Text","content":"Raspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationdans une pièce non chauffée"},{"id":"text-20","heading":"Text","content":"&lt;! &#8211;"},{"id":"text-21","heading":"Text","content":"Raspberry Pi # 2512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339récepteur GPS de navigationen environnement de bureau"},{"id":"text-22","heading":"Text","content":"-&gt;"},{"id":"text-23","heading":"Text","content":"Raspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigationRécepteur GPSen environnement de bureau"},{"id":"text-24","heading":"Text","content":"Raspberry Pi # 4512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 5S navigationRécepteur GPSdans une pièce non chauffée"},{"id":"text-25","heading":"Text","content":"Raspberry Pi # 5512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauCalendrier U-blox 7QRécepteur GPSen environnement de bureau"},{"id":"text-26","heading":"Text","content":"et voici une façon légèrement différente de regarder la valeur du décalage,\ntracer la valeur absolue du décalage, le rouge pour les décalages positifs et le bleu pour\ncompensations négatives. Les événements transitoires tels que les redémarrages ont été supprimés."},{"id":"text-27","heading":"Text","content":"Raspberry Pi # 1512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigation Récepteur GPS dans une pièce non chauffée"},{"id":"text-28","heading":"Text","content":"&lt;! &#8211;"},{"id":"text-29","heading":"Text","content":"Raspberry Pi # 2512 Mo,\n      Linux / 3.2.27 +\nSynchronisation PPS en mode noyau\n      Adafruit MTK3339\n      la navigationRécepteur GPS\n      en environnement de bureau"},{"id":"text-30","heading":"Text","content":"-&gt;"},{"id":"text-31","heading":"Text","content":"Raspberry Pi # 3512 Mo, Linux / 3.6.11\nSynchronisation PPS en mode noyauU-blox 6M navigation\n GPS receveur\n      en environnement de bureau"},{"id":"text-32","heading":"Text","content":"Raspberry Pi # 4512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyauU-blox 5S navigation\n GPS receveur\n      dans une pièce non chauffée"},{"id":"text-33","heading":"Text","content":"Raspberry Pi # 5512 Mo, Linux / 3.6.11 +\nSynchronisation PPS en mode noyau\n      Calendrier U-blox 7Q\n GPS receveur\n      en environnement de bureau"},{"id":"text-34","heading":"Text","content":"Création d&#39;une carte SD avec le système d&#39;exploitation\nVous pouvez acheter une carte SD avec le système d&#39;exploitation Linux installé et prêt\naller. Sachant que je devrais apporter des modifications au système d’exploitation, j’ai acheté un\ncarte SD prête à être programmée au cas où, mais j’ai fabriqué la mienne par\nen suivant les étapes ici: http://www.raspberrypi.org/downloads"},{"id":"text-35","heading":"Text","content":"Téléchargez une image de système d&#39;exploitation pour la carte SD &#8211; 2012-09-18-wheezy-raspbian.zip \nDécompressez le contenu de l&#39;archive Zip dans un fichier .IMG \nTéléchargez le programme d&#39;écriture de carte SD: Win32DiskImager \nUtilisez l’imageur de disque pour écrire l’image du système d’exploitation sur la carte SD."},{"id":"text-36","heading":"Text","content":"J&#39;ai ensuite branché la carte SD au Raspberry Pi, connecté\nau réseau, et le pouvoir appliqué &#8230;"},{"id":"text-37","heading":"Text","content":"Beaucoup de gens ont demandé d&#39;ajouter un GPS à\nle Raspberry Pi sans avoir besoin de soudure, et maintenant cela est devenu une réalité grâce à la NTPI\nGPS Addon Board produit par Nevis Computers Ltd au Royaume-Uni. J&#39;ai utilisé le rpi_gpio_ntp\nprogramme a été développé par Folkert van Heusden et annoncé\ndans la liste de diffusion Time-Nuts, qui permet de travailler en mode utilisateur avec PPS\nsignal, ne nécessitant donc pas de version spéciale du système d’exploitation.\nLes versions actuelles de Raspbian n&#39;en ont plus besoin.\nC’est ce que vous obtenez dans la boîte du GPS NTPI Raspberry Pi\nCarte d&#39;extension (avec l&#39;option antenne puck):"},{"id":"text-38","heading":"Text","content":"Une carte avec le périphérique GPS de qualité de synchronisation et le connecteur SMA\n    qui se branche sur le connecteur GPIO à 26 broches du Pi.\nUn  optionnel antenne GPS à rondelle magnétique, ou vous pouvez utiliser votre propre\n    antenne avec un connecteur SMA.\nVous aurez peut-être également besoin de: Une pile de secours CR2032, qui s’ajuste sur la face inférieure\n    de la carte."},{"id":"text-39","heading":"Text","content":"(Notez que l’antenne est une option supplémentaire et que vous devez acheter\nvotre propre batterie)\nPour que cela fonctionne avec un Raspberry Pi, voici les étapes que je\na pris. J&#39;ai inclus les étapes pour ajouter la surveillance MRTG et le fichier distant\naccès à partir de systèmes Windows, mais vous pouvez les omettre si vous n&#39;en avez pas besoin."},{"id":"text-40","heading":"Text","content":"Configurer mon routeur pour réserver une adresse IP au Raspberry\n    Pi\nModification du nom de l&#39;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nNTP mis à jour pour le développement actuel\n    version (j&#39;ai utilisé une copie FTP d&#39;un autre Pi).\nConfigurez les E / S série sur le\n    Tarte aux framboises.\nGpsd installé et configuré et ses utilitaires.\nNTP configuré pour utiliser la mémoire partagée pendant un temps approximatif\n    (type de pilote 28.0).\nInstallé les outils PPS (sudo apt-get install pps-tools)\nInstallé le rpi_gpio_ntp\n    programme de Folkert van Heusden (seulement pour très tôt Raspbian\n    versions).\nNTP configuré pour utiliser le partagé\n    mémoire pour PPS (type de pilote 28.1).\nSNMP installé et configuré\n    divers collecteurs de données MRTG (facultatif).\nSNMP configuré pour surveiller la  CPU\n    Température (optionnel).\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC (facultatif).\nConfigurer le PC pour la mise en réseau sans fil\n    Clé USB Wi-Fi (en option)."},{"id":"text-41","heading":"Text","content":"Installé sur le Raspberry Pila carte ressemble à ceci. lele fil d&#39;antenne peut être retiréà travers un trou dans le boîtier près du connecteur Ethernet.\nNotez que cette carte utilise GPIO 18 pour son signal PPS, donc tout logiciel doit être configuré de manière appropriée."},{"id":"text-42","heading":"Text","content":"Vous pouvez demander à quel point ce mode utilisateur fonctionne correctement. bien\nc&#39;est plutôt bien, mais pas assez aussi bon que le mode noyau, mais plus\nque suffisant pour la précision offerte par le Raspberry Pi. Peut-être le\nmieux que le Pi pourrait faire sinon serait la synchronisation via une connexion LAN à un\nStratum-1 serveur NTP. La comparaison de tracé ci-dessous montre le Pi synchronisé\nsur un serveur de strate-1 mais sur Wi-Fi, puis sur les performances après l&#39;installation\nle panneau d&#39;addition GPS NTPI. Un terrain idéal serait une ligne droite à la\nNiveau 500 microsecondes sur ce graphique (je dois ajouter un décalage car MRTG ne peut pas tracer\nnombres négatifs). La gigue moyenne sur 6 heures rapportée par NTP est passée de\n100-150 microsecondes à moins de 4 microsecondes. L&#39;amélioration de la marche\nde la synchronisation Wi-Fi à la synchronisation PPS, c&#39;est évident!"},{"id":"text-43","heading":"Text","content":"Mise à jour vers la dernière version de Raspbian Linux\nLa version de Linux que vous utilisez est affichée lorsque vous vous connectez, mais vous\npeut également utiliser la commande:\n  $ uname -a\npour montrer quelle version est en cours d&#39;exécution. J&#39;ai commencé avec:  Linux raspberrypi 3.12.26+ # 702 PREEMPT Wed Aug 6 17:43:49 BST 2014 armv6l GNU / Linux\nPour mettre à jour mon logiciel, j&#39;ai exécuté les commandes:\n  $ sudo apt-get update  $ sudo apt-get dist-upgrade  $ sudo rpi-update\net après le redémarrage, j&#39;ai terminé par:  Linux raspberrypi 3.12.32+ # 721 PREEMPT Fri Nov 7 16:50:31 GMT 2014 armv6l \nConfiguration de Linux pour PPS sur le port GPIO\nGrâce aux courriels de Olav Andrarde et Timo Kokkonen, j&#39;ai découvert que\nLe support PPS a été ajouté à Linux disponible pour le Raspberry Pi,\nbien que vous ayez besoin d&#39;ajouter quelques lignes à la configuration pour l&#39;activer.\nComme Raspbian évolue continuellement, la méthode exacte pour effectuer ces changements\névolue également, donc en fonction du moment où vous avez téléchargé Raspbian, vous devez suivre\nsoit le novembre 2014 ou le février\n2015 sections ci-dessous. J&#39;ai mis les informations les plus récentes en premier,\nbien que je préfère normalement que les choses soient énumérées dans l’ordre chronologique, comme dans un\njournal intime!\n    Versions Raspbian vers février 2015\nAprès avoir mis à jour un autre Raspberry Pi vers le dernier Raspbian &#8211; pour un nouveau\nRaspberry Pi 2 que j&#39;avais acheté &#8211; j&#39;ai découvert que les choses avaient changé une fois\nencore. Ces détails de mon démarrage rapide\npage. Versions de Linux: 3.18.6+ 3.18.7-v7\n  $ sudo nano /boot/config.txt\n&#8211; Ajouter dtoverlay = pps-gpio, gpiopin = 18\nsur une nouvelle ligne.\n   Si vous avez précédemment ajouté bcm2708.pps_gpio_pin = 18 à la fin de\ncmdline.txt, supprimez-le.   Sauver et fermer.\n  $ sudo nano\n/ etc / modules &#8211; Ajouter pps-gpio\nsur une nouvelle ligne.   Enregistrez, fermez et redémarrez.\nMaintenant, vérifiez que PPS fonctionne.\n    Versions Raspbian vers novembre 2014\nPour activer PPS sur le port GPIO, vous devez suivre deux étapes: l’une pour indiquer au\nnoyau pour inclure le support, et un pour amener le module de support à\nêtre chargé. Tout d’abord, indiquez au noyau que la broche 18 de GPIO doit être utilisée.\nCela active la prise en charge de PPS-GPIO dans le noyau. Ajouter ce texte au\nFichier /boot/cmdline.txt:\n  $ sudo nano /boot/cmdline.txt    ajouter:        bcm2708.pps_gpio_pin = 18    à la  fin de la ligne.    Ce doit être sur le même ligne, pas sur un Nouveau ligne,\ncomme l&#39;a découvert Ray Hunter!\nEnsuite, vous devez dire au noyau de charger le module qui fournit cette information.\nsoutien. Pourquoi cela ne peut pas être automatique, je ne sais pas! Ajouter le\nnom du module à la fin du fichier / etc / modules.\n  $ sudo nano / etc / modules    ajouter:       \npps-gpio     à la fin si la liste, et redémarrez. \nVérifier que PPS fonctionne\nPour vérifier que le module est chargé, vous pouvez utiliser la commande lsmod, par exemple\nexemple:\n  $ lsmod | grep pps\nLa sortie devrait être semblable à:\n  pps_gpio 2529 1  pps_core 7943 2 pps_gpio\nVous devriez maintenant pouvoir exécuter la commande ppstest et voir les transitions\nune fois par seconde, par exemple:\n$ sudo ppstest / dev / pps0 # appuyez sur Ctrl-C pour annuler .. essayer le source PPS &quot;/ dev / pps0&quot; a trouvé la source PPS &quot;/ dev / pps0&quot; ok, trouvé 1 source (s), commencez maintenant à récupérer les données &#8230; source 0 &#8211; assert 1351501153.999956346, séquence: 47481 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501154.999954601, séquence: 47482 &#8211; effacer 0,000000000, séquence: 0 source 0 &#8211; assert 1351501155.999951856, séquence: 47483 &#8211; effacé 0,000000000, séquence: 0 ^ C"},{"id":"text-44","heading":"Text","content":"Notez qu&#39;il n&#39;y a pas de valeur donnée pour le temps &quot;clair&quot;. Gary\nE Miller rapporte que le pilote pps-gpio ne cherche qu’un seul avantage, le positif\nbord allant. Si vous utilisez un appareil GPS différent de ceux mentionnés\nDans ce cas, vous aurez peut-être besoin d’un onduleur de sortie de 3,3 volts dans la ligne PPS du GPS."},{"id":"text-45","heading":"Text","content":"L&#39;approche de Hauke ​​Lampe\nUniquement des informations historiques: Depuis que j&#39;ai écrit cette page pour la première fois, Hauke ​​Lampe a\ndisponible une image préconfigurée de Raspberry Pi OS ici.\nSon article est basé sur sa version d’un GPS série comme je le décris ici, mais vous devez le faire.\naucun des travaux de construction et de configuration que je mentionne ici. Ma framboise\nLa Pi # 3 fonctionne à partir de cette image de système d&#39;exploitation et je développe l&#39;installation GPS à l&#39;adresse\nle moment. Les commentaires et les changements jusqu&#39;à présent:"},{"id":"text-46","heading":"Text","content":"Modification de l&#39;adresse IP du port Ethernet en un numéro fixe\n    adresse (statique) &#8211; Comment\n    à.Remarque: Si vous faites cela, vous devrez peut-être éditer le fichier hosts sur votre ordinateur.\n    systèmes pour permettre l&#39;accès à l&#39;appareil par nom plutôt que par IP\n    adresse. Ajouter une ligne telle que:  192.168.0.51\n    framboise-pi-1 \n    au fichier (avec l&#39;adresse et le nom de votre RPi, bien sûr). Sur\n    Windows-8, notez que Windows Defender peut essayer de remplacer un hôte modifié\n    fichier avec celui par défaut, supprimant ainsi vos modifications! Sous Windows, le\n    Le fichier à modifier est  Windows  system32  drivers  etc  hosts, et vous devrez peut-être\n    Accès de niveau administrateur pour éditer ce fichier.\nModification du nom de l&#39;appareil &#8211; Comment\n    à.\nNTP configuré pour utiliser la directive pool,\n    permettre la surveillance à distance, et bûche\n    statistiques.\nSNMP installé et configuré\n    divers collecteurs de données MRTG.\nSAMBA installé, pour que je puisse\n    accéder aux statistiques NTP à partir du PC.\nConfigurer le PC pour la mise en réseau sans fil avec un ancien NetGear\n    Clé USB Wi-Fi (remplacée plus tard par une unité Edimax)."},{"id":"text-47","heading":"Text","content":"Quelques utilitaires &quot;standard&quot; de Raspberry Pi\nne sont pas présents dans cette image de système d&#39;exploitation, et devront être téléchargés séparément avec\napt-get. Voici à quoi cela ressemble pour le moment. L&#39;antenne patch\nest attaché au ModMyPi blanc\navec du ruban adhésif double face, et la carte réceptrice avec un écrou simple et\nboulon. Les dérivations provenaient également de ModMyPi et la longueur de 150 mm n’est pas\nnécessaire ici! Le dongle Wi-Fi est à gauche. Graphiques de performance\nsont ici."},{"id":"text-48","heading":"Text","content":"Comme mon application d’essai est pour un serveur NTP, je n’ai pas besoin de\nafficher sur le Raspberry Pi, ou d&#39;ailleurs un clavier et une souris connectés en permanence. Tous mes\nl&#39;interaction se fera via un terminal, et même cela sera émulé via programme\nfonctionnant sur un ordinateur distant, avec une connectivité via le port Ethernet du\nTarte aux framboises. Une telle opération est communément appelée un serveur sans tête.\nUn bloc d&#39;alimentation et un boîtier sont les seuls éléments que j&#39;ai ajoutés au Raspberry fourni\nPi. Il y a quelques conseils pour courir sans tête ici: http://glynrob.com/hardware/raspberry-pi-headless/\nVous avez besoin d’un programme terminal qui fonctionnera en mode SSH &#8211; I\nmastic utilisé\nsur un PC Windows XP.\nJ&#39;ai regardé sur mon routeur qui exécute DD-WRT pour voir l&#39;adresse IP\nqui avait été affecté au Pi, et j&#39;ai ensuite utilisé cette adresse pour exécuter\nPUTTY en mode SSH. J&#39;ai tout de suite une connexion avec l&#39;utilisateur par défaut\nnom et mot de passe. Vous pouvez enregistrer les paramètres du Pi depuis PUTTY.\n(J&#39;ai appelé le mien &quot;RaspberryPi&quot;), et fais un raccourci Windows pour se connecter\nà votre Pi avec des valeurs telles que:"},{"id":"text-49","heading":"Text","content":"Cible: C:  Tools  PuTTY  PUTTY.EXE -load RaspberryPi\nCommencez dans: C:  Tools  PuTTY"},{"id":"text-50","heading":"Text","content":"Votre chemin d&#39;accès et le nom des paramètres enregistrés seront différents.\nCommande Linux pour se déconnecter et se déconnecter:\nse déconnecter\nAu fait, en ajoutant un serveur X-windows\nprogramme tel que Xming sur votre PC, vous pouvez voir les graphiques du Raspberry Pi\naussi, si vous voulez, mais c&#39;est  ne pas nécessaire pour les opérations décrites\nici &#8211; vous pouvez tout faire directement à partir de la ligne de commande.  \nMise à jour du système d&#39;exploitation\nJ&#39;ai suivi le conseil ici\npour mettre à jour le système d&#39;exploitation, bien que je ne pense pas que c&#39;était vraiment nécessaire car le système d&#39;exploitation\ntéléchargé n&#39;avait qu&#39;un mois. Pour exécuter les commandes nécessite des privilèges\naccès, obtenu ici en préfixant la commande avec sudo.\nL’exécution de ces commandes prend beaucoup de temps et nécessite un accès Internet depuis\nvotre Pi. Prévoyez 30 à 45 minutes."},{"id":"text-51","heading":"Text","content":"$ sudo apt-get update"},{"id":"text-52","heading":"Text","content":"$ sudo apt-get dist-upgrade"},{"id":"text-53","heading":"Text","content":"Vous devrez probablement redémarrer le système d&#39;exploitation après avoir apporté les modifications suivantes:"},{"id":"text-54","heading":"Text","content":"$ sudo reboot"},{"id":"text-55","heading":"Text","content":"Si vous souhaitez déterminer quelles mises à niveau sont en attente, essayez:"},{"id":"text-56","heading":"Text","content":"$ sudo apt-get --just-print upgrade"},{"id":"text-57","heading":"Text","content":"et redirigez la sortie vers un fichier texte. Merci à Graham\ndans le comté de Durham, au Royaume-Uni, pour ce conseil. \nRéglage du fuseau horaire\nVous voudrez peut-être vérifier que le Raspberry Pi est configuré pour\nvous donner l&#39;heure dans votre fuseau horaire local: Utilisez la commande:"},{"id":"text-58","heading":"Text","content":"$ sudo dpkg-reconfigure tzdata"},{"id":"text-59","heading":"Text","content":"et sélectionnez la région et la ville appropriées. Pour le Royaume-Uni,\nJ&#39;ai choisi l&#39;Europe / Londres. La procédure reflétera les données du fuseau horaire et\ndate et heure actuelles à l&#39;heure locale et à l&#39;heure UTC à la fin. \nBien qu’il existe une interface graphique avec laquelle\nconfigurer le Wi-Fi, cela ne semblait pas fonctionner pour moi. En tout cas, si vous\nfonctionnent sans tête, vous pouvez même ne pas avoir accès à l&#39;interface graphique. le\nadaptateur réseau que j&#39;ai utilisé était l&#39;adaptateur USB nano sans fil 150Mbps Edimax EW-7811UN\nunité, que j&#39;ai reçu d&#39;Amazon (juste prix et bonne livraison).\nIl semble y avoir trois étapes:"},{"id":"text-60","heading":"Text","content":"Convertissez le mot de passe Wi-Fi en chaîne hexadécimale (cela peut être\n    optionnel):  $ sudo wpa_passphrase VotreSSID\n    Votre mot de passeVous obtiendrez un résultat hexadécimal tel que &quot;b7d90db3ddbd11d5ddb3dbfd81de&quot;\n    dont vous aurez besoin plus tard.  \nEditez le fichier /etc/wpa_supplicant/wpa_supplicant.conf  $ sudo nano /etc/wpa_supplicant/wpa_supplicant.confpour le faire ressembler à ceci:\nctrl_interface = DIR = / var / run / wpa_supplicant GROUP = netdevupdate_config = 1réseau = {ssid = &quot;YourSSID&quot;proto = WPA RSNscan_ssid = 1key_mgmt = WPA-PSKpaire par paire = CCMP TKIPgroupe = CCMP TKIPpsk = b7d90db3ddbd11d5ddb3dbfd81deNotez que le ssid doit être entre guillemets."},{"id":"text-61","heading":"Text","content":"Editez le fichier / etc / network / interfaces   $ sudo nano / etc / network / interfacespour le faire ressembler à ceci:\nauto lo\niface lo inet loopbackiface eth0 inet dhcp\nallow-hotplug wlan0auto wlan0iface wlan0 inet dhcpWireless-Essid YourSSIDpre-up wpa_supplicant -B w -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.confKillall -q wpa_supplicant\niface default inet dhcp"},{"id":"text-62","heading":"Text","content":"Vous pouvez ensuite utiliser le $ sudo ifdown\nwlan0 et $ sudo ifup wlan0 commandes à\nredémarrez le réseau sans fil. Je conseillerais également un redémarrage pour assurer\nque tout s&#39;est passé comme prévu. \nComment éditer la configuration NTP\nLe fichier de configuration NTP réside dans le répertoire / etc, de sorte que vous\npeut changer dans ce répertoire pour éditer le fichier. Parce que le fichier est un\nfichier système, vous devez  sudo commande permettant de sauvegarder la version modifiée du\nfichier, mais d’abord, j’ai fait une copie (cp) du fichier fourni juste au cas où je me suis planté\net a dû revenir à la configuration de travail NTP. J&#39;ai utilisé le  vi\néditeur qui est fourni avec le système d&#39;exploitation, et il y a des instructions pour vi ici,\net aussi à\nGuru99.com dans le cadre d&#39;un Linux / Unix\ntutoriel pour débutants.\nle  nano éditeur que j’ai découvert plus tard, et qui est fourni avec le Raspberry Pi, est un bien meilleur choix &#8211; beaucoup\nplus facile à utiliser!"},{"id":"text-63","heading":"Text","content":"$ cd / etc"},{"id":"text-64","heading":"Text","content":"$ sudo cp ntp.conf ntp-original.conf"},{"id":"text-65","heading":"Text","content":"$ sudo nano ntp.conf"},{"id":"text-66","heading":"Text","content":"Je voulais pouvoir surveiller NTP depuis un autre PC sur mon réseau local,\nplutôt que d’ajouter le programme de surveillance MRTG au Pi, mais il existe des\nlignes qui limitent l’accès au NTP fonctionnant sur le Pi par défaut\ninstallation. Ces lignes du fichier ntp.conf commencent par le mot clé\n&quot;restreindre&quot;. J&#39;ai supprimé ces restrictions en les commentant\nlignes &#8211; ce qui est réalisé en ajoutant un caractère de hachage au début de la\nligne. Par exemple:"},{"id":"text-67","heading":"Text","content":"Remplacer:\n    restreindre -4 par défaut kod notrap nomodify nopeer noquery"},{"id":"text-68","heading":"Text","content":"Avec:\n    # restreint -4 par défaut kod notrap nomodify nopeer noquery"},{"id":"text-69","heading":"Text","content":"Après avoir modifié ntp.conf, vous devez redémarrer le démon ntp:"},{"id":"text-70","heading":"Text","content":"$ sudo /etc/init.d/ntp restart"},{"id":"text-71","heading":"Text","content":"Si la sécurité sur votre réseau vous préoccupe, vous pouvez\nsouhaite être plus sélectif en modifiant les restrictions. \nBien que le contenu par défaut de ntp.conf fonctionne correctement\nDans la plupart des cas, ils ne profitent pas de la nouvelle directive NTP POOL pour\nspécifier les serveurs de pool. J&#39;ai également modifié le pool générique &quot;debian&quot;\nà la piscine plus locale &quot;UK&quot;. J&#39;ai donc changé le serveur\nbassin. lignes à une directive de pool unique:"},{"id":"text-72","heading":"Text","content":"Remplacer:\nserveur 0.debian.pool.ntp.org iburst\nserveur 1.debian.pool.ntp.org iburst\nserveur 2.debian.pool.ntp.org iburst\nserveur 3.debian.pool.ntp.org iburst\nAvec:\npool fr.pool.ntp.org iburst"},{"id":"text-73","heading":"Text","content":"Mon propre réseau local possède trois serveurs NTP de strate 1, un sur FreeBSD et\ndeux exécutant Windows, alors j&#39;ai ajouté ceux\navant les serveurs de la piscine. Bien sûr, cela est spécifique à mon réseau local. Pour\nl&#39;offset minimum, j&#39;ai fait interroger NTP les serveurs locaux à 32 secondes (2 ^^ 5)\nintervalles, et n&#39;a pas permis que cela dérive vers le haut vers les 1024 secondes\nintervalle maximum que NTP atteindrait laissé à ses propres périphériques. j&#39;ai fait ça\navec les qualificatifs minpoll et maxpoll. Cependant, je ne voulais pas forcer\nles serveurs Internet à interroger que souvent (on considère au mieux\nau pire pourrait vous faire bloquer par un serveur), alors j&#39;ai donc fait\nl&#39;intervalle d&#39;interrogation minimal pour les serveurs Internet, 1024 secondes\n(2 ^^ 10). J&#39;ai enlevé les choses qui avaient été commentées pour simplifier le fichier,\net le rendre plus facile à comprendre. C&#39;est pourquoi mon fichier ntp.conf s&#39;est terminé comme suit:"},{"id":"text-74","heading":"Text","content":"# /etc/ntp.conf, configuration pour ntpd; voir ntp.conf (5) pour obtenir de l&#39;aide"},{"id":"text-75","heading":"Text","content":"# Fichier de dérive pour mémoriser la fréquence d&#39;horloge lors des redémarrages\ndriftfile /var/lib/ntp/ntp.drift"},{"id":"text-76","heading":"Text","content":"# Les serveurs\nserveur 192.168.0.3 minpoll 5 maxpoll 5 iburst préfère\nserveur 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserveur 192.168.0.7 minpoll 5 maxpoll 5 iburst\npool fr.pool.ntp.org minpoll 10 iburst"},{"id":"text-77","heading":"Text","content":"N&#39;oubliez pas de redémarrer NTP après avoir apporté les modifications. De\nPC de surveillance Windows avec NTP installé\nJe vois maintenant:"},{"id":"text-78","heading":"Text","content":"C: &gt; ntpq -p raspi\n     référence distante st t lorsque l&#39;interrogation atteint le décalage de retard de gigue\n=============================================== ============================\n* pixie .PPS. 1 u 26 32 377 0,467 -0,010 0,023\n+ feenix .PPS. 1 u 4 32 377 0,603 -0,226 0,039\n+ stamsund .PPS. 1 31 31 377 0,586 0,004 0,040\n-dns0.rmplc.co.u 193.62.22.74 2 707 1024 377 21.915 3.490 2.295\n-dns1.rmplc.co.u 193.62.22.74 2 u 177 1024 377 23.736 4.609 3.621\n-dawn.rt.uk.eu.o 193.79.237.14 2 277 1024 377 20.508 3.150 3.065\n-lyla.preshweb.c 129.215.42.240 3 u 544 1024 377 28.082 5.937 3.944"},{"id":"text-79","heading":"Text","content":"C: &gt; ntpq -c rv raspi\nassocid = 0 status = 0615 leap_none, sync_ntp, 1 événement, clock_sync,\nversion = &quot;ntpd 4.2.6p5@1.2349-o ven. mai 18 20:30:57 UTC 2012 (1)&quot;,\nprocesseur = &quot;armv6l&quot;, système = &quot;Linux / 3.2.27 +&quot;, saut = 00, strate = 2,\nprecision = -20, rootdelay = 0.467, rootdisp = 2.387, refid = 192.168.0.3,\nreftime = d4365966.98133154 sam., 27 oct. 2012 14: 00: 22.594,\nclock = d4365984.f4e4138b sam. 27 oct. 2012 14: 00: 52.956, homologue = 49569, tc = 5,\nmintc = 3, offset = -0,010, fréquence = -43,888, sys_jitter = 0,023,\nclk_jitter = 0.015, clk_wander = 0.008"},{"id":"text-80","heading":"Text","content":"Une approche pour que le NTP voie\nla partie série du flux de sortie du récepteur GPS (pour la partie grossière du\ntemps, les secondes) est d&#39;installer\nle pilote gpsd, et cela permet une vérification de la base\nconnectivité. Le GPS que j&#39;ai commencé à utiliser était un Trimble Resolution SMT,\npour lequel j&#39;ai réussi à obtenir à la fois une carte d&#39;évaluation et une carte d&#39;interface\nconverti la sortie série en RS-232 et USB. J&#39;ai utilisé le feuilleton\nvia USB plutôt que le RS-232 pour le Raspberry Pi."},{"id":"text-81","heading":"Text","content":"C&#39;est le GPS que j&#39;ai utilisé. Il\n      est une carte d’évaluation pour un récepteur de synchronisation GPS monté en surface, le\n      Trimble Resolution SMT. C&#39;est un peu inhabituel d&#39;avoir un format TSIP\n      sortie plutôt que le format NMEA standard, mais le gpsd Linux peut\n      reconnaître et accepter ce format. La sortie est sur un en-tête à 8 broches avec un non standard\n      espacement des broches! Il est assez sensible pour utiliser un support magnétique.\n      Rondelle GPS dans ma salle informatique à l&#39;étage supérieur."},{"id":"text-82","heading":"Text","content":"Juste comme j&#39;ai acquis le conseil,\n      il y avait une offre sur la liste de diffusion time-nuts pour un \n      interface prête à l&#39;emploi. Cela a un connecteur correspondant à 8 broches, et\n      fournit une sortie PPS, une sortie série aux niveaux RS-232 (non utilisé ici) et dispose d&#39;un convertisseur série-USB intégré! Idéal!\nFaites attention en utilisant d’autres unités GPS que vous n’aurez pas\n      dépasser +3,3 V sur le signal PPS transmis au Raspberry Pi, sous forme de signal 5 V\n      niveau sera  dommage le dispositif. J&#39;ai utilisé un diviseur résistif\n      (non représenté) pour réduire le niveau à une valeur nominale de 3,2 V.\nJ&#39;ai soudé un diviseur résistif 3k9 * + 6k8 au PPS\n      en-tête, puis a soudé un câble double alimenté en un en-tête de 0,1 pouce que j’ai eu à traîner.\n      Je l&#39;ai connecté à des broches\n      GND et GPIO-24 sur le 26 broches  Raspberry Pi GPIO\n      entête.* &#8211; incorrectement donné comme 1k0 plus tôt."},{"id":"text-83","heading":"Text","content":"Tout d’abord, j’ai connecté l’appareil au port USB inférieur, puis\nvérifié ce qui était vu sur les ports USB."},{"id":"text-84","heading":"Text","content":"$ sudo lsusb\nPériphérique de bus 001: ID 1d6b: 0002 concentrateur racine Linux Foundation 2.0\nBus 001 Appareil 002: ID 0424: 9512 Standard Microsystems Corp.\nBus 001 Appareil 003: ID 0424: ec00 Standard Microsystems Corp.\nDispositif de bus 001 005: ID 04d8: 00df Microchip Technology, Inc."},{"id":"text-85","heading":"Text","content":"Il semble que mon GPS apparaisse sous le numéro 005 dans cette liste, mais\ncomment sera-t-il nommé? Pour vérifier cela, vous devez parcourir l’un des\nFichiers journaux Linux:"},{"id":"text-86","heading":"Text","content":"$ more / var / log / syslog"},{"id":"text-87","heading":"Text","content":"et dans mon cas, au moment où j&#39;ai branché l&#39;appareil là-bas\nétait une référence à: ttyACM0:et j&#39;ai reconnu\ntty comme un port série (TeleType d&#39;il y a longtemps!). Si vous utilisez un vrai\npériphérique série, il apparaîtra comme ttyAMA0.\n  Les prochaines étapes sont à\ninstallez le logiciel gpsd et démarrez le service gpsd pointant sur l&#39;appareil\nnom vient de découvrir:"},{"id":"text-88","heading":"Text","content":"$ sudo apt-get installez gpsd gpsd-clients python-gps"},{"id":"text-89","heading":"Text","content":"À partir d&#39;un rapport que j&#39;ai reçu, si vous rencontrez des erreurs avec l&#39;étape ci-dessus, vous devrez peut-être exécuter une mise à jour vers apt-get:\n$ sudo apt-get update\net éventuellement alors:\n$ sudo apt-get upgrade\nqui peut mettre à niveau l&#39;ensemble du système d&#39;exploitation vers la version actuelle."},{"id":"text-90","heading":"Text","content":"$ sudo gpsd / dev / ttyACM0 -n -F /var/run/gpsd.sock"},{"id":"text-91","heading":"Text","content":"À ce stade, vous devriez pouvoir voir une sortie en mode texte\ndepuis votre récepteur GPS en exécutant la commande &quot;cgps\n-s&quot;, quelque chose comme ce qui suit."},{"id":"text-92","heading":"Text","content":"$ cgps -s"},{"id":"text-93","heading":"Text","content":"Notez qu’il s’agit d’un GPS en mode chronométrage, il préférera\nsatellites qui ont une altitude plus élevée, car ceux-ci sont moins susceptibles d&#39;avoir\neffets multi-chemins ou réflexions. Cependant, pour le niveau de précision de\nque nous visons (microsecondes, pas nanosecondes), ce raffinement n’est pas\nessentiel, et je ne pouvais voir aucune différence significative entre un\n&quot;timing&quot; GPS and a &quot;position&quot; GPS on the microsecond level. \nNote that you will need to make gpsd start automatically at boot time,\nand to tell the configuration tool what device to use, and add the &quot;-n&quot;\noption for working with NTP. See the note later in this\ndocument. \nTelling NTP the seconds from the GPS\nNow that gpsd is working, we can edit the NTP configuration to\nadd a type 28 reference clock which will make NTP look at the shared memory\ncreated by gpsd.  This can be done for both the coarse time (seconds) and\nthe fine time (PPS edge) with a 28.0 and a 28.1 driver, although I only use the\n28.0 driver here as the Raspberry Pi supports PPS via a kernel-mode driver (more\nlater).  The first step is\nto get the seconds alone, and be aware that this will ne pas be better than\nInternet time alone due to the offset of the serial/USB data from the true\nsecond, and because of the variability and drift in this offset.  We will\nneed to add a connection later between the PPS signal and one of the Raspberry Pi&#39;s I/O\npins to generate a PPS interrupt.  Here is my modified ntp.conf file. \nI&#39;ve used 0.000 for the time1 modifier to start with, so that we can determine\nan approximate value for the delay of the serial data from the GPS after ntp is\nup and running.  I changed the refid for the type 28 driver to &quot;SHM&quot;\nto indicate more clearly that the data is coming from the SHared Memory provided\nby gpsd.\nNote that I have marked more than one server as\n&quot;prefer&quot;.  This is because if the first preferred server goes\noffline, it appears that NTP will no longer accept the PPS data as valid (is\nthat wise?), so a second preferred server is configured to cover that\npossibility.  In my case, it happens because 192.168.0.3 sometimes has an\nNTP update, causing its NTP to go offline for some seconds, and hence causes a\nglitch in the connected servers.  Having more than one preferred server\nshould prevent that."},{"id":"text-94","heading":"Text","content":"# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.000 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst prefer\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst"},{"id":"text-95","heading":"Text","content":"Note that when using a PPS source you doit have one\nother server marked &quot;prefer&quot;.  In the example above I have added\nprefer to the shared memory driver (type 28) so that the combination of PPS and\nGPSD would provide the correct time even with no Internet servers.  Looking at the output from ntpq -p after some time we might\nsee:"},{"id":"text-96","heading":"Text","content":"C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\nxSHM(0)          .SHM.           15 l   15   16  377    0.000  -353.23   1.277\n*pixie           .PPS.            1 u   25   32  377    0.484   -0.016   0.105\n+feenix          .PPS.            1 u   31   32  377    0.592   -0.120   0.044\n+stamsund        .PPS.            1 u   16   32  377    0.546   -0.037   0.083\nxns0.luns.net.uk 157.44.176.4     2 u 1656 1024  156   31.904    3.702   5.455\nxtime.videxio.ne 131.188.3.223    2 u  45m 1024   74   31.765    8.590   2.796\nxlyla.preshweb.c 129.215.42.240   3 u  510 1024  377   25.568    4.793   5.990\n-dawn.rt.uk.eu.o 193.67.79.202    2 u  492 1024  367   20.308    2.408   2.903"},{"id":"text-97","heading":"Text","content":"and while the SHM driver is present and connected (reach =\n377), it has been rejected by NTP (the &quot;x&quot; in the first column),\nperhaps because its offset was consistently too great compared to the other\nservers.  That&#39;s the purpose of the time1 modifier in the &quot;fudge&quot;\ncommander. We can see that the SHM output is some 350 milliseconds later, so\nwe can use that value for time1 to bring the GPS output approximately into line\nwith UTC, as shown in the edited /etc/ntp.conf below.  (The time values in\nthe ntpq -p display are all in milliseconds).\nHint: if at this point the reach field for the SHM\ndevice stays at zero, likely the gpsd wasn&#39;t started with the &quot;-n&quot;\noption. You can make the gpsd always start at system boot time with that -n\noption as described later in this note."},{"id":"text-98","heading":"Text","content":"# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help\n \n# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift\n# Server from shared memory provided by gpsd\nserver 127.127.28.0 minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid SHM stratum 15\n# Local LAN servers\nserver 192.168.0.3 minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2 minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7 minpoll 5 maxpoll 5 iburst\n# UK pool servers\npool uk.pool.ntp.org minpoll 10 iburst"},{"id":"text-99","heading":"Text","content":"The output from ntpq -p then shows the offset for the SHM\ndriver to be much nearer to zero, and this /might/ be good enough for you if you\nare out in the field with no other reference.  But we can do better, and\nthe next step is to use the precise PPS signal from the GPS to improve the\naccuracy down to the microsecond level."},{"id":"text-100","heading":"Text","content":"C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n-SHM(0)          .SHM.           15 l    1   16   17    0.000    1.766   0.943\n*pixie           .PPS.            1 u   13   32    3    0.421   -0.325   0.194\n+feenix          .PPS.            1 u   13   32    3    0.528   -0.644   0.969\n+stamsund        .PPS.            1 u   11   32    3    0.409   -0.336   0.145\n-dns0.rmplc.co.u 195.66.241.2     2 u   35 1024    1   22.872    3.604   5.037\n-mail1.itdojo.or 10.10.120.2      2 u   34 1024    1   38.472    3.324   7.084\n ntp.fundamental 193.62.22.82     2 u   33 1024    1   30.980    2.450   3.837\n 82.113.154.206  193.62.22.82     2 u   32 1024    1   19.219    0.683   5.880"},{"id":"text-101","heading":"Text","content":"Note: if you are working stand-alone, without any Internet servers, you may\n  need an extra &quot;flag1 1&quot; in the fudge for the type 28\n  ref-clock.  Please see the notes here\n  for further information.  Thanks to Whitham D. Reeve Anchorage, Alaska USA\n  for the testing.\n \nBut my time is 16 seconds out!\nI did notice with the GPS unit that I have that it doesn&#39;t\nhave battery backup, so when it first starts it has to download quite a lot of data\nfrom the GPS satellites before it has full lock.  While the PPS signal\nis acquired quite quickly, it takes a few minutes for the receiver to determine\nthe number of seconds offset between GPS-time GPST) and the usual UTC.  As I\nwrite, that GPST-UTC offset is 16 seconds &#8211; the offset is because recent\nleap-seconds are not applied to GPS time &#8211; plus\ninformation. The implications of this are different\ndepending on what other servers you have configured in your ntp.conf file"},{"id":"text-102","heading":"Text","content":"If you have some Internet or LAN servers, ntp is clever\n    enough to ignore the obvious &quot;bad chimer&quot;, and may simply display a\n    large offset for the GPS in the  ntpq -p output when starting\n    up. Après\n    a few minutes, the offset will revert to the correct value.  The delay\n    is not a problem in this case. \nIf you have no other source than the GPS, then you should\n    probably wait a few minutes before assuming that even the coarse seconds\n    part of the time is correct.  I haven&#39;t checked how long it will take\n    NTP to step the clock by the 16 seconds needed after the GPS starts sending\n    UTC rather than GPS time.  If your GPS does this, consider adding some\n    sort of battery backup so that the GPS-UTC offset is stored while the unit\n    is down."},{"id":"text-103","heading":"Text","content":"Quite why I saw this issue while using gpsd\nis uncertain.  Since writing the above I have been in contact with the\nauteur de gpsd who tells me that protection is\nincorporated into the gpsd software whereby it\nwill not pass on the time to its shared memory until the output from the GPS\nreceiver has a (GPST-UTC) value in excess of 10 seconds.  So I should never\nhave seen the 16 seconds faster value at all.\nPlease note that this problem is likely peculiar to my\nparticular GPS receiver &#8211; an\nevaluation board with no battery backup.  Just be aware of this problem in\ncase it bites you!  It doesn&#39;t happen with the u-blox pure serial GPS\nreceiver I describe later, as this board has battery\nbackup.  &quot;Your mileage may vary&quot;, as they say! \nThe next step was to get the PPS working.  This requires\nupdating the Linux kernel for the Raspberry Pi, and while you can do that\nyourself, there is a ready-made kernel image and support modules available on\nthe Web.  Much of the information below is based on David K&#39;s Web page:\n  https://github.com/davidk/adafruit-raspberrypi-linux-pps\nYou can check the version of the kernel you are running at the moment by:"},{"id":"text-104","heading":"Text","content":"$ uname -a\nLinux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux"},{"id":"text-105","heading":"Text","content":"First you need to get the updated kernel image and\nmodules.  At the time of writing, these were available for the current\nversion of the OS from chrisprt as mentioned here:\nKernel image: https://docs.google.com/open?id=0BznvtPCGqrd3ZElKZHEtUDRpUEUModules: https://docs.google.com/open?id=0BznvtPCGqrd3VTZ2TmxFTktYM0E\nThese come down as Zip files and, as I wasn&#39;t sure about\ndownloading these from Google Docs directly on the Raspberry Pi, I downloaded\nthem to a local Windows FTP server first, and then installed an FTP client on the\nRaspberry Pi to drag the Zip files across in FTP image mode &#8211; i.e. binary files."},{"id":"text-106","heading":"Text","content":"# Installing an FTP client:\n$ sudo apt-get install ftp"},{"id":"text-107","heading":"Text","content":"I could then use standard FTP command to drag the files from\nmy local FTP server to the Raspberry Pi.  I created a directory named pps\nbelow the home user directory for the files, and then unzipped the archives I\nhad copied:"},{"id":"text-108","heading":"Text","content":"$ mkdir pps"},{"id":"text-109","heading":"Text","content":"$ cd pps"},{"id":"text-110","heading":"Text","content":"# FTP get 3.2.27-pps-g965b922-dirty.zip in binary (image) mode.\n# FTP get kernel-pps-gpio24.zip in binary (image) mode\n(substitute your own commands here)."},{"id":"text-111","heading":"Text","content":"$ unzip kernel-pps-gpio24.zip"},{"id":"text-112","heading":"Text","content":"$ unzip 3.2.27-pps-g965b922-dirty.zip"},{"id":"text-113","heading":"Text","content":"In the pps/kernel-pps-gpio24 directory you will find a file\nkernel-pps-gpio24.img.  This must be renamed and moved to the /boot/ directory, while we first\ntake a safety copy of the original kernel image."},{"id":"text-114","heading":"Text","content":"$ sudo mv /boot/kernel.img /boot/kernel.img.orig"},{"id":"text-115","heading":"Text","content":"$ sudo cp kernel-pps-gpio24.img /boot/kernel.img"},{"id":"text-116","heading":"Text","content":"Now we need to move the module files into the area where the\nnew kernel expects to find them.  I found the command on the Web page\neither confusing or wrong, as I ended up with the wrong structure to start\navec. What it appears to need is:"},{"id":"text-117","heading":"Text","content":"/lib/modules/3.2.27+\n/lib/modules/3.2.27+/kernel\n/lib/modules/3.2.27+/modules.*\n/lib/modules/3.2.27-cutdown+\n/lib/modules/3.2.27-cutdown+/kernel\n/lib/modules/3.2.27-cutdown+/modules.*\n/lib/modules/3.2.27-pps-g965b922-dirty\n/lib/modules/3.2.27-pps-g965b922-dirty/kernel/\n/lib/modules/3.2.27-pps-g965b922-dirty/modules.*"},{"id":"text-118","heading":"Text","content":"You will find both the kernel directory and the modules files\nin the unzipped 3.2.27-pps-g965b922-dirty directory, so the following command\nmay work correctly for you.  I made a mess of this having followed the Web\npage verbatim, and not having made allowances for the differences in the file\nNom. Assuming you are now in the pps directory, move the required files to\nthe /lib/modules directory, and add the pps-gpio module to the module list:"},{"id":"text-119","heading":"Text","content":"$ sudo mv 3.2.27-pps-g965b922-dirty /lib/modules/3.2.27-pps-g965b922-dirty"},{"id":"text-120","heading":"Text","content":"$ echo &quot;pps-gpio&quot; | sudo tee -a /etc/modules\n(Command corrected, thanks Matthew Huxtable!  Alternatively edit \n /etc/modules using the nano editor to add the pps-gpio at the end.\n$ sudo nano /etc/modules"},{"id":"text-121","heading":"Text","content":"$ sudo reboot"},{"id":"text-122","heading":"Text","content":"You will see the changed kernel name at the next login,\n    and you can check with the uname -a command as before:"},{"id":"text-123","heading":"Text","content":"$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux"},{"id":"text-124","heading":"Text","content":"An aside &#8211; what is a module in Linux?"},{"id":"text-125","heading":"Text","content":"You may be used to the idea of device drivers for Windows &#8211;\nthose .SYS files &#8211; but what are &quot;modules&quot; in Linux and how do they\nrelate to device drivers?  I asked that question on the time-nuts list, and\ngot this reply from Michael Tharp:"},{"id":"text-126","heading":"Text","content":"&quot;Linux modules are the same, although Linux modules almost always need to be\n  compiled against the specific kernel version while Windows drivers are typically only bound to which release you&#39;re running. \n  That is the reason you have to compile the kernel, rather than just plop down a driver\n  downloaded from the internet. \n&quot;That said, the reason your PPS driver is a module is that it makes it easier to tweak options. \n  Almost all modules that are part of the main kernel source (which PPS is, for a year or so)\n  can be compiled in rather than as a separate module, but you can pass options to a module as you load it while you cannot do that with a\n  built-in.  It also makes it possible to tweak the source, recompile just that module, and test it on the fly rather than recompiling the entire\n  kernel and rebooting.&quot;"},{"id":"text-127","heading":"Text","content":"Many thanks, Michael. \nChecking the PPS is working\nTo check that you are running the new kernel and that the pps-gpio\nmodule is loaded, then install the pps-tools et\nrun it to see the changes on pin 24 (assuming you have a 3.3 V PPS signal\nconnected.  Warning: faire ne pas connect a 5 V signal to the GPIO pins!"},{"id":"text-128","heading":"Text","content":"$ uname -a\nLinux raspberrypi 3.2.27-pps-g965b922-dirty #1 PREEMPT Sat Sep 22 16:30:50 EDT 2012 armv6l GNU/Linux"},{"id":"text-129","heading":"Text","content":"$ dmesg | grep pps\n[ 0.000000] Linux version 3.2.27-pps-g965b922-dirty (root@bt) (gcc version 4.\n6.2 (Ubuntu/Linaro 4.6.2-14ubuntu2~ppa1) ) #1 PREEMPT Sat Sep 22 16:30:50 EDT 20\n12\n[ 1.866364] usb usb1: Manufacturer: Linux 3.2.27-pps-g965b922-dirty dwc_otg_h\nCD\n[ 12.797224] pps_core: LinuxPPS API ver. 1 registered\n[ 12.803850] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giome\ntti \n[ 12.824858]  pps pps0: new PPS source pps-gpio.-1\n[ 12.832182] pps pps0: Registered IRQ 194 as PPS source\n[ 133.043038] pps_ldisc: PPS line discipline registered\n[ 133.044841] pps pps1: new PPS source acm0\n[ 133.044879] pps pps1: source &quot;/dev/ttyACM0&quot; added"},{"id":"text-130","heading":"Text","content":"$ sudo aptitude install pps-tools # may take some time"},{"id":"text-131","heading":"Text","content":"$ sudo ppstest /dev/pps0 # press Ctrl-C to cancel.. \ntrying PPS source &quot;/dev/pps0&quot; \nfound PPS source &quot;/dev/pps0&quot; \nok, found 1 source(s), now start fetching data... \nsource 0 - assert 1351501153.999956346, sequence: 47481 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501154.999954601, sequence: 47482 - clear 0.000000000, sequence: 0 \nsource 0 - assert 1351501155.999951856, sequence: 47483 - clear 0.000000000, sequence: 0 \n^C"},{"id":"text-132","heading":"Text","content":"The &quot;clear&quot; entries showing as zero is correct for\nthis driver implementation.  Note that if you don&#39;t have a PPS signal\nconnected to GPIO pin 24 the last three lines from the dmesg output may be\nmissing.  In the output above, the PPS source was only registered some 133\nseconds after startup, possibly the length of time it took the GPS to\nlock.  On a second system with no PPS connected the last three lines were\nmissing.\nThis test should still work even with NTP running and using the PPS signal.  \nUnfortunately, the version of NTP supplied with the Raspberry\nPi Linux does not support PPS.  Likely it has been compiled to minimise its\nmemory and disk footprint.  These are the steps to download, compile and\ninstall NTP (with help from jbeal&#39;s\nposting). You can choose between a release and a development version\nas shown in step 4 below. You could also use a copy of the development tarball on\nyour own local FTP server.  So from logging in, here are the steps. \nThe lines below are shown for development version ntp-dev-4.2.7p397, but you\nwill need to alter the version number to suit the version you wish to compile. \nThe two time-consuming steps (configure and make) appear to be CPU limited\nrather than SD-card I/O access limited. \nYou can see which version I am currently running here."},{"id":"text-133","heading":"Text","content":"$ mkdir ntp                  # make a convenient working directory, if you don&#39;t already have one"},{"id":"text-134","heading":"Text","content":"$ cd ntp                     # enter that directory"},{"id":"text-135","heading":"Text","content":"$ sudo apt-get install libcap-dev\t# once-off, required to prevent later file not found error\n$ sudo apt-get install libssl-dev\t# once-off, you may not need this, but reports suggest you might to build keygen"},{"id":"text-136","heading":"Text","content":"# Get the desired tarball, current or development - use one of the following:\n$ wget http://archive.ntp.org/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz\t\t\t\t\t# release\n$ wget http://archive.ntp.org/ntp4/ntp-dev/ntp-dev-4.2.7p397.tar.gz\t\t\t# development\n \n(May redirect to:  https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p10.tar.gz)"},{"id":"text-137","heading":"Text","content":"$ tar xvfz ntp-4.2.8p10.tar.gz"},{"id":"text-138","heading":"Text","content":"$ cd ntp-dev-4.2.8p10"},{"id":"text-139","heading":"Text","content":"$ ./configure --enable-linuxcaps\t# takes 11-15 minutes"},{"id":"text-140","heading":"Text","content":"# If your PPS doesn&#39;t work and you get a &quot;clock type 22 invalid&quot; message, be sure to install pps-tools\n# first, and clear out the directory:  cd ~/ntp, rm -r ntp-dev-4.2.7p397, and start again from step 5."},{"id":"text-141","heading":"Text","content":"# It seems that the --enable-linuxcaps flag may not be required on other Linux variants,\n# or on the RPi with later versions of Linux with PPS and pps-tools installed.\n# It is required for the more recent Raspbian Jessie (later 2015)."},{"id":"text-142","heading":"Text","content":"$ make\t\t\t\t\t# takes 18-25 minutes\n(use &quot;make -j5&quot; for faster execution on the four-core Raspberry Pi 2/3.)"},{"id":"text-143","heading":"Text","content":"# This removes the original NTP and installs the new.\n# Step may not be needed - see below.\n# Recommend: omit this step.\n$ sudo apt-get remove ntp    # get rid of previously existing install of ntpd"},{"id":"text-144","heading":"Text","content":"$ sudo make install          # puts ntp* in /usr/local/bin/ntp*, takes 30-60 seconds"},{"id":"text-145","heading":"Text","content":"It is not entirely clear to me whether step 9 above is\nrequired.  It does not appear to be when updating from 4.2.7p304 to\n4.2.7p321, for example. je suis ne pas using step 9.\n  Once you have a new set of NTP\nbinaries, you first need to stop NTP, use super-user mode to copy the binaries\nto their final directory, and then restart NTP.  Once restarted, a simple\ncheck that it&#39;s working correctly.  I recommend these steps,\nalthough there are alternatives.  See the note below about step 2."},{"id":"text-146","heading":"Text","content":"$ sudo /etc/init.d/ntp stop"},{"id":"text-147","heading":"Text","content":"$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/"},{"id":"text-148","heading":"Text","content":"$ sudo /etc/init.d/ntp start"},{"id":"text-149","heading":"Text","content":"$ ntpq -crv -pn\t\t# optional step to check for version and basic function"},{"id":"text-150","heading":"Text","content":"Remarque:  on some more recent versions of Raspbian steps 1\nand 3 may require:"},{"id":"text-151","heading":"Text","content":"$ sudo service ntp stop"},{"id":"text-152","heading":"Text","content":"$ sudo cp /usr/local/bin/ntp* /usr/bin/  &amp;&amp; sudo cp /usr/local/sbin/ntp* /usr/sbin/"},{"id":"text-153","heading":"Text","content":"$ sudo service ntp start"},{"id":"text-154","heading":"Text","content":"Remarque: that on some systems the binary ntp* files will\nbe written to a mixture of /usr/local/bin et /usr/local/sbin,\naccording to the paths defined in sntp/loc.  I have been told that the\n&quot;sbin&quot; is for system files (i.e. ones not usually run by users such as\nservers and daemons, and the &quot;bin&quot; is for files usually executed by\nusers).  For Debian, for just the ntp* files, this is:"},{"id":"text-155","heading":"Text","content":"# Debian installations and man page suffixes\nMDOC\nntp-keygen,sbin,8\nntp-wait,sbin,8\nntpd,sbin,8\nntpdate,sbin,8\nntpdc,bin,1\nntpdsim,sbin,8\nntpq,bin,1\nntpsnmpd,sbin,8\nntptime,sbin,8\nntptrace,bin,1"},{"id":"text-156","heading":"Text","content":"so you may need to check both directories to get the most\nrecent files.  Check with &quot;ls -l&quot; which shows the file date.\n \nA confession: I did alter one system to\npoint the NTP start-up to the directory I preferred, rather than leaving it\npointing to an old version.  I suspect that in my own personal use, only\nthe ntpd and ntpq executables matter.  \n \nUpdating multiple Raspberry Pi cards\n \nIf, like me, you have multiple Raspberry Pi cards, you will\nnot want to waste almost an hour compiling and updating NTP on each card. \nFortunately, my experience so far using the development versions of NTP\n(4.2.7p&#8230;) suggests that simply copying the binaries from one Pi to another\nworks as expected.  This may be luck, or it may be because the OS\ndifferences between Linux/3.2.27+ and Linux/3.6.11+ are not that great. Si\nyou have access to an FTP server (I used a Windows PC running IIS) you may be\nable to use commands such as those below to save a compiled version from one Pi\nand load it onto another.  You may need to use  sudo\napt-get install ftp  if FTP is not already available. Step 5 is required once. Étape\n7 is required for each new version you save. \nReplace &quot;368&quot; in the steps below with the version number you have just\ncompiled.\n \nTo save the newly compiled versions:"},{"id":"text-157","heading":"Text","content":"$ ftp"},{"id":"text-158","heading":"Text","content":"(Login as Anonymous or known user)"},{"id":"text-159","heading":"Text","content":"bin  (forces binary mode)"},{"id":"text-160","heading":"Text","content":"mkdir RaspberryPi  (step only needed once)"},{"id":"text-161","heading":"Text","content":"cd RaspberryPi"},{"id":"text-162","heading":"Text","content":"mkdir 397-safe  (step needed once per new version)"},{"id":"text-163","heading":"Text","content":"cd 397-safe"},{"id":"text-164","heading":"Text","content":"prompt   (may disable prompting for steps 10 and 13)"},{"id":"text-165","heading":"Text","content":"lcd /usr/local/bin"},{"id":"text-166","heading":"Text","content":"mput ntp*"},{"id":"text-167","heading":"Text","content":"(respond Y to the prompt for all the files)"},{"id":"text-168","heading":"Text","content":"lcd /usr/local/sbin"},{"id":"text-169","heading":"Text","content":"mput ntp*"},{"id":"text-170","heading":"Text","content":"ls -l  (to check that all eight files are there and have the date you expect)"},{"id":"text-171","heading":"Text","content":"quitter"},{"id":"text-172","heading":"Text","content":"To load a new version onto another Raspberry Pi:"},{"id":"text-173","heading":"Text","content":"$ cd /usr/local/bin"},{"id":"text-174","heading":"Text","content":"$ sudo ftp \t# sudo allows writing to system directories"},{"id":"text-175","heading":"Text","content":"(Login as Anonymous or known user)"},{"id":"text-176","heading":"Text","content":"bin  (forces binary mode)"},{"id":"text-177","heading":"Text","content":"cd RaspberryPi/397-safe"},{"id":"text-178","heading":"Text","content":"ls -l  (to check that the files there are correct and have the date you expect)"},{"id":"text-179","heading":"Text","content":"mget ntp*"},{"id":"text-180","heading":"Text","content":"(respond Y to the prompt for all the files)"},{"id":"text-181","heading":"Text","content":"quitter"},{"id":"text-182","heading":"Text","content":"$ sudo /etc/init.d/ntp stop"},{"id":"text-183","heading":"Text","content":"$ sudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/"},{"id":"text-184","heading":"Text","content":"$ sudo /etc/init.d/ntp start"},{"id":"text-185","heading":"Text","content":"$ ntpq -crv -pn  # to check the NTP version, and that it is still working"},{"id":"text-186","heading":"Text","content":"See the discussion above about the combined commands in\n    step 11.  An alternative to steps 1 to 9 might be, if you are brave:"},{"id":"text-187","heading":"Text","content":"sudo wget -P /usr/local/bin -N ftp:///RaspberryPi/397-safe/ntp*"},{"id":"text-188","heading":"Text","content":"Making updating other cards even easier &#8211; use a fixed directory name:\nAfter storing the working version on your FTP server, copy it\non the FTP server to a directory with a fixed name such as:"},{"id":"text-189","heading":"Text","content":"/RaspberryPi/ntp/"},{"id":"text-190","heading":"Text","content":"You can then write a script for updating other Raspberry Pi\ncards something like this:"},{"id":"text-191","heading":"Text","content":"$ nano update-ntp"},{"id":"text-192","heading":"Text","content":"with the following contents:"},{"id":"text-193","heading":"Text","content":"sudo wget --no-passive-ftp -P /usr/local/bin -N ftp:///RaspberryPi/ntp/ntp*\nsudo /etc/init.d/ntp stop\nsleep 1\nsudo cp /usr/local/bin/ntp* /usr/sbin/  &amp;&amp;  sudo cp /usr/local/bin/ntp* /usr/bin/\nsleep 1\nsudo /etc/init.d/ntp start\nsleep 4\nntpq -crv -pn"},{"id":"text-194","heading":"Text","content":"remplaçant  with the name or IP address\n    of your own FTP server.  With a Microsoft FTP server, I found that I\n    needed to add &#8211;no-passive-ftp  after the wget command, as shown above.  Remember to make the script executable:"},{"id":"text-195","heading":"Text","content":"$ chmod +x update-ntp"},{"id":"text-196","heading":"Text","content":"and run it from your local directory:"},{"id":"text-197","heading":"Text","content":"$ ./update-ntp"},{"id":"text-198","heading":"Text","content":"You can tell another Raspberry Pi to run the update by using the SSH command\nthus:"},{"id":"text-199","heading":"Text","content":"$ ssh pi@the-other-raspi &quot;./update-ntp&quot;"},{"id":"text-200","heading":"Text","content":"You will need to enter the password for the user &quot;pi&quot;, although\nthis can be avoided (I am told) by using public key based authentication, if that fits with your security model. \nOnce you have managed to copy your key\tto the second machine (man ssh-copy-id) you need no password either. \nI&#39;m afraid I don&#39;t know how to do that, though.  \nTo get NTP to use the PPS data which is now available to it,\nthe timestamps of the transitions on the GPIO pin, we need to add another\nrefclock (server) line to the ntp.conf file.  The server we use is a type\n22 server called the ATOM refclock, and we can give it a reference ID of\n&quot;PPS&quot;.  I also changed the reference ID of the serial data to\n&quot;GPS&quot;.  Note that with a type 22 clock you doit have one\nother server marked as &quot;prefer&quot;."},{"id":"text-201","heading":"Text","content":"# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help"},{"id":"text-202","heading":"Text","content":"# Drift file to remember clock rate across restarts\ndriftfile /var/lib/ntp/ntp.drift"},{"id":"text-203","heading":"Text","content":"# coarse time ref-clock, not really needed here as we have LAN &amp; WAN servers\nserver 127.127.28.0  minpoll 4 maxpoll 4\nfudge 127.127.28.0 time1 +0.350 refid GPS  stratum 15"},{"id":"text-204","heading":"Text","content":"# Kernel-mode PPS ref-clock for the precise seconds\nserver 127.127.22.0 minpoll 4 maxpoll 4\nfudge 127.127.22.0  refid PPS"},{"id":"text-205","heading":"Text","content":"# LAN servers\nserver 192.168.0.3  minpoll 5 maxpoll 5 iburst prefer\nserver 192.168.0.2  minpoll 5 maxpoll 5 iburst\nserver 192.168.0.7  minpoll 5 maxpoll 5 iburst"},{"id":"text-206","heading":"Text","content":"# WAN servers, &quot;pool&quot; will expand the number of servers to suit\npool uk.pool.ntp.org  minpoll 10  iburst"},{"id":"text-207","heading":"Text","content":"Remarque: when using the ATOM (type 22) refclock, one of the other servers\ndoit be marked as prefer.  This is because the type 22 clock only\nsupplies the timing dans the second, and another server is required to\ndetermine the courant second.\n \nChecking that NTP is seeing the PPS data\nWhen you have restarted NTP with the new binaries, you\n    should see a new line in the output from an ntpq -p command, and the word\n    &quot;kern&quot; should be present in the output of an ntpq -c rv command:"},{"id":"text-208","heading":"Text","content":"C:&gt;ntpq -p raspi\n     remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPS.           15 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            0 l   12   16  377    0.000    0.002   0.002\n*pixie           .PPS.            1 u   18   32  377    0.498   -0.030   0.025\n+feenix          .PPS.            1 u    5   32  377    0.619   -0.078   0.035\n+stamsund        .PPS.            1 u   29   32  377    0.614   -0.017   0.051\n uk.pool.ntp.org .POOL.          16 p    - 1024    0    0.000    0.000   0.002\n-ntp.uk.syrahost 192.93.2.20      2 u  405 1024  377   30.031    8.487   0.274\n-ntp2.exa-networ 195.66.241.10    2 u  217 1024  377   26.263    3.167   1.277\n-resntp-a-vip.lo 182.7.208.171    3 u   49 1024  377   17.854    2.828   1.460\n-time.shf.uk.as4 91.208.177.20    3 u   75 1024  377   18.825    0.680   1.974"},{"id":"text-209","heading":"Text","content":"C:&gt;ntpq -c rv raspi\nassocid=0 status=011d leap_none, sync_pps, 1 event, kern,\nversion=&quot;ntpd 4.2.7p314@1.2483 Mon Oct 29 15:30:42 UTC 2012 (3)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.2.27-pps-g965b922-dirty&quot;, leap=00,\nstratum=1, precision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d439fe8b.16dba50f  Tue, Oct 30 2012  7:21:47.089,\nclock=d439fe97.4d7ac44d  Tue, Oct 30 2012  7:21:59.302, peer=63905, tc=4,\nmintc=3, offset=0.001547, frequency=-45.081, sys_jitter=0.001907,\nclk_jitter=0.000, clk_wander=0.000"},{"id":"text-210","heading":"Text","content":"You may find that by adding the directive &quot;nohz=off&quot; to the end of\nyour /boot/cmdline.txt that jitter is decreased by up to 50%.  Try it and\nsee for yourself.  Some systems it helps, and others it does not,\ndepending, I suspect, on which OS and firmware versions you have. Comme\nguide, you may get to average jitter in the range:"},{"id":"text-211","heading":"Text","content":"Modèle\nAveraged jitter"},{"id":"text-212","heading":"Text","content":"Raspberry Pi B \n3.9 us, but may be better"},{"id":"text-213","heading":"Text","content":"Raspberry Pi B+\n4.2 µs"},{"id":"text-214","heading":"Text","content":"Raspberry Pi 2 B\n2 µs"},{"id":"text-215","heading":"Text","content":"Raspberry Pi 3 B    \n1 µs"},{"id":"text-216","heading":"Text","content":"Thanks to the folks here\nfor their help. \nWith the replaced version of NTP we lose the automatic running\nde ntpd at startup which was present in the\noriginal install.  We also need to start gpsd\nso that the coarse time is available to NTP."},{"id":"text-217","heading":"Text","content":"# To configure gpsd to auto-start, try: \n$ sudo dpkg-reconfigure gpsd"},{"id":"text-218","heading":"Text","content":"This seems to work as expected, and allows the gpsd\nto automatically start up.  To check that, I rebooted, and logged in, and\ncould run cgps -s right away.  However, NTP\nwon&#39;t see the time from the GPS until après    cgps -s is run. \nThis is fixed as follows (thanks to A Carver):  by default, gpsd\nwon&#39;t connect to the GPS receiver until there is client software such as cgps\nwith requires it.  This allows for some power-saving in the GPS\nreceiver.  To circumvent this, the gpsd needs to be started with the\n&quot;-n&quot; option.  These options are set in the directory\n/etc/default, so you need to edit the file /etc/default/gpsd to change the\nline: GPSD_OPTIONS=&quot;&quot; to GPSD_OPTIONS=&quot;-n&quot;.  Method A\nis to do this through dpkg-reconfigure gpsd, method B is to edit the file\ndirectly."},{"id":"text-219","heading":"Text","content":"$ sudo nano /etc/default/gpsd"},{"id":"text-220","heading":"Text","content":"NTP will auto-start after a reboot with either Method A or\nMethod B above.\nThere is a cut-out area in the ModMyPi case which will allow\nconnections to the GPIO connector such as ribbon cable which you can easily\nbreak out and file down to a neat edge.  The sharp-eyed amongst you will\nnotice that three wires are shown &#8211; this is because the surplus header had three\nwires connected, but I only used two &#8211; ground (blue) and GPIO 24 (red). \nThe black lead would be GPIO 23 but it is unused and not connected."},{"id":"text-221","heading":"Text","content":"GPS Receiver Issues\nThere are two issues which are now becoming apparent with the\nparticular GPS receiver I have and the Raspberry Pi."},{"id":"text-222","heading":"Text","content":"It seems that after a power-down reboot, the GPS receiver\n    isn&#39;t correctly detected, and need a disconnect/reconnect of its USB\n    connector before it is seen by gpsd.\n    The pulse-per-second signal still comes through,\n    though, so the precise seconds are working, but the coarse seconds are\n    ne pas. This is clearly unacceptable as you would not get the correct\n    time unless you also had an Internet NTP server available.It is possible that a power-up followed by a reboot mai resolve this\n    problème. \nDuring the booting of the GPS receiver (if it does not have\n    a battery) it mai output GPS time (which is 16 seconds adrift from\n    UTC at the time of writing). Bien que gpsd est\n    supposed to catch this situation, it could mean that the Raspberry Pi will\n    not know what the correct time is for some time after booting, and even then\n    it could take 10-20 minutes to be sure that the correct time was actually\n    being sent by the GPS and for NTP to make the 16 seconds step correction\n    required."},{"id":"text-223","heading":"Text","content":"If your receiver has this 16-second ambiguity, be sure you have a source\nof coarse time available such as an Internet NTP server. \nBecause of the problem (1) above, I bought a serial GPS\nreceiver from China.  By following the instructions here\nI was able to make the serial port available on the Raspberry Pi independent of\nits use as a login or boot-up terminal port."},{"id":"text-224","heading":"Text","content":"(make a safety coppy of the file we are about to edit)\n$ sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt"},{"id":"text-225","heading":"Text","content":"$ sudo nano /boot/cmdline.txt\n(remove the parameter including the string &quot;ttyAMA0&quot;:\nconsole=ttyAMA0,115200\nIn Raspbian Wheezy there are two parameters:\n console=ttyAMA0,115200 kgdboc=ttyAMA0,115200)"},{"id":"text-226","heading":"Text","content":"$ sudo nano /etc/inittab\n(Comment out the line like &quot;2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100&quot;\n by putting a hash (#) at the start of the line.  Note that the line was not \n 2:23 on my version of Linux, so be sure to look for the actual line with ttyAMA0.\n It was the last line of the file, as it happens)."},{"id":"text-227","heading":"Text","content":"(You need to reboot to bring these changes into effect)\n$ sudo reboot"},{"id":"text-228","heading":"Text","content":"(Minicom then works - to exit minicom, Ctrl-A, release, Q or X.)\n$ minicom -b 9600 -o -D /dev/ttyAMA0"},{"id":"text-229","heading":"Text","content":"(If minicom gives command not found, you need to install it:)\n$ sudo apt-get install minicom"},{"id":"text-230","heading":"Text","content":"Note that the Raspberry Pi requires 3.3 V signals on the serial\npins &#8211; ne pas  RS-232 level which will damage the device. Toi\nshould now be able to configure gpsd to talk to ttyAMA0 (using sudo\ndpkg-reconfigure gpsd), and the cgps -s\ncommand should work as above. \n3.3 V GPS receiver\nI found a 3.3 V I/O very compact GPS receiver board here\ndescribed as: &quot;GPS Receiver u-blox NEO-6M Module with Antenna USART TTL &amp; IIC Interface&quot;. \nIt includes the patch antenna and cost less than £20.  Such modules seem to be a\nstandard for flight control for model aircraft and similar applications.  It does require one minor modification, which is to solder a wire\nto pin 3 of the NEO-6M module to extract the PPS signal.  This unit\nwas later replaced by a Adafruit\n    Ultimate GPS Breakout which requires no additional soldering, and has a\nbuilt-in antenna."},{"id":"text-231","heading":"Text","content":"The U-blox board from China and supplied antenna under test."},{"id":"text-232","heading":"Text","content":"The Adafruit GPS mated to the Raspberry Pi.  Only\n      le GPS Tx =&gt; Pi Rx lead (yellow) is connected, and thesecond ground lead (blue) isn&#39;t connected either."},{"id":"text-233","heading":"Text","content":"Raspberry Pi #2 with its Adafruit GPS. Red/brown are+5V/0, orange the GPS Tx, and yellow the PPS."},{"id":"text-234","heading":"Text","content":"One the left is the receiver undergoing initial tests. Vous pouvez\nsee the patch antenna on the left raised on a block of foam so that it can\n&quot;see&quot; past the clutter of the receiver, the receiver itself on the blue PCB mounted vertically in the\nbreadboard, and you might just see the orange-pink wire at the top-right corner\nof the receiver which has been carefully soldered to pin 3 of the NEO-6M to get\nthe PPS signal.  The wire is anchored in the top-right mounting hole for\nstrain relief.  You don&#39;t need surface-mount tools to make this connection,\nmais toi faire need a very fine soldering tip and considerable care! \nLike the TX/RX signals from this module, the PPS signal is at 3.3 V level and\ntherefore ideal for feeding the Raspberry Pi.  The board will accept either\n3.3 V or 5 V power while retaining 3.3V I/O levels, and I&#39;m using 5 V to power the\nboard to reduce the load on the 3.3 V regulator on the Raspberry Pi board. \nThe U-blox device is specified at less than 50 mA supply current.\nFor the final installation, the Adafruit module was used as\nits single package was more convenient.  Not all the leads are connected as\nthere is only one place to connect ground on the module (so the blue is left\nopen), and for simplicity the green Pi Tx =&gt; GPS Rx was not connected. \nJudge the size of the Raspberry Pi by the Ethernet connector on the left!\nThe next step was to set up the Raspberry Pi to talk to the new module, use serial\nGPS data via  gpsd for the coarse time,\nand to use its PPS\nline to provide precise time just as described above.  To preset the serial line\nspeed to 9600 at Linux start-up, edit the file  /boot/config.txt\nto include the line:\n        init_uart_baud=9600\nas it says in: http://elinux.org/RPi_config.txt. \nYou can check using the command:"},{"id":"text-235","heading":"Text","content":"stty -F /dev/ttyAMA0"},{"id":"text-236","heading":"Text","content":"I found that the speed was already set to 9600 on a recent\nRaspberry Pi installed from the NOOBS software.  I gather that on a typical Linux system you might use the\ncommand: stty -F /dev/ttyAMA0 9600. \nRaspberry Pi GPIO multi-pin connector\nThis time , not only were PPS and ground connections required,\nbut also the serial port and the +5 V line, so I used a piece of 6-way ribbon cable to connect between\nthe Raspberry Pi and my serial GPS device.  I happened to have a 10-pin\nheader which fitted the GPIO connector, so these are the connections I chose to\nmake:"},{"id":"text-237","heading":"Text","content":"macable\nTarte aux framboisesconnecteur\nCommentaire\nGPS moduleconnecteur"},{"id":"text-238","heading":"Text","content":"rouge\n+ 5V\nMy unit takes less than 50 mA\n1 +5V"},{"id":"text-239","heading":"Text","content":"+ 5V"},{"id":"text-240","heading":"Text","content":"Bleu\nSol\nOne of two ground connections\n2 GND"},{"id":"text-241","heading":"Text","content":"vert\nTXD\nNot connected, see below"},{"id":"text-242","heading":"Text","content":"Jaune\nRXD\nReceives serial data sent from the GPS\n3 TXD"},{"id":"text-243","heading":"Text","content":"GPIO 18"},{"id":"text-244","heading":"Text","content":"Sol"},{"id":"text-245","heading":"Text","content":"GPIO 23"},{"id":"text-246","heading":"Text","content":"blanc\nGPIO 24\nReceives the PPS sent from the GPS\nPPS pin on u-blox device"},{"id":"text-247","heading":"Text","content":"Noir\nGnd\nOne of two ground connections\n6 GND"},{"id":"text-248","heading":"Text","content":"I actually didn&#39;t connect the TXD lead to the GPS module in the first instance,\nas the GPS receiver powers up sending data in the correct format, so there is\nnothing which the computer Besoins to control.  There is a description\nof the GPIO pin header here. \nAgain, please note that 3.3 V signals are required,  ne pas the 5 V level, and\nabsolument  ne pas the RS-232 level! \nConverting from USB to native serial &#8211; software changes\nWe need to tell gpsd to look for input from a different\nsource: ttyAMA0 instead of ttyACM0"},{"id":"text-249","heading":"Text","content":"$ sudo nano /etc/default/gpsd"},{"id":"text-250","heading":"Text","content":"and change the DEVICES= to point to\n&quot;/dev/ttyAMA0&quot;.  You could use &quot;sudo\ndpkg-reconfigure\ngpsd&quot; instead.  You may also find that the delay between PPS and TXD\non the serial line is different from that over USB, so you may wish to edit your\nntp.conf  accordingly &#8211; it makes the output look nicer at least and may make\nprediction of the nearest second more accurate during the initial acquisition. \nIn my case I needed to change the 0.35 second offset seen in the earlier device\nto the 0.13 second offset seen with the U-blox device, hence the following\nchanger ntp.conf, from"},{"id":"text-251","heading":"Text","content":"fudge 127.127.28.0 time1 +0.350 refid SHM stratum 15"},{"id":"text-252","heading":"Text","content":"à:"},{"id":"text-253","heading":"Text","content":"fudge 127.127.28.0 time1 +0.130 refid SHM stratum 15"},{"id":"text-254","heading":"Text","content":"This configuration has been running since\n  Friday, November 09, 2012.  \n \nOn reflection, I am unsure why I chose to make the stratum 15\nin the example above,  Possible stratum 2 or 3 might be better, otherwise\nNTP may think that the source is of very poor quality and fail to sync to it.\n \nRobin Scwab notes that you could try using the value of\n&quot;Time offset&quot; displayed in cgps -s as the starting value for the time1\nparameter.  This sounds to be a gooo idea, except that on one system here I\nhappened to check Time Offset was about 0.640 seconds, but the best value for\ntime1 (i.e. the value resulting in the smallest average offset) was 0.130\nseconds.  Where did the extra 0.5 seconds come from? \n \nNumber of NTP clients which can be handled\n \nSomeone asked: &quot;How many NTP clients can it\nhandle?&quot;  Well, I have not done any extensive testing on how many clients this\nNTP server can handle (as it will easily be enough for use on a LAN, and it&#39;s\nnot fit for public use in its present security date).  I did manage to\nlocate one NTP stress-testing program here,\nbut the maximum rate I could get it to produce on my PC was about 75 packets per\nsecond, and the Raspberry Pi can handle that rate with ease.  With NTP\nclient PCs polling at 64 second intervals (the fastest normally used), that&#39;s\n4800 clients, so easily enough for a small organisation.  If you were using\nthis for a small organisation, I would recommend using two or three stratum-1\nservers so that you are covered in the event of failure &#8211; perhaps mark one of the\nservers &quot;prefer&quot; on the client PCs to avoid NTP from\n&quot;clock-hopping&quot;.  If you have better\nstress-test data, as Kasper Pedersen did, please let me know and I can publish it here.\n \nKasper Pedersen notes:\n \nI did one a few years ago that goes a bit faster (Linux):\n \nhttp://n1.taur.dk/permanent/ntpload.c\n \nTo test a Raspberry Pi you need 4 instances running, at which point the\nPi runs out of CPU, and settles on 3520/s.  That ought to be enough for most small homes.. 🙂 \n \nThese are brief notes only, on an alternative approach which\ndoes not require a modified kernel with PPS support in the OS, nor does it\nrequire a recompiled NTP, but which produces\nslightly less accurate timekeeping.  It may, however, be quite good enough\nfor most purposes.  The program was developed by Folkert van Heusden, see: http://vanheusden.com/time/rpi_gpio_ntp/ \nand announced\nin the Time-Nuts mailing list.\n \nBase installation &#8211; check you meet these requirements\n \nYou can start here assuming that you have your Raspberry Pi\nbasically working with GPSD and NTP, meaning that:"},{"id":"text-255","heading":"Text","content":"You have installed the current operating system and any\n    updates.\nYou have made any optional IP address or computer name\n    changes.\nYou have got NTP working, preferably connected to your\n    country&#39;s pool servers.\nYou have recompiled\n    and installed NTP to get a full version (is a re-compile required?).\nYou have the PPS signal from the GPS receiver connected to\n    the GPIO, e.g. GPIO-8 (pin 24), or GPIO 18 for the no-soldering\n    planche.\nYou have  installed and configured the gpsd Logiciel\n    and utilities, and made gpsd auto-start.\nYou have a GPS device connected either via a serial or a\n    USB connection.\nle cgps -s command produces a correct display.\nYou have configured NTP to talk to the type 28.0 shared\n    memory driver, and can see the GPSD output in ntpq -pn."},{"id":"text-256","heading":"Text","content":"Optional first step &#8211; to determine the offset of your GPS serial data from\nthe exact second\n \nThe objective is to determine the offset between the PPS\nsignal from your GPS and the serial data which typically follows some hundred or\nmore milliseconds later.  NTP can use that offset either to make a better\nsync when using just a GPS receiver with no PPS, or to present a slightly less\ndéroutant ntpq -p output when using PPS.  To measure what offset\nshould be specified for the time1 factor when using a GPS receiver (type 28\nreference clock driver), we can use NTP as a measuring tool by making it sync to\nexisting servers and have it monitor the\nshared memory #0 written by  gpsd.  I.e. NTP will not use server\n28.0 for timekeeping, but it volonté display the offset in the ntpq\n-p  commander. To do this, you add these\nlines to your ntp.conf (if they are not already there):"},{"id":"text-257","heading":"Text","content":"# Server to be monitored only, not selected for syncing\nserver 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.000 refid GPSD"},{"id":"text-258","heading":"Text","content":"Watch the results from  ntpq\n-pn, and look at the offset for the server with the refid GPSD.  On one of my RPi cards it varied between -322 and -336 (units are\nms in the ntpq report). \nTake an average of those values, and replace the 0.000 after time1 with that average.  In this case, the average was -329 ms, so try:"},{"id":"text-259","heading":"Text","content":"server 127.127.28.0 minpoll 4 maxpoll 4 noselect\nfudge 127.127.28.0 time1 0.329 refid GPSD"},{"id":"text-260","heading":"Text","content":"i.e. if the reported offset is negative, you need to make\ntime1 a positive value.  Now you should see much smaller offsets for the GPSD server. \nCe n&#39;est pas\nessential to do this, but it gives you confidence that things are working as\nexpected, it may help NTP in the early startup, and it produces a less\ndéroutant  ntpq display.  Don&#39;t forget to remove the noselect\nwhen you have the best value for the offset, and set the flags to include préféré\nso that NTP knows it can use that source as a seconds provider! Là\nmust be at least one préférer for PPS to work.  This now has the NTP daemon seeing the GPSD device, and\nthe next step is to\nadd in some PPS support."},{"id":"text-261","heading":"Text","content":"server 127.127.28.0 minpoll 4 maxpoll 4 prefer\nfudge 127.127.28.0 time1 0.329 refid GPSD"},{"id":"text-262","heading":"Text","content":"Getting the average value for time1 automatically\n \nAngelo Mileto writes: What I did to get a good sample of data for the  time1 value was let the ntpq -p command run for a period of time and capture the results. \nThen, using awk, calculate the average/mean of the values collected.  If you look at the static ntpq -p output, you will see something like this:\n \n          remote           refid      st t when poll reach   delay   offset  jitter\n==============================================================================\n SHM(0)          .GPSD.           2 l   13   16  377    0.000   33.837   3.510\noPPS(0)          .PPS.            2 l   12   32  377    0.000    0.002   0.002\nalong with other pool/server entries.  As noted above, you need to ensure you have a good preferred source for the comparison to work. \nTo capture your data, execute the following at the command line from your user&#39;s home directory:"},{"id":"text-263","heading":"Text","content":"watch -n0.5 &quot;ntpq -pn | grep &#39;.GPSD. 2 1 1&#39; | tee --append GPSD_Offset.txt&quot;"},{"id":"text-264","heading":"Text","content":"Pay attention to the single and double quotes in that command.  If you notice, the grep is looking for the exact line from the ntpq -p output that contains your GPSD\nrefid.  So if you named it something different, that would replace the .GPSD. in the command. \nAlso, notice the &quot;2 1 1&quot;, that is the stratum, t and when fields.  The stratum is whatever you set it to in the ntp.conf; the t should always be a 1 and the when is going to capture the output\nseulement when the timer reaches 1 meaning that it just updated the value. \nThere is no sense in capturing data every .5 seconds for data that doesn&#39;t\nchange!  So the easiest way to get the value to grep for is to manually run the ntpq -p and copy from your refid through the when fields and that&#39;s what will be grepped for.\n \nLet that run for a good while &#8211; probably not really needed &#8211; but that&#39;s the point of getting a good sample size. \nThis will capture the output from the ntpq command filtering to just your SHM/GPSD. \nThis will all be saved to a file GPSD_Offset.txt in the current directory &#8211; that&#39;s what the &quot;tee &#8211;append GPSD_Offset.txt&quot; does. \nYou can tail -f that file if you want while the watch command is running to see what is going into that file. \nNOTE: If you need to restart the process because you changed some setting and want to start over, delete any existing GPSD_Offset.txt file first.\n \nOnce you have a sufficient sample size, you can then use the following command to get the actual value for the average/mean:"},{"id":"text-265","heading":"Text","content":"awk &#39;total=total+$9; count=count+1 END print &quot;Total:&quot;total; print &quot;Count:&quot;count; print &quot; Avg:&quot;total/count&#39; GPSD_Offset.txt"},{"id":"text-266","heading":"Text","content":"This steps through every line of the GPSD_Offset.txt file and totals up all of the offset values. \nIt will also count how many lines/values are there.  Finally it just prints the information: Total, count and average. \nThe average value is what you would put into the  time1 value as noted above. \nDon&#39;t forget to change the noselect to prefer when you are in there to add the time1 value.\nAngelo Mileto\n \nDJT: This is somewhat beyond my Linux, so my thanks to Angelo for the scripts and the\ndetailed explanation.  Angelo can be contacted here.\nDownloading and compiling Folkert van Heusden&#39;s program\n \nAs of 2013-Jun-18, rpi_gpio_ntp-0.3 was the current version,\nbut thanks to Thomas Erthner I know that version 1.5 is now available, so I&#39;ve\nupdated the lines below.  However, I&#39;ve only tested version 0.3, not\nversion 1.5.  For more details, please see Folkert&#39;s\npage."},{"id":"text-267","heading":"Text","content":"$ wget http:\n//vanheusden.\ncom/time/rpi_gpio_ntp/rpi_gpio\n_ntp-1.5.\ntgz"},{"id":"text-268","heading":"Text","content":"$ tar xvfz rpi_gpio_ntp-1.5.tgz\n$ cd rpi_gpio_ntp-1.5\n$ sudo make install"},{"id":"text-269","heading":"Text","content":"This places the resulting binary in /usr/local/bin/.\nYou don&#39;t need this for current Raspbian versions.\n \nTo test you are receiving a PPS signal, from GPIO pin 8:"},{"id":"text-270","heading":"Text","content":"$ sudo rpi_gpio_ntp -g 8 -d\nrpi_gpio_ntp v0.2, (C) 2013 by folkert@vanheusden.com"},{"id":"text-271","heading":"Text","content":"NTP unit: 0\nGPIO pin: 8\nFudge : 0.000000\n&quot;Fork into the background&quot; disabled because of debug mode.\n1371475664.752146325]poll() GPIO 8 interrupt occurred\n1371475665.000148935]poll() GPIO 8 interrupt occurred\n1371475666.000147203]poll() GPIO 8 interrupt occurred\n1371475667.000160470]poll() GPIO 8 interrupt occurred\n1371475668.000159739]poll() GPIO 8 interrupt occurred\n(Ctrl-C pressed)\n$"},{"id":"text-272","heading":"Text","content":"Running the program\n \nTo make NTP read the PPS timings on the GPSD shared memory, we need to use\nthis command to start the program, assuming the PPS signal is being sent to\nGPIO-8 (physical pin 24 &#8211; see here). \nUse pin 18 is you are using the no-soldering board."},{"id":"text-273","heading":"Text","content":"$ sudo rpi_gpio_ntp -N 1 -g 8"},{"id":"text-274","heading":"Text","content":"and to edit the ntp.conf file, to include the shared memory driver, on section 1\nof the GPSD shared memory, replacing the earlier type 22 driver.  Add:"},{"id":"text-275","heading":"Text","content":"server 127.127.28.1 minpoll 4 prefer\nfudge 127.127.28.1 refid UPPS"},{"id":"text-276","heading":"Text","content":"I suggest &quot;UPPS&quot; to show it&#39;s user-mode PPS (and not\nthe more accurate Kernel mode).  If you want to see the output pulse from the program, you can add the &quot;-p 7&quot;\nparameter:"},{"id":"text-277","heading":"Text","content":"sudo rpi_gpio_ntp -N 1 -g 8 -p 7"},{"id":"text-278","heading":"Text","content":"and you can then use an oscilloscope to compare the time of\nthe PPS rising edge with the toggling line from GPIO pin 7 (connector pin\n26). On my system, there was a variable delay of between 270 and 390\nmicroseconds between PPS and program response.\n \nAuto-start\n \nMore information to follow, for now, this from Folkert: \nmodifier  /etc/rc.local  and add the\nfollowing (BEFORE the exit 0 statement and AFTER the #!/bin/sh line):"},{"id":"text-279","heading":"Text","content":"/usr/local/bin/rpi_gpio_ntp -N 1 -g 8"},{"id":"text-280","heading":"Text","content":"Replace &#39;8&#39; by the gpio pin you are using, e.g. 18 for the no-soldering\nplanche.\n \nPerformance\n \nThe original documentation suggested using minpoll=1, however on testing using\nntpq -pn  it appeared that NTP will automatically accept 3 as the minimum value. Comme\nthe previous testing with kernel-mode PPS had been with minpoll=4, it seemed\nonly fair to test with that value.  You can see the change from minpoll=1\nto minpoll=4 just after 18:00 UTC.  Recall that 1 was replaced internally\nby 3, the lowest value NTP will accept.  With minpoll=4,\nboth the reported offset and the averaged jitter were reduced.  First, what it looks like in MRTG for comparison with the results\nabove:"},{"id":"text-281","heading":"Text","content":"Don&#39;t get confused: the MRTG plot above covers rather more\nthan one day, whereas the plots below cover just under half a day. Sur le\nplot MRTG plot, you can see that the RPi was changed from kernel-mode PPS at\n13:00 UTC and run for a short while with Internet servers alone, visible as the\nlarger excursions on the plot above around 13:00).  \n \nFrom my NTPplotter\nprogram graphs below, you can see more clearly that at 13:30\nthe user-mode PPS was started, and the just after 18:00 the minpoll was changed\nfrom 1 (actually 3) to 4, resulting in a slight drop of RMS offset from around 5\nmicroseconds to 4 microseconds:"},{"id":"text-282","heading":"Text","content":"The jitter graph shows a drop in averaged jitter (green line) from just below 7 to just\nabove 5 microseconds after 18:00, when the minpoll was changed from 3 to 4. \nThe initial higher value of averaged jitter is the tail resulting from\nInternet-only sync."},{"id":"text-283","heading":"Text","content":"On another Raspberry Pi you can see the dramatic difference between NTP sync\nover the network and that achieved with the user-mode PPS software. Dans\nthis case, network sync was to a local NTP stratum-1 server over a Wi-Fi\nconnection, and the PPS sync was with a U-blox 5S module.  User-mode PPS\nwas started just after 11:00 UTC in the middle of the graphs below.  RMS\noffset dropped from a rather variable 48-80 microseconds to around 2 microseconds,\nand jitter averaged over 6 hours dropped from around 80 microseconds to under\n2.5 microseconds."},{"id":"text-284","heading":"Text","content":"To monitor NTP you can edit the ntp.conf file to turn on the generation\nof more detailed statistics data.  Note that this data maybe a megabyte or more per day, so think about keeping only a few days\nworth, and only enabling statistics collection when needed as the number of\nwrites to the SD card flash memory is limited.  The detailed information\ncan now be found here and I\noffer a program to plot the statistics data and produce offset and jitter graphs\nsuch as those above here.\n \n \nTransients\n \nI may have been unfortunate in locating one Raspberry Pi with an Adafruit\nmodule in a position where it was not getting as good a view of the sky as\nothers, or it may be that other devices connected to that RPi or software\ninstalled is an issue.  I have been seeing transient poor time-keeping\n(loss of GPS PPS signal) at intermittent times.  I did discover that\ndisconnections a lead to a USB hub connected to that RPi seemed to improve\ndes choses.\n \n If the problem was caused purely by unfortunate GPS satellite\nposition, I might have expected it to repeat in a near 24-hour pattern, which\ndoes appear to be the case.  Thanks to John Ryan for correcting me about the GPS\norbital period, I was originally thinking sidereal time and 4 minute earlier\neach day.  However, on the Time-Nuts mailing list, in connection with\nanother topic, Bob Camp commented:"},{"id":"text-285","heading":"Text","content":"&quot;The GPS constellation repeats roughly once a day. \n  It is not at all uncommon to have a “worst case” satellite geometry for a given antenna location. \n  If you have one, it will repeat once a day and show up as a bump in the timing out of your GPS module&#8230;.&quot;"},{"id":"text-286","heading":"Text","content":"Although the GPS satellites repeat position in just less than\n12 hours, there is also the rotation of the earth to take into account, so the\nposition repeats at your location every 24 hours (well, ~23 h 56 m).\n \n   On reflection, 2014 February 09, this is the only Raspberry\nPi with certain radio software installed, and the problem only seems to occur\nsome days after a reboot, so I think I will stop recording the problem\nici. I am editing out the transients as they affect the P/N timekeeping\ngraphs, but I leave the raw-graphs as-is."},{"id":"text-287","heading":"Text","content":"Date\nTransient"},{"id":"text-288","heading":"Text","content":"Dec 31\n20:00-20:45, 23:10-24:00"},{"id":"text-289","heading":"Text","content":"Jan-01\n20:14-20:37, 23:17-23:28"},{"id":"text-290","heading":"Text","content":"Jan-02\n01:29 02:45, 19:57..20:13, 20:14..20:29, 20:31, 23:13, 23:24 23:30..23:54"},{"id":"text-291","heading":"Text","content":"Jan-03\n02:39, 03:44, 20:12..20:22, 23:24..23:52"},{"id":"text-292","heading":"Text","content":"Jan-04\n02:37, 20:03..20:28, 23:06, 23:41..23:45"},{"id":"text-293","heading":"Text","content":"Jan-05\n02:31"},{"id":"text-294","heading":"Text","content":"Removed USB extension cable from RasPi-2"},{"id":"text-295","heading":"Text","content":"Jan-06\n19:33..1940, 19:54, 22:49..22:55"},{"id":"text-296","heading":"Text","content":"Jan-10\n20:30 22:07-22:17 22:37-22:45 23:03"},{"id":"text-297","heading":"Text","content":"Jan-11\n21:57-23:18"},{"id":"text-298","heading":"Text","content":"Jan-12\n22:01-22:54"},{"id":"text-299","heading":"Text","content":"Jan-13\n19:17-19:37 22:37-22:54"},{"id":"text-300","heading":"Text","content":"Jan-14\n01:46-01:47 19:30 19:40 22:46-22:51"},{"id":"text-301","heading":"Text","content":"Jan 15\n01:47 19:16-19:35 22:42-22:46 23:06"},{"id":"text-302","heading":"Text","content":"Jan-16\n19:05-19:32 22:24-22:41"},{"id":"text-303","heading":"Text","content":"Jan-17\n19:07-19:19 22:04-22:34"},{"id":"text-304","heading":"Text","content":"Jan-18\n19:11-19:16 21:55-21:57"},{"id":"text-305","heading":"Text","content":"Jan-19\n02:38-02:39"},{"id":"text-306","heading":"Text","content":"Jan-20\n19:04-20:06"},{"id":"text-307","heading":"Text","content":"Jan-21\n02:55-03:03 03:17 19:00 19:46 20:15 22:06"},{"id":"text-308","heading":"Text","content":"Jan-22\n02:56-03:05"},{"id":"text-309","heading":"Text","content":"Jan-23\n10:46 12:48"},{"id":"text-310","heading":"Text","content":"Jan-24\n02:48-02:53 07:21 07:44 12:46-12:48 17:11 19:20-19:36"},{"id":"text-311","heading":"Text","content":"Jan-25\n07:13 07:18 07:52-07:53 13:02-13:11"},{"id":"text-312","heading":"Text","content":"Jan-26\n02:50 03:26 18:06 18:31-18:36 21:59"},{"id":"text-313","heading":"Text","content":"Jan-27\n02:42 02:57-03:37 07:09 (reboot at 17:23)"},{"id":"text-314","heading":"Text","content":"Jan-31\n21:19-21:21"},{"id":"text-315","heading":"Text","content":"Feb-05\n20:59 23:12 (is this something which starts days after boot?)"},{"id":"text-316","heading":"Text","content":"Feb-07\n\t\t18:03 18:41 20:52"},{"id":"text-317","heading":"Text","content":"Feb-08\n15:09 15:42 18:37 20:33 20:46 21:24"},{"id":"text-318","heading":"Text","content":"Feb-09\n00:13 00:37-00:43 01:37"},{"id":"text-319","heading":"Text","content":"If you are operating completely alone, with no internet\nconnection and just the GPS, your NTP may need to be told about leap-seconds\nwhich change the offset between GPS time and wall-clock time every so\nsouvent. Some GPS receivers provide this information automatically, but this\ncan also be done by providing a file with the times of changes (in a standard format) and telling ntpd where to\nfind that file.  On my own\nsystems I have set up a Samba share on the NTP servers so that I can update the\nleap-seconds file from a central location.  To do this, add a new writeable share named &quot;ntp-leapseconds&quot;\nby adding lines to the end of smb.conf, and then restart Samba:"},{"id":"text-320","heading":"Text","content":"sudo nano /etc/samba/smb.conf\n[ntp-leapseconds]"},{"id":"text-321","heading":"Text","content":"comment = NTP leapsecond.file\npath = /home/pi/ntp\nwriteable = yes\nguest ok = yes"},{"id":"text-322","heading":"Text","content":"sudo /etc/init.d/samba restart"},{"id":"text-323","heading":"Text","content":"I chose to put my leap-seconds file in the default user&#39;s\n&quot;ntp&quot; home directory, but you may prefer some where more secure! \nTo tell ntpd where to find the file,\tadd one line to the end of ntp.conf with\nnano, and restart NTP:"},{"id":"text-324","heading":"Text","content":"sudo nano /etc/ntp.conf\nleapfile /home/pi/ntp/leap-seconds.file\nsudo /etc/init.d/ntp restart"},{"id":"text-325","heading":"Text","content":"You can get the leap-seconds file from a variety of locations,\nincluding:\n \n    ftp://utcnist.colorado.edu/pub/    ftp://tycho.usno.navy.mil/pub/ntp/\n \nand it will be named  leap-seconds.3582403200\nwith a different serial number as the information is updated (this file was found in December 2013). je\ncopy the file to a constant name:  leap-seconds.file\nso that I don&#39;t need to alter NTP each time.  I then have a small Windows\ncommand file to update all my systems &#8211; Windows, FreeBSD and Raspberry Pi\ncards.  Here&#39;s an extract:"},{"id":"text-326","heading":"Text","content":"XCOPY /D /Y  leap-seconds.file  \\Altantpetc\nXCOPY /D /Y  leap-seconds.file  \\Stamsundntpetc\nXCOPY /D /Y  leap-seconds.file  \\Pixie-IIntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-1ntp-leapseconds\nXCOPY /D /Y  leap-seconds.file  \\RasPi-2ntp-leapseconds\nPAUSE"},{"id":"text-327","heading":"Text","content":"You can check whether NTP is using the file, and whether your\nfile is stale, with the:  ntpq -crv \ncommander:"},{"id":"text-328","heading":"Text","content":"associd=0 status=01fd leap_none, sync_pps, 15 events, kern,\nversion=&quot;ntpd 4.2.7p408@1.2483 Sun Dec 29 14:36:43 UTC 2013 (1)&quot;,\nprocessor=&quot;armv6l&quot;, system=&quot;Linux/3.6.11&quot;, leap=00, stratum=1,\nprecision=-19, rootdelay=0.000, rootdisp=1.180, refid=PPS,\nreftime=d66b96d3.01b61b26  Mon, Dec 30 2013  6:53:07.006,\nclock=d66b96df.3df17b24  Mon, Dec 30 2013  6:53:19.241, peer=61352, tc=4,\nmintc=3, offset=0.000281, frequency=-34.180, sys_jitter=0.001907,\nclk_jitter=0.001, clk_wander=0.003, tai=35, leapsec=201207010000,\nexpire=201406010000"},{"id":"text-329","heading":"Text","content":"Look at the two final lines.  leapsec shows the latest\nleap second (here is was on 2012 Jul 01), and when the leap-second file expires\n(here: 2014-Jun-01).  There will also be a warning if the file is stale.\n \nUpdate the file from time-to-time &#8211; say every six months &#8211; in\nMay and November as leap-second changes usually happen at the end of June or\nDecember.  There is more information here. \n \nIf you keep getting a different ntp.conf from that which you edited, your\nrouter may be the cause. It seems some routers give out NTP information in DHCP which the Pi by default uses over\n/etc/ntp.conf.\n \nThe fix I think is:"},{"id":"text-330","heading":"Text","content":"rm /etc/dhcp/dhclient-exit-hooks.d/ntp"},{"id":"text-331","heading":"Text","content":"and if you have the following file, remove it as well:"},{"id":"text-332","heading":"Text","content":"rm /var/lib/ntp/ntp.conf.dhcp"},{"id":"text-333","heading":"Text","content":"Then reboot.\nYou can produce real-time graphs like those below using MRTG\nand a simple script which can get the statistics from NTP remotely. Là\nis more information here.  I happen to run\nMRTG and the collection scripts on a Windows PC."},{"id":"text-334","heading":"Text","content":"RasPi-2\n \nRasPi-4"},{"id":"text-335","heading":"Text","content":"Information on general SNMP monitoring may now be found here. \nThis allows monitoring of the network I/O on the card, and a number of other\nparameters which are exposed for measurement by the OS.  An example graph\nfollows:"},{"id":"text-336","heading":"Text","content":"RasPi-3"},{"id":"text-337","heading":"Text","content":"As NTP tries to keep the clock on the card at a constant\nfrequency, it is often compensating for the effects of temperature changes which\ncause frequency changes.  It is therefore worthwhile monitoring the CPU temperature\nmonitoring as described here,\nalthough with a PPS signal and when used as a stratum-1 server, temperature\neffects may be less obvious.  Example graphs are shown below:"},{"id":"text-338","heading":"Text","content":"RasPi-4"},{"id":"text-339","heading":"Text","content":"The MRTG monitoring scripts (which I actually run on a Windows PC\ncovering several Raspberry Pi cards) are in this Zip\narchive. \n \nI extended the SNMP pass function to allow monitoring of\nambient temperature using the DS18B20 &quot;single-wire&quot; device. Cette\nis well written up for use with the Raspberry Pi here,\nand the detailed description is now here. \nSample results:"},{"id":"text-340","heading":"Text","content":"RasPi-4\nIndoor temperature °C"},{"id":"text-341","heading":"Text","content":"Outdoor temperature °F"},{"id":"text-342","heading":"Text","content":"Merci!\n \nMy thanks to Webshed for\nuploading the information about using the DS18B20. \n \nRunning a publicly accessible NTP server\n \nIf you are running a server which is accessible from the\npublic Internet &#8211; perhaps you are contributing to the NTP\nbassin project &#8211; there are some simple precautions you should take to ensure\nthat your server is not used as the source of an attack on other PCs. Remarque\nthat this doesn&#39;t apply to most end-user clients sitting on your local PC, you\nwould need to have specially opened a port in your firewall or router to allow\npublic incoming unsolicited UDP port 123 packets into your local network. \nIf you are using a development version (4.2.7p26 or later) you are already\nprotected.  The following notice explains more:"},{"id":"text-343","heading":"Text","content":"NTP users are strongly urged to take immediate action to ensure that their NTP daemon is not susceptible to use in a reflected denial-of-service\n      (DRDoS) attack. Please see the\n       NTP Security Notice for vulnerability and mitigation details, and the\n      Réseau\n      Time Foundation Blog pour plus d&#39;informations. (January 2014)"},{"id":"text-344","heading":"Text","content":"Raspberry Pi: 86 x 56 x 21 mm\nRaspberry Pi in its box: 91 x 62 x 29 mm\nTrimble evaluation board: 66 x 32 x 8 mm\nTrimble evaluation board with interface: 66 x 32 x 24 mm\nU-blox interface card: 39 x 22 x 6 mm (excluding connection\n    pins)\nPatch antenna supplied with interface card: 25 x 25 x 7 mm"},{"id":"text-345","heading":"Text","content":"What else have I done with the Raspberry Pi?"},{"id":"text-346","heading":"Text","content":"Receiving ADS-B signals on\n1.09 GHz with a cheap TV dongle and feeding the results to Plane\nPlotter over a Wi-Fi link.  This allows you to put the receiver right\nup close to the antenna, avoiding an expensive (or lossy) piece of cable, and\navoiding the need for a cable run at all.  Details are here. \nIt&#39;s not much more than following someone else&#39;s instructions, but at least I\ncan vouch for every command on that page, and perhaps you will find something\nuseful there.\nA Digital Wall clock\n    using the Raspberry Pi &#8211; synchronised with NTP, of course!"},{"id":"text-347","heading":"Text","content":"Acknowledgments\nI would like to support NTP\n \nClick to rate this post!\n                                   \n                               [Total: 0  Average: 0]"}],"media":{"primary_image":""},"relations":[{"rel":"canonical","href":"https://tutos-gameserver.fr/2019/10/05/construire-un-serveur-ntp-stratum-1-stratum-pi-serveur-dimpression-2/"},{"rel":"alternate","href":"https://tutos-gameserver.fr/2019/10/05/construire-un-serveur-ntp-stratum-1-stratum-pi-serveur-dimpression-2/llm","type":"text/html"},{"rel":"alternate","href":"https://tutos-gameserver.fr/2019/10/05/construire-un-serveur-ntp-stratum-1-stratum-pi-serveur-dimpression-2/llm.json","type":"application/json"},{"rel":"llm-manifest","href":"https://tutos-gameserver.fr/llm-endpoints-manifest.json","type":"application/json"}],"http_headers":{"X-LLM-Friendly":"1","X-LLM-Schema":"1.1.0","Content-Security-Policy":"default-src 'none'; img-src * data:; style-src 'unsafe-inline'"},"license":"CC BY-ND 4.0","attribution_required":true,"allow_cors":false}