Skip to content
PiSky docs ← Back to pisky.space
Docs · 2 min read

Remote weather database

Connect an external MySQL database to graph the hours behind each archive day, not just its daily summary.

PiSky always keeps a daily weather summary on the station itself — that's deliberately coarse, because writing a sample every few minutes for years would wear out an SD card. Connecting a remote weather database (in PiSky Setup, under "Remote history database") adds intraday detail behind those summaries, which is what powers the hour-by-hour charts on the sky archive page. The daily summary keeps recording locally either way — if the database becomes unreachable, the station simply loses the ability to draw that day's within-day curve, nothing else.

Requirements

A MySQL (or MySQL-compatible) server the Pi can reach, and PHP's MySQL PDO driver installed on the station (php-mysql). The setup page tells you directly if that driver is missing.

Fields

  • Store detailed history in a remote database — the on/off switch for the whole feature.
  • Database host, Port, Database name, User, Password — standard connection details. The password field is write-only: once saved it shows "Stored — leave blank to keep" rather than the value itself, and leaving it blank on a later save keeps the existing password rather than clearing it.
  • Station identifier — lets several stations share one database; each station's rows are kept apart by this value, so pick something unique per station if you're pointing more than one at the same server.
  • Sample interval (seconds) — how often a reading is allowed to be written, from every minute up to once an hour.
  • Keep detail for (days) — how long intraday detail is retained before it's eligible to be cleared out. The daily summary itself is never affected by this setting; only the hour-by-hour detail behind it ages out.
  • Require an encrypted connection — verifies the server's TLS certificate; leave this on unless you have a specific reason to connect over an unencrypted link.

A separate Test the database connection button creates the required tables on first use — there's no separate migration step — and reports how many samples are currently stored for this station.

How recording works

Samples are written as a side effect of the station serving a live weather reading, not by a background job — so a database that never gets any traffic (an idle station nobody is viewing) won't accumulate samples either. Whichever it is, the connection details are kept apart from the rest of the station's configuration and are never exposed through any admin screen once saved.