物联网中心-报告的属性问题 [英] IOT Central - Reported properties issue
问题描述
从设备发送信息时,我无法获取已报告的属性以正确更新/显示的问题.我正在使用IOT Central/IOT Hub文档中提供的入门代码.下面的代码.该功能运行时,它会报告成功,但在IOT Central中查看设备属性时,它们不会显示.我已经验证了属性名称已在设备模板中正确配置,但显然缺少某些内容.我还更改了下面代码中的属性名称,以查看是否会收到错误消息,但仍然报告成功.有什么想法吗?
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",
制造商:测试制造商"
};
twin.properties.reported.update(properties,(err)=> console.log(Sent device properties;
+
(err?error: ${err.toString()}
:status: success
)));
}
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
)));
}
推荐答案
只是弄清楚我在做什么错...我将设备模板中的属性设置为应用程序属性,而不是设备属性.
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.
这篇关于物联网中心-报告的属性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!