User Tools

Site Tools


timehat:software_03-2025


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
timehat:software_03-2025 [2025/03/16 01:19] – created millerjstimehat:software_03-2025 [2025/03/16 01:38] (current) – [System Status Web Page] millerjs
Line 4: Line 4:
   * RV-3032-c7 Version   * RV-3032-c7 Version
  
-==== General ====+===== General =====
 Software Info Software Info
   * The operating system is Raspbian Lite (64bit)    * The operating system is Raspbian Lite (64bit) 
Line 19: Line 19:
   * WiFi and Bluetooth disabled to save power. Also WiFi is generally too unstable for use as a network time server.   * WiFi and Bluetooth disabled to save power. Also WiFi is generally too unstable for use as a network time server.
   * RAM usage is minimal, any Pi can run this setup, adding more RAM will not improve performance.   * RAM usage is minimal, any Pi can run this setup, adding more RAM will not improve performance.
 +
 +===== System Status Web Page =====
 +To provide users with a quick snapshot of the status of the TimeHat system, I created a simple web page that shows things like the system uptime, temperature from the CPU and RTC, chrony status, gpsd status, and current satellite map and historical satellite heat map. 
 +
 +{{ :timehat:timehatstatusdash.png?800 |}}
 +
 +This page is updated every five minutes by the ''TimeHatInfoGetter.py'' script, which runs as a cron job by the root user:
 +
 +
 +''*/5 * * * * /root/TimeHatInfoGetter.py >/dev/null 2>&1''
 +
 +This script generates two JSON files which are placed in ''/var/www/html/'' - ''timehatstats.json'' and ''satplot.json''. The first is where the general system information is stored, and the second is where the heatmap log is stored. Check out the examples below. The main configurable parameter of the info getter python script is whether or not to obfuscate the location. Some users may choose to expose this on the public web, but not want to share their precise location. The obfuscation routine simply truncates the latitude and longitude to two decimal places. E.g. - 44.1234567 gets trimmed to 44.12. 
 +==== script ====
 +
 +==== HTML ====
 +
 +==== example JSON ====
 +===== Config Files =====
 +
 +==== config.txt ====
 +''/boot/firmware/config.txt''
 +
 +<file config.txt>
 +# For more options and information see
 +# http://rptl.io/configtxt
 +# Some settings may impact device functionality. See link above for details
 +
 +dtparam=i2c_arm=on
 +dtoverlay=i2c-rtc,rv3032
 +dtparam=backup-switchover-mode=1
 +
 +arm_64bit=1
 +
 +[all]
 +enable_uart=1
 +dtoverlay=disable-wifi
 +dtoverlay=disable-bt
 +dtoverlay=pps-gpio,gpiopin=4
 +dtparam=act_led_trigger=heartbeat
 +
 +disable_fw_kms_setup=1
 +auto_initramfs=1
 +#disable_poe_fan=1
 +#force_eeprom_read=0
 +#ignore_lcd=1
 +
 +arm_boost=0
 +arm_freq=1000
 +force_turbo=1
 +</file>
 +
 +==== gpsd ====
 +''/etc/default/gpsd''
 +
 +<code>
 +GPSD_OPTIONS="-n -p"
 +DEVICES="/dev/ttyAMA0"
 +</code>
 +
 +==== gpsd.service ====
 +''/etc/systemd/system/gpsd.service''
 +
 +<code>
 +[Unit]
 +Description=GPS (Global Positioning System) Daemon
 +Requires=gpsd.socket
 +# Needed with chrony SOCK refclock
 +After=chronyd.service
 +
 +[Service]
 +Type=forking
 +EnvironmentFile=-/etc/default/gpsd
 +EnvironmentFile=-/etc/sysconfig/gpsd
 +ExecStart=/usr/local/sbin/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES
 +
 +[Install]
 +WantedBy=multi-user.target
 +Also=gpsd.socket
 +</code>
 +
 +==== chrony.conf ====
 + ''/etc/chrony.conf''
 +
 +<code>
 +server time-a.nist.gov
 +server time-a-wwv.nist.gov
 +server time-a-b.nist.gov
 +
 +refclock SOCK /run/chrony.ttyAMA0.sock refid GPS
 +
 +rtcsync
 +
 +logchange 0.5
 +
 +local stratum 10
 +
 +makestep 1.0 3
 +
 +logdir /var/log/chrony
 +log statistics tracking
 +
 +dumpdir /var/log/chrony
 +driftfile /chrony.drift
 +
 +allow
 +</code>
 +
 +==== chronyd.service ====
 +
 +''/etc/systemd/system/chronyd.service''
 +
 +<code>
 +[Unit]
 +Description=chrony, an NTP client/server
 +Documentation=man:chronyd(8) man:chronyc(1) man:chrony.conf(5)
 +Conflicts=openntpd.service ntp.service ntpsec.service
 +Wants=time-sync.target
 +Before=time-sync.target
 +After=network.target
 +
 +[Service]
 +Type=forking
 +ExecStart=/usr/local/sbin/chronyd -f /etc/chrony.conf
 +
 +[Install]
 +Alias=chronyd.service
 +WantedBy=multi-user.target
 +</code>
 +
timehat/software_03-2025.1742087950.txt.gz · Last modified: by millerjs

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki