天狼皓月 发表于 2020-9-18 16:52:40

阿里云智能家居 温湿度上传报错

在使用官方的案例调用SmartDH11这个案例的时候,出现上报信息出错。做LED灯的时候可以正常控制下发的数据,但是在上传数据的时候就报错了。确认wifi 和 阿里云可以正常连接。





Topic数据使用的是

物模型通信 中的属性上报 第一个***/${deviceName}/thing/event/property/post 和属性设置***/${deviceName}/thing/service/property/set




代码中是这样的


    Serial.print("DHT.temperature=");
    Serial.println(DHT.temperature);
    Serial.print("DHT.humidity");
    Serial.println(DHT.humidity);
    client.publish(pubTopic,("{\"id\":"+ClientId+",\"params\":{\""+TempIdentifier+"\":"+DHT.temperature+",\""+HumiIdentifier+"\":"+DHT.humidity+"},\"method\":\"thing.event.property.post\"}").c_str());



报错信息 是 Recevice {"code":520,"data":{"topic":"/sys/a1SMZiujM/${deviceName}/thing/event/property/post","productKey":"a1SMZiujM","deviceName":"${deviceName}"},"id":"12345","message":"no active session for a1SMZiujMJ3&${deviceName}"}
parseObject() failed




一直找不到错在哪里,希望各位大神帮忙解答一下,在此万分感谢。


hnyzcj 发表于 2020-9-20 07:39:02

社区找下,前面有大神写了详细教程。
页: [1]
查看完整版本: 阿里云智能家居 温湿度上传报错