Feeding data to influxDB
Hi there, progress is great on my project. I have now reached a state, where I am considering the optimal approach to storing time-series-data in my influxDB.
I can do it from the device, which is ESP8266 on wifi with IP, or I can do it from the server, but not sure what approach to use on the server.
Any tips and tricks to share?
Super awesome it works great, can I add more sensor variables to one line in the external server?
@njbuch You can not add more sensor variables to one line.
- if you configure a sensor it will send all the sensor variables data under the sensor.
- If configure a node it will all the sensor variables data under the node.
- If you configure a gateway it will send all the sensor variable data under the gateway.
If the above configuration does not meet your requirements, you have to create multiple entries.
Tried to post all measurements from a node, but there is no tag keys, and hence I cannot query the data....
Looking at the interface there is a "tags" field, but not sure how the temperature measurement is seperated from the humidity...?
@njbuch Tags are common across all data in MyController, It will indicate that, data from MyConroller. You can do a query based on
Key format. Default key format is
@jkandasa Not sure I understand that. I have tried:
SELECT mean("value") FROM "$ESP_0B9892" WHERE "sensorName" = 'humid-1'
In influxdb, but no results....(but works).. but trying:
SELECT * FROM "$ESP_0B9892"
time value 2017-02-07T17:35:21.305Z 21 2017-02-07T17:35:21.34Z 54.4 2017-02-07T17:36:22.233Z 21.1 2017-02-07T17:36:22.269Z 54.4
which indicates there is no tags or anything to seperate the data.
This is my config window:
Is that in the query on influxdb or the configuration?
In configuration, you have to user
key formatfrom the following list,
You can use mixed of any value from above list.
The table name will be based on your
Key formatvalue. If you use any references from the above list, It will be replaced dynamically at runtime with actual value. Hence your table name will be based on your
key formatand actual resource value.
You have to create a query for influxDB based on your resource and
- My resource: nodeEui = 2, sensorName = temp_1
- My query will be like
SELECT mean("value") FROM '2_temp_1'
$nodeEui_$sensorName) replaced on dynamically as
I hope this example clears your confusion.
Thanks for the good explanation, have played a lot with it, but cannot make it work.
This is my external server configs:
And I have two resources created:
But nothing can be found in influxdb, and the log is empty...
I had it working 2 days ago with static info in the external server... which was stupid I see now
@njbuch To check available series on the databases do the query,
SHOW SERIES. will list available series.
For your configuration, you should have the following series and it is query,
- ESP_0B9892_Skur_fugtighed >>
select * from ESP_0B9892_Skur_fugtighed
- ESP_0B9892_Skur_Temperature >>
select * from ESP_0B9892_Skur_Temperature
- ESP_0B9892_Skur_fugtighed >>