-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
645 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
## InfluxDB | ||
|
||
This update implements the data transfer to an InfluxDB time-series database. | ||
InfluxDB v1.x and v2.x are supported. | ||
|
||
### Configuration for InfluxDB v1.x | ||
|
||
Add these lines to the .config file and adjust the values according to your environment: | ||
|
||
``` | ||
ENABLE_INFLUXDB=true | ||
INFLUXDB_HOST=localhost | ||
INFLUXDB_PORT=8086 | ||
INFLUXDB_VERSION=1 | ||
INFLUXDB_MEASUREMENT=e3dc | ||
INFLUXDB_1_DB=e3dc | ||
``` | ||
|
||
Start the influx client to prepare the database. | ||
|
||
Create a database | ||
``` | ||
create database e3dc | ||
``` | ||
|
||
Access data using the influx client | ||
``` | ||
precision rfc3339 | ||
use e3dc | ||
select * from e3dc where topic = 'e3dc/solar/power' tz('Europe/Berlin') | ||
``` | ||
|
||
Set a retention policy to limit data collection | ||
``` | ||
CREATE RETENTION POLICY "one_day" ON "e3dc" DURATION 24h REPLICATION 1 DEFAULT | ||
``` | ||
|
||
### Configuration for InfluxDB v2.x | ||
|
||
Add and adjust the following lines in .config | ||
``` | ||
ENABLE_INFLUXDB=true | ||
INFLUXDB_HOST=localhost | ||
INFLUXDB_PORT=8086 | ||
INFLUXDB_VERSION=2 | ||
INFLUXDB_MEASUREMENT=e3dc | ||
INFLUXDB_2_ORGA=<my_orga> | ||
INFLUXDB_2_BUCKET=<my_bucket> | ||
INFLUXDB_2_TOKEN=<my_token> | ||
``` | ||
|
||
Please use the web admin tool of the InfluxDB v2.x to configure the bucket, the orga and the token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
CXX=g++ | ||
ROOT_VALUE=rscp2mqtt | ||
TARGET=rscp2mqtt | ||
|
||
all: $(ROOT_VALUE) | ||
all: $(TARGET) | ||
|
||
$(ROOT_VALUE): clean | ||
$(TARGET): clean | ||
ifeq ($(WITH_INFLUXDB), yes) | ||
$(CXX) -O3 RscpMqttMain.cpp RscpProtocol.cpp AES.cpp SocketConnection.cpp -pthread -lmosquitto -lcurl -o $@ -DINFLUXDB | ||
else | ||
$(CXX) -O3 RscpMqttMain.cpp RscpProtocol.cpp AES.cpp SocketConnection.cpp -pthread -lmosquitto -o $@ | ||
|
||
endif | ||
|
||
clean: | ||
-rm $(ROOT_VALUE) $(VECTOR) | ||
-rm $(TARGET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.