From 30b0b834c0e3faf911747c6518a6822f7a21bca8 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Fri, 13 Jun 2025 13:56:26 -0600 Subject: [PATCH] 1749844586 --- CHANGELOG.txt | 6 +++++ full_status.sh | 10 ++++++- installer3.sh | 27 +++---------------- notes-scratch-todo.txt | 7 ++++- reconfig_full.sh | 25 +++++++++++++++++ .../boot-firmware-config.txt | 12 +++++++++ 6 files changed, 62 insertions(+), 25 deletions(-) create mode 100644 working-debug-level-conf-dev/boot-firmware-config.txt diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 364e8ef..e79af16 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Added RTC (https://www.adafruit.com/product/3013) added packages python3-smbus i2c-tools to installer updated installer to set gpio baud to 921600 + added rtc i2c overlay /boot/firmware/config.txt + removed fake-hwclock package NEO GPS Module Wiring Changed to 5v mode @@ -8,3 +10,7 @@ NEO GPS Module Changed Baudrate UART1 to 921600 Time Pulse Mode 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 \ No newline at end of file diff --git a/full_status.sh b/full_status.sh index c059753..925feee 100644 --- a/full_status.sh +++ b/full_status.sh @@ -20,4 +20,12 @@ watch chronyc sources # track echo "Watching chronyc tracking" -watch -n 10 chronyc tracking \ No newline at end of file +watch -n 10 chronyc tracking + +# i2c +echo "Detecting I2C Devices" +sudo i2cdetect -y 1 + +# rtc +echo "Reading from hardware RTC" +sudo hwclock -r \ No newline at end of file diff --git a/installer3.sh b/installer3.sh index d3c47b2..f982cc8 100644 --- a/installer3.sh +++ b/installer3.sh @@ -36,34 +36,15 @@ sudo apt update 1>/dev/null 2>/dev/null # clean up echo "Disabling unneeded junk..." 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..." -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 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 - -# 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 +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 pps-gpio is in /etc/modules already grep -e "pps-gpio" /etc/modules diff --git a/notes-scratch-todo.txt b/notes-scratch-todo.txt index e6cd177..68fc1c4 100644 --- a/notes-scratch-todo.txt +++ b/notes-scratch-todo.txt @@ -11,7 +11,12 @@ rtc module add `dtoverlay=i2c-rtc,ds3231` to /boot/firmware/config.txt reboot 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 diff --git a/reconfig_full.sh b/reconfig_full.sh index edd627b..31ce4d1 100644 --- a/reconfig_full.sh +++ b/reconfig_full.sh @@ -15,6 +15,7 @@ grafana="/etc/grafana/grafana.ini" influxdb="/etc/influxdb/influxdb.conf" telegraf="/etc/telegraf/telegraf.conf" udev_rule="/etc/udev/rules.d/50-tty.rules" +bootfirmwareconfig="/boot/firmware/config.txt" ## new conf file paths gpsd_new=""$1/gpsd"" chrony_new="$1/chrony.conf" @@ -22,6 +23,7 @@ grafana_new="$1/grafana.ini" influxdb_new="$1/influxdb.conf" telegraf_new="$1/telegraf.conf" udev_new="$1/50-tty.rules" +bootfirmwareconfig_new="$1/boot-firmware-config.txt" # stop da services 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 $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 bash ./services.sh start 1>/dev/null \ No newline at end of file diff --git a/working-debug-level-conf-dev/boot-firmware-config.txt b/working-debug-level-conf-dev/boot-firmware-config.txt new file mode 100644 index 0000000..471082c --- /dev/null +++ b/working-debug-level-conf-dev/boot-firmware-config.txt @@ -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 \ No newline at end of file