ESP32-DevKitC-VIE: which board in Arduino IDE?

Hi

Iwhich board have I to select for the ESP32-DevKitC-VIE? I choosed "ESP32 WRovwe (all versions). But when I want to compile an example from the library "MySql_MariaDB_Generic", I can not compile it. In this code they use

#if ! (ESP8266 || ESP32 )

  #error This code is intended to run on the ESP8266/ESP32 platform! Please check your Tools->Board setting

#endif

And it doesn't have set ESP32. Is this the wrong board or where can I get the correct one?

Thanks, Peter

You can choose simply esp32 dev module.

Unfortunately same message, Variable ESP32 is not set.

Are you sure that you chose "ESP32 Dev Module" and not one of the multitude of other boards with ESP32 in their name ?

Please post the full error message, using code tags when you do

Your board selection looks like this?
image

I do not have one but looking on line I found this information:
Tools → Board → ESP32 Arduino → ESP32 Dev Module

This is the generic board definition for the ESP32-WROOM-32-based DevKitC boards and is the one Espressif recommends for standard DevKitC variants.

I would start with these settings:

Board: ESP32 Dev Module
Upload Speed: 921600 (or 460800 if you have upload problems)
CPU Frequency: 240 MHz
Flash Frequency: 80 MHz
Flash Mode: QIO
Flash Size: 4 MB (32 Mb)
Partition Scheme: Default 4 MB with SPIFFS
PSRAM: Disabled (unless your module specifically has PSRAM)

One thing I'd like you to check: What is printed on the metal RF shield?

For example:

ESP32-WROOM-32
ESP32-WROOM-32E
ESP32-WROOM-32UE (external antenna)
ESP32-WROVER-E (includes PSRAM)

The last letter(s) determine whether there are any special settings, particularly for PSRAM and the antenna.

Hopefully this helps, I do not have the hardware to test it. Also which IDE are you using? Are any of the pins connected to anything?

Yes:

On the metal shield its ESP32-WROVERE.

Try an older version of the ESP32 platform. I looked at the platform.txt of version 2.0.2 and it contains -DESP32. Version 3.3.11 contains -DESP32=ESP32.
A reasonable safe bet is version 2.0.17.

In the Arduino IDE I can not work with platform-file, can I?

It is not possible to edit platform configuration files using Arduino IDE. If you do want to edit a platform configuration file, you should use a programmer grade general purpose text editor.

Some good options are VS Code or **Notepad++, but there are plenty of other excellent free open source editors.

Arduino IDE loads the platform configuration file on startup, and so won't automatically reflect changes you make while Arduino IDE is running. So if you do edit the platform configuration files, make sure to either restart Arduino IDE, or else select Tools > Reload Board Data from the Arduino IDE menus.

#if ! (ESP8266 || ESP32 )

That won't work because as the error says there is no variable named ESP32.

I would just delete that #if

The problem is, that this variable is used in the library "MySQL_MariaDB_Generic" and not only in the example. But I Think I have found a possibility not to use this library.

Sounds like valid option. Library that has been obsolete for 4 years is rarely best choice.

I did not suggest to modify the platform.txt; it might open an other can of worms :wink:

Yeah, if you are going to modify files to fix the problem, it would be better to edit the library source code as suggested in post #12.

As knin mentioned the library is 4 years old and I have found another library (ESP32_MySQL) that solves my problem.

Thanks everybody for your suggestions.