Closed Steven35700 closed 2 years ago
Hi @Steven35700,
I was able to reproduce the issue. It seems the policy ( mentioned as mqttProxyCognitoPolicy
in the tutorial) assigned to Cognito identity role (mentioned as Cognito_mqtt_proxy_identity_poolAuth_Role
in the tutorial) does not have permissions to receive packets (iot:Receive
) from broker.
Could you go to: IAM Console > Choose Roles > Search for the Cognito identity role you created > Edit Inline policy for IoT.
The updated policy should have following permissions to the resource:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"iot:Receive",
"iot:Subscribe",
"iot:AttachPolicy",
"iot:AttachPrincipalPolicy",
"iot:Connect",
"iot:GetThingShadow",
"iot:ListAttachedPolicies",
"iot:DeleteThingShadow",
"iot:UpdateThingShadow",
"iot:CreateCertificateFromCsr",
"iot:Publish"
],
"Resource": "*"
}
]
}
After updating policy please reconnect the mobile app to the BLE device.
Hi,
I made the change, everything works perfectly now! So there is an error in the tutorial. Thank you very much for your time and help!
Steven
Glad to know it works! I will close the issue.
Briefly summarize the issue being raised I configured the "CONFIG_OTA_MQTT_BLE_TRANSPORT_DEMO_ENABLED" demo on my ESP32 with this tutorial. I manage to connect the ESP32 to the MQTT proxy fine and everything seems to work. Unfortunately, it seems that the ESP32 does not receive a notification that there is a new firmware.
Describe the desired outcome Normally, the ESP32 should receive notification that an update is available and start downloading it, then check the code signing before rebooting with this new version.
System information
References ESP32 Logs :
Android FreeRTOS Demo Logs :
Additional context This must not come from my job configuration or my AWS configuration because I manage to do an OTA update with the "CONFIG_OTA_MQTT_UPDATE_DEMO_ENABLED" demo.
It doesn't seem to come from my Cognito configuration because I also manage to send MQTT BLE packets with the "CONFIG_MQTT_BLE_TRANSPORT_DEMO_ENABLED" demo. However, it is true that with this demo, I have problems with the reception (subscription) of MQTT messages where the demo crashes (reboot card).