# Send retarded data to InfluxDB

**URL:** <https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972>\
**Category:** General\
**Created:** [28 January 2020 20:29 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972 "2020-01-28T20:29:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ardweb](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@ardweb](https://discourse.nodered.org/u/ardweb)\
**Post date:** [28 January 2020 20:29 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972/1 "2020-01-28T20:29:43Z")

</div>

Hi.

I am using several [mkr 1010 Arduinos](https://store.arduino.cc/arduino-mkr-wifi-1010) connected to some sensors (mkr env Shield and seeedstudio grove sensors), and send the measured data (for example every 3 minutes), vía MQTT to a RPI with NodeRed, Grafana and InfluxDB.

If everything works, it's fine. But, because of the weak WiFi signal, or too many clients are connected to one WiFi-antenna, the arduino gets disconnected, and after some time, the WiFi signal gets strong, and the arduino connects to it.

I would like to know, if I can publish data in InfluxDB using NodeRed, that is retarded (for example 10 minutes too late). It would send in the message the amount of time it's too.

Can InfluxDB handle with it, and the retarded time? I would like to avoid in the DataBase an extra column with the lag time.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 January 2020 20:57 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972/2 "2020-01-28T20:57:22Z")

</div>

Yes, InfluxDB will allow you to specify the timestamp of the record. Normally you don't because you are sending pretty much in real-time but you can certainly send it.

However, you will also need to think about caching of data. So you will want to auto-cache and replay in order only if online. You will also need to think about available cache space.

---

<div class="post-metadata">

**Author:** ![ardweb](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@ardweb](https://discourse.nodered.org/u/ardweb)\
**Post date:** [28 January 2020 22:02 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972/3 "2020-01-28T22:02:42Z")

</div>

Thanks.

But how can I do it from NodeRed? Inside the arduinos, there is no problem. I can catch the moment when I loose the WiFi connection, store the measurement values, i order to send them. But how can I achive to tell influxDB that the data is out of time? Now I only add the payload to InfluxDB (as a JSon-Obj). Timestep is autocatically added.

---

<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 January 2020 22:06 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972/4 "2020-01-28T22:06:19Z")

</div>

The influx batch node allows specifying a timestamp. Not sure whether the basic influx node does.

---

<div class="post-metadata">

**Author:** ![ardweb](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@ardweb](https://discourse.nodered.org/u/ardweb)\
**Post date:** [28 January 2020 22:32 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972/5 "2020-01-28T22:32:39Z")

</div>

Ok. Reading the help of the batch node:

> The **measurement** property of a point contains the name of the measurement for the point. The **fields** property will contain the fields of the point. If supplied, the **tags** property will contain the tags for the point. To set the time for the point, supply a **timestamp** property.

Do you have any example? How should I modify my payload? Now, my payload is quite simple (like: {"temp":23.25919,"sensorID":1,"hum":54.15326,"pressure":101.0474,"illuminance":33.87097,"uva":0,"uvb":0,"uvIndex":0} )

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 January 2020 23:43 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972/6 "2020-01-28T23:43:13Z")

</div>

You don't need a node to write to InfluxDB. Have a look at the API, it is really easy to use and you can call it using just an HTTP request node. Then you can do whatever you like.

---

<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:** [29 January 2020 16:34 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972/7 "2020-01-29T16:34:14Z")

</div>

Read the info tab carefully, it tells you how to structure the data, but you do need to read it carefully and make sure you understand what it means. Without going and looking myself I do not remember exactly what the format is. Once you work out what it needs then if you don't know how to get the data into that format then ask again, explaining what structure you need.

---

<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:** [29 March 2020 16:34 UTC](https://discourse.nodered.org/t/send-retarded-data-to-influxdb/20972/8 "2020-03-29T16:34:17Z")

</div>

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