[ESP32] 포트 인식 안되는 문제 해결 / 아두이노 IDE 환경 셋팅 / LED 깜박이는 예제 실행
1. 문제 상황
ESP32보드에 USB케이블로 노트북과 연결했는데
장치관리자에서 포트번호가 나오지 않았다.
해당 장치를 더블클릭하면 아래처럼 속성 창이 뜬다.
드라이버 업데이트를 클릭해서 시도해보았지만, 드라이버가 없어서 해결되지 않았다.
2. 해결 방법
https://www.arduino.cc/en/software
Software
Open-source electronic prototyping platform enabling users to create interactive electronic objects.
www.arduino.cc
아두이노 IDE를 설치하니 자동으로 드라이버가 설치되어서 문제가 해결되었다.
만약 아두이노 IDE가 이미 있거나 설치해도 해결되지 않는 경우,
아래 링크에서 직접 디바이스 드라이버를 설치할 수 있다.
https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers
CP210x USB to UART Bridge VCP Drivers - Silicon Labs
The CP210x USB to UART Bridge Virtual COM Port (VCP) drivers are required for device operation as a Virtual COM Port to facilitate host communication with CP210x products. These devices can also interface to a host using the direct access driver.
www.silabs.com
3. 아두이노 IDE에서 환경 세팅
툴 - 보드 - 보드 매니저에서 esp32를 검색하여 설치하는데, 아래처럼 아무것도 나오지 않는다.
https://github.com/espressif/arduino-esp32
espressif/arduino-esp32
Arduino core for the ESP32. Contribute to espressif/arduino-esp32 development by creating an account on GitHub.
github.com
깃허브 링크에서 Using Arduino IDE Boards Manager (preferred)
- Instructions for Boards Manager 에 들어간다.
아래 •Stable release link: 를 복사한다.
21.05.17 기준 링크주소이다.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
파일 - 환경 설정 에 들어간다.
추가적인 보드 매니저 URLs에 위에서 복사한 링크를 입력하고 확인 버튼 클릭.
다시 툴 - 보드 - 보드 매니저에서 esp32검색하여 설치한다.
툴 - 보드, 포트번호를 선택하면 환경 셋팅이 완료된다.
포트번호를 모르는 경우, 장치관리자에서 확인할 수 있다.
4. 소스코드 컴파일 및 업로드
예제 소스코드를 작성하고 컴파일 및 실행한다.
나는 소스코드를 아래와 같이 작성하였고
void setup() {
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
왼쪽 버튼이 컴파일, 오른쪽 버튼이 업로드 버튼이다.
5. 결과 영상
아래와 같이 잘 실행되었다.