From dfb5721e2545cd19b5deb0209089e7230fc8b6dc Mon Sep 17 00:00:00 2001 From: Pieter Hollander Date: Wed, 27 Mar 2024 09:50:37 +0100 Subject: [PATCH] Improve install instructions. --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ec9874d..af89438 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Optionally, TimescaleDB can be used. ## Install instructions +Docker is the preferred way to install OpenDTU Logger, but using the binary is also possible. + ### Docker ```sh @@ -44,6 +46,12 @@ Add the contents of `systemd/opendtu-logger.service` and alter the `REMOTE_URL` ### PostgreSQL setup +To install PostgreSQL on Debian / Ubuntu run + +```sh +sudo apt install postgresql +``` + The OpenDTU logger logs to a PostgreSQL database and optionally supports TimescaleDB. Create a separate database and user using the following commands. ```sql @@ -53,7 +61,7 @@ GRANT ALL privileges ON DATABASE opendtu_logger TO opendtu_logger; GRANT ALL ON SCHEMA public TO opendtu_logger; ``` -Optional: enable TimescaleDB extension +Optional: enable the TimescaleDB extension. To make use of TimescaleDB, follow the steps outlined in [their documentation](https://docs.timescale.com/self-hosted/latest/install/installation-linux/). Then, enable TimescaleDB support for the `opendtu_logger` database by executing the following commands ```sql \c opendtu_logger @@ -71,9 +79,14 @@ TIMESCALEDB_ENABLED="true" TZ="Europe/Amsterdam" ``` +- `REMOTE_URL`is used to specify the IP address or hostname OpenDTU is running on. E.g.: `192.168.1.6` or `opendtu.internal` +- `DB_URL` specifies the credentials required to connect to the PostgreSQL database. All [connection parameters documented by golang's `lib/pq` package](https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters) can be used. +- `TIMESCALEDB_ENABLED` should be set to `true` or `false`. +- `TZ` is used to ensure data is recorded with the right timestamp. Choose the timezone valid for your location from [this Wikipedia page](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + ## Grafana -The `grafana` folder contains example dashboards. +The `grafana` folder contains example dashboards which can be imported into existing Grafana installs, or into the provided Docker Compose with Grafana setup. - The `opendtu_` dashboards contain visualisations for each table the OpenDTU logger records to. - `PV.json` is a dashboard which combines the visualisations of each table that I found to be most useful.