Node-red influxdb insert-update


#1

I am sending data to the Node-Red server with the mqtt.fx program as attached. The Mqtt server is taking it.

How to register and update the received data in influxdb. can you help me ?


#2

Hi, you have to tell us a bit more about your hardware and what you have tried.


#3

I am sending mqtt data with Arduino.


#4

so what is your flow? What does the message you are sending look like?


#5


#6

I'm sending data like mqtt.fx. I want to update the data I've sent into influxdb


#7

Take a look at flows.nodered.org if you search the flows for MQTT influxdb should show you how to link MQTT and influxdb.


#8

and look for the contrib-influxdb node

image

Though you can also write to InfluxDB directly simply using an http request node


#9

I'm testing now. I hope it works.
You are all very helpful. thank you so much


#10

yes I managed to save a single line in influxdb.
but when I send a line from the mqtt.fx program as below, I can add the lines I want and shred.


#11

Right, so you are handling a STRING from MQTT and you need to break that into an object to pass to the InfluxDB Node.

You can either use the http node to send the data via the REST API.

Or you need to turn the incoming payload to an object. If you can change what's in MQTT and make it valid JSON then you can simply use the JSON node to start with. Otherwise, you will need to split the string by ", " then split each result by ": " and build the object. Then you need to rearrange the data according to the instructions of the node so that it ends up in the right place in InfluxDB.