Great project, so I wanted to try and implement instantaneously. However….
Tried to implement the DHT11 webserver on the ESP32.
In the sketch is listed:
// Import required libraries #include "WiFi.h" #include "ESPAsyncWebServer.h" #include <Adafruit_Sensor.h> #include <DHT.h> however in the explanation is listed: #include "WiFi.h" #include "ESPAsyncWebServer.h" #include <ESPAsyncTCP.h> //This one is missing in the sketch #include <Adafruit_Sensor.h> #include <DHT.h> Also " Installing the Async TCP Library for ESP32" refers to AsyncTCP library, which in not included in the include section, but in the explanation ESPAsyncTCP is referred to. Compiling the sketch I get an endless list of errors, just listing one: Arduino: 1.8.7 (Windows 10), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None" D:\Arduino\sketches\libraries\AsyncTCP\src\AsyncTCP.cpp:259:32: error: field 'call' has incomplete type 'tcpip_api_call_data' struct tcpip_api_call_data call; When I include the ESPAsyncTCP library instead of the AsyncTCP I get the next error listed: D:\Arduino\sketches\libraries\ESPAsyncTCP\src\ESPAsyncTCPbuffer.cpp:27:19: fatal error: debug.h: No such file or directory
Question: Any suggestions for resolving the problem?
best regards,
Hans Sodaar
Hello Hans! Thanks for posting your question here, I appreciate it.
1. First, are you using an ESP32, right? Just to double-check.
2. You don’t need to include the library:
#include <ESPAsyncTCP.h> //This one is missing in the sketch
Please use the exact code that I provide.
You need AsyncTCP installed, but you don’t need to include it in the main code (the ESPAsyncWebServer takes care of including it).
The ESPAsyncTCP is for the ESP8266 board, so don’t use it.
3. Are you using the latest ESP32 board add-on? Are you using the latest libraries?
Thanks!