Hi, I am new to node red. I'm using it to send some data to influxdb at a sampling rate of 1000Hz. The data is coming from a tcp in node (connected to OpenSignals (r)evolution). The data is in an array form. I've placed a debug node after the function node to check if all the wanted elements are passed through the function. The debug shows that all wanted elements are passed however when I connect it to Influxdb, some of the data are missing.
I've attached the picture from node red below.
I have tried adjusting the time precision in Influxdb to millisecond, microsecond and nanosecond but there are still data missing.
Another trial was using a batch node and to send the message once 1000 messages was received but it still doesn't work.
(OpenSignals only can be connected to Node red via TCP ports)
I tried with a simple example where I insert an array [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] and not all the number are inserted into the influxdb.
Influxdb log: (Only 2 out of 20 numbers are stored)
You are not actually sending an array, but separate inserts, but in this case it does not matter. If you send 100 or more, you should prepare an actual array and use the batch node.
Your issue is caused by the lack of uniqueness:
InfluxDB identifies unique data points by their measurement, tag set, and timestamp
The timestamp could sometimes help, but if you insert many at the same time, the timestamp will remain the same, even in nanosecond precision.
Note that the 'value' is not taken into account, it simply overwrites the previous 'value'.
You can solve this by adding a tag with the value to make it unique. example; 'uniq:1','uniq:2'
Hi. Firstly, please format code by putting ``` above and below.
Secondly,, not sure why you need F2 (just send {payload: value1} in the F1 loop).
Lastly, it might be the design of the influx node to discard incoming msgs if it is busy performing a task. If so, you might need some form of queue controlled by the completion of the influx node.