ESP32 Compilation error

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!

Hello,

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

Master. Should I not be.

Yes you should take the v0.8

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.

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

It seems to be taken instead of esp32 one

1 Like

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.

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

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?

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

1 Like

Thanks for the tip.
I can compile it now

I am also facing issue while compiling the program. it shows the following-

WARNING: library ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display claims to run on (esp8266, esp32) architecture(s) and may be incompatible with your current board which runs on (avr) architecture(s).
In file included from C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306.h:33:0,

             from C:\Users\em11666\Documents\Arduino\lora.h\lora.h.ino:4:

C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306Wire.h: In member function ‘virtual bool SSD1306Wire::connect()’:

C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306Wire.h:54:40: error: no matching function for call to ‘TwoWire::begin(uint8_t&, uint8_t&)’

   Wire.begin(this->_sda, this->_scl);

                                    ^

In file included from C:\Users\em11666\Documents\Arduino\lora.h\lora.h.ino:3:0:

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:52:10: note: candidate: void TwoWire::begin()

 void begin();

      ^

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:52:10: note: candidate expects 0 arguments, 2 provided

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:53:10: note: candidate: void TwoWire::begin(uint8_t)

 void begin(uint8_t);

      ^

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:53:10: note: candidate expects 1 argument, 2 provided

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:54:10: note: candidate: void TwoWire::begin(int)

 void begin(int);

      ^

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:54:10: note: candidate expects 1 argument, 2 provided

In file included from C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306.h:33:0,

             from C:\Users\em11666\Documents\Arduino\lora.h\lora.h.ino:4:

C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306Wire.h: In member function ‘virtual void SSD1306Wire::display()’:

C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306Wire.h:78:43: error: ‘_min’ was not declared in this scope

          minBoundY = _min(minBoundY, y);

                                       ^

C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306Wire.h:79:43: error: ‘_max’ was not declared in this scope

          maxBoundY = _max(maxBoundY, y);

                                       ^

C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306Wire.h: In member function ‘void SSD1306Wire::initI2cIfNeccesary()’:

C:\Users\em11666\Documents\Arduino\libraries\ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display\src/SSD1306Wire.h:167:42: error: no matching function for call to ‘TwoWire::begin(uint8_t&, uint8_t&)’

     Wire.begin(this->_sda, this->_scl);

                                      ^

In file included from C:\Users\em11666\Documents\Arduino\lora.h\lora.h.ino:3:0:

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:52:10: note: candidate: void TwoWire::begin()

 void begin();

      ^

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:52:10: note: candidate expects 0 arguments, 2 provided

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:53:10: note: candidate: void TwoWire::begin(uint8_t)

 void begin(uint8_t);

      ^

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:53:10: note: candidate expects 1 argument, 2 provided

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:54:10: note: candidate: void TwoWire::begin(int)

 void begin(int);

      ^

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:54:10: note: candidate expects 1 argument, 2 provided

C:\Users\em11666\Documents\Arduino\lora.h\lora.h.ino: In function ‘void setup()’:

lora.h:71:29: error: no matching function for call to ‘SPIClass::begin(int, int, int, int)’

SPI.begin(SCK,MISO,MOSI,SS);

                         ^

In file included from C:\Users\em11666\Documents\Arduino\lora.h\lora.h.ino:1:0:

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:159:15: note: candidate: static void SPIClass::begin()

static void begin();

           ^

C:\Users\em11666\Desktop\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:159:15: note: candidate expects 0 arguments, 4 provided

lora.h:73:19: error: ‘RST’ was not declared in this scope

LoRa.setPins(SS,RST,DI00);

               ^

lora.h:73:23: error: ‘DI00’ was not declared in this scope

LoRa.setPins(SS,RST,DI00);

                   ^

C:\Users\em11666\Documents\Arduino\lora.h\lora.h.ino: At global scope:

lora.h:86:1: error: expected unqualified-id before ‘<’ token

void loop()
{

^

exit status 1
no matching function for call to ‘SPIClass::begin(int, int, int, int)’

Please help me in this, i am new to arduino

regards

Amrit

Hello,

Did you took the libraries included in lib folder ?
Indeed at each commit compilation is checked for each board automaticaly with Jenkins. Currently there is not compilation issue detected.
It may be related to your installation environment.

May I advise you to format properly your log extract. Currently it is difficult to read.

Hello, uint8_t mac_addr[6];
WiFi.BSSID(i, mac_addr); ,
I am getting the error no matching function for call to ‘WiFiClass::BSSID(int&, uint8_t [6])’
, can u help me resolving this, Thankyou

If you are using arduino IDE I suggest that you switch to platformIO, it will be easier to build