Couldn’t be any easier - once you know it. Thanks again!
Now, while this hurdle was taken, it stopped me at compiling with a bug somewhere. I just don’t know where to look.
I shrunk my sketch down to the minimum. This runs well when started on Arduino-IDE, but does not compile on Eclipse/Sloeber. This is the simplified code:
// simple Webservertest
#include <Arduino.h>
#include "WiFi.h"
#include "WebServer.h"
/* SSID & Password */
const char* ssid = " YourNetworkName"; // Enter SSID here
const char* password = " YourPassword"; //Enter Password here
WebServer server(80);
void setup() {
Serial.begin(115200);
Serial.println("");
// Double WiFi.begin and delay is workaround for bug reported here:
// https://www.esp32.com/viewtopic.php?f=19&t=12720&sid=3ed49d3cf2cbb7e1549d760f83444359
WiFi.begin(ssid, password); //Connect to the WiFi network
delay(200);
WiFi.begin(ssid, password);
while (WiFi.status() != 3) { //Wait for connection; WL_CONNECTED==3
Serial.println("Waiting for WiFi connection…");
delay(500);
}
Serial.print("IP address: ");
Serial.println(WiFi.localIP()); // local IP
server.on("/", []() {
server.send(200, "text / plain", "Greetings from root dir");});
server.on("/test", []() {
server.send(200, "text / plain", "Plain text on test"); });
server.begin(); //Start the server
Serial.println("Server listening");
}
void loop() {
server.handleClient(); //Handling of incoming requests
}
The double WiFi.begin and delay are needed to cope with a bug described here: No WiFi connection after upload - odd workaround needed - ESP32 Forum but as it is coded it runs well (only on Arduino-IDE.)
However, compiling on sloeber gives this message:
Starting C++ compile
...
In file included from /home/ullix/sloeber/arduinoPlugin/packages/esp32/hardware/esp32/1.0.4/libraries/WebServer/src/WebServer.cpp:32:0:
/home/ullix/sloeber//arduinoPlugin/packages/esp32/hardware/esp32/1.0.4/tools/sdk/include/mbedtls/mbedtls/md5.h:34:10: error: #include expects "FILENAME" or <FILENAME>
#include MBEDTLS_CONFIG_FILE
^
make: *** [libraries/WebServer/src/WebServer.cpp.o] Fehler 1
libraries/WebServer/src/subdir.mk:28: die Regel für Ziel „libraries/WebServer/src/WebServer.cpp.o“ scheiterte
The md5.h file has this content:
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
Where do I have to look?