I’m actually using Arduino/ESP-IDF “combined” mode and I set those lines at the beginning of my platformio.ini config file in my project :
[env]
platform = https://github.com/platformio/platform-espressif32.git
framework = arduino, espidf
If I understand well, the version of ESP-IDF used is the version that is included with the PlatformIO (lastest) version I’m using ?
I was able to make my project work with MQTT5, but I had to get the lastest ESP-MQTT sources from Espressif github repo and put them under /lib project folder. I then included those .h files in my main.cpp file :
#include "../lib/esp-mqtt/mqtt_client.h"
#include "../lib/esp-mqtt/mqtt5_client.h"
mqtt5_client.h is not even included in the version of ESP-IDF framework included with PlatformIO. But it is included in this Github repo of Espressif: https://github.com/espressif/esp-mqtt. This version of MQTT (v5) is more recent than the one that is included in the ESP-IDF version that PlatformIO framework includes.
Is there a better way to use the most recent version of MQTT5 than the way I did it ?
Thank you.