• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    Feeding data to influxDB

    Scheduled Pinned Locked Moved General Discussion
    11 Posts 2 Posters 4.6k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jkandasaJ Offline
      jkandasa
      last edited by

      @njbuch

      Any tips and tricks to share?

      You can do it from server. No need to touch your device 😉

      This feature is available in recent SNAPSHOT version.

      You have to create an external server as shown,

      0_1486399732509_upload-361a7b51-b651-4d63-8266-0d4e7f4f19ff

      Assign sensors variable or sensor or gateway to this external server.

      0_1486399805051_upload-c4264ae1-299d-4ab8-ab80-3debaa6c9980

      All done 🙂

      1 Reply Last reply Reply Quote 1
      • N Offline
        njbuch
        last edited by

        Super awesome it works great, can I add more sensor variables to one line in the external server?

        jkandasaJ 1 Reply Last reply Reply Quote 0
        • jkandasaJ Offline
          jkandasa @njbuch
          last edited by

          @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.

          1 Reply Last reply Reply Quote 1
          • N Offline
            njbuch
            last edited by

            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...?

            jkandasaJ 1 Reply Last reply Reply Quote 0
            • jkandasaJ Offline
              jkandasa @njbuch
              last edited by

              @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 sensorName

              N 1 Reply Last reply Reply Quote 0
              • N Offline
                njbuch @jkandasa
                last edited by njbuch

                @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:
                0_1486500910356_upload-b007fd61-5c93-4bd3-93df-9496ff45bc5e

                jkandasaJ 1 Reply Last reply Reply Quote 0
                • jkandasaJ Offline
                  jkandasa @njbuch
                  last edited by

                  @njbuch You should use dynamic key format. currently("$ESP_0B9892") it is static. Change keyFormat as one of or mixed. Supported key's are here

                  Example:
                  Key format, examples:

                  • $sensorName >> SELECT mean("value") FROM 'humid-1'
                  • $sensorName >> SELECT mean("value") FROM 'temp-1'
                  N 1 Reply Last reply Reply Quote 0
                  • N Offline
                    njbuch @jkandasa
                    last edited by jkandasa

                    @njbuch

                    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 your key 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 as 2_temp_1.

                    I hope this example clears your confusion.

                    1 Reply Last reply Reply Quote 0
                    • N Offline
                      njbuch
                      last edited by

                      Thanks for the good explanation, have played a lot with it, but cannot make it work.

                      This is my external server configs:
                      0_1486586923982_upload-9e3bb13a-02cd-4e42-aed7-b997559730eb

                      And I have two resources created:
                      0_1486586961908_upload-93a7aabe-a744-4bf1-b924-5ba17572c87e

                      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 🙂

                      jkandasaJ 1 Reply Last reply Reply Quote 0
                      • jkandasaJ Offline
                        jkandasa @njbuch
                        last edited by

                        @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
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        0

                        Online

                        587

                        Users

                        529

                        Topics

                        3.4k

                        Posts
                        Copyright © 2015-2025 MyController.org | Contributors | Localization