I can not add the DHT (Adafruit) Lib to Wemos D1 8266 Plattform

I try to use the DHT Lib from Ada, but I always get an Error 1…

Here the log:

>Processing d1 (platform: espressif8266; board: d1; framework: arduino)
----------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: ht t p s : / / d o c s . p l a t f o r m i o . o r g /page/boards/espressif8266/d1.html
PLATFORM: Espressif 8266 (3.2.0) > WEMOS D1 R1
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.30002.0 (3.0.2)
 - tool-esptool 1.413.0 (4.13)
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa 2.100300.210717 (10.3.0)
LDF: Library Dependency Finder -> h t t p s : / / b i t . l y / c o n f i g u r e - p i o -ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Library Manager: Installing DHT sensor library

Unpacking  [------------------------------------]    0%
Unpacking  [##----------------------------------]    6%
Unpacking  [####--------------------------------]   12%
Unpacking  [######------------------------------]   18%
Unpacking  [#########---------------------------]   25%
Unpacking  [###########-------------------------]   31%
Unpacking  [#############-----------------------]   37%
Unpacking  [###############---------------------]   43%
Unpacking  [##################------------------]   50%
Unpacking  [####################----------------]   56%
Unpacking  [######################--------------]   62%
Unpacking  [########################------------]   68%
Unpacking  [###########################---------]   75%
Unpacking  [#############################-------]   81%
Unpacking  [###############################-----]   87%
Unpacking  [#################################---]   93%
Unpacking  [####################################]  100%
Library Manager: DHT sensor library @ 1.4.3 has been installed!
Library Manager: Installing dependencies...
Library Manager: Installing Adafruit Unified Sensor

Unpacking  [------------------------------------]    0%
Unpacking  [##----------------------------------]    7%
Unpacking  [#####-------------------------------]   15%
Unpacking  [########----------------------------]   23%
Unpacking  [###########-------------------------]   30%
Unpacking  [#############-----------------------]   38%
Unpacking  [################--------------------]   46%
Unpacking  [###################-----------------]   53%
Unpacking  [######################--------------]   61%
Unpacking  [########################------------]   69%
Unpacking  [###########################---------]   76%
Unpacking  [##############################------]   84%
Unpacking  [#################################---]   92%
Unpacking  [####################################]  100%
Library Manager: Adafruit Unified Sensor @ 1.1.4 has been installed!
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <DHT sensor library> 1.4.3
Building in release mode
Compiling .pio\build\d1\src\main.cpp.o
Generating LD script .pio\build\d1\ld\local.eagle.app.v6.common.ld
Compiling .pio\build\d1\lib4bb\DHT sensor library\DHT.cpp.o
Compiling .pio\build\d1\lib4bb\DHT sensor library\DHT_U.cpp.o
Archiving .pio\build\d1\libFrameworkArduinoVariant.a
Compiling .pio\build\d1\FrameworkArduino\Crypto.cpp.o
In file included from .pio\libdeps\d1\DHT sensor library\DHT_U.cpp:15:
.pio\libdeps\d1\DHT sensor library\DHT_U.h:36:10: fatal error: Adafruit_Sensor.h: No such file or directory

*************************************************************************
* Looking for Adafruit_Sensor.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Adafruit_Sensor.h"
* Web  > h t t p s : / / p l a t f o r m i o . o r g / l i b / s e a r c h ? q u e r y = h e a d e r : Adafruit_Sensor.h
*
*************************************************************************

   36 | #include <Adafruit_Sensor.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio\build\d1\FrameworkArduino\Esp-frag.cpp.o
Compiling .pio\build\d1\FrameworkArduino\Esp-version.cpp.o
Compiling .pio\build\d1\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\d1\FrameworkArduino\FS.cpp.o
Compiling .pio\build\d1\FrameworkArduino\FSnoop.cpp.o
Compiling .pio\build\d1\FrameworkArduino\FunctionalInterrupt.cpp.o
*** [.pio\build\d1\lib4bb\DHT sensor library\DHT_U.cpp.o] Error 1
============================== [FAILED] Took 4.51 seconds ==============================Der Terminalprozess "C:\Users\drhel\.platformio\penv\Scripts\platformio.exe 'run'" wurde mit folgendem Exitcode beendet: 1.

Do anyone have a solution for this issue, coz I can’t find any in the web…

THX

TecDoc

This shows up with PlatformIO Registry. So try adding that library? In the project’s platformio.ini file, you should have both libraries:

lib_deps =
     adafruit/DHT sensor library @ ^1.4.3
     adafruit/Adafruit Unified Sensor @ ^1.1.4

and also make sure that you main sketch file at elast includes DHT.h so that the library dependency finder is triggered to search for all its dependencies.

1 Like

pio lib install 31 && pio lib install 18