Cannot Display Location Telemetry in IOT Central App RRS feed

  • Question

  • I'm having trouble getting the correct recipe of information for sending telemetry events for GPS Location (location telemetry).  I am sending the messages from a dot net core application so I am using the C# sdk.  Can someone please provide a C# sample snippet of code that will successfully send a GPS latitude and longitude pair to the IOT Central App?

    Note I can successfully send other telemetry information like temperature so it is not a problem of connection.

    Thursday, July 25, 2019 12:00 AM

All replies

  • Hi,

    What is the trouble you are facing? You can define the properties for location telemetry same as temperature and send the data to IoT Central.

    Once your application is ready, you can create a location measurement to display in IoT Central. Please refer the MSDN thread which addresses similar query and modify your code accordingly.

    Also, see this post for more details.

    Thursday, July 25, 2019 7:58 AM
  • Well....specifically, it's not working.  I am sending data that should work, but the GPS location data is not being shown on the map anywhere.  Here is more detail on what I am seeing below.

    Here is the JSON I am sending in.  All of the temperatures are working properly.


    Here is location configuration from the "Measurements" page.  As you can see it matches the items in the telemetry message above.

    Display Name = GPS Location

    Field Name: location

    Here are some specific code snippets from the application that is generating the test information and sending it to the IOT central app.

    //Client Libraries
    using Microsoft.Azure.Devices.Client;
    using Microsoft.Azure.Devices.Shared;
    using Newtonsoft.Json;
    //Connect Function Call
                    Client = DeviceClient.CreateFromConnectionString(DeviceConnectionString, TransportType.Mqtt);
    //Send Telemetry Function Call
    var measurementString = JsonConvert.SerializeObject(telemetryClass);
                        await Client.SendEventAsync(new Message(Encoding.ASCII.GetBytes(measurementString)));  
    //Telemetry Data Structures
     class Telemetry
            public Telemetry()
                location = new Location();
            public decimal bcpuTemp { get; set; }
            public decimal gpuTemp { get; set; }
            public decimal mcpuTemp { get; set; }
            public decimal pllTemp { get; set; }
            public decimal tboardTemp { get; set; }
            public decimal tdiodeTemp { get; set; }
            public decimal thermalTemp { get; set; }
            public Location location { get; set; }
        class Location
            public decimal lat { get; set; }
            public decimal lon { get; set; }
            public decimal? alt { get; set; }

    Thursday, July 25, 2019 9:32 PM
  • I was successfully able to get it working as a "property" but I have yet to be able to get it working as a "Telemetry" measurement.
    Friday, July 26, 2019 7:56 PM
  • Just to confirm, have you tried the steps mentioned in the documentation
    Monday, July 29, 2019 7:39 AM