TTN Payload to InluxDB

From a LoRaWan TTN node I get next payload:

payload

The path to value 3908 is payload_fields.echteld.

The value 3908 (“echteld”) must be saved in an Influx DB (without password) on 192.168.2.185 named “waterstanden” via the Influx DB Out Node. These are my settings:

I have tried different measurement field settings like msg.payload.echteld, payload_fields.echteld and payload.echteld but nothing is written to the database.

Can someone give me some advice how to handle this?

Have you read and understood the Info panel for the influxdb node?

If have read the info but it turned out I did not understood :thinking:

What do you think I'm doing wrong?

I don't think much is right unfortunately. For example, what does it say about how to specify the measurement, and how have you tried to do that?

Hi Colin. Just tried (again) what is written in the info (see below), but no succes :frowning:


Node Help

A simple influxdb output node to write values and tags to an influxdb measurement.

The fields and tags to write are in msg.payload . If msg.payload is a string, number, or boolean, it will be written as a single value to the specified measurement (called value ).

If msg.payload is an object containing multiple properties, the fields will be written to the measurement.

If msg.payload is an array containing two objects, the first object will be written as the set of named fields, the second is the set of named tags.

Finally, if msg.payload is an array of arrays, it will be written as a series of points containing fields and tags.

If the measurement field is not set in the node configuration, the user can send in data with a specified measurement name in msg.measurement to overwrite the measurement field in the configuration of the node.

Check Advanced Query Options to specify a time precision and retention policy for the insertion.

The advanced query options Time Precision and Retention Policy can be overwritten using message properties msg.precision and msg.retentionPolicy .

So what don't you understand?
If you don't understand the basics of message structure, have a look at the section in the node red docs on messages?
https://nodered.org/docs/user-guide/messages

As far as my knowledge goes, even after reading all the info mentioned, I did nothing wrong setting up this node but still it doesn't work. That's why I'm here, asking a more experienced user to check and help me with the specific and right settings.

What have you done to achieve that?

I've tried them all:

msg.measurement
msg.echteld
echteld
payload.echteld
msg.payload
payload
object
payload.object
payload.object.echteld
object.echteld

Show us your flow where you are doing what the info says, which is to provide the measurement name in msg.measurement, or just to put the measurement name in the node if it is fixed. In the image you posted earlier you told the node to use a measurement named "msg.payload.echteld", which I assume is not what the measurement is named.

The measurement named "msg.payload.echteld" was one of many, please see the list of all I tried in the above post.

Just did a fresh new install of NodeRED but the problem stays the same.

This is my flow (TTN access key edited with xxxxxxxxxx):

[{"id":"3588197a.a23a96","type":"tab","label":"Testen","disabled":false,"info":""},{"id":"879ea9fe.24c108","type":"ttn uplink","z":"3588197a.a23a96","name":"LSN-50","app":"b1ba9763.8396f8","dev_id":"dragino-nap","field":"","x":190,"y":160,"wires":[["7aa54d21.346504","ce83de4.9a66c2"]]},{"id":"ce83de4.9a66c2","type":"debug","z":"3588197a.a23a96","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":370,"y":260,"wires":[]},{"id":"7aa54d21.346504","type":"influxdb out","z":"3588197a.a23a96","influxdb":"23461b4.ab202e4","name":"Waterstanden","measurement":"echteld","precision":"","retentionPolicy":"","x":400,"y":140,"wires":[]},{"id":"b1ba9763.8396f8","type":"ttn app","z":"","appId":"dragino-nap","accessKey":"ttn-account-v2.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","discovery":"discovery.thethingsnetwork.org:1900"},{"id":"23461b4.ab202e4","type":"influxdb","z":"","hostname":"192.168.2.185","port":"8086","protocol":"http","database":"waterstanden","name":"Waterstanden","usetls":false,"tls":""}]

This is the complete debug output:

this page will explain how to get the right path to data (assuming it’s not a buffer).

https://nodered.org/docs/user-guide/messages

Do you mean the actual name of the measurement is msg.payload.echteld or that the measurement name is in msg.payload.echteld?

Thanks ukmoose but the Influxdb Out Node should work without this all. As far as I know...

You have to put the data in the right attributes of the message as defined in the Info tab for the influx node.

The node info screen shows the node is not critical because it handles strings, numbers and booleans from "msg.payload". So it should at least write something to the database when the measurement field is filled in with one of the terms as show in the list above. But is does not.

Please answer the question that I have asked multiple times: Is the name of the measurement "msg.payload.echteld" or is the name of the measurement to be found inside msg.payload.echteld?

The name of the measurement is "echteld" and is inside msg.payload.echteld. Please see the image of the complete debug output above, this answers i.m.o. your question or maybe I am wrong?

Right, ok so I see from your flow that you now have echteld in the measurement so that should be ok,
Next the data to be written to that measurement must be in msg,payload and I see that is {echteld: 3908} so that should write that value to the field echteld of the measurement echteld. So when you run it what do you see? Any errors or anything?

Thanks again! No error messages, NodeRED reports "succesfully deployed". After disabling the debug node no messages or whatever are shown in the debug window which is correct isn't it? When sending a payload via The Things Network no error messages or whatever are shown until I enable the debug node. Thereafter the correct payload is shown in the debug window, but still no error messages.

To be sure I've re-installed InfluxDB on my RPi but this makes no difference.