In this application you can control the LED on the ESP32 by sending messages to the MQTT broker. It uses ESP-MQTT library which implements mqtt client to connect to mqtt broker.
This example can be executed on any ESP32 board, the only required interface is WiFi and connection to internet.
- Open the project configuration menu (
idf.py menuconfig
) - Configure Wi-Fi or Ethernet under "Example Connection Configuration" menu. See "Establishing Wi-Fi or Ethernet Connection" section in examples/protocols/README.md for more details.
- When using Make build system, set
Default serial port
underSerial flasher config
.
Build the project and flash it to the board, then run monitor tool to view serial output:
idf.py -p PORT flash monitor
(To exit the serial monitor, type Ctrl-]
.)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.