Dear community,
I have a NodeMCU V2 ESP8266 12F with a OLED Display I2C SSD1306 Chip 128 x 64 Pixel.
If I remove the code for the display, the ESP loads and boots within 2 minutes and connects to HomeAssistant. Everything works and I can control the LEDs. But if I add the code for the display and the fonts, the ESP boots only spontaneously and needs at least 10-15 minutes for it. What am I doing wrong? I have also changed the notation of the GPIOs and used the internal D-names, but that doesn’t help either. Some times when I’m lucky and the ESP boots, it’s not connected to HA and I can’t upload new software over the air.
I found this kind of thread but I don’t know what to do - seems to be the same issue?: ESP8266 (NodeMCU v3) Wifi problem with I2C SSD1306 (SH1106 128x64)
Thanks for your help. Anna
Show code
esphome:
name: esp-door
esp8266:
board: nodemcuv2
sensor:
- platform: dht
pin: D6
model: DHT22
update_interval: 5min
temperature:
name: "Temperature"
id: inside_temperature
accuracy_decimals: 1
humidity:
name: "Humidity"
id: inside_humidity
accuracy_decimals: 1
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 5min
light:
- platform: binary
name: "Light Red"
output: output_component1
- platform: binary
name: "Light Green"
output: output_component2
output:
- platform: gpio
id: output_component1
pin: D7
- platform: gpio
id: output_component2
pin: D8
button:
- platform: restart
name: "Restart"
- platform: safe_mode
name: "Restart in Safe Mode"
switch:
- platform: template
name: "ESPDisplay Demo"
id: template_demo
turn_on_action:
- display.page.show: pageOnline
- switch.template.publish:
id: template_demo
state: ON
turn_off_action:
- display.page.show: pageOFF
- switch.template.publish:
id: template_demo
state: OFF
# Enable i2c and spi
i2c:
sda: D0
scl: D1
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
id: my_display
pages:
- id: pageOFF
lambda: |-
it.fill(COLOR_OFF);
- id: pageOnline
lambda: |-
it.print(64, 0, id(font_19), TextAlign::TOP_CENTER, "Online");
font:
- file: 'arial.ttf'
id: font_19
size: 19
glyphs: ['&', '@', '!', ',', '.', '?', '"', '%', '(', ')', '+', '-', '_', ':', '°', '0',
'1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z','å', 'Ä', 'ä', 'Ö', 'ö', 'Ü', 'ü', '/']
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxx"
ota:
password: "xxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp-doorFallback Hotspot"
password: "xxx"
captive_portal: