Help me with my display lcd

My display doesn’t have any output, it’s a 1602A and it’s connected to the correct ports.

This is my logs

[18:39:35][W][component:214]: Component lcd_base took a long time for an operation (0.07 s).
[18:39:35][W][component:215]: Components should block for at most 20-30ms.
[18:39:36][W][component:214]: Component lcd_base took a long time for an operation (0.07 s).
[18:39:36][W][component:215]: Components should block for at most 20-30ms.
[18:39:37][W][component:214]: Component lcd_base took a long time for an operation (0.07 s).
[18:39:37][W][component:215]: Components should block for at most 20-30ms.
[18:39:38][W][component:214]: Component lcd_base took a long time for an operation (0.07 s).
[18:39:38][W][component:215]: Components should block for at most 20-30ms.
[18:39:39][W][component:214]: Component lcd_base took a long time for an operation (0.07 s).
[18:39:39][W][component:215]: Components should block for at most 20-30ms.
[18:39:40][W][component:214]: Component lcd_base took a long time for an operation (0.07 s).
[18:39:40][W][component:215]: Components should block for at most 20-30ms.
[18:39:41][W][dht:169]: Requesting data from DHT failed!
[18:39:41][W][dht:060]: Invalid readings! Please check your wiring (pull-up resistor, pin number).

and here is my code in esphome

substitutions:
  esphome_name: esp32_ssd130

esphome:
  name: "${esphome_name}"
  friendly_name: Esp1

esp32:
  board: esp32dev
  framework:
    type: arduino

logger:

api:
  encryption:
    key: "BKhP/AvEf5VCKFGETTqLlPwCNyLoVzmRS0KDxXOgKeA="

ota:
  password: "c410da6cd9e1563bd33aaa5d11f4d10a"

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

  ap:
    ssid: "Acqua-Callidus Fallback Hotspot"
    password: "Lgp5pPm1ErIm"

captive_portal:

i2c:
  - id: bus_a
    sda: 21
    scl: 22
    frequency: 400kHz
    scan: true


globals:
   - id: current_page_num
     type: int
     restore_value: no
     initial_value: '1'

sensor:
  - platform: dht
    pin: GPIO13
    model: dht11
    temperature:
      name: "office_temperature"
      id: office_temperature
    humidity:
      name: "office_humidity"
      id: office_humidity
    update_interval: 20s
  - platform: bmp280
    temperature:
      name: "Outside Temperature"
      id: outside_temperature
      oversampling: 16x
    pressure:
      name: "Outside Pressure"
      id: outside_pressure
    address: 0x76
  - platform: uptime
    name: "${esphome_name} - Uptime Sensor"
  - platform: wifi_signal
    name: "${esphome_name} - WiFi Signal"
    update_interval: 60s

text_sensor:
  - platform: wifi_info
    ip_address:
      name: endereco-ip
      id: enderecoip
      icon: mdi:ip-network   

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO2
      inverted: true
      mode:
        input: true
        pullup: true
    id: display_button
    on_press:
      then:
        - lambda: |-
            id(current_page_num) = 2;
        - logger.log: "Current page set to 2"
        - output.turn_off: led2
        - output.turn_off: led3
        - output.turn_off: led4
        - output.turn_off: led5
        - output.turn_off: led1

  - platform: gpio
    id: button1
    pin:
      number: GPIO4
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - lambda: |-
            id(current_page_num) = 3;
        - logger.log: "Current page set to 3"
        - output.turn_off: led2
        - output.turn_off: led3
        - output.turn_off: led4
        - output.turn_off: led5
        - output.turn_on: led1   

  - platform: gpio
    id: button2
    pin:
      number: GPIO5
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - lambda: |-
            id(current_page_num) = 4;
        - logger.log: "Current page set to 4"
        - output.turn_off: led1
        - output.turn_off: led3
        - output.turn_off: led4
        - output.turn_off: led5
        - output.turn_on: led2

  - platform: gpio
    id: button3
    pin:
      number: GPIO15
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - lambda: |-
            id(current_page_num) = 5;
        - logger.log: "Current page set to 5"
        - output.turn_off: led1
        - output.turn_off: led2
        - output.turn_off: led4
        - output.turn_off: led5
        - output.turn_on: led3

  - platform: gpio
    id: button4
    pin:
      number: GPIO18
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - lambda: |-
            id(current_page_num) = 6;
        - logger.log: "Current page set to 6"
        - output.turn_off: led1
        - output.turn_off: led2
        - output.turn_off: led3
        - output.turn_off: led5
        - output.turn_on: led4

  - platform: gpio
    id: button5
    pin:
      number: GPIO19
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - lambda: |-
            id(current_page_num) = 7;
        - logger.log: "Current page set to 7"
        - output.turn_off: led1
        - output.turn_off: led2
        - output.turn_off: led3
        - output.turn_off: led4
        - output.turn_on: led5


light:
  - platform: binary
    name: "LED1"
    output: led1
  - platform: binary
    name: "LED2"
    output: led2
  - platform: binary
    name: "LED3"
    output: led3  
  - platform: binary
    name: "LED4"
    output: led4    
  - platform: binary
    name: "LED5"
    output: led5    

output:
  - id: led1
    platform: gpio
    pin: GPIO23
  - id: led2
    platform: gpio
    pin: GPIO32
  - id: led3
    platform: gpio
    pin: GPIO14
  - id: led4
    platform: gpio
    pin: GPIO25
  - id: led5
    platform: gpio
    pin: GPIO26

font:
  - file: "stocky.ttf"
    id: my_font
    size: 14
  - file: "arial.ttf"
    id: my_font2
    size: 13
  - file: "arial.ttf"
    id: my_font3
    size: 12
  - file: "arial.ttf"
    id: my_font4
    size: 15

  - file: materialdesignicons-webfont.ttf
    id: icon_font
    size: 25
    glyphs:
      - "\U000F1447" # clock
      - "\U000F0E66" # sprout

  - file: materialdesignicons-webfont.ttf
    id: icon_font20
    size: 20
    glyphs:
      - "\U000F0A5F" # ip
      - "\U000F059F" # web
      - "\U000F0028" # web no checked
      - "\U000F05A9" # wifi on
      - "\U000F05AA" # wifi off
      

  - file: materialdesignicons-webfont.ttf
    id: icon_font15
    size: 15
    glyphs:
      - "\U000F058C" # water
      - "\U000F04C5" # speedometer
      - "\U000F050F" # thermometer

time:
  - platform: homeassistant
    id: ha_time

display:
  - platform: lcd_pcf8574
    dimensions: 20x4
    address: 0x27
    id: lcd
    update_interval: 1s 
    lambda: |-
      it.print(0,0,"Hello World");

Someone help me please

I don’t believe you can use fonts with lcd_pcf8574. I believe you’re stuck with the built in ones.

If it’s a 16x2 display why have you defined it as a 20x4 display in the code? Possibly that is one issue?

Also what Nick said, no TTF fonts with this style of LCD display. You can define 8 custom characters, this is described in the docs for your display.

Could you explain this to me?

I was using a different display before, that’s why I have these fonts in the code

The 1602A is 16 characters by 2 lines, thus:

display:
  - platform: lcd_pcf8574
    dimensions: 16x2
    address: 0x27
    id: lcd
    update_interval: 1s 
    lambda: |-
      it.print(0,0,"Hello World");

The custom characters?

Lastly, have you turned the backlight on? You should be able to read the text regardless…

I tried with the 16x2 dimension, this different dimension was one of my tests.

I didn’t use those fonts, I used them on another display.

Can you post a photo of the back of your display model, connected to the ESP?

And the full logs.

Having re-read your config file, I see you aren’t using the ttf font. Nevertheless the font file will take up space on the esp. try removing them.

1 Like

I managed to solve it, it was necessary to adjust a component in the converter to input sda, scl

1 Like

So you wrongly reported this, which I assumed to be true. Assumption, the mother of f ups.