Location Data Missing from Raw Data

Desiree Caudillo 0 Reputation points
2023-06-30T21:36:49.8833333+00:00

I am following the tutorial to use location data in an Azure IoT Central solution and I am still unable to see the data in Azure. I have verified that the fields in Iot Central match the property names exactly, including case. (I opened a support chat case 2306300040009067)

Here's the transform data I am sending over to Azure:

"location": {
"lat": best_lat,
"lon": best_lon,
"alt":0
}

I have the device location template set to receive location telemetry and the schema is set to geopoint just like the tutorial explains.

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
347 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Desiree Caudillo 0 Reputation points
    2023-07-10T18:44:54.2+00:00

    Hi @Roman Kiss & @LeelaRajeshSayana-MSFT

    Just to give you more information, here is the JSON file I am pulling data from:

    {
        "event": "53a87e2f-e0f6-4864-b9aa-03496e751338",
        "session": "e4007c39-b60e-4ff0-abdf-54c4bf83ab3b",
        "best_id": "testingNoteecard",
        "device": "dev:xxxxxxxxx",
        "product": "product:com.blues.dcaudillo:xxxxxxxxxx",
        "app": "app:e616e8c0-2c5af",
        "when": 1640129719,     
        "file": "sensors.qo",
        "body": {
            "humidity": 47.085200000000007,
            "temp": 25.875
        },
        "best_location_type": "gps",
        "best_lat": 30.6270025,
        "best_lon": -96.38035546875,
        "best_location": "College Station TX",
        "best_country": "US",
        "best_timezone": "America/Chicago"
    }
    
    

    I am routing the data using this JSONata Expression:

    {
    "device": {
    "deviceId": device
    },
    "measurements": {
    "temp": body.temp,
    "humidity": body.humidity
    },
    "location": {
    "lat": best_lat,
    "lon": best_lon,
    "alt":0
    },
    "timestamp": $fromMillis(when * 1000)
    }
    

    The only raw data pulled from this expression in Azure is the Device ID, Measurements, and Timestamp. The location data is not in the unmodeled data at all.

    Screenshot 2023-07-10 at 2.43.11 PM.png

    It appears the Location property is completely skipped over once the data is routed to Azure. I tested the route on my end with this curl request and the values should be appearing like they are here:

    curl -X 'POST' -d '{"device":{"deviceId":"dev:xxxxxxxxx"},"location":{"alt":0,"lat":30.6270025,"lon":-96.38035546875},"measurements":{"humidity":47.08520000000001,"temp":25.875},"timestamp":"2021-12-21T23:35:19.000Z"}' -H 'Content-Type: application/json' -H 'User-Agent: notes' 'https://iotc-fnb67yx2woajmsq.azurewebsites.net/api/IoTCIntegration?code=uu5HQeO5Kz21UcYOfA44_eDwQcTSd0LvMR2dfldxQewcAzFu3SKSEQ=='
    
    0 comments No comments

  2. Desiree Caudillo 0 Reputation points
    2023-07-10T18:48:13.27+00:00

    I will give the property capability type a try, but it did not work for me in the past. I am currently using Telemetry.

    I'll give it a try and let you guys know.

    Here's what I currently have: Screenshot 2023-07-10 at 2.47.57 PM

    0 comments No comments

  3. Desiree Caudillo 0 Reputation points
    2023-07-10T18:53:06.39+00:00

    Screenshot 2023-07-10 at 2.50.48 PM

    Screenshot 2023-07-10 at 2.51.31 PM

    It appears I have the same output, even after switching to a property capability type.

    0 comments No comments