waypoint
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
* `bash ~/Precision-Timekeeping-Fuckery/full_status.sh`
|
* `bash ~/Precision-Timekeeping-Fuckery/full_status.sh`
|
||||||
|
|
||||||
**Status (Services)**
|
**Status (Services)**
|
||||||
* `bash ~/Precision-Timekeeping-Fuckert/status_services.sh`
|
* `bash ~/Precision-Timekeeping-Fuckery/status_services.sh`
|
||||||
|
|
||||||
**Test PPS**
|
**Test PPS**
|
||||||
* `sudo ppstest /dev/pps0`
|
* `sudo ppstest /dev/pps0`
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
**Pins are 2mm pitch**
|
**Pins are 2mm pitch**
|
||||||
**3.3 Volts**
|
**3.3 Volts**
|
||||||
| Cable | Module Pin | Module Pin Meaning | Raspberry Pi 4 Pin | Voltage | Notes |
|
| Cable | Module Pin | Module Pin Meaning | Raspberry Pi 4 Pin | Voltage | Notes |
|
||||||
|:-------|:-----------|:-------------------------|:---------------------------|:------------------------|:----------------------------------------------------------|
|
|:-------|:-----------|:-------------------------|:---------------------------|:-----------------|:----------------------------------------------------------|
|
||||||
| Red | 2 - VCC | Voltage In | 1 - 3.3 Volts Out | 3.3 V | NOT 5 V TOLERANT |
|
| Red | 2 - VCC | Voltage In | 1 - 3.3 Volts Out (Split) | 3.3 V | NOT 5 V TOLERANT |
|
||||||
| Black | 8 - GND | Ground | 25 - Ground | 3.3 V? | UNKNOWN 3 V AND 5 V TOLERANCES |
|
| Black | 8 - GND | Ground | 25 - Ground | 3.3 V? | UNKNOWN 3 V AND 5 V TOLERANCES |
|
||||||
| Yellow | 4 - RST | Hardware Reset | NC? - Not Connected/GPIO? | 3.3 V | NOT 5 V TOLERANT |
|
| Yellow | 4 - RST | Hardware Reset | NC? - Not Connected/GPIO? | 3.3 V | NOT 5 V TOLERANT |
|
||||||
| White | 6 - TP1 | Time Pulse 1/PPS | 12 - GPIO 18 | 3.3 V | NOT 5 V TOLERANT |
|
| White | 6 - TP1 | Time Pulse 1/PPS | 12 - GPIO 18 | 3.3 V | NOT 5 V TOLERANT |
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
SUBSYSTEM=="pps[0-9]*", GROUP="dialout", MODE="0660"
|
||||||
|
SUBSYSTEM=="tty[0-9]*", GROUP="dialout", MODE="0660"
|
||||||
|
SUBSYSTEM=="tty[A-Z]*[0-9]*", GROUP="dialout", MODE="0660"
|
||||||
|
SUBSYSTEM=="i2c[A-Z]-*[0-9]*", GROUP="dialout", MODE="0660"
|
||||||
|
SUBSYSTEM=="rtc[0-9]*", GROUP="dialout", MODE="0660"
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# Precision Timekeeping Fuckery Additions
|
||||||
|
## GPS PPS GPIO Signal
|
||||||
|
dtoverlay=pps-gpio,gpiopin=18
|
||||||
|
|
||||||
|
## GPS GPIO UART
|
||||||
|
enable_uart=1
|
||||||
|
init_uart_baud=115200
|
||||||
|
|
||||||
|
## I2C Hardware RTC Overlay
|
||||||
|
dtoverlay=i2c-rtc,ds3231
|
||||||
|
# End Precision Timekeeping Fuckery Additions
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# SHM refclock is shared memory driver, it is populated by GPSd and read by chrony
|
||||||
|
# it is SHM 0
|
||||||
|
# refid is what we want to call this source = NMEA
|
||||||
|
# offset = 0.000 means we do not yet know the delay
|
||||||
|
# precision is how precise this is. not 1e-3 = 1 millisecond, so not very precision
|
||||||
|
# poll 0 means poll every 2^0 seconds = 1 second poll interval
|
||||||
|
# filter 3 means take the average/median (forget which) of the 3 most recent readings. NMEA can be jumpy so we're averaging here
|
||||||
|
refclock SHM 0 refid NMEA offset 0.000 precision 1e-6 poll 0 filter 3
|
||||||
|
|
||||||
|
# PPS refclock is PPS specific, with /dev/pps0 being the source
|
||||||
|
# refid PPS means call it the PPS source
|
||||||
|
# lock NMEA means this PPS source will also lock to the NMEA source for time of day info
|
||||||
|
# offset = 0.0 means no offset... this should probably always remain 0
|
||||||
|
# poll 3 = poll every 2^3=8 seconds. polling more frequently isn't necessarily better
|
||||||
|
# trust means we trust this time. the NMEA will be kicked out as false ticker eventually, so we need to trust the combo
|
||||||
|
refclock PPS /dev/pps0 refid PPS lock NMEA offset 0.0 poll 3 trust
|
||||||
|
|
||||||
|
# allow local connections to ntp
|
||||||
|
allow 10.0.0.0/24
|
||||||
|
|
||||||
|
# manual
|
||||||
|
manual
|
||||||
|
|
||||||
|
# tell clients im the big dog
|
||||||
|
local stratum 1
|
||||||
|
|
||||||
|
# Good Time Servers
|
||||||
|
pool time.cloudflare.com iburst
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# USB might be /dev/ttyACM0
|
||||||
|
# serial might be /dev/ttyS0
|
||||||
|
# pps might be /dev/pps0
|
||||||
|
DEVICES="/dev/ttyS0 /dev/pps0"
|
||||||
|
|
||||||
|
# -n means start without a client connection (i.e. at boot)
|
||||||
|
# -s 9600 is to set baud to 9600
|
||||||
|
GPSD_OPTIONS="-n -s 9600"
|
||||||
|
|
||||||
|
# also start in general
|
||||||
|
START_DAEMON="true"
|
||||||
|
|
||||||
|
# Automatically hot add/remove USB GPS devices via gpsdctl
|
||||||
|
# USBAUTO="true"
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
instance_name = "Precision Timekeeping"
|
||||||
|
|
||||||
|
[server]
|
||||||
|
# Protocol (http, https, h2, socket)
|
||||||
|
protocol = http
|
||||||
|
|
||||||
|
# The http port to use
|
||||||
|
http_port = 3000
|
||||||
|
|
||||||
|
[log]
|
||||||
|
# Either "debug", "info", "warn", "error", "critical", default is "info"
|
||||||
|
level = info
|
||||||
|
|
||||||
|
# Either "console", "file", "syslog". Default is console and file
|
||||||
|
# Use space to separate multiple modes, e.g. "console file"
|
||||||
|
mode = console file
|
||||||
|
|
||||||
|
[log.file]
|
||||||
|
# log line format, valid options are text, console and json
|
||||||
|
format = text
|
||||||
|
|
||||||
|
# This enables automated log rotate(switch of following options), default is true
|
||||||
|
log_rotate = true
|
||||||
|
|
||||||
|
# Max line number of single file, default is 1000000
|
||||||
|
max_lines = 1000000
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
dev=$1
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# report usage statistics to influxdb company
|
||||||
|
reporting-enabled = false
|
||||||
|
|
||||||
|
[meta]
|
||||||
|
# Where the metadata/raft database is stored
|
||||||
|
dir = "/var/lib/influxdb/meta"
|
||||||
|
|
||||||
|
[data]
|
||||||
|
# The directory where the TSM storage engine stores TSM files.
|
||||||
|
dir = "/var/lib/influxdb/data"
|
||||||
|
|
||||||
|
# The directory where the TSM storage engine stores WAL files.
|
||||||
|
wal-dir = "/var/lib/influxdb/wal"
|
||||||
|
|
||||||
|
# Trace logging provides more verbose output around the tsm engine. Turning
|
||||||
|
# this on can provide more useful output for debugging tsm engine issues.
|
||||||
|
trace-logging-enabled = false
|
||||||
|
|
||||||
|
[logging]
|
||||||
|
format = "auto"
|
||||||
|
level = "info"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# m h dom mon dow command
|
||||||
|
# set hardware I2C RTC hourly
|
||||||
|
0 * * * * /bin/bash -c "/usr/sbin/hwclock -w 2>> /var/log/root-crontab.log"
|
||||||
|
@reboot /usr/share/customscripts/ifnet "/usr/share/customscripts/webhook bootup" 2>> /var/log/root-crontab.log
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
[global_tags]
|
||||||
|
[agent]
|
||||||
|
interval = "10s"
|
||||||
|
round_interval = true
|
||||||
|
metric_batch_size = 10000
|
||||||
|
metric_buffer_limit = 1000000
|
||||||
|
collection_jitter = "0s"
|
||||||
|
flush_interval = "10s"
|
||||||
|
flush_jitter = "0s"
|
||||||
|
precision = "0s"
|
||||||
|
logfile = "/var/log/telegraf/telegraf.log"
|
||||||
|
# debug = true
|
||||||
|
|
||||||
|
[[inputs.chrony]]
|
||||||
|
metrics = ["tracking"]
|
||||||
|
timeout = "5s"
|
||||||
|
|
||||||
|
[[outputs.influxdb]]
|
||||||
|
urls = ["http://127.0.0.1:8086"]
|
||||||
|
database = "Chrony_Stats"
|
||||||
|
timeout = "5s"
|
||||||
|
# skip_database_creation = true
|
||||||
+2
-2
@@ -2,10 +2,10 @@
|
|||||||
# set -e
|
# set -e
|
||||||
|
|
||||||
echo "Fully upgrading, this may take a while..."
|
echo "Fully upgrading, this may take a while..."
|
||||||
sudo apt dist-upgrade -y 1>/dev/null 2>&1
|
sudo apt dist-upgrade -y 1>/dev/null
|
||||||
|
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
sudo apt autoremove -y 1>/dev/null 2>&1
|
sudo apt autoremove -y 1>/dev/null
|
||||||
|
|
||||||
echo "Installer2.sh complete" >> ./status.txt
|
echo "Installer2.sh complete" >> ./status.txt
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -28,7 +28,7 @@ fi
|
|||||||
|
|
||||||
# updoot
|
# updoot
|
||||||
echo "Getting new software lists..."
|
echo "Getting new software lists..."
|
||||||
sudo apt update 1>/dev/null 2>&1
|
sudo apt update
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
echo "Disabling unneeded junk..."
|
echo "Disabling unneeded junk..."
|
||||||
@@ -37,11 +37,11 @@ sudo update-rc.d -f fake-hwclock remove 1>/dev/null 2>/dev/null
|
|||||||
sudo systemctl disable fake-hwclock 1>/dev/null 2>/dev/null
|
sudo systemctl disable fake-hwclock 1>/dev/null 2>/dev/null
|
||||||
|
|
||||||
echo "Purging unneeded junk..."
|
echo "Purging unneeded junk..."
|
||||||
sudo apt purge -y "bluetooth*" "usb*" "wireless*" "pci*" "fonts*" build-essential "bluez*" "alsa*" fake-hwclock 1>/dev/null 2>&1
|
sudo apt purge -y "bluetooth*" "usb*" "wireless*" "pci*" "fonts*" build-essential "bluez*" "alsa*" fake-hwclock
|
||||||
|
|
||||||
# install da packages
|
# install da packages
|
||||||
echo "Installing packages, this may take a while..."
|
echo "Installing packages, this may take a while..."
|
||||||
sudo apt install -y telegraf grafana influxdb pps-tools gpsd gpsd-clients chrony syslog-ng gh lynx btop htop iptraf iotop neovim netcat-traditional python3-smbus i2c-tools picocom 1>/dev/null 2>&1
|
sudo apt install -y telegraf grafana influxdb pps-tools git gh gpsd gpsd-clients chrony syslog-ng gh lynx btop htop iptraf-ng iotop neovim netcat-traditional python3-smbus i2c-tools picocom
|
||||||
|
|
||||||
# check if pps-gpio is in /etc/modules already
|
# check if pps-gpio is in /etc/modules already
|
||||||
grep -e "pps-gpio" /etc/modules
|
grep -e "pps-gpio" /etc/modules
|
||||||
@@ -56,7 +56,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
sudo apt autoremove -y 1>/dev/null 2>&1
|
sudo apt autoremove -y
|
||||||
|
|
||||||
if [ ! -z $SUDO_USER ]; then
|
if [ ! -z $SUDO_USER ]; then
|
||||||
username=$SUDO_USER
|
username=$SUDO_USER
|
||||||
|
|||||||
+3
-3
@@ -10,10 +10,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Updating Software Lists"
|
echo "Updating Software Lists"
|
||||||
sudo apt update 1>/dev/null 2>&1
|
sudo apt update
|
||||||
|
|
||||||
echo "Installing git and raspi-config"
|
echo "Installing git"
|
||||||
sudo apt install git raspi-config -y 1>/dev/null 2>&1
|
sudo apt install -y git
|
||||||
|
|
||||||
echo "Cloning Repo"
|
echo "Cloning Repo"
|
||||||
cd /home/$username
|
cd /home/$username
|
||||||
|
|||||||
Reference in New Issue
Block a user