ESP32 Compilation error

resolved

#1

I’m trying to set up OMG on an ESP32. I’ve followed the instructions here

I did already have a library called ESP32_BLE_Arduino in my libraries directory so I renamed it ESP32_BLE_Arduino-old and copied the release version to ESP32_BLE_Arduino.

I loaded the info file and hit the compile button but received these errors:

Arduino: 1.8.5 (Windows 7), Board: "ESP32 Dev Module, Minimal SPIFFS (Large APPS with OTA), QIO, 80MHz, 4MB (32Mb), 921600, None"

WARNING: library ArduinoOTA claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library Update claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library ESP32_BLE_Arduino-old claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library rc-switch claims to run on (avr, esp8266, esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library SPI claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library ESPmDNS claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
In file included from C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino:134:0:

C:\Users\User\Documents\Arduino-new\hardware\espressif\arduino-esp32\libraries\ArduinoOTA\src/ArduinoOTA.h:83:5: error: 'WiFiUDP' does not name a type

     WiFiUDP _udp_ota;

     ^

C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino: In function 'void setup()':

OpenMQTTGateway:262: error: no matching function for call to 'WiFiClass::macAddress()'

     trc(WiFi.macAddress()); 

                         ^

In file included from C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino:133:0:

d:\Program Files (x86)\Arduino1.88\libraries\WiFi\src/WiFi.h:137:14: note: candidate: uint8_t* WiFiClass::macAddress(uint8_t*)

     uint8_t* macAddress(uint8_t* mac);

              ^

d:\Program Files (x86)\Arduino1.88\libraries\WiFi\src/WiFi.h:137:14: note:   candidate expects 1 argument, 0 provided

C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino: In function 'void setup_wifi()':

OpenMQTTGateway:400: error: 'class WiFiClass' has no member named 'mode'

   WiFi.mode(WIFI_STA);

        ^

OpenMQTTGateway:400: error: 'WIFI_STA' was not declared in this scope

   WiFi.mode(WIFI_STA);

             ^

C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino: In function 'void stateMeasures()':

OpenMQTTGateway:712: error: 'StaticJsonBuffer' was not declared in this scope

       StaticJsonBuffer<200> jsonBuffer;

       ^

C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino:712:7: note: suggested alternative:

In file included from C:\Users\User\Documents\Arduino-new\libraries\ArduinoJson\src/ArduinoJson/StaticJsonDocument.hpp:8:0,

                 from C:\Users\User\Documents\Arduino-new\libraries\ArduinoJson\src/ArduinoJson.hpp:10,

                 from C:\Users\User\Documents\Arduino-new\libraries\ArduinoJson\src/ArduinoJson.h:9,

                 from C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino:61:

C:\Users\User\Documents\Arduino-new\libraries\ArduinoJson\src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note:   'ArduinoJson::Internals::StaticJsonBuffer'

 class StaticJsonBuffer : public Internals::StaticJsonBufferBase {

       ^

OpenMQTTGateway:712: error: 'jsonBuffer' was not declared in this scope

       StaticJsonBuffer<200> jsonBuffer;

                             ^

OpenMQTTGateway:787: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'

       SYSdata.printTo(JSONmessageBuffer, sizeof(JSONmessageBuffer));

               ^

Multiple libraries were found for "WiFi.h"
 Used: d:\Program Files (x86)\Arduino1.88\libraries\WiFi
 Not used: C:\Users\User\Documents\Arduino-new\hardware\espressif\arduino-esp32\libraries\WiFi
Multiple libraries were found for "BLEDevice.h"
 Used: C:\Users\User\Documents\Arduino-new\libraries\ESP32_BLE_Arduino-old
 Not used: C:\Users\User\Documents\Arduino-new\libraries\ESP32_BLE_Arduino
exit status 1
no matching function for call to 'WiFiClass::macAddress()'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The rest of my library directory looks like this:

I’ve had success previously running OMG on an esp8266 but I’m not sure what’s breaking the esp32 compile. Any help is most greatly appreciated!


#2

Hello,

Are you trying to compile v0.8 or the master?


#3

Master. Should I not be.


#4

Yes you should take the v0.8


#5

Thanks for the help. I’ve downloaded the files from your link above. I’ve copied ALL of the libraries included in the source zip file into my libraries path and tried compiling. I am still getting this error:

Arduino: 1.8.5 (Windows 7), Board: "ESP32 Dev Module, Minimal SPIFFS (Large APPS with OTA), QIO, 80MHz, 4MB (32Mb), 921600, None"

WARNING: library ArduinoOTA claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library Update claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library ESP32_BLE_Arduino claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library rc-switch claims to run on (avr, esp8266, esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library SPI claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
WARNING: library ESPmDNS claims to run on (esp32) architecture(s) and may be incompatible with your current board which runs on (arduino-esp32) architecture(s).
In file included from C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino:130:0:

C:\Users\User\Documents\Arduino-new\hardware\espressif\arduino-esp32\libraries\ArduinoOTA\src/ArduinoOTA.h:83:5: error: 'WiFiUDP' does not name a type

     WiFiUDP _udp_ota;

     ^

C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino: In function 'void setup()':

OpenMQTTGateway:258: error: no matching function for call to 'WiFiClass::macAddress()'

     trc(WiFi.macAddress()); 

                         ^

In file included from C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino:129:0:

d:\Program Files (x86)\Arduino1.88\libraries\WiFi\src/WiFi.h:137:14: note: candidate: uint8_t* WiFiClass::macAddress(uint8_t*)

     uint8_t* macAddress(uint8_t* mac);

              ^

d:\Program Files (x86)\Arduino1.88\libraries\WiFi\src/WiFi.h:137:14: note:   candidate expects 1 argument, 0 provided

C:\Users\User\Documents\Arduino-new\OpenMQTTGateway\OpenMQTTGateway.ino: In function 'void setup_wifi()':

OpenMQTTGateway:391: error: 'class WiFiClass' has no member named 'mode'

   WiFi.mode(WIFI_STA);

        ^

OpenMQTTGateway:391: error: 'WIFI_STA' was not declared in this scope

   WiFi.mode(WIFI_STA);

             ^

Multiple libraries were found for "WiFi.h"
 Used: d:\Program Files (x86)\Arduino1.88\libraries\WiFi
 Not used: C:\Users\User\Documents\Arduino-new\hardware\espressif\arduino-esp32\libraries\WiFi
exit status 1
no matching function for call to 'WiFiClass::macAddress()'

Invalid library found in C:\Users\User\Documents\Arduino-new\hardware\espressif\arduino-esp32\libraries\AzureIoT: C:\Users\User\Documents\Arduino-new\hardware\espressif\arduino-esp32\libraries\AzureIoT
Invalid library found in C:\Users\User\Documents\Arduino-new\hardware\espressif\arduino-esp32\libraries\BLE: C:\Users\User\Documents\Arduino-new\hardware\espressif\arduino-esp32\libraries\BLE
Invalid library found in C:\Users\User\Documents\Arduino-new\libraries\old: C:\Users\User\Documents\Arduino-new\libraries\old

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Further help is much appreciated. Thank you.


#6

Try to remove this folder :
d:\Program Files (x86)\Arduino1.88\libraries\WiFi

It seems to be taken instead of esp32 one


#7

Thank you for your time in helping with this. I see how you diagnosed the problem now. I’m very clumsy/ignorant when it comes to the Arduino environment set up but I am learning. The program compiled fine once I made the change you suggested. Thanks again.


#8

With pleasure, I will add your case in the troubleshooting section of the wiki


#9

Hi,

I am getting the following error:

C:\Work\Software\arduino-1.8.5_ESP32\portable\sketchbook\OpenMQTTGateway\ZgatewayBT.ino:40:27: fatal error: BLEDevice.h: No such file or directory

Of course, the file BLEDevice.h do exist under:

C:\Work\Software\arduino-1.8.5_ESP32\portable\sketchbook\OpenMQTTGateway\lib\ESP32_BLE_Arduino\src

Any idea?


#10

Yes, did you put the esp32 ble lib from Openmqttgateway/lib/esp32_ble_arduino into your /libraries ?


#11

Thanks for the tip.
I can compile it now