Using InfluxDB with Cayenne and GPS

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:

from Chronograf:

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

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?

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
----                ----------------             -------          -----------       ------ -------      -------- ---------

I got a working GPS solution.
For this I use “Grafana Worldmap Panel NG 0.4.0”

(Oh. It’s an outdated version. Will upgrade it.)

This plugin treats data from Influx as GPS data.

1st of all you need to store Lora’s data in InfluxDB simirar to:

{
status: {
RSSI_SNR_info: ‘no’,
battery_info: ‘present’,
downlink_counter: ‘present’,
uplink_counter: ‘present’,
gps_info: ‘present’,
triggered_by_push1: ‘yes’,
triggered_by_acceler: ‘no’,
temperature_info: ‘present’
},
temperature: 31,
gpsLatitude: ‘xx°xx.856N’,
gpsLatDecimal: xx.xx76,
gpsLongitude: ‘yyy°29.56E’,
gpsLongDecimal: yy.yyy66666666667,
gpsQuality: 2,
gpsSats: 2,
GPS: { latitude: xx.3376, longitude: yy.yyy66666666667 },
ULcounter: 64,
DLcounter: 5,
batteryLevel: 4.023
}

The key moment that you need a pair of gpsLatitude and gpsLongitude.

In such case Grafana will treat data as geospatial data.

And yes, I use " Grafana Worldmap NG"