Overview
Wildlife activity is governed by natural light cycles. Dawn choruses peak around sunrise, many mammals are most active during twilight, nocturnal species emerge after astronomical dusk, and amphibian behaviour often correlates with moon phase and illumination. Effective biodiversity monitoring must align with these rhythms.
dielty is a sunrise, sunset, twilight, moonrise, moonset, and moon phase calculator for headless Linux systems like the Raspberry Pi. It reads the device’s location from /etc/geolocation and computes solar and lunar events for any date — enabling monitoring nodes to schedule recordings, camera traps, and sensor captures around the precise light conditions at their deployment site.
Why It Matters
Fixed recording schedules waste power and storage by capturing silence during inactive periods, or miss peak activity by starting too late. With dielty, a node can begin acoustic recording at civil dawn, activate a camera trap at sunset, or trigger a burst capture at moonrise — adapting automatically as day length shifts through the seasons and across latitudes.
The included systemd timers run user scripts at sunrise and sunset automatically, making it straightforward to build event-driven monitoring workflows without cron hacks or manual recalculation.
Key Features
- Solar events — sunrise, sunset, solar noon, civil/nautical/astronomical twilight
- Lunar events — moonrise, moonset, moon phase, illumination percentage
- Three modes — report (table), query (single event), wait (block until event)
- Full date support (YYYY-MM-DD), not limited to today
- JSON output for integration with other tools
- DST-safe — calculations in UTC, local times via the kernel timezone database
- No dependencies — pure C++17, no external libraries
- Reads
/etc/geolocation— works out of the box on headless systems - Systemd timers for automatic sunrise/sunset script execution
Quick Start
sudo apt install cmake g++
cd dielty
mkdir build && cd build
cmake ..
make -j$(nproc)
sudo make installExample Usage
dielty # full report for today
dielty sun sunrise # print sunrise time
dielty wait civil-dawn # block until civil dawn
dielty -d 2026-06-21 report # report for summer solstice
dielty -json report # JSON output
dielty -lat 51.5 -lon -0.1 # override locationSource Code
dielty is open source and available on GitHub.