sukesh-ak / ESP32-TUX

ESP32-TUX - ESP32 / ESP32-XX Touch UX Template using LVGL to get you started
https://tux.sukesh.me
MIT License
236 stars 55 forks source link

MQTT implementation #30

Closed fnandomaia closed 1 year ago

fnandomaia commented 1 year ago

I'm trying to implement the MQTT protocol inside an ESP32-TUX instance.

  1. I enabled MQTT configuration inside idf.py menuconfig.

  2. main.hpp I put the include of the local file for the mqtt library downloaded from Github (https://github.com/espressif/esp-mqtt) because that way it didn't give error of include not found.

  3. main.hpp include mqtt_client.h file. I initialized the functions: mqtt_event_handler() and mqtt_app_start(). 20230517-192556-003

  4. main.cpp I placed the respective functions from the previous step and initialized mqtt_app_start(). 20230517-192517-002

  5. It happens that when compiling it gives an error inside the mqtt_client.h library, as shown in the image below. 20230517-192407-001

I wonder if anyone has an idea of how to make it work or an example of working MQTT (connect, subscribe, publish) code.

Thanks!

sukesh-ak commented 1 year ago

@fnandomaia Please try to get MQTT working outside of ESP32-TUX so its easier to integrate after that.

IDF official repo is here https://github.com/espressif/esp-mqtt