NightWatcher2
Last year’s NightWatcher was a sneaky little C daemon that read a Sky Quality Meter (Unihedron SQM-LE) and wrote the numbers to a file. It worked, which, around here, is exactly the sort of thing that gets a project torn down to the ground and rebuilt.
NightWatcher2 is that rebuild. Same mission; quantifying how dark the night sky over CrestaLoma Observatory really is (not terribly) but re-imagined in C++, fully automated, self-monitoring, and now contributing its readings to the Dark Sky Network as station DSN036.
What it measures
The instrument at the heart of it all is a Sky Quality Meter: a Unihedron SQM that reports the brightness of the night sky in magnitudes per square arcsecond (mag/arcsec²). The scale is fantastically counterintuitive; bigger means darker. A genuinely dark site reads somewhere around 21.5; a light-marinated suburb slumps in near 18. NightWatcher2 takes a reading every few minutes, all night, every night, and has yet to complain about the hours. Actually, it takes readings during the day too, but they are decidedly less interesting…
What changed since v1
Very nearly everything:
- Rebuilt in C++. The original single-threaded C daemon has been honorably retired.
- A proper MariaDB database in place of flat RRD files, so every reading is kept and queryable.
- Its own web interface and REST API, plus a hardened webhook that pushes data outward. Nothing needs to reach back into the home network.
- Speaks to both SQM-LE (Ethernet) and SQM-LU (USB) meters, and folds in outdoor weather for context.
- Shipped as a real Debian package with continuous integration, because “just run
make” stops being fun around the thirtieth iteration. - Automatic nightly and monthly exports to the Dark Sky Network’s shared archive.
Live sky brightness
Here is the last week from the observatory, straight out of the database. The solid line is sky brightness; watch it climb into proper darkness after twilight and fall off a cliff at dawn. Switch on the Sun, Moon overlays to see what’s nudging it around. Tick Live and the chart quietly refreshes itself as new readings arrive.
The code
All of it open source, since the entire point is to be useful to other dark-sky sites:
- NightWatcher2 — the monitoring daemon, tools, and web interface
- nightwatcher-wp — the WordPress plugin drawing the graph above
- NightWatcher, the original — retained for posterity, and to make v2 look good by comparison
Recent Comments