_unmodeleddata with IoT Plug and Play mobile template

Vinod Ramasubbu 6 Reputation points
2021-10-04T21:42:54.593+00:00

I am sending data from a python client app to a device created in IOT central with IoT Plug and Play mobile template.
The data I am sending matches the schema but it shows up as _unmodeleddata in the raw data tab.
Could you please let me know how to fix this ?

input data sent from Python client:

{"sensors": {"geolocation": {"lat": 40.767792, "lon": -73.982275, "alt": 190}}, "battery": 80, "accelerometer": {"x": 33, "y": 47, "z": 47}, "magnetometer": {"x": 47, "y": 17, "z": 63}, "gyroscope": {"x": 39, "y": 51, "z": 15}, "barometer": 63}
{"sensors": {"geolocation": {"lat": 40.767839, "lon": -73.981452, "alt": 190}}, "battery": 64, "accelerometer": {"x": 35, "y": 57, "z": 37}, "magnetometer": {"x": 21, "y": 53, "z": 47}, "gyroscope": {"x": 43, "y": 33, "z": 33}, "barometer": 17}
{"sensors": {"geolocation": {"lat": 40.764295, "lon": -73.972997, "alt": 108}}, "battery": 80, "accelerometer": {"x": 57, "y": 29, "z": 29}, "magnetometer": {"x": 51, "y": 45, "z": 49}, "gyroscope": {"x": 35, "y": 51, "z": 15}, "barometer": 25}
{"sensors": {"geolocation": {"lat": 40.763591, "lon": -73.971419, "alt": 202}}, "battery": 14, "accelerometer": {"x": 21, "y": 59, "z": 35}, "magnetometer": {"x": 21, "y": 45, "z": 23}, "gyroscope": {"x": 37, "y": 19, "z": 39}, "barometer": 41}
{"sensors": {"geolocation": {"lat": 40.767343, "lon": -73.968673, "alt": 124}}, "battery": 96, "accelerometer": {"x": 51, "y": 35, "z": 47}, "magnetometer": {"x": 19, "y": 39, "z": 47}, "gyroscope": {"x": 23, "y": 25, "z": 31}, "barometer": 63}
{"sensors": {"geolocation": {"lat": 40.765628, "lon": -73.964618, "alt": 392}}, "battery": 32, "accelerometer": {"x": 43, "y": 25, "z": 27}, "magnetometer": {"x": 17, "y": 41, "z": 21}, "gyroscope": {"x": 61, "y": 31, "z": 61}, "barometer": 53}

data received on Device (Raw Data Tab):

{
"_unmodeleddata": {
"sensors": {
"geolocation": {
"lat": 40.765628,
"lon": -73.964618,
"alt": 392
}
},
"battery": 32,
"accelerometer": {
"x": 43,
"y": 25,
"z": 27
},
"magnetometer": {
"x": 17,
"y": 41,
"z": 21
},
"gyroscope": {
"x": 61,
"y": 31,
"z": 61
},
"barometer": 53
},
"_eventtype": "Telemetry",
"_timestamp": "2021-10-04T21:18:49.828Z"
}

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
359 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dom 1,631 Reputation points Microsoft Employee
    2021-10-05T05:16:50.097+00:00

    Hi, can you check in your IoT Central application if the device is showing as "Unassociated" or is assigned to the IoT Plug and Play mobile device template? Also, is your Python client sending a modelID, and if so is it the modelID of the IoT Plug and Play mobile device template?


  2. Roman Kiss 2,246 Reputation points
    2021-10-05T07:24:49.43+00:00

    Hi,

    It looks like your client are sending not correct telemetry data according to the IoT Plug and Play mobile model.

    Based on this device model, the telemetry data must be sent by its sensors component, so the message must be setup for this component name and the payload should be the following (based on your data):

    {
      "geolocation": {
        "lat": 40.765628,
        "lon": -73.964618,
        "alt": 392
      },
      "battery": 32,
      "accelerometer": {
        "x": 43,
        "y": 25,
        "z": 27
      },
      "magnetometer": {
        "x": 17,
        "y": 41,
        "z": 21
      },
      "gyroscope": {
        "x": 61,
        "y": 31,
        "z": 61
      },
      "barometer": 53
    }
    

    The following is an example how to setup a component name for telemetry data using the MQTT direct protocol, where the publisher topic is used:

    devices/mydevice123/messages/events/$.ct=application%2Fjson&$.ce=utf-8&$.sub=sensors
    
    0 comments No comments