ESP01-s+relay, trouble with config

Hello everyone.
I have esp01-s with relay module. I’m trying to flash with console and via esphome with wi-fi.
If I uploading such config:

esphome:
  name: mini
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "MikroT"
  password: "*******"

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
   password: '12345'
   port: 6053

HomeAssistant and ESPHome can connect and interact with esp module.

If I uploading second config with relay:

esphome:
  name: mini
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "MikroT"
  password: "********"

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
   password: '12345'
   port: 6053



switch:
  - platform: gpio
    pin: 1
    name: "Switch Relay"

Neither HomeAsistant, nor ESPHome can’t interact with esp module. I can ping it via comand line my notebook in same network with HASS and ESPHome.

esp module become unaccessible. I can only downgrade esp with first firmware via console.

What’s wrong in second firmware? I don’t understand. Maybe anybody faced with such issue?
Thanks in advance.

Did you connect anything on GPIO1? That pin must be high at boot, otherwise nothing will work. try with disconnected relay…
Or try to change relay definition fromGPIO1 to GPIO0

Mistake was here:

wrong version:

# Enable Home Assistant API
api:

ota:
   password: '12345'
   port: 6053

working version:

# Enable Home Assistant API
api:
   password: '12345'
   port: 6053

ota:

1 Like