ESP32_basic

MINUEX·2026년 3월 20일

목표

  1. ESP32 + DHT22를 ESP-IDF 환경에서 연결해서 온습도 값을 Serial 로그로 출력
  2. OLED에 온습도 값 출력
  3. 특정 온도 이상 시 LED 점등

문제 1. idf.py not found

zsh: command not found: idf.py

source ~/esp/esp-idf/export.sh

문제 2. DHT 설치 시 의존성 문제

fatal error: dht.h: No such file or directory

아래처럼 CMakeLists.txt에 REQUIRES dht 추가


문제 3. esp_idf_lib_helpers 없음

component 'esp_idf_lib_helpers' could not be found

esp-idf-lib의 dht는 다른 컴포넌트에 의존함

cd /Users/minseokim/Documents/ESP32/led
rm -rf components/dht
idf.py add-dependency "esp-idf-lib/dht^1.2.0"

-> ESP-IDF Component Manager 사용
https://components.espressif.com/components/esp-idf-lib/dht/versions/1.2.0/readme


문제 5. 제품 명칭 문제

DHT_TYPE_AM2301로 통일


문제 6. 계속 read failed

Initialization error, problem in phase 'B'
→ phase 'C'

브레드보드 접촉 불량 or 점퍼선 문제로 보임.
ESP32와 암-암으로 직접 연결 시 해당 문제 해결되었음.

ESP32DHT22
3.3V+
GPIO4OUT
GND-

문제 7. OLED 라이브러리 설치

idf.py add-dependency "espressif/ssd1306"

결과

0개의 댓글