Hi all,
I can’t get my SH1106 (https://www.amazon.de/gp/product/B078J78R45/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1) to work at all.
I have my ESP32 set up and it arrived in Home Assistant “well”.
I then attached the four cables to the ESP32:
- VDD to 3V3
- GND to GND
- SDA to GPIO14
- SCK to GPIO26 (don’t know why it says SCK instead of SCL on the display pcb)
I googled for the code to use and there I started to get confused:
esphome:
name: dst-schreibtisch
friendly_name: DST_Schreibtisch
esp32:
board: esp32dev
framework:
type: arduino
text_sensor:
- platform: homeassistant
name: "EspText"
id: esp_text
entity_id: input_text.esptext
i2c:
sda: 14
scl: 26
font:
- file: "gfonts://Roboto"
id: roboto
size: 10
display:
- platform: ssd1306_i2c
model: "SH1106 128x64"
update_interval: 0.5s
address: 0x3C
lambda: |-
it.printf(0, 10,id(roboto), "%s", id(esp_text).state.c_str());
So I couldn’t find anything on the platform and the model to use correctly.
I found some info here: Need help with SH1106 Oled Display jivgym uses the same model, so I copied his code.
He isn’t showing the i2c section, but I got that from here: Output data from one ESP32 to two SH1106 oled displays I’m using a different notation as ESPhome says that this was correct for my board, and I have been using this notation on other ESP devices of the same model/type.
So I think the code is kind of ok?
So I uploaded the code, but then everything seems to fall apart.
The ESP reports this when I plug it in and load the log window:
[11:06:18][W][component:237]: Component display took a long time for an operation (281 ms).
[11:06:18][W][component:238]: Components should block for at most 30 ms.
[11:06:18][W][component:157]: Component wifi set Warning flag: scanning for networks
[11:06:18][W][component:237]: Component display took a long time for an operation (280 ms).
[11:06:18][W][component:238]: Components should block for at most 30 ms.
[11:06:19][W][component:237]: Component display took a long time for an operation (280 ms).
[11:06:19][W][component:238]: Components should block for at most 30 ms.
[11:06:19][W][component:237]: Component display took a long time for an operation (280 ms).
[11:06:19][W][component:238]: Components should block for at most 30 ms.
[11:06:20][W][component:237]: Component display took a long time for an operation (280 ms).
[11:06:20][W][component:238]: Components should block for at most 30 ms.
[11:06:20][W][component:237]: Component display took a long time for an operation (280 ms).
[11:06:20][W][component:238]: Components should block for at most 30 ms.
[11:06:21][W][component:237]: Component display took a long time for an operation (280 ms).
[11:06:21][W][component:238]: Components should block for at most 30 ms.
[11:06:21][W][component:237]: Component display took a long time for an operation (280 ms).
[11:06:21][W][component:238]: Components should block for at most 30 ms.
Also, I see no text sensor in Home Assistant, although the log says that it created one:
[11:06:57][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'EspText'
[11:06:57][C][homeassistant.text_sensor:024]: Entity ID: 'input_text.esptext'
Any idea what I have done wrong this time?