• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 DHT webserver

Q&A Forum › Category: ESP32 › ESP32 DHT webserver
0 Vote Up Vote Down
Hans Sodaar asked 6 years ago

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

Question Tags: mismatch #includes and compiling error
3 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

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!

0 Vote Up Vote Down
Hans Sodaar answered 6 years ago

Updated the libraries and evrything works fine. Thanks for the response.

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

I’m glad it worked! Thanks for letting me know,
Rui

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.