ERROR Connecting to failed: [Errno 111] Connection refused

Hi, very new to Home Assistant.
I’m trying to install device on my esp32 through wireless. But got this error.
I have searched many same issues in Internet. I have tried built OTA web update on my esp32, write the code about connecting wifi, setting ArduinoOTA port 3232 and letting the on-board led blinking, it’s running. Even check the ESP32 IP on Advanced IP Scanner correctly. However, still not solute this problem.

This is my esphome YAML. Thanks for helping.

  name: testdata
  platform: ESP32
  board: nodemcu-32s

# Enable logging

# Enable Home Assistant API

  password: "b111dfdef449e288adf370eb372847b3"

  ssid: "CCSPE-AP-02"
  password: "mypass"
  # use_address:

  # Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "Testdata Fallback Hotspot"
    password: "Cq1w1hD6cYvC"

    # Set this to the IP of the ESP
    # Set this to the IP address of the router. Often ends with .1
    # The subnet of the network. works for most home networks.

This is error code.

========================= [SUCCESS] Took 11.36 seconds =========================
INFO Successfully compiled program.
INFO Connecting to
ERROR Connecting to failed: [Errno 111] Connection refused
1 Like

I have same question…

The first flash needs to be done serial. OTA only works afterwards.

1 Like

So you mean that I have to install by plug into the computer running esphome dashboard at first time?

Indeed. First time serial, only after that OTA.

1 Like

If reaching the computer running ESPHome is inconvenient then you can also download the flash file (is one of the options) and use the standalone flasher:

1 Like

Thanks for your help @francisp @Dujith.
The device succeeded install on my esp32. :)))

1 Like