Using InfluxDB with Cayenne and GPS


#1

Hello,

I’ve got everything humming along nicely now, however when using CayenneLPP as the codec and the InfluxDB integration, I can only select field(geohash) when I specifically query the device_frmpayload_data_gps_location_20_location tag.

My payload (or at least the relevant part!) looks like this:

            "object": {
                "gpsLocation": {
                    "20": {
                        "altitude": <INT>,
                        "latitude": <FLOAT>,
                        "longitude": <FLOAT>
                    }
                },
                "illuminanceSensor": {
                    "21": 0
                }
            },

(I’ve replaced the actual values for lat/long with when pasting this in!)

and my reading of https://www.loraserver.io/lora-app-server/integrate/sending-receiving/influxdb/ suggests that this should produce a set of tags for the field device_frmpayload_data_illuminance_sensor_31 but all I get is value

The device is a TTGO Beam running https://github.com/cyberman54/ESP32-Paxcounter and I’m using the “Dynamic” Cayenne payload setting.

The data is coming through as expected, I’m just not seeing the GPS data available in InfluxDB, so I can’t graph it in Grafana :frowning:


#2

from Chronograf:

field name is value but the measurement name is what you expected.


#3

Thanks, but that’s not the problem I’m having.

I can read the data fine, what I can’t do is map the data contained within the measurement name to the GPS latitude/longitude.

Is this something you’re able to help with?


#4

OK, so here are the measurements I have in InfluxDB:

device_frmpayload_data_analog_input_23
device_frmpayload_data_barometer_30
device_frmpayload_data_gps_location_20_altitude
device_frmpayload_data_gps_location_20_location
device_frmpayload_data_humidity_percent
device_frmpayload_data_humidity_sensor_29
device_frmpayload_data_illuminance_sensor_21
device_frmpayload_data_illuminance_sensor_31
device_frmpayload_data_temp_degrees_c
device_frmpayload_data_temperature_sensor_26
device_frmpayload_data_vdd
device_uplink

Instead of the GPS co-ordinates turning up as their own measurement, I would expect to see them as tags/values on the device_frmpayload_data_illuminance_sensor_21 field in the same way that I see them on the device_frmpayload_data_gps_location_20_location field:

> select * from  device_frmpayload_data_analog_input_23 limit 10;
name: device_frmpayload_data_analog_input_23
time                application_name             dev_eui          device_name       f_port value
----                ----------------             -------          -----------       ------ -----

> select * from  device_frmpayload_data_gps_location_20_location limit 10;
name: device_frmpayload_data_gps_location_20_location
time                application_name             dev_eui          device_name       f_port geohash      latitude longitude
----                ----------------             -------          -----------       ------ -------      -------- ---------