AWS Pub/Sub example - Subscribe not getting test messages

grant.rolls
Posts: 2
Joined: Mon Apr 09, 2018 3:32 am

AWS Pub/Sub example - Subscribe not getting test messages

Postby grant.rolls » Mon Apr 09, 2018 3:55 am

Hi,
I am starting my R&D on ESP32 modules with the ESP32-EVB.

I have loaded the subscribe_publish esp-idf example. I have setup device as per aws/esp requirements, and set the app config.
The device is completing the connection procedure and I can see publish events coming in on the AWS MQTT test page from the device.

However, I cannot seem to get the device to receive any published messages. The subscribe callback is never called. I can confirm the subscription is at least initially connected, as if I change the policy to a different sub topic, the unit does not connect.

Have tried different topics as well as separate pub and sub topics.
Is there some sort of filtering happening? Or is the subscribe just not working?

Cheers,
Grant

grant.rolls
Posts: 2
Joined: Mon Apr 09, 2018 3:32 am

Re: AWS Pub/Sub example - Subscribe not getting test messages

Postby grant.rolls » Tue Apr 10, 2018 5:38 am

I have figured out the issue. For anyone else that may run into this, it was a policy/permissions issue on AWS server-side.

In the policy setup, I tried to only allow permissions to subscribe/publish the specific topic 'test_topic/esp32'
The way policy file is written, there is a different format for subscribe and publish rules (topic/topicfilter). I couldn't get a multi-level subscribe rule working.

Using a 'wildcard' policy (allow all iot related actions) allowed sub/pub on all topics and I received the messages published from the test platform with the ESP32.

Code: Select all

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "iot:Publish",
        "iot:Connect",
        "iot:Receive",
        "iot:Subscribe",
        "iot:GetThingShadow",
        "iot:DeleteThingShadow",
        "iot:UpdateThingShadow"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}

Daniel
Posts: 28
Joined: Tue Jan 09, 2018 12:55 pm

Re: AWS Pub/Sub example - Subscribe not getting test messages

Postby Daniel » Tue Apr 10, 2018 7:49 am

Hello,there is the demo for ardunio .Actually,I made it work well.https://exploreembedded.com/wiki/AWS_IO ... uino_ESP32 The source code is at the bottom.

Who is online

Users browsing this forum: Dennie and 66 guests