DHT sensor library cannot get the temperature when add espidf framework

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
zzzz0317
 
Posts: 1
Joined: Sat May 20, 2023 8:48 am

DHT sensor library cannot get the temperature when add espidf framework

Post by zzzz0317 »

I tried to integrate and compile using the official example DHT_Unified_Sensor, but found that the difference in configuring the framework in platformio.ini would affect the effect.

When the framework is specified includes espidf, the project that compiles successfully cannot get the temperature and humidity values.

Code: Select all

[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino, espidf
monitor_speed = 115200
monitor_raw = yes
lib_deps = 
  adafruit/Adafruit Unified Sensor@^1.1.9
  adafruit/DHT sensor library@^1.4.4
When the framework only retains arduino, there is no problem with the compilation result, and the temperature can be obtained normally.

Code: Select all

[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
monitor_speed = 115200
monitor_raw = yes
lib_deps = 
  adafruit/Adafruit Unified Sensor@^1.1.9
  adafruit/DHT sensor library@^1.4.4
Attachment is the minimal code used for testing, for troubleshooting purposes. grateful.

- Arduino board: ESP32-WROVER-E

- Arduino IDE version:
PlatformIO Core 6.1.7
PlatformIO Home 3.4.4
Attachments
test_dht11.zip
(14.21 KiB) Downloaded 3 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”