ERROR Connecting to 192.168.4.240:8266 failed: [Errno 111] Connection refused

Hello,
I have installed an ESP. I can access draf via the IP, I have installed ESPHome in HA and created the ESP ( ESP gas meter ).

esphome:
  name: esp-gaszahler
  friendly_name: ESP-Gaszähler

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "/zrEQM4mfLb6PvYgH+UWw90x9u6Y0FeQ8Fb9r/Fh3l0="

ota:
  - platform: esphome
    password: "af5c7f9da95fec4c4e2c7b230dbfeef4"

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

  domain: ".fritz.box"
  manual_ip:
    static_ip: 192.168.4.240
    gateway: 192.168.4.1
    dns1: 192.168.4.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp-Gaszahler Fallback Hotspot"
    password: "86WkaUdI1yhG"

captive_portal:

But when I run INSTALL I get the Errno 111 message

INFO ESPHome 2024.9.2
INFO Reading configuration /config/esphome/esp-gaszahler.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp-gaszahler (board: esp01_1m; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.6
RAM:   [====      ]  41.7% (used 34176 bytes from 81920 bytes)
Flash: [=====     ]  47.6% (used 487605 bytes from 1023984 bytes)
========================= [SUCCESS] Took 11.14 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.4.240
ERROR Connecting to 192.168.4.240:8266 failed: [Errno 111] Connection refused

Do I still have to set up port forwarding in the router to port 8266?

Gruß
Andreas

Welcome Andreas.

Please post in English per the forum rules.

Are flashing the esp device for the first time? You need to do that over serial.

Or does it have esphome on it and you are trying to update the firmware? If so, what is it’s existing IP address?

1 Like