All Projects → TinajaLabs → ansible-role-ntp-gps

TinajaLabs / ansible-role-ntp-gps

Licence: MIT license
Ansible Role: NTP with GPS on Raspberry Pi

Programming Languages

Jinja
831 projects

Projects that are alternatives of or similar to ansible-role-ntp-gps

aw-clock
Astronomy/weather clock
Stars: ✭ 41 (+173.33%)
Mutual labels:  raspberrypi, gps
automile-php
Automile offers a simple, smart, cutting-edge telematics solution for businesses to track and manage their business vehicles.
Stars: ✭ 28 (+86.67%)
Mutual labels:  gps
pipxe
iPXE for the Raspberry Pi
Stars: ✭ 154 (+926.67%)
Mutual labels:  raspberrypi
munet
Network WiFi access, OTA, NTP time and MQTT (via PubSubClient) for ESP8266 and ESP32
Stars: ✭ 20 (+33.33%)
Mutual labels:  ntp
pi roombot
ROS raspberry pi "roomba" like robot
Stars: ✭ 12 (-20%)
Mutual labels:  raspberrypi
UpdatingHDmapByMonoCamera
Updating HD map with RTK-GPS and monocular camera
Stars: ✭ 120 (+700%)
Mutual labels:  gps
RTKLIB
A version of RTKLIB optimized for single and dual frequency low cost GPS receivers, especially u-blox receivers. It is based on RTKLIB 2.4.3 and is kept reasonably closely synced to that branch. Documentation for RTKLIB is available at rtklib.com. This software is provided “AS IS” without any warranties of any kind so please be careful, especial…
Stars: ✭ 420 (+2700%)
Mutual labels:  gps
Atlas
🌎 Atlas is a set of APIs for looking up information about locations
Stars: ✭ 21 (+40%)
Mutual labels:  gps
LongDistance
Long Distance Netflix chrome extension to replace Showgoers and Netflix Party
Stars: ✭ 37 (+146.67%)
Mutual labels:  ntp
HitUP
Find top things in New Tab, including GitHub Trending Repositories.
Stars: ✭ 176 (+1073.33%)
Mutual labels:  ntp
automile-net
Automile offers a simple, smart, cutting-edge telematics solution for businesses to track and manage their business vehicles.
Stars: ✭ 24 (+60%)
Mutual labels:  gps
build esp8266
Bash Script to Build MicroPython for ESP8266 on Raspberry Pi or Debian Linux
Stars: ✭ 13 (-13.33%)
Mutual labels:  raspberrypi
local-paste
Lightweight pastebin for home network which may or may not be connected to the internet.
Stars: ✭ 24 (+60%)
Mutual labels:  raspberrypi
wor-flasher
Legal utility that runs on RPiOS to flash another SD card with Windows 10/11
Stars: ✭ 451 (+2906.67%)
Mutual labels:  raspberrypi
Cayenne-Agent
Cayenne Agent
Stars: ✭ 20 (+33.33%)
Mutual labels:  raspberrypi
pi
🥧 Monorepo for my Raspberry Pi dashboard and GPS satellite listener.
Stars: ✭ 27 (+80%)
Mutual labels:  gps
ESP32 IMU BARO GPS VARIO
GPS altimeter/variometer with LCD display, routes with waypoints, data/gps track logging, bluetooth NMEA sentence transmission, wifi AP + webpage configuration
Stars: ✭ 72 (+380%)
Mutual labels:  gps
teslausb
Steps and scripts for turning a Raspberry Pi into a useful USB drive for a Tesla
Stars: ✭ 1,426 (+9406.67%)
Mutual labels:  raspberrypi
gpx-interpolate
Python function to interpolate GPX data using piecewise cubic Hermite splines
Stars: ✭ 35 (+133.33%)
Mutual labels:  gps
SparkFun RTK Firmware
Centimeter precision GPS/GNSS using L1/L2 signals broadcast over Bluetooth SPP (using the ESP32) in an easy to use enclosure.
Stars: ✭ 38 (+153.33%)
Mutual labels:  gps

Ansible NTP-GPS

A simple Ansible role to configure a GPS based NTP Server which can deliver a time signal to a network that is not connected to the internet.

This build uses a Raspberry Pi and time signals derived from a connected GPS device.

Requirements

Designed and tested with:

Alt text

Alt text

Wiring connections:

from Raspi pin:  4 (+5V)            to GPS Breakout pin: VIN +5V        
from Raspi pin:  6 (Ground)         to GPS Breakout pin: GND Gnd        
from Raspi pin:  8 (TXD0) (GPIO14)  to GPS Breakout pin: RX TX
from Raspi pin: 10 (RXD0) (GPIO15)  to GPS Breakout pin: TX RX
from Raspi pin: 12 (GPIO18)         to GPS Breakout pin: PPS (Pulses Per Second)

Role Variables

None.

Role Templates

A set of default templates for cmdline.txt, dhclient.conf, ntp.conf, config.txt, and gpsd are provided in the templates subdirectory of this role. They should work fine for most applications. Should local conditions dictate, you may optionally override them by putting equivalent-named files in {{ inventory_dir }}/templates.

Dependencies

None.

Example Playbook

Create playbook, tinaja-ntp-gps.yml:

    - hosts: ntpserver
      roles:
         - { role: tinaja.ntp-gps }

Basic Steps

  • Install Ansible - will assume this is already done...
  • Download the latest version of the Raspbian image from: https://downloads.raspberrypi.org/raspbian_lite_latest
  • Burn the image on a MicroSD card (8G or more) using etcher
  • Add a magic empty file named SSH onto the boot partition (configures default SSH service)
  • Plug in the MicroSD image into the Raspi and boot up.
  • After bootup, copy your public key to the raspberrypi using user:pi, password:raspberry:

$ ssh-copy-id -f -i ~/.ssh/id_rsa.pub [email protected]

  • Setup a host inventory file with a reference like this:

tinaja-ntp ansible_host=<raspi ipaddress> ansible_user=pi

  • Run your playbook:

$ ansible-playbook tinaja-ntp-gps.yml -i hosts/hosts.ini -u pi -b -c ssh

Run these tests after rebooting:

Log into your raspi:

$ ssh [email protected]

Escalate to user, root:

# sudo su -

See the serial data streaming in from the GPS device

# cat /dev/ttyAMA0

See the /dev/pps0 device streaming in

# ppstest /dev/pps0

See the gps device statistics including the time, Latitude, Longitude from the GPS receiver

# gpsmon

See the list of ntp servers. The PPS reference should have an asterisk indicating the primary source.

# ntpq -p

*SHM(2) .PPS. 0 l 1 64 377 0.000 -51.298 4.627

On your local server

Set up the NTP server to point to the new NTP server. Edit /etc/ntp.cfg:

# nano /etc/ntp.conf

Change this:

# You do need to talk to an NTP server or two (or three).  
#server ntp.your-provider.example  

to this:

# You do need to talk to an NTP server or two (or three).  
#server ntp.your-provider.example  
server <your ntp server ip or fqdn>

Save the file and restart the NTP service:

# systemctl restart ntp.service

See the magic, by running this command:

# date

References

License

MIT

Author Information

Chris Jefferies - [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].