【发布时间】:2021-02-02 05:43:01
【问题描述】:
我是 AWS IoT 的新手,现在尝试利用现有资源来了解主要概念。
在使用 aws iot-data 命令尝试将数据发布到 AWS 保留主题之一时,我遇到了一种奇怪的行为。
假设我想更新一些名为 stubShadow 的名为 Shadow 的 stub 事物(我在 AWS IoT Dashboard 中使用 Test 选项卡):
aws iot-data update-thing-shadow --thing-name stub --shadow-name stubShadow \
--cli-binary-format raw-in-base64-out \
--payload '{"state":{"desired":{"ColorRGB":[0,11,11]}},"clientToken":"21b21b21-bfd2-4279-8c65-e2f697ff4fab"}' /dev/stdout
而且效果很好,我可以关注$aws/things/stub/shadow/name/stubShadow/update/accepted 主题以获取更新。
现在我想使用topic 参数发布消息。这是一个例子:
aws iot-data publish --topic "$aws/things/stub/shadow/name/stubShadow/update" \
--cli-binary-format raw-in-base64-out \
--payload '{"state":{"reported":{"ColorRGB":[0,11,11]}},"clientToken":"21b21b21-bfd2-4279-8c65-e2f697ff4fab"}'
什么都没有发生... 我想知道向 AWS 服务主题发送直接消息时此命令有什么问题?我错过了什么吗?因为对于常规(手动创建的)主题,它运行良好。
【问题讨论】:
标签: amazon-web-services aws-iot aws-iot-core