Resolving IP address of esp32_02.local

HI,
what do you do if you get that error. What’s wrong?
I have SlimmeLezer+ to connect on electricity meter S34U18 (vattenfall Sweden) with
/H1-port av P1-standard.
Regards Christian


INFO Reading configuration /config/esphome/elkontrol1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing elkontrol1 (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
Platform Manager: Installing platformio/espressif32 @ 3.5.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%          
Platform Manager: espressif32 @ 3.5.0 has been installed!
The platform 'platformio/espressif32 @ 3.5.0' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.
Tool Manager: Installing platformio/toolchain-xtensa32 @ ~2.50200.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: toolchain-xtensa32 @ 2.50200.97 has been installed!
Tool Manager: Installing platformio/framework-arduinoespressif32 @ ~3.10006.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
Tool Manager: framework-arduinoespressif32 @ 3.10006.210326 has been installed!
Tool Manager: Installing platformio/tool-esptoolpy @ ~1.30100.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-esptoolpy @ 1.30100.210531 has been installed!
Tool Manager: Installing platformio/tool-scons @ ~4.40300.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Tool Manager: tool-scons @ 4.40300.1 has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <WiFi> 1.0
|-- <FS> 1.0
|-- <Update> 1.0
|-- <ESPAsyncWebServer-esphome> 2.1.0
|   |-- <AsyncTCP-esphome> 1.2.2
|-- <DNSServer> 1.1.0
|-- <ESPmDNS> 1.0
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/api_connection.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/api_frame_helper.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/api_server.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/list_entities.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/proto.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/user_services.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/api/util.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/captive_portal/captive_portal.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/esp32/core.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/esp32/gpio_arduino.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/esp32/gpio_idf.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/esp32/preferences.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/homeassistant/sensor/homeassistant_sensor.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/logger/logger.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/md5/md5.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/mdns/mdns_component.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/mdns/mdns_esp32_arduino.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/mdns/mdns_esp_idf.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/network/util.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/ota/ota_component.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/sensor/automation.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/sensor/filter.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/sensor/sensor.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/socket/socket.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/web_server_base/web_server_base.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/wifi/wifi_component.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/wifi/wifi_component_esp32_arduino.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/application.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/color.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/component.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/controller.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/entity_base.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/helpers.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/log.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/scheduler.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/esphome/core/util.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/src/main.cpp.o
Generating partitions /data/elkontrol1/.pioenvs/elkontrol1/partitions.bin
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib528/AsyncTCP-esphome/AsyncTCP.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/ETH.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFi.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFiAP.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFiClient.cpp.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/lib528/libAsyncTCP-esphome.a
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFiGeneric.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFiMulti.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFiSTA.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFiScan.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFiServer.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib64d/WiFi/WiFiUdp.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib01c/FS/FS.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib01c/FS/vfs_api.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libbc6/Update/HttpsOTAUpdate.cpp.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/lib64d/libWiFi.a
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libbc6/Update/Updater.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libc74/ESPAsyncWebServer-esphome/AsyncEventSource.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libc74/ESPAsyncWebServer-esphome/AsyncWebSocket.cpp.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/lib01c/libFS.a
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libc74/ESPAsyncWebServer-esphome/WebAuthentication.cpp.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/libbc6/libUpdate.a
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libc74/ESPAsyncWebServer-esphome/WebHandlers.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libc74/ESPAsyncWebServer-esphome/WebRequest.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libc74/ESPAsyncWebServer-esphome/WebResponses.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/libc74/ESPAsyncWebServer-esphome/WebServer.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib333/DNSServer/DNSServer.cpp.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/lib333/libDNSServer.a
Compiling /data/elkontrol1/.pioenvs/elkontrol1/lib915/ESPmDNS/ESPmDNS.cpp.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/libFrameworkArduinoVariant.a
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/Esp.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/FunctionalInterrupt.cpp.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/libc74/libESPAsyncWebServer-esphome.a
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/HardwareSerial.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/IPAddress.cpp.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/lib915/libESPmDNS.a
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/IPv6Address.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/MD5Builder.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/Print.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/Stream.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/StreamString.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/WMath.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/WString.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/base64.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/cbuf.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-adc.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-bt.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-cpu.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-dac.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-gpio.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-i2c.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-ledc.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-log.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-matrix.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-misc.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-psram.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-rmt.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-spi.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-time.c.o
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c: In function 'spiTransferBytesNL':
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
                 uint8_t * last_out8 = &result[c_longs-1];
                                       ^
/data/cache/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
                 uint8_t * last_data8 = &last_data;
                                        ^
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-timer.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-touch.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/esp32-hal-uart.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/libb64/cdecode.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/libb64/cencode.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/main.cpp.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/stdlib_noniso.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/wiring_pulse.c.o
Compiling /data/elkontrol1/.pioenvs/elkontrol1/FrameworkArduino/wiring_shift.c.o
Archiving /data/elkontrol1/.pioenvs/elkontrol1/libFrameworkArduino.a
Linking /data/elkontrol1/.pioenvs/elkontrol1/firmware.elf
RAM:   [=         ]  12.6% (used 41196 bytes from 327680 bytes)
Flash: [=====     ]  49.3% (used 904938 bytes from 1835008 bytes)
Building /data/elkontrol1/.pioenvs/elkontrol1/firmware.bin
esp32_create_combined_bin(["/data/elkontrol1/.pioenvs/elkontrol1/firmware.bin"], ["/data/elkontrol1/.pioenvs/elkontrol1/firmware.elf"])
Wrote 0xecf50 bytes to file /data/elkontrol1/.pioenvs/elkontrol1/firmware-factory.bin, ready to flash to offset 0x0
======================== [SUCCESS] Took 230.54 seconds ========================
INFO Successfully compiled program.
INFO Resolving IP address of elkontrol1.local
ERROR Error resolving IP address of elkontrol1.local. Is it connected to WiFi?
ERROR (If this error persists, please set a static IP address: https://esphome.io/components/wifi.html#manual-ips)
ERROR Error resolving IP address: Error resolving address with mDNS: Did not respond. Maybe the device is offline., [Errno -5] No address associated with hostname

Here’s a SWAG- reboot the router.

Have you tried to ping it:
ping

  1. Has it worked before?
  2. Please post your config - obfuscate your SSID details.

I can ping and I can access, with IP address from browser with SlimmeLezer +.
But in HA ESPHome is offline, and ESPHome config.yaml file

INFO Reading configuration /config/esphome/elkontrol1.yaml...
INFO Starting log output from elkontrol1.local using esphome API
WARNING Can't connect to ESPHome API for elkontrol1.local: Error resolving IP address: [Errno -2] Name or service not known
INFO Trying to reconnect to elkontrol1.local in the background

  name: elkontrol1

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "214"
ota:
  password: "1428a1c73b0a22c555b295"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Elkontrol1 Fallback Hotspot"
    password: "a2TIvR"

captive_portal:
# Example configuration entry
sensor:
  - platform: homeassistant
    name: "Temperature Sensor From Home Assistant"
    entity_id: sensor.temperature_sensor

If you can ping it then your issue is mDNS on your local network.

Are your ESPHome node and HA on the same subnet? I assume so since you aren’t using static IP

I suggest you check that mDNS works on your local LAN and maybe also try a static IP.

Here’s something I just found.

In Windows from a command window you can use “mdns-sd -Q” command to see how the mDNS resolves the IP:

C:\Users\steve>dns-sd -Q solar.local
Timestamp A/R Flags if Name T C Rdata
22:02:37.973 Add 2 6 solar.local. 1 1 192.168.1.201
22:03:09.633 Rmv 0 6 solar.local. 1 1 192.168.1.201

Try to type in the name in your router ( dont ask, i dont know which name) :slight_smile:

maybe this :wink:

IP address: https://esphome.io/components/wifi.html

edit:
or this

elkontrol1.local

edit2:
basically you need to map the name of the device to its IP-number ( in DNS or Router ) , or as the straight forward “error message” says “set a static IP”

add this (use_address) to your wifi section

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: elkontrol1
2 Likes

might work, but not if the router or dns don’t know that name

I presume you can also type the ip in addition to the name.

ok, i haven’t seen this(use_address) before, was about to ask you about it, have to try this, on some of my “bogus” devices :slight_smile: ( after reading about it )

edit: Is it setting/forcing the dns/router to use this ?

in esp yaml
you might wat to add:

use_address: elkontrol1.<mylocal.dns>

where <mylocal.dns> is the local dns name, if you use it

ps: for sure this is a mdns issue

to be frank i dont know. I just had this problem where after flashing a device and setting them up to work they would remain offline in the esp gui.
I read lots of threads and someone recommended this option.

I tried it and since then all my esphome devices appear online without fault.

The ESP device get it’s IP from dchp or static, if dhcp it get the name that ESP provides, DNS(if in use) have to correspond to this as well, can’t just “call” with a name that dns and/or router don’t know about,… but if “use_name” have the “power” to write to dns/router, it would be great

noted.
So dont try it

oops, just checked…
my statement should have been:

  domain: <local.dns>

so my esp yaml looks like:


esphome:
  name: mydevice
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret wifi_ssid1
  password: !secret wifi_password
  domain: .mydomain.name

so my dns address resolves into:

mydevice. mydomain.name

OK, i don’t know anything about the esp gui, but i guess maybe flashing a device wont flash it’s MAC address, so next time you turn it on(if they have been in the network before) maybe your Router or DNS found it “familiar” , specially if you gave the flashed device same name, as before.

If you in the ESP_gui can set a static address, that would be the preferred way (to me), everything that’s wired, or capable of running outside dhcp, i don’t want to have inside dhcp

Hi aceindy,
should i write like: mydevice = elkontrol1 ; mydomain.name = ?

You either use the static address:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: 192.168.x.y

but I personally prefer a dhcp reservation in my router (and I also use a dns name in my router).

So I have a dhcp reservation for 192.168.x.y using the MAC address, and gave it the name ‘mydevice’
My routers domain name is ‘mydomain.name’
so my esphome yaml looks like:

esphome:
  name: mydevice
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret wifi_ssid1
  password: !secret wifi_password
  domain: .mydomain.name

so I can reach my esp using its name mydevice.mydomain.name, which my router resolves into 192.168.x.y. I prefer that above using static addresses (as it will make it easier to track and replace it in case it breaks down…I only need to update the MAC address in my router :wink: )

when I using the IP address of Simmelezer which is 192.168.1.33, in logs is the wrong password

INFO Reading configuration /config/esphome/elkontrol1.yaml…
INFO Starting log output from 192.168.1.33 using esphome API
WARNING Can’t connect to ESPHome API for 192.168.1.33: Invalid password!
INFO Trying to reconnect to 192.168.1.33 in the background