1749844586

This commit is contained in:
2025-06-13 13:56:26 -06:00
parent d8b5017c7a
commit 30b0b834c0
6 changed files with 62 additions and 25 deletions
+6
View File
@@ -1,6 +1,8 @@
Added RTC (https://www.adafruit.com/product/3013) Added RTC (https://www.adafruit.com/product/3013)
added packages python3-smbus i2c-tools to installer added packages python3-smbus i2c-tools to installer
updated installer to set gpio baud to 921600 updated installer to set gpio baud to 921600
added rtc i2c overlay /boot/firmware/config.txt
removed fake-hwclock package
NEO GPS Module NEO GPS Module
Wiring Wiring
Changed to 5v mode Changed to 5v mode
@@ -8,3 +10,7 @@ NEO GPS Module
Changed Baudrate UART1 to 921600 Changed Baudrate UART1 to 921600
Time Pulse Mode Time Pulse Mode
Antenna Cable Delay set to the calculated 14ns Antenna Cable Delay set to the calculated 14ns
Installer
updated with new settings
set /boot/firmware/config.txt to be appended to by a config file for ease
added package picocom
+8
View File
@@ -21,3 +21,11 @@ watch chronyc sources
# track # track
echo "Watching chronyc tracking" echo "Watching chronyc tracking"
watch -n 10 chronyc tracking watch -n 10 chronyc tracking
# i2c
echo "Detecting I2C Devices"
sudo i2cdetect -y 1
# rtc
echo "Reading from hardware RTC"
sudo hwclock -r
+4 -23
View File
@@ -36,34 +36,15 @@ sudo apt update 1>/dev/null 2>/dev/null
# clean up # clean up
echo "Disabling unneeded junk..." echo "Disabling unneeded junk..."
sudo systemctl disable bluetooth 1>/dev/null 2>/dev/null sudo systemctl disable bluetooth 1>/dev/null 2>/dev/null
sudo update-rc.d -f fake-hwclock remove
sudo systemctl disable fake-hwclock
echo "Purging unneeded junk..." echo "Purging unneeded junk..."
sudo apt purge -y "bluetooth*" "usb*" "wireless*" "pci*" "fonts*" build-essential "bluez*" "alsa*" 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 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
# check if /boot/firmware/config.txt is configured yet
grep -q -e "GPS PPS signals" /boot/firmware/config.txt
grepconfig=$?
# configure the overlay
if [ $grepconfig -eq 0 ]; then
echo "/boot/firmware/config.txt already updated, skipping..."
else
# pps and gpio uart
echo "Adding lines to /boot/firmware/config.txt to enable pps and gpio uart..."
sudo bash -c "echo '# GPS PPS GPIO Signal' >> /boot/firmware/config.txt"
sudo bash -c "echo 'dtoverlay=pps-gpio,gpiopin=18' >> /boot/firmware/config.txt" # pps
sudo bash -c "echo '# GPS GPIO UART' >> /boot/firmware/config.txt"
sudo bash -c "echo 'enable_uart=1' >> /boot/firmware/config.txt" # enable uart
sudo bash -c "echo 'init_uart_baud=921600' >> /boot/firmware/config.txt" # set baudrate here to
# i2c
sudo bash -c "echo '# I2C Hardware RTC Overlay' >> /boot/firmware/config.txt"
sudo bash -c "echo 'dtoverlay=i2c-rtc,ds3231' >> /boot/firmware/config.txt"
fi
# 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
+6 -1
View File
@@ -11,7 +11,12 @@ rtc module
add `dtoverlay=i2c-rtc,ds3231` to /boot/firmware/config.txt add `dtoverlay=i2c-rtc,ds3231` to /boot/firmware/config.txt
reboot reboot
detect/test module `sudo i2cdetect -y 1` detect/test module `sudo i2cdetect -y 1`
looking for address 68 looking for address UU AFTER configure Overlay
looking for address 68 BEFORE configure overlay
remove package fake-hwclock
remove from rc
read rtc `sudo hwclock -r`
set rtc `sudo hwclock -w`
raspberry pi RTC tutorial: https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time raspberry pi RTC tutorial: https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time
+25
View File
@@ -15,6 +15,7 @@ grafana="/etc/grafana/grafana.ini"
influxdb="/etc/influxdb/influxdb.conf" influxdb="/etc/influxdb/influxdb.conf"
telegraf="/etc/telegraf/telegraf.conf" telegraf="/etc/telegraf/telegraf.conf"
udev_rule="/etc/udev/rules.d/50-tty.rules" udev_rule="/etc/udev/rules.d/50-tty.rules"
bootfirmwareconfig="/boot/firmware/config.txt"
## new conf file paths ## new conf file paths
gpsd_new=""$1/gpsd"" gpsd_new=""$1/gpsd""
chrony_new="$1/chrony.conf" chrony_new="$1/chrony.conf"
@@ -22,6 +23,7 @@ grafana_new="$1/grafana.ini"
influxdb_new="$1/influxdb.conf" influxdb_new="$1/influxdb.conf"
telegraf_new="$1/telegraf.conf" telegraf_new="$1/telegraf.conf"
udev_new="$1/50-tty.rules" udev_new="$1/50-tty.rules"
bootfirmwareconfig_new="$1/boot-firmware-config.txt"
# stop da services # stop da services
bash ./services.sh stop 1>/dev/null 2>/dev/null bash ./services.sh stop 1>/dev/null 2>/dev/null
@@ -38,5 +40,28 @@ sudo bash -c "cat $influxdb_new > $influxdb"
sudo bash -c "cat $telegraf_new > $telegraf" sudo bash -c "cat $telegraf_new > $telegraf"
sudo bash -c "cat $udev_new > $udev_rule" sudo bash -c "cat $udev_new > $udev_rule"
# check if /boot/firmware/config.txt is configured yet
grep -q -e "GPS PPS signals" /boot/firmware/config.txt
grepconfig=$?
# configure the overlay
if [ $grepconfig -eq 0 ]; then # if config exists, skip
echo "/boot/firmware/config.txt already updated, skipping..."
else
# APPEND to /boot/firmware/config.txt
sudo bash -c "cat $bootfirmwareconfig >> $bootfirmwareconfig_new"
# pps and gpio uart
# echo "Adding lines to /boot/firmware/config.txt to enable pps and gpio uart..."
# sudo bash -c "echo '# GPS PPS GPIO Signal' >> /boot/firmware/config.txt"
# sudo bash -c "echo 'dtoverlay=pps-gpio,gpiopin=18' >> /boot/firmware/config.txt" # pps
#
# sudo bash -c "echo '# GPS GPIO UART' >> /boot/firmware/config.txt"
# sudo bash -c "echo 'enable_uart=1' >> /boot/firmware/config.txt" # enable uart
# sudo bash -c "echo 'init_uart_baud=921600' >> /boot/firmware/config.txt" # set baudrate here to
# # i2c
# sudo bash -c "echo '# I2C Hardware RTC Overlay' >> /boot/firmware/config.txt"
# sudo bash -c "echo 'dtoverlay=i2c-rtc,ds3231' >> /boot/firmware/config.txt"
fi
# start da services # start da services
bash ./services.sh start 1>/dev/null bash ./services.sh start 1>/dev/null
@@ -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=921600
## I2C Hardware RTC Overlay
dtoverlay=i2c-rtc,ds3231
# End Precision Timekeeping Fuckery Additions