Hello Rui,
Thank you for the good course for the ESP32/IDE which I am now following.
However I am facing an issue when trying to run the Sketch for DHT11 Temperature & Humidity sensor which is the following;
Arduino: 1.8.8 (Windows 10), Board: “NodeMCU-32S, 80MHz, 921600”
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Thomas\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Thomas\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Thomas\Documents\Arduino\hardware\espressif\esp32\libraries\libraries -fqbn=esp32:esp32:nodemcu-32s:FlashFreq=80,UploadSpeed=921600 -ide-version=10808 -build-path C:\Users\Thomas\AppData\Local\Temp\arduino_build_258073 -warnings=none -build-cache C:\Users\Thomas\AppData\Local\Temp\arduino_cache_485764 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.esptool_py.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.0 -prefs=runtime.tools.esptool_py-2.6.0.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.0 -prefs=runtime.tools.mkspiffs.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -verbose C:\Users\Thomas\Documents\Arduino\hardware\espressif\esp32\libraries\DHT11_Temperature_Humidity_sensor\DHT11_Temperature_Humidity_sensor.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Thomas\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Thomas\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Thomas\Documents\Arduino\hardware\espressif\esp32\libraries\libraries -fqbn=esp32:esp32:nodemcu-32s:FlashFreq=80,UploadSpeed=921600 -ide-version=10808 -build-path C:\Users\Thomas\AppData\Local\Temp\arduino_build_258073 -warnings=none -build-cache C:\Users\Thomas\AppData\Local\Temp\arduino_cache_485764 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.esptool_py.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.0 -prefs=runtime.tools.esptool_py-2.6.0.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.0 -prefs=runtime.tools.mkspiffs.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\tools\mkspiffs\0.2.3 -verbose C:\Users\Thomas\Documents\Arduino\hardware\espressif\esp32\libraries\DHT11_Temperature_Humidity_sensor\DHT11_Temperature_Humidity_sensor.ino
Using board ‘nodemcu-32s’ from platform in folder: C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1
Using core ‘esp32’ from platform in folder: C:\Users\Thomas\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1
Detecting libraries used…
“C:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-80-g6c4433a-5.2.0/bin/xtensa-esp32-elf-g++” -DESP_PLATFORM “-DMBEDTLS_CONFIG_FILE=\”mbedtls/esp_config.h\”” -DHAVE_CONFIG_H “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/config” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/app_trace” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/app_update” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/asio” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/bootloader_support” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/bt” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/coap” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/console” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/driver” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp-tls” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp32” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp_adc_cal” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp_event” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp_http_client” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp_http_server” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp_https_ota” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp_https_server” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp_ringbuf” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/ethernet” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/expat” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/fatfs” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/freemodbus” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/freertos” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/heap” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/idf_test” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/jsmn” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/json” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/libsodium” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/log” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/lwip” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/mbedtls” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/mdns” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/micro-ecc” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/mqtt” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/newlib” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/nghttp” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/nvs_flash” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/openssl” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/protobuf-c” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/protocomm” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/pthread” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/sdmmc” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/smartconfig_ack” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/soc” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/spi_flash” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/spiffs” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/tcp_transport” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/tcpip_adapter” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/ulp” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/unity” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/vfs” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/wear_levelling” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/wifi_provisioning” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/wpa_supplicant” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/xtensa-debug-module” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp32-camera” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/esp-face” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1/tools/sdk/include/fb_gfx” -std=gnu++11 -fno-exceptions -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10808 -DARDUINO_NodeMCU_32S -DARDUINO_ARCH_ESP32 “-DARDUINO_BOARD=\”NodeMCU_32S\”” “-DARDUINO_VARIANT=\”nodemcu-32s\”” -DESP32 -DCORE_DEBUG_LEVEL=0 “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1\\cores\\esp32” “-IC:\\Users\\Thomas\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\1.0.1\\variants\\nodemcu-32s” “C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_258073\\sketch\\DHT11_Temperature_Humidity_sensor.ino.cpp” -o nul
DHT11_Temperature_Humidity_sensor:2:22: error: esp32DHT.h: No such file or directory
compilation terminated.
exit status 1
esp32DHT.h: No such file or directory
I have followed your instructions regarding download DHT Sensor library; https://randomnerdtutorials.com/esp32-dht11-dht22-temperature-humidity-web-server-arduino-ide/
The Sketch I am trying to run is the same as you have on the above link, however I keep on getting the same error.
When saving the Sketch for the DHT11 it was not saved in the DHT folder which I don’t really understand.
Hope you can help in understanding where I go wrong and thank for the good course.
Cheers,
Thomas
Hello Thomas, It looks like the DHT library is missing in your installation like you’ve said. Please follow these instructions:
- Open your Arduino IDE
- Go to Sketch > Include Libraries > Manage Libraries
- Search for “DHT sensor”
- You should find this result: “DHT sensor library by Adafruit”
- Install the latest version (at the moment 1.3.2)
Try to re-upload that code. Does it work now? Thanks for your patience!
Hello Rui,
Thanks for the feed back and instructions.
I installed the DHT sensor library by Adafruit v. 1.3.2 and are still getting this message;
DHT11_Temperature_Humidity_sensor:2:22: error: esp32DHT.h: No such file or directory
compilation terminated.
exit status 1
esp32DHT.h: No such file or directory
I wonder if the issue is that the Sketch is saved in the wrong place?
Right the path is the following; PC > C > Users > Thomas > Documents > Arduino > hardware > espressif > esp32 > libraries
The DHT11_Temperature_Humidity_sensor sketch is saved in it own folder under libraries.
I have tried to run the sketch according to your tutorial https://randomnerdtutorials.com/complete-guide-for-dht11dht22-humidity-and-temperature-sensor-with-arduino/
Sorry these simple questions however I am a newbie to coding and these things.
Cheers,
Thomas
Hello Thomas, I’ve never seen that error before… You should be able to save your sketch anywhere in your computer and the Arduino IDE takes care of finding the libraries and compile them.
However, you shouldn’t save your files in that folder. That folder is used to store the examples from the libraries, so it should remain unmodified. I recommend saving your sketches in your Desktop or in your Documents folder…
Which exact code are you trying to upload to your ESP32? Can you post it here (please remove the SSID and password)?
Hello Rui,
Thank you for your patience and understanding.
I have set up a new Libraries under hardware where new Sketches are being saved to, hope that is correct.
Under Preferences the Sketchbook location is the following; C:\Users\Thomas\Documents\Arduino\hardware\espressif\esp32\libraries
Is that right or should this location also point to the folder where own sketches are being saved?
The sketch used is from this URL; https://randomnerdtutorials.com/esp32-dht11-dht22-temperature-humidity-web-server-arduino-ide/
/*
* Rui Santos
* Complete Project Details http://randomnerdtutorials.com
*/
//#include <WiFi.h>
#include “DHT.h”
// Uncomment one of the lines below for whatever DHT sensor type you’re using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
//#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
// Replace with your network credentials
//const char* ssid = “YOUR_SSID”;
//const char* password = “YOUR_PASSWORD”;
//WiFiServer server(80);
// DHT Sensor
const int DHTPin = 32;
// Initialize DHT sensor.
DHT dht(DHTPin, DHTTYPE);
// Temporary variables
static char celsiusTemp[7];
static char fahrenheitTemp[7];
static char humidityTemp[7];
// Client variables
char linebuf[80];
int charcount=0;
void setup() {
// initialize the DHT sensor
dht.begin();
//Initialize serial and wait for port to open:
Serial.begin(115200);
while(!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// We start by connecting to a WiFi network
//Serial.println();
//Serial.println();
//Serial.print(“Connecting to “);
//Serial.println(ssid);
//WiFi.begin(ssid, password);
// attempt to connect to Wifi network:
//while(WiFi.status() != WL_CONNECTED) {
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
delay(500);
//Serial.print(“.”);
}
//Serial.println(“”);
//Serial.println(“WiFi connected”);
//Serial.println(“IP address: “);
// Serial.println(WiFi.localIP());
//server.begin();
}
void loop() {
// listen for incoming clients
//WiFiClient client = server.available();
if (client) {
//Serial.println(“New client”);
// memset(linebuf,0,sizeof(linebuf));
// charcount=0;
// an http request ends with a blank line
boolean currentLineIsBlank = true;
//while (client.connected()) {
//if (client.available()) {
//char c = client.read();
//Serial.write(c);
//read char by char HTTP request
linebuf[charcount]=c;
if (charcount<sizeof(linebuf)-1) charcount++;
// if you’ve gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so you can send a reply
if (c == ‘\n’ && currentLineIsBlank) {
// Sensor readings may also be up to 2 seconds ‘old’ (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println(“Failed to read from DHT sensor!”);
strcpy(celsiusTemp,”Failed”);
strcpy(fahrenheitTemp, “Failed”);
strcpy(humidityTemp, “Failed”);
}
else{
// Computes temperature values in Celsius + Fahrenheit and Humidity
float hic = dht.computeHeatIndex(t, h, false);
dtostrf(hic, 6, 2, celsiusTemp);
float hif = dht.computeHeatIndex(f, h);
dtostrf(hif, 6, 2, fahrenheitTemp);
dtostrf(h, 6, 2, humidityTemp);
// You can delete the following Serial.print’s, it’s just for debugging purposes
/*Serial.print(“Humidity: “);
Serial.print(h);
Serial.print(” %\t Temperature: “);
Serial.print(t);
Serial.print(” *C “);
Serial.print(f);
Serial.print(” *F\t Heat index: “);
Serial.print(hic);
Serial.print(” *C “);
Serial.print(hif);
Serial.print(” *F”);
Serial.print(“Humidity: “);
Serial.print(h);
Serial.print(” %\t Temperature: “);
Serial.print(t);
Serial.print(” *C “);
Serial.print(f);
Serial.print(” *F\t Heat index: “);
Serial.print(hic);
Serial.print(” *C “);
Serial.print(hif);
Serial.println(” *F”);*/
}
// send a standard http response header
//client.println(“HTTP/1.1 200 OK”);
//client.println(“Content-Type: text/html”);
//client.println(“Connection: close”); // the connection will be closed after completion of the response
//client.println();
//client.println(“<!DOCTYPE HTML><html><head><meta name=\”viewport\” content=\”width=device-width, initial-scale=1\”>”);
//client.println(“<meta http-equiv=\”refresh\” content=\”30\”></head>”);
//client.println(“<body><div style=\”font-size: 3.5rem;\”><p>ESP32 – DHT</p><p>”);
//if(atoi(celsiusTemp)>=25){
//client.println(“<div style=\”color: #930000;\”>”);
}
else if(atoi(celsiusTemp)<25 && atoi(celsiusTemp)>=5){
client.println(“<div style=\”color: #006601;\”>”);
}
else if(atoi(celsiusTemp)<5){
client.println(“<div style=\”color: #009191;\”>”);
}
client.println(celsiusTemp);
client.println(“*C</p><p>”);
client.println(fahrenheitTemp);
client.println(“*F</p></div><p>”);
client.println(humidityTemp);
client.println(“%</p></div>”);
client.println(“</body></html>”);
break;
}
if (c == ‘\n’) {
// you’re starting a new line
currentLineIsBlank = true;
memset(linebuf,0,sizeof(linebuf));
charcount=0;
} else if (c != ‘\r’) {
// you’ve gotten a character on the current line
currentLineIsBlank = false;
}
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
Serial.println(“client disconnected”);
}
}
I have tried to take everything related to WIFI out by addng // in front.
When Verify/compile the following Error comes;
In file included from C:\Users\Thomas\Documents\Arduino\hardware\espressif\esp32\libraries\libraries\DHT_sensor_library\DHT_U.cpp:22:0:
C:\Users\Thomas\Documents\Arduino\hardware\espressif\esp32\libraries\libraries\DHT_sensor_library\DHT_U.h:25:29: fatal error: Adafruit_Sensor.h: No such file or directory
compilation terminated.
Using library DHT_sensor_library at version 1.3.2 in folder: C:\Users\Thomas\Documents\Arduino\hardware\espressif\esp32\libraries\libraries\DHT_sensor_library
exit status 1
Error compiling for board ThaiEasyElec’s ESPino32.
Cheers,
Thomas
Hello Thomas, I apologize for the trouble compiling that sketch. It looks like there’s another library missing.
You also need to install the Adafruit_Sensor library. Follow the next steps to install the library in your Arduino IDE:
- Click here to download the Adafruit_Sensor library. You should have a .zip folder in your Downloads folder
- Unzip the .zip folder and you should get Adafruit_Sensor-master folder
- Rename your folder from Adafruit_Sensor-master to Adafruit_Sensor
- Move the Adafruit_Sensor folder to your Arduino IDE installation libraries folder
- Finally, re-open your Arduino IDE
Can you try to compile now? Does it work?
Hello Rui,
Thank you for your advixe.
The reason for not being able to run the sketch from Adafruit was as I expected the library for DHT sensors and Adafruit was located in the wrong folder.
When installing they go into the library under hardware, from where they have to be move to a folder outside hardware.
I did that and it is now working.
Thanks for your support, good courses and tutorials, please keep it up.
Cheers,
Thoams
You’re welcome Thomas! I’m glad you made it work! I’ll mark this thread as “resolved”, feel free to post more questions here: https://rntlab.com/ask-question/