Newbie: ESPHome setup help

Hi, I am having trouble configuring an ESP8266 with ESPHome. I can create a new node, but cannot get it to connect.

I have installed HassOS on a Proxmox VM, using Whiskerz007 installation script. and installed ESPHome through Hass.io.

From the ESPHome Dashboard, I added a new node and uploaded it via USB.
Flashing sucussfully completes, confirming:
IP Address: 192.168.1.17
Hostname: ‘test1’
The device shows green on the Dashboard and is discovered in HA. If I try to configure it, the connection fails. “Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.”

Looking at the ESPHome Dashboard logs (OTA), I get:
INFO Reading configuration…
INFO Starting log output from test1.local using esphome API
INFO Connecting to test1.local:6053 (92.242.132.16)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error
connecting to 92.242.132.16: timed out). Re-Trying in 1 seconds

The device has an IP address of 192.168.1.17, but it look like it is trying to connect to 92.242.132.16.

Has anyone seen this before?
Have I missed a step somewhere?

Anyone?
Could it be something to do with HA being inside a VM?

I can ping it at 192.168.1.17
Is there a web interface that I can access?
I’ve tried 192.168.1.17:6053, but failed.

Hi,
your problem is probably in DNS.

Your test1.local name is translated to ip 92.242.132.16.

You can add “use_address” variable to wifi section in YAML of your device, to specify optional hostname to connect to, so for example

wifi:
  ssid: "ssid"
  password: "password"
  use_address: "192.168.1.17"

Libor

2 Likes

Thanks Libor, that worked.
Thank you very much :smile:

1 Like

I am having a similar issue. I have performed the steps GDA performed with a HELTEC WIFI kit 32. I have been wracking my brain googling everything I can think of. I’ve tried setting a static ip using the provided example but that gives error 111, can’t connect to… I have tried to add an Integration (found and pinged an entry from my router with response) but it fails every time. I have gotten basically every error code associated with setting a static ip but still can’t get my Node connected.
my yaml:

 esphome:
  name: kdh1
  platform: ESP32
  board: heltec_wifi_kit_32

wifi:
  ssid: "Phantom"
  password: "navychief"
  use_address: "192.168.1.18"

 # Optional manual IP
  manual_ip:
    static_ip: 10.0.0.42
    gateway: 10.0.0.1
    subnet: 255.255.255.0
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Note10"
    password: "navychief"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  port: 3232
  password: ''
  reboot_timeout: 15min
ota:
  safe_mode: true
  port: 3232
  password: ''

the readout from trying to upload:

INFO Reading configuration /config/esphome/kdh1.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/kdh1
Processing kdh1 (board: heltec_wifi_kit_32; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif32 3.10004.210126 (1.0.4) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - toolchain-xtensa32 2.50200.97 (5.2.0)
Library Manager: Installing Hash
Library Manager: Already installed, built-in library
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <FS> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <AsyncTCP-esphome> 1.2.2
|   |-- <FS> 1.0
|   |-- <WiFi> 1.0
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <Update> 1.0
|-- <WiFi> 1.0
Retrieving maximum program size /data/kdh1/.pioenvs/kdh1/firmware.elf
Checking size /data/kdh1/.pioenvs/kdh1/firmware.elf
RAM:   [=         ]  12.9% (used 42304 bytes from 327680 bytes)
Flash: [=====     ]  47.5% (used 872494 bytes from 1835008 bytes)
========================= [SUCCESS] Took 1.76 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.1.18
ERROR Connecting to 192.168.1.18:3232 failed: [Errno 111] Connection refused

Your ‘use_address’ value is different from your ‘static_ip’ value.
You should not need both of them.

1 Like

Ok. I’ve removed the ‘use_address’ and still get the ‘ERROR Connecting to 192.168.1.18:3232 failed: [Errno 111] Connection refused’

Of note, I’ve also tried to connect and run programs on Arduino IDE. I can run some of the Example sketches that show different things on the tiny screen, but hit a wall with ESPHome. I’m sort of a newbie with both but there’s probably something I’m doing/not doing that could fix it, I just need a nudge in the right direction.

Did you perform the initial load of ESPHome firmware via the USB connection and a flash utility? If not, that’s your issue. Use the … option of the ESPHome menu, select Compile, and when it completes, then select Download. Otherwise, use a USB cable to connect your ESP device to the HA system and select that USB/tty/serial device in the upper-right corner.

Here’s how one user describes the process:

Do I need to leave the flasher running when it tries to reconnect? The flasher gave an indication of an AP Server.

INFO Connecting to 192.168.1.18:3232 (192.168.1.18)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Timeout while waiting for message response!). Re-Trying in 3 seconds

I’m having issue after issue with my device setup. Wish developers had automatic solutions to common issues.

1 Like