After adding the ‘DHT sensor’ library through the PIO Library registry and confirming in terminal logs as well as in project explorer that it, and its dependencies were installed, I receive a No such file or directory
error for a dependency from DHT sensor to Adafruit Unified Sensor.
I assume I’m missing something obvious, but I cannot find any posts about an issue matching this.
Afaik for Adafruit Sensor libraries you also need
Yes, correct. PIO Library manager did install that, and as you can see from project installer it is there, however when compiling DHT sensor, it cannot locate that dependant library.
Looks like the libraries in the registry are outdated.
Try
lib_deps =
https://github.com/adafruit/Adafruit_Sensor @ ^1.1.15
https://github.com/adafruit/DHT-sensor-library @ ^1.4.6
and the DHTtester-Example will compile without issues.
This did work, thank you for the help.
I’m just curious though, is the PIO Library Registry tool not meant to handle dependencies for me, rather than me having to explicitly list them all in the ini file?
This is the responsibility of the library.
If the library provides a libary.json
and lists its dependencies there, PlatformIO will automatically install the dependent libraries.
Unfortunately, the Adafruit libraries do not provide library.json
files.
See library.json — PlatformIO latest documentation
and dependencies — PlatformIO latest documentation
Take the ESPAsyncWebServer as an example which lists all its dependencies, even for different platforms (espressif32 / espressif8266): me-no-dev/ESPAsyncWebServer/library.json
1 Like
In a perfect universe. If you want to be sure to have a reproducible build environment pin the libs to the exact version. Everything else is lottery game…