I get the following error after installing on an esp device. The error pops up when configuring the device from integration page. Here is the error “Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.”
Here is the logs from the install.
INFO ESPHome 2023.6.4
INFO Reading configuration /config/esphome/test-10.yaml…
INFO Generating C++ source…
INFO Compiling app…
Processing test-10 (board: esp32dev; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.4
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/api_connection.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/api_server.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/list_entities.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/proto.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/api/user_services.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/captive_portal/captive_portal.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/esp32/gpio.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/esp32/preferences.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/logger/logger.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/md5/md5.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/mdns/mdns_component.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/mdns/mdns_esp32.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/mdns/mdns_host.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/mdns/mdns_rp2040.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/network/util.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/ota/ota_backend_arduino_rp2040.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/ota/ota_component.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/socket/socket.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/web_server_base/web_server_base.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/wifi/wifi_component.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/wifi/wifi_component_esp32_arduino.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/components/wifi/wifi_component_pico_w.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/application.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/component.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/component_iterator.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/controller.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/entity_base.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/helpers.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/log.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/scheduler.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/string_ref.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/esphome/core/util.cpp.o
Compiling /data/test-10/.pioenvs/test-10/src/main.cpp.o
Linking /data/test-10/.pioenvs/test-10/firmware.elf
RAM: [= ] 12.4% (used 40536 bytes from 327680 bytes)
Flash: [===== ] 49.0% (used 899553 bytes from 1835008 bytes)
Building /data/test-10/.pioenvs/test-10/firmware.bin
Creating esp32 image…
Successfully created esp32 image.
esp32_create_combined_bin(["/data/test-10/.pioenvs/test-10/firmware.bin"], ["/data/test-10/.pioenvs/test-10/firmware.elf"])
Wrote 0xed070 bytes to file /data/test-10/.pioenvs/test-10/firmware-factory.bin, ready to flash to offset 0x0
========================= [SUCCESS] Took 87.58 seconds =========================
INFO Successfully compiled program.
esptool.py v4.6
Serial port /dev/ttyUSB0
Connecting…
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: a0:b7:65:4a:cd:b4
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 460800
Changed.
Configuring flash size…
Auto-detected Flash size: 4MB
Flash will be erased from 0x00010000 to 0x000edfff…
Flash will be erased from 0x00001000 to 0x00005fff…
Flash will be erased from 0x00008000 to 0x00008fff…
Flash will be erased from 0x0000e000 to 0x0000ffff…
Compressed 905328 bytes to 601472…
Wrote 905328 bytes (601472 compressed) at 0x00010000 in 14.1 seconds (effective 511.9 kbit/s)…
Hash of data verified.
Compressed 17440 bytes to 12128…
Wrote 17440 bytes (12128 compressed) at 0x00001000 in 0.6 seconds (effective 216.4 kbit/s)…
Hash of data verified.
Compressed 3072 bytes to 144…
Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.1 seconds (effective 323.3 kbit/s)…
Hash of data verified.
Compressed 8192 bytes to 47…
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 449.1 kbit/s)…
Hash of data verified.
Leaving…
Hard resetting via RTS pin…
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[11:57:41][I][logger:262]: Log initialized
[11:57:41][C][ota:469]: There have been 0 suspected unsuccessful boot attempts.
[11:57:41][D][esp32.preferences:114]: Saving 1 preferences to flash…
[11:57:41][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[11:57:41][I][app:029]: Running through setup()…
[11:57:41][C][wifi:038]: Setting up WiFi…
[11:57:41][C][wifi:048]: Starting WiFi…
[11:57:41][C][wifi:049]: Local MAC: A0:B7:65:4A:CD:B4
[11:57:41][D][wifi:425]: Starting scan…
[11:57:47][D][wifi:440]: Found networks:
[11:57:47][I][wifi:484]: - ‘SummitDelta’ (48:DD:0C:66:29:05) [redacted]▂▄▆█
[11:57:47][D][wifi:485]: Channel: 6
[11:57:47][D][wifi:486]: RSSI: -49 dB
[11:57:47][I][wifi:484]: - ‘SummitDelta’ (D0:16:7C:F7:4C:25) [redacted]▂▄▆█
[11:57:47][D][wifi:485]: Channel: 6
[11:57:47][D][wifi:486]: RSSI: -70 dB
[11:57:47][D][wifi:489]: - ‘’[redacted] (48:DD:0C:66:29:07) [redacted]▂▄▆█
[11:57:47][D][wifi:489]: - ‘’[redacted] (48:DD:0C:66:29:03) [redacted]▂▄▆█
[11:57:47][D][wifi:489]: - ‘’[redacted] (D0:16:7C:F7:4C:27) [redacted]▂▄▆█
[11:57:47][D][wifi:489]: - ‘’[redacted] (D0:16:7C:F7:4C:23) [redacted]▂▄▆█
[11:57:47][I][wifi:274]: WiFi Connecting to ‘SummitDelta’…
[11:57:50][I][wifi:557]: WiFi Connected!
[11:57:50][C][wifi:379]: Local MAC: A0:B7:65:4A:CD:B4
[11:57:50][C][wifi:380]: SSID: ‘SummitDelta’[redacted]
[11:57:50][C][wifi:381]: IP Address: 192.168.4.105
[11:57:50][C][wifi:383]: BSSID: 48:DD:0C:66:29:05[redacted]
[11:57:50][C][wifi:384]: Hostname: ‘test-10’
[11:57:50][C][wifi:386]: Signal strength: -48 dB ▂▄▆█
[11:57:50][C][wifi:390]: Channel: 6
[11:57:50][C][wifi:391]: Subnet: 255.255.252.0
[11:57:50][C][wifi:392]: Gateway: 192.168.4.1
[11:57:50][C][wifi:393]: DNS1: 192.168.4.1
[11:57:50][C][wifi:394]: DNS2: 0.0.0.0
[11:57:50][D][wifi:566]: Disabling AP…
[11:57:50][C][ota:093]: Over-The-Air Updates:
[11:57:50][C][ota:094]: Address: test-10.local:3232
[11:57:50][C][ota:097]: Using Password.
[11:57:50][C][api:025]: Setting up Home Assistant API server…
[11:57:50][I][app:062]: setup() finished successfully!
[11:57:50][I][app:102]: ESPHome version 2023.6.4 compiled on Jul 8 2023, 11:56:47
[11:57:50][C][wifi:543]: WiFi:
[11:57:50][C][wifi:379]: Local MAC: A0:B7:65:4A:CD:B4
[11:57:50][C][wifi:380]: SSID: ‘SummitDelta’[redacted]
[11:57:50][C][wifi:381]: IP Address: 192.168.4.105
[11:57:50][C][wifi:383]: BSSID: 48:DD:0C:66:29:05[redacted]
[11:57:50][C][wifi:384]: Hostname: ‘test-10’
[11:57:50][C][wifi:386]: Signal strength: -48 dB ▂▄▆█
[11:57:50][C][wifi:390]: Channel: 6
[11:57:50][C][wifi:391]: Subnet: 255.255.252.0
[11:57:50][C][wifi:392]: Gateway: 192.168.4.1
[11:57:50][C][wifi:393]: DNS1: 192.168.4.1
[11:57:50][C][wifi:394]: DNS2: 0.0.0.0
[11:57:50][C][logger:301]: Logger:
[11:57:50][C][logger:302]: Level: DEBUG
[11:57:50][C][logger:303]: Log Baud Rate: 115200
[11:57:50][C][logger:305]: Hardware UART: UART0
[11:57:50][C][captive_portal:088]: Captive Portal:
[11:57:50][C][mdns:112]: mDNS:
[11:57:50][C][mdns:113]: Hostname: test-10
[11:57:50][C][ota:093]: Over-The-Air Updates:
[11:57:50][C][ota:094]: Address: test-10.local:3232
[11:57:50][C][ota:097]: Using Password.
[11:57:50][C][api:138]: API Server:
[11:57:50][C][api:139]: Address: test-10.local:6053
[11:57:50][C][api:141]: Using noise encryption: YES
Here is my setup from esp home. I blanked the password and api key.
esphome:
name: test-10
friendly_name: test 10
esp32:
board: esp32dev
framework:
type: arduino
Enable logging
logger:
Enable Home Assistant API
api:
encryption:
key: “**********************”
ota:
password: “bedcec0577f0b0698cab5995e31560ed”
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: “Test-10 Fallback Hotspot”
password: “*********”
captive_portal: