Hello world with ESPHome on ESP32-S3

Updated on 14 October 2022
dev board ESP32-S3-DevKitC-1
chip ESP32-S3-WROOM-1-N8R2
features esphome esp32s3
This tutorial is more than 1 year old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Before starting

Dependancies

Ensure the following dependancies are downloaded and available:

Buy the components

Code

Download config hello-esphome-esp32s3.yaml
esphome:
  name: hello

  on_boot:
    - repeat:
        count: 10
        then:
          - logger.log: "Hello World"
          - delay: 1s

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  framework:
    type: arduino
    version: 2.0.3
    platform_version: 5.1.0

logger:
  level: VERBOSE
  baud_rate: 115200
  deassert_rts_dtr: true
  # Enable USB CDC: https://esphome.io/components/logger.html#hardware-uarts
  # hardware_uart: USB_CDC

Makefile

YAML_FILE=hello-esphome-esp32s3.yaml
UPLOAD_PORT?=/dev/cu.usbmodem14*
SERIAL_PORT?=/dev/cu.usbserial-14*

.PHONY: default compile upload clean

default: clean compile upload

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:
	esphome compile $(YAML_FILE)

upload:
	@echo "Ensure you plug in the board into the USB port"
	esphome upload --device $(UPLOAD_PORT) $(YAML_FILE)

log:
	@echo "Ensure you plug in the board into the UART port"
	esphome logs --device $(SERIAL_PORT) $(YAML_FILE)

clean:
	rm -rf .esphome

Prototype

A photo of the actual setup.

Hello world with ESPHome on ESP32-S3 prototype

Serial console

Serial output from the firmware.

Hello world with ESPHome on ESP32-S3 serial console

Hello world with ESPHome on ESP32-S3 browser

Change to the UART port to view the logs

Description

Installing ESPHome CLI

$ python --version
Python 3.10.6

$ pip3 --version
pip 22.2.2

$ pip3 install wheel
$ pip3 install esphome
$ esphome version
Version: 2022.8.3

Compile and upload

  1. Compile firmware for this board

     esphome compile hello-esphome-esp32s3.yaml
    
  2. Plug into the USB port of the board and check the port address

     $ ls /dev/cu.*
    
     /dev/cu.Bluetooth-Incoming-Port  /dev/cu.usbmodem14101
    
  3. Upload the firmware

     esphome upload --device /dev/cu.usbmodem14101 hello-esphome-esp32s3.yaml
    

Access logs

  1. Unplug and plug into the UART port of the board
  2. Check the new port address

     $ ls /dev/cu.*
     /dev/cu.Bluetooth-Incoming-Port  /dev/cu.SLAB_USBtoUART  /dev/cu.usbserial-1410
    
  3. Access the logs

     esphome logs --device /dev/cu.usbserial-1410 hello-esphome-esp32s3.yaml
    

References