TTN Payload to InluxDB

Replace the influxdb node with a debug node, and compare the format of what is output, to the examples given in the influxdb node readme.
If it's different, it just won't work!

How do you know it is not writing to the database?

Via SSH:

influx

use waterstanden

select * from waterstanden

Nothing showed :frowning:

Try

use waterstanden
show measurements

that should show echteld

select * from echteld

It does not seem that complex to me, since the TTN node sends sensor name "echteld" and measurement value "3908" correctly. Nevertheless, I am unable to write this in the Influx database. Unfortunately, I give up after too many frustrating hours of testing.

Thanks anyway for your tips!

It should not be difficult. What do you see when you show measurements.
Your influx query did not work because you were not specifying a valid measurement in the select statement.

I admire your perseverance, mine is less and I am not experienced with NodeRED and Influx. And I know I can't expect a step-by-step guide to solve this.

When I create a new database "waterstanden" I see nothing after "show measurements". After one or more times a payload uplink from the LoRa node this is the output:

show measurements
name: measurements
name
----
echteld

This while I use the same flow as posted above:

[{"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":""}]

If needed I can send you a PM with the flow including the complete TTN access key.

OK, so it has written to the database, I suspect your flow is working correctly, assuming it is the same one as yesterday. Now try
select * from echteld
to see what it has written.

This is the output:

select * from echteld
name: echteld
time echteld
=== =====
1560432050564511773 3908
1560432177588323535 3908
1560433060009686583 3948

Excellent, all working.
So the final problem was just that you were using the wrong select statement to fetch the data. In Influx a measurement is roughly equivalent to a table in a conventional sql database.

1 Like

So the problem was not only my lack of knowledge of NodeRED but also the lack of knowledge of Influx. I'm going to be embarrassed now for the moment :smirk:

Thank you so much for your help!