on_message is not working in python

馋奶兔 提交于 2019-12-12 03:37:48

问题


I am working on aws iot and able to get the shadow state updated by the terminal via shell script .But i am able to get root@raspberrypi:~# ./aws_subscribe.py Connected with result code 0 and also in aws iot home i am getting out of sync error and i am following this blog


回答1:


The 'Shadow status' field on the AWS console merely shows if the 'reported' and 'desired' states are the same, it has no functional impact.

This is an example that would show the status as out of sync:

{
  "reported": {
    "locked": true
  },
  "desired": {
    "locked": false
  }
}

Where as this example would show them as in sync.

{
  "reported": {
    "locked": true
  },
  "desired": {
    "locked": true
  }
}

That's really all there is to it. You can completely remove the 'desired' state by sending the following JSON, if you do this it will always show as in sync.

{
  "desired": null
}


来源:https://stackoverflow.com/questions/37984677/on-message-is-not-working-in-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!