Sonoff basic r1 - code change can't connect to wifi

Hello,
When I flash simple sonoff basic r1 esphome code:

esphome:
  name: grzalka_zasobnik
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "voboIOT"
  password: "xxxxxxxxxxxxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Grzalka Zasobnik"
    password: "xxxxxxxxxxxxxxxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "xxxxxxxxxxxxxxxx"

ota:

everything works - meaning sonoff connect to wifi and I can reflash it OTA
but when I add those lines to esphome:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "Sonoff Basic Button"
    on_press:
      - switch.toggle: relay

switch:
  - platform: gpio
    name: "Sonoff Basic Relay"
    pin: GPIO12
    id: relay

status_led:
  pin:
    number: GPIO13
    inverted: yes

sonoff cannot connect to wifi:

Using 'COM8' as serial port.
Showing logs:
[23:13:37][D][wifi:319]: Found networks:
[23:13:37][I][wifi:365]: - 'voboIOT' (C4:AD:34:F6:D0:A8) ▂▄▆█
[23:13:37][D][wifi:366]:     Channel: 1
[23:13:37][D][wifi:367]:     RSSI: -66 dB
[23:13:37][I][wifi:365]: - 'voboIOT' (C4:AD:34:F6:E9:E4) ▂▄▆█
[23:13:37][D][wifi:366]:     Channel: 9
[23:13:37][D][wifi:367]:     RSSI: -65 dB
[23:13:37][D][wifi:369]: - 'Grzalka Zasobnik' (6A:C6:3A:81:06:D5) ▂▄▆█
[23:13:37][D][wifi:369]: - 'WLAN1-4JJNNM' (B4:86:55:87:D4:FA) ▂▄▆█
[23:13:37][I][wifi:193]: WiFi Connecting to 'voboIOT'...
[23:13:43][W][wifi_esp8266:391]: Event: Disconnected ssid='voboIOT' reason='Probe Request Unsuccessful'
[23:13:43][W][wifi:451]: Error while connecting to network.
[23:13:43][I][wifi:193]: WiFi Connecting to 'voboIOT'...
[23:13:49][W][wifi_esp8266:391]: Event: Disconnected ssid='voboIOT' reason='Probe Request Unsuccessful'
[23:13:49][W][wifi:451]: Error while connecting to network.
[23:13:54][D][wifi:304]: Starting scan...
[23:14:00][D][wifi:319]: Found networks:
[23:14:00][I][wifi:365]: - 'voboIOT' (C4:AD:34:F6:E9:E4) ▂▄▆█
[23:14:00][D][wifi:366]:     Channel: 9
[23:14:00][D][wifi:367]:     RSSI: -64 dB
[23:14:00][I][wifi:365]: - 'voboIOT' (C4:AD:34:F6:D0:A8) ▂▄▆█
[23:14:00][D][wifi:366]:     Channel: 1
[23:14:00][D][wifi:367]:     RSSI: -65 dB
[23:14:00][D][wifi:369]: - 'Grzalka Zasobnik' (6A:C6:3A:81:06:D5) ▂▄▆█
[23:14:00][D][wifi:369]: - 'WLAN1-4JJNNM' (B4:86:55:87:D4:FA) ▂▄▆█
[23:14:00][I][wifi:193]: WiFi Connecting to 'voboIOT'...
[23:14:06][W][wifi_esp8266:391]: Event: Disconnected ssid='voboIOT' reason='Probe Request Unsuccessful'
[23:14:06][W][wifi:451]: Error while connecting to network.
[23:14:06][I][wifi:193]: WiFi Connecting to 'voboIOT'...
[23:14:12][W][wifi_esp8266:391]: Event: Disconnected ssid='voboIOT' reason='Probe Request Unsuccessful'
[23:14:12][W][wifi:451]: Error while connecting to network.

I will be greatful for any help

Maciek

Check it out here: WiFi problems on nodemcu clones with "ECO Plugs B REV 1.1" chip · Issue #952 · esphome/issues · GitHub

thanks for help.
upgrade to 1.15.0 stable solves the problem

sorry, I was wrong;
no luck
this part breaks wifi connection:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "pompa recyrkulacja przycisk"
    on_press:
      - switch.toggle: relay_pompa_recyrkulacja

I have a similar issue with a sonoff basic running latest version of ESPHOME (2022.9): as soon as i remove those lines it works.

for anyone else finding this , if this is a sonoff basic r1 especially, try commenting out the “logger” and possibly “ota” sections entierly, to disable adding extra weight to the final binary.

NOTE: commenting out “ota” disables the “over the air update” feature, however in my case, it doesn’t work anyway due to memory constraints. This is something you have to check and decide for yourself.

The reasoning is that this sonoff basic doesn’t have enough memory.

ex:

ota:

password:

logger: