ERROR Connecting to 192.168.0.126:3232 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.

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

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "b111dfdef449e288adf370eb372847b3"

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

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

  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.0.126
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.0.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0
captive_portal:

This is error code.

========================= [SUCCESS] Took 11.36 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.0.126
ERROR Connecting to 192.168.0.126:3232 failed: [Errno 111] Connection refused
3 Likes

I have same question…

1 Like

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: https://github.com/esphome/esphome-flasher

1 Like

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

1 Like