- 最新
- 投票最多
- 评论最多
Using this page for the comments below.
Overall, you are close. The IoT Policy has the correct actions and resources to publish to the $aws/rules
reserved topic used for basic ingest, and the python code looks correct too.
The one change would be in the rule itself. While your client publishes to $aws/rules/basic_ingest_rule/data/wind/adodar
there are two things needed for the rule to be used for basic ingest. First, the rule must be name basic_ingest_rule
in this instance, as that is how AWS IoT Core knows which rule to invoke for the incoming message.
Second, since the rule itself can be used for both basic ingest or regular messages published to data/wind/adodar
, the SQL syntax should look like this:
SELECT *,timestamp() as ts FROM '$data/wind/adodar'
The reason for removing the $aws/...
portion in the FROM
clause is that (from the doc link above):
Your devices and rules can't subscribe to Basic Ingest reserved topics. For more information, see Reserved topics.
Emphasis mine. Also, if the rule will only be used for basic ingest, the FROM
clause is optional. More details can be found in Using Basic Ingest section of the documentation.
Please let me know if this helps clear things up and more importantly, works. If you are still have problems, please post a comment.
相关内容
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前
Despite successfully implementing logging in CloudWatch as expected, I'm still being billed for messages. Even though documentation suggests that using the basic ingest method should only incur connectivity charges (https://docs.aws.amazon.com/iot/latest/developerguide/iot-basic-ingest.html) , I'm unsure if I'll also be billed for the number of messages ingested.
Can you share the billing metrics you are seeing? If published to the
$aws/rules/...
topic, you should see connectivity, Rule evaluation and 1 or more Rule executions. E.g. USD$0.30/million messages (assuming less than 5KiB in size). I'd suggest opening a support case to get clarity on billing.