- Newest
- Most votes
- Most comments
Based on the information provided, there are several potential reasons why your IoT rules are not matching the published messages:
- SQL Statement Format: The SQL statement in your IoT rule might need adjustment. For the topic
esp8266/data, the correct format should be:
SELECT * FROM 'esp8266/data'
Note that the topic name should be enclosed in single quotes.
-
External Service Capacity: Before rule execution, ensure that the external services linked to your rule (Lambda and Kinesis Data Firehose) have sufficient throughput and capacity units for your application. If these services are throttling or experiencing issues, it could prevent rule execution.
-
WHERE Clause Filtering: If you've added any WHERE clauses to your rule, they might be filtering out your messages. Try using a simple rule without any WHERE conditions first to confirm basic functionality.
-
Rule Action Configuration: Verify that the rule action is correctly configured with the proper Lambda function ARN and IAM role permissions.
-
Message Format: The message payload format might not match what the rule is expecting. Ensure your ESP8266 is publishing valid JSON if your rule expects JSON data.
To further troubleshoot:
- Try creating a simpler rule that just republishes to another MQTT topic (using the republish action) to see if basic rule matching works
- Check if there are any errors in the CloudWatch Logs related to rule execution failures
- Verify that the IAM role associated with your rule has the necessary permissions to invoke your Lambda function
- Ensure that your Lambda function is in the same region as your IoT Core setup
If all these checks pass and you're still experiencing issues, it might be worth testing with the AWS IoT MQTT test client to publish test messages and see if they trigger your rules.
Sources
Harnessing the power of AWS IoT rules with substitution templates | The Internet of Things on AWS – Official Blog
Diagnosing rules issues - AWS IoT Core
Best practices for using MQTT topics in the AWS IoT Rules Engine - Designing MQTT Topics for AWS IoT Core
answered a year ago
Not sure, if you've figured it out already. The only difference I see in my setup is that I actually used double-quotes for the topic name in the SQL of the rule.
answered 10 months ago
Relevant content
asked 4 years ago
asked 4 years ago
