Hanging ESP with OLED

Hi there
trying to work with a simple oled display, but the esp displays my " hello world ", but it hangs and gets in an offline state…
When display is detached, it runs normally.
Any advice ?

esphome:
name: esphome-web-2c7f1c

esp8266:
board: esp01_1m

Enable logging

logger:

Enable Home Assistant API

api:

ota:

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

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: “Esphome-Web-2C7F1C”
password: “UPINPwwJtM2F”

captive_portal:

font:

  • file: fonts/bebas-neue/BebasNeue-Regular.ttf
    id: font2
    size: 12

i2c:
sda: GPIO4
scl: GPIO5
scan: true

display:

  • platform: ssd1306_i2c
    model: “SH1106 128x64”
    address: 0x3c
    lambda: |-
    it.print(0, 0, id(font2), “Hello World!”);

Please use three backtic’s above and below your code block, so the formatting will be correct.

Is this the complete yaml file? And can you also post your logfile.
Did you already tried it with another font file?

Edit: Are you sure you are using an ESP01? As far as I know, that model has only 2 GPIO pins GPIO0 and GPIO2 and in your yaml you are using GPIO4 and GPIO5

long ago, but did you solved this in the meantime?
I came along here because having the same problem.
If I set “SH1106 128x64”, the Hello World is the last I get, the all incl. WiFi hangs.
If I set “SH1106 128x32”, everything works, but the Fonts are streched vertically and I have not all lines I’d like to use.

Detail: The hardware I am using is the “spacehuhn deauther v5”. With the “hacker” firmware from spacehuhn, the display is working as 128x64.

Still no idea, how to fix it.