ESP32 OTA connection refused Error 111

Hello there,
I have some troubles flashing my ESP32 with OTA. I configured ESP32 for OTA with Arduino IDE. Now it is possible to flash ESP32 with Arduino IDE, but when I try to flash it with ESPhome I got the following error mesage. I’m quite new to ESP and could not find any existing topics here. Does somebody has a hint for me?

Thanks a lot Fabian

Errormessage:
INFO Successfully compiled program.
INFO Connecting to 192.168.1.194
ERROR Connecting to 192.168.1.194:3232 failed: [Errno 111] Connection refused

**ESPhome Yaml:

esphome:
  name: esp32_temp_heizung

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxx"

ota:
  safe_mode: True
  id: "esp32_temp_heizung"
  password: "xxxxxxx"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32-Temp-Heizung"
    password: "W4DJGHknkmX2"

captive_portal:

Arduino IDE code:

#include <WiFi.h>
#include <ArduinoOTA.h>

const char* ssid = "fabulous";
const char* password = "xxxxxxx";
String hostname = "esp32_temp_heizung";

void setup() {
Serial.begin(9600);
WiFi.setHostname(hostname.c_str());
  WiFi.begin(ssid, password);
  ArduinoOTA.setHostname("esp32_temp_heizung");
  ArduinoOTA.setPassword("xxxxxxx");
  ArduinoOTA.begin();

   while (WiFi.status() != WL_CONNECTED) {
  
    Serial.println(".");
delay(500);
   }
Serial.print("You're connected to the network");
Serial.println(WiFi.SSID());

Serial.print(WiFi.networkID());
Serial.print(WiFi.localIP());
}

void loop() {
  ArduinoOTA.handle();
}

Its one or the other. Either use ESPHome or your own sketch with Arduino.
If you want to use ESPHome you will have use an USB and a https connection or use the manual install that will direct you to the web installer or offline tool.

Thanks Charles,
I thought when enabling OTA for ESP32 with arduinoOTA Library it works generally, also with ESPhome…thanks for clarifying…

Regards
Fabian

Np, to clairify:
ESPHome has its own OTA so once its programmed the device can be updated and changed via the Wifi.
It even has a fallback hotspot so you connect to it whenever it falls of the normal Wifi for any reason

This may be a stupid question, but can someone list the exact procedure for OTA update of the firmware?