Feeding data to influxDB
-
-
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.
however,- 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 issensorName
-
@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"
Returns:
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 format
from the following list,- $gatewayName
- $nodeName
- $nodeEui
- $sensorName
- $sensorId
- $variableType
- $variableTypeId
You can use mixed of any value from above list.
Examples:- $sensorName
- $sensorName_$sensorId
etc.,
The table name will be based on your
Key format
value. 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 yourkey format
and actual resource value.You have to create a query for influxDB based on your resource and
Key format
.Example:
- My
key format
is$nodeEui_$sensorName
- My resource: nodeEui = 2, sensorName = temp_1
- My query will be like
SELECT mean("value") FROM '2_temp_1'
- Here
Key format
($nodeEui_$sensorName
) replaced on dynamically as2_temp_1
.
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 >>