问题
I'm having an issue getting Reported properties to update/display properly when sending from the device. I'm using the starter code provided in the IOT Central/ IOT Hub docs. Code below. When the function runs it reports back success yet when viewing the properties of the device in IOT Central they are not displayed. I have verified that the property names are configured correctly in the device template but I'm obviously missing something. I also changed the names of the properties in the code below to see if I would receive an error, but it still reported success. Any ideas?
function sendDeviceProperties(twin) {
var properties = {
serialNumber: '123-ABC',
manufacturer: 'Test Manufacturer'
};
twin.properties.reported.update(properties, (err) => console.log(Sent device properties;
+
(err ? error: ${err.toString()}
: status: success
)));
}
回答1:
Just figured out what I was doing wrong...I set up the Property in the device template as an application property as opposed to a device property.
来源:https://stackoverflow.com/questions/53207787/iot-central-reported-properties-issue