Dependancies
Buy the components
blinky-esphome-esp32c3.yaml
esphome:
name: blinky
platformio_options:
board_build.flash_mode: dio
esp32:
board: esp32-c3-devkitm-1
variant: ESP32C3
framework:
type: esp-idf
logger:
level: VERBOSE
baud_rate: 115200
deassert_rts_dtr: true
switch:
- platform: gpio
pin:
number: 3 # on-board LED GPIO8 does not work, so GPIO3 is used
mode: output
id: led
interval:
- interval: 2s
then:
- switch.toggle: led
- logger.log: "LED toggling"
YAML_FILE=blinky-esphome-esp32c3.yaml
PORT?=/dev/cu.usbserial-*
.PHONY: default compile upload log clean
default: clean compile upload log
help: ## Show help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
compile: ## Compile esphome
esphome compile $(YAML_FILE)
upload: ## Upload the firmware to the board
esphome upload --device $(PORT) $(YAML_FILE)
log: ## Start the logs
esphome logs --device $(PORT) $(YAML_FILE)
clean: ## Remove all build files
rm -rf .esphome
The default RGB LED on-board which is GPIO8
does on work. So, wire up a simple LED to GPIO3
with a 1k
resistor to the ground.
Compile firmware for this board
esphome compile blinky-esphome-esp32c3.yaml
Plug into the USB
port of the board and check the port address
$ ls /dev/cu.*
/dev/cu.Bluetooth-Incoming-Port /dev/cu.SLAB_USBtoUART /dev/cu.usbserial-1410
Upload the firmware
esphome upload --device /dev/cu.SLAB_USBtoUART blinky-esphome-esp32c3.yaml
USB
port of the boardCheck the new port address
$ ls /dev/cu.*
/dev/cu.Bluetooth-Incoming-Port /dev/cu.SLAB_USBtoUART /dev/cu.usbserial-1410
Access the logs
esphome logs --device /dev/cu.SLAB_USBtoUART blinky-esphome-esp32c3.yaml