CayenneMQTTClient.h: No such file or directory

hi, i´m trying to make an IoT project with esp32, I´ve already connect my device to cayenne, but when i pasted the code arduino give me this error:

CayenneMQTTClient.h: No such file or directory

anybody who knows how to fix this?

you need to first install GitHub - myDevicesIoT/Cayenne-MQTT-Arduino: Cayenne MQTT Arduino Library library to your arduino IDE. then need to use this code for ESP32 Cayenne-MQTT-Arduino/ESP32.ino at master · myDevicesIoT/Cayenne-MQTT-Arduino · GitHub

1 Like

Thanks for the answer shramik_salgaonkar, it effectively solves the problem but I really can’t understand and I want to know if you can clarify.

The code automatically generated by Cayenne makes this inclusion:
#include “CayenneMQTTClient.h”

And the Arduino IDE produces this error:
error: CayenneMQTTClient.h: No such file or directory

The library has been previously installed and the file is in the following path:
…\Documents\Arduino\libraries\Cayenne\src\CayenneMQTTClient\CayenneMQTTClient.h

The code in:
Cayenne-MQTT-Arduino/ESP32.ino at master · myDevicesIoT/Cayenne-MQTT-Arduino · GitHub

It makes the following inclusion:
#include <CayenneMQTTESP32.h>
That is not the same that Cayenne automatically produces.

CayenneMQTTESP32.h is located on the following route:
…\Documents\Arduino\libraries\Cayenne\src\CayenneMQTTESP32.h

So :

  1. Why does Cayenne automatically produce code that includes an error?

  2. Why the Arduino IDE can’t find the CayenneMQTTClient.h library?

  3. What is the difference between CayenneMQTTClient.h and CayenneMQTTESP32.h?

I think it is important to understand this.

Best regards.

First of all, there is no ESP32 device on the cayenne dashboard to select. We have added support to ESP32 quite later and it is in the GitHub library.

Because you had downloaded the cayenne MQTT library.

CayenneMQTTClient.h is the common header for the cayenne MQTT library

whereas CayenneMQTTESP32.h is the header file specific to ESP32 which also includes CayenneMQTTClient.h