# Modbus TCP to InfluxDB datalogging

**URL:** <https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560>\
**Category:** Industrial\
**Created:** [26 April 2020 17:59 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560 "2020-04-26T17:59:28Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 April 2020 16:47 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/21 "2020-04-27T16:47:11Z")

</div>

Did you submit an issue against the node?

---

<div class="post-metadata">

**Author:** ![Rsich](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@Rsich](https://discourse.nodered.org/u/Rsich)\
**Post date:** [28 April 2020 06:07 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/22 "2020-04-28T06:07:34Z")

</div>

Great! Starts working, Thank you very much Colin  
Now how to get the daily & monthly report out of influxDB?

---

<div class="post-metadata">

**Author:** ![mturnbull](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mturnbull/32/20742_2.png) [@mturnbull](https://discourse.nodered.org/u/mturnbull)\
**Post date:** [28 April 2020 13:21 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/23 "2020-04-28T13:21:34Z")

</div>

No I didn't think to do that because It's a limitation of that node and not an "issue" in terms of a bug. I only wanted to make Rsich aware of this and that there are other ways to write data to influxDB - that's all. With your assistance (and also from other forum members) he seems to have it working now.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 April 2020 13:34 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/24 "2020-04-28T13:34:31Z")

</div>

What is the limitation?

---

<div class="post-metadata">

**Author:** ![mturnbull](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mturnbull/32/20742_2.png) [@mturnbull](https://discourse.nodered.org/u/mturnbull)\
**Post date:** [28 April 2020 15:17 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/25 "2020-04-28T15:17:43Z")

</div>

Works well for writing floats and strings. Integers get written to influxDB too but only as floats or string fields too depending on how you set up the write in the node (as far as I can tell). Not being able to write integers as integers in influxDB can be an issue for some types of queries such as when you want to count the occurrence of a number of events over a period of time etc. I have found writing to the database using HTTP is easier and preserves data types. (just my personal preference).

Regardless of all of this, I only wanted to point out there are other ways to write to InfluxDB than just the influx node. I certainly did not want to create a sub thread or some sort of side issue on the forum so I won't be posting about this again in this thread.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 April 2020 15:47 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/26 "2020-04-28T15:47:33Z")

</div>

OK, yes I understand. Thanks.

---

<div class="post-metadata">

**Author:** ![Rsich](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@Rsich](https://discourse.nodered.org/u/Rsich)\
**Post date:** [28 April 2020 16:48 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/27 "2020-04-28T16:48:10Z")

</div>

Hi Colin, the limitation mentioned was the the no of messages per day in the node-red forum is  
max 7, need to wait for 24 hrs, that is why I couldn't reply you that day.

Pls advise how to generate periodic reports - daily & monthly, from InfluxDB logged data

---

<div class="post-metadata">

**Author:** ![Rsich](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@Rsich](https://discourse.nodered.org/u/Rsich)\
**Post date:** [28 April 2020 16:57 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/28 "2020-04-28T16:57:09Z")

</div>

Hi Micheal, could you pls send a sample, how to use HTTP to log all data types on InfluxDB

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 April 2020 17:47 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/29 "2020-04-28T17:47:07Z")

</div>

Unless you specifically need to have integer or Boolean _type_ fields in the database then the influx nodes are fine. I believe all the examples you quoted would be float types.

---

<div class="post-metadata">

**Author:** ![Rsich](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@Rsich](https://discourse.nodered.org/u/Rsich)\
**Post date:** [28 April 2020 18:04 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/30 "2020-04-28T18:04:19Z")

</div>

Yes , all are float types, working well, thanks

---

<div class="post-metadata">

**Author:** ![Rsich](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@Rsich](https://discourse.nodered.org/u/Rsich)\
**Post date:** [8 May 2020 07:19 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/31 "2020-05-08T07:19:36Z")

</div>

Interested to know how to include integer & binary fields, in the influxdb.  
Integers from DHT11sensors , DS18B20 sensors through I2C bus & binary signals are coming from Raspberry pi3 B+

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 May 2020 07:44 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/32 "2020-05-08T07:44:36Z")

</div>

> [@Rsich](#):
>
> Interested to know how to include integer & binary fields

An integer value can be be stored in a Float type. A non-integer float value cannot be stored in an Int type. If you have a value that is always an integer then I assume there is a small saving to be had by using Int field type but unless you are storing massive amounts of data I would not worry about it. I don't think there is a binary field type.  
To use a non-float type I think you will have to use the direct http API rather than using the influx nodes.  
Having said that I don't know whether it is possible to pre-define a field type and whether, if you did, then you could use the influx nodes and influx would convert the values for you.

> **[Types | Flux Documentation](https://docs.influxdata.com/influxdb/v2/reference/flux/language/types/)**
>
> A type defines the set of values and operations on those values. Types are never explicitly declared as part of the syntax. Types are always inferred from the usage of the value.

**[Edit]** Oops, that is for influx v2 which is not supported yet. No doubt google will find the ones for 1.8

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 July 2020 07:57 UTC](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560/33 "2020-07-07T07:57:08Z")

</div>

Closed on 7 July 2020 07:57 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/modbus-tcp-to-influxdb-datalogging/25560.md?page=1)
