OVMS3-idf/examples/protocols/aws_iot/subscribe_publish
Angus Gratton 4f1a856dbf cmake: Remove defaults for COMPONENT_SRCDIRS, COMPONENT_SRCS, COMPONENT_ADD_INCLUDEDIRS
* Philosophical: "explicit is better than implicit".
* Practical: Allows useful errors if invalid directories given in components as the defaults aren't
  always used. Also trims the -I path from a number of components that have no actual include
  directory.
* Simplifies knowing which components will be header-only and which won't
2018-04-30 09:59:20 +10:00
..
main Fix Kconfig.projbuild in some examples, where myssid is erroneously kept as the default value for password. 2018-04-05 14:34:43 +05:30
CMakeLists.txt cmake: Remove defaults for COMPONENT_SRCDIRS, COMPONENT_SRCS, COMPONENT_ADD_INCLUDEDIRS 2018-04-30 09:59:20 +10:00
Makefile AWS IoT Device SDK Support 2017-03-13 17:23:29 +08:00
README.md AWS IoT Device SDK Support 2017-03-13 17:23:29 +08:00
sdkconfig.defaults AWS IoT Device SDK Support 2017-03-13 17:23:29 +08:00

Amazon Web Services IoT MQTT Subscribe/Publish Example

This is an adaptation of the AWS IoT C SDK "subscribe_publish" example for ESP-IDF.

Configuration

See the README.md in the parent directory for information about configuring the AWS IoT examples.

Monitoring MQTT Data from the device

After flashing the example to your ESP32, it should connect to Amazon and start subscribing/publishing MQTT data.

The example code publishes MQTT data to the topic test_topic/esp32. Amazon provides a web interface to subscribe to MQTT topics for testing:

  • On the AWS IoT console, click "MQTT Client" near the top-right.
  • Click "Generate Client ID" to generate a random client ID.
  • Click "Connect"

One connection succeeds, you can subscribe to the data published by the ESP32:

  • Click "Subscribe to Topic"
  • Enter "Subscription Topic" test_topic/esp32
  • Click "Subscribe"

... you should see MQTT data published from the running example.

To publish data back to the device:

  • Click "Publish to Topic"
  • Enter "Publish Topic" test_topic/esp32
  • Enter a message in the payload field
  • Click Publish