Display GC9A01 (1,28 Zoll rund) mit D1 Mini und espHome

Hallo zusammen,

ich habe mir mal das Display GC9A01 (rundes 1,28 Zoll Display Wiki 1,28 Display zugelegt.

Nun versuche ich es über esphome mit einem D1 Mini zu verbinden.
Aber irgendwie klappt es nicht.
Wenn ich ein Beispiel-Programm mit der Arduino IDE verwende, dann kann ich das Display programmieren (Internetuhr mit Arduino IDE und die Anzeige funktioniert wie erwartet.

Bei der gleichen Pin-Belegung mit esphome klappt es nicht.

Ich versuche hier nur einen einfachen Text auszugeben,
das Ergebnis ist das auf dem Bildschirm nur ein weis-grau gemustertet Bild erscheint.

mein Yaml:

 esphome:
   name: test-d1mini
   friendly_name: Test_D1mini
 
 esp8266:
   board: d1_mini
 
 logger:
 
 api:
   encryption:
     key: ......
 
 ota:
   password: ....
 
 wifi:
   ssid: !secret wifi_ssid
   password: !secret wifi_password
 
   ap:
     ssid: "Test-D1Mini Fallback Hotspot"
     password: ...
 
 time:
   - platform: homeassistant
     id: esptime
 
 external_components:
   - source: github://pr#3625
     components: [ gc9a01 ]
 
 spi:
   mosi_pin: D7
   clk_pin: D5
 
 
 display:
 - platform: gc9a01
   cs_pin: D8
   dc_pin: D2
   rotation: 90
   lambda: |-
     it.printf(0, 31, id(GCfont00), TextAlign::BASELINE_LEFT, "WAIT...");
 
 font:
   - file: "fonts/GC9A01_Font00.ttf"
     id: GCfont00
     size: 10

– Sorry ich bekomme die Formatierung der Yaml-Datei nicht hin

Bitte beachten, bei der Einbindung von “- source: github://pr#3625” Zeile 46
muss auch eine Datei angepasst werden, da neuerdings display.DisplayBufferRef in display.DisplayRef umbenannt wurde.

/config/esphome/.esphome/external_components/1ff663bb/esphome/components/gc9a01/display.py Zeile 63:
Alt:

            config[CONF_LAMBDA], [(display.DisplayBufferRef, "it")], return_type=cg.void

Neu:

            config[CONF_LAMBDA], [(display.DisplayRef, "it")], return_type=cg.void

Hat irgendjemand von Euch dieses Display bereits im Einsatz und kann mir helfen?
Ich habe den Eindruck als ob das Senden der Daten an das Display nicht klappt.

Vielen Dank
Rüdiger

:crayon:by HarryP: Codezeilen in Code-TAG’s eingebunden.

Wegen Formatierung :wink:

 [code] Dein YAML Code [/code]

Oder einfach das
image
drücken, sollte dann so aussehen:
image

Hab es oben mal entsprechend geändert.

Danke, denn meine Kommentare mit “#” wurden falsch angezeigt,
bin wohl etwas sehr ausser Übung in Foren.

Schade,
anscheinend benutzt niemand von Euch das Display.

Hast du mal gegoogelt? Ich hab das zum Thema gefunden → Add support round display: GC9A01 240x240 IPS · Issue #1699 · esphome/feature-requests · GitHub

Hallo Lindtbaer,

den Link hab ich schon gefunden,

das steht ja in meiner yaml

external_components:
   - source: github://pr#3625
     components: [ gc9a01 ]
 
 spi:
   mosi_pin: D7
   clk_pin: D5
 
 
 display:
 - platform: gc9a01
   cs_pin: D8
   dc_pin: D2
   rotation: 90
   lambda: |-
     it.printf(0, 31, id(GCfont00), TextAlign::BASELINE_LEFT, "WAIT...");

mit dem Unterschied, dass ich halt Text ausgebe.

Das Problem ist dass anscheinend das Display nicht resettet oder initialisiert wird.

Habe den Eindruck dass irgendetwas an der Implementierung github://pr#3625 nicht stimmt,
denn wie gesagt, wenn ich Arduino IDE verwende, dann klappt es.

Dann hab ich auch keine Idee mehr außer du nimmst nicht ESP Home und versuchst über andere Wege deine Daten auf dem Gerät zu bekommen.

Hallo Maik,

danke,
ich werde mal schauen, in ca. 2 Wochen bekomme ich ESP32S, dann versuche ich es damit mal.
Vielleicht klappt die Bibliothek mit dem D1 Mini nicht richtig.

Wie ist denn das Feedback zum display im allgemeinen?
Bzw. @simon42 welche(s) Display würdest du mittlerweile fürs Haus für HA empfehlen?

Hi, gibt es denn Neuigkeiten zu diesem Thema? Habe das Display gestern zum ersten mal in Betrieb genommen. Wenn es mit EspHome zu aufwändig wird, dann werde ich wohl im Arduino einen zusätzlichen MQTT-Client laufen lassen und damit meine Homeassistant Daten auf dem runden Display anzeigen. Beste Grüße, Gerhard

Hallo Zusammen,

sorry, hatte irgendwie viel zu tun und die Hausautomatisierung trat in den Hintergrund.
Ich werde ab nächster Woche mich mal wieder mit dem Thema GC9A01 befassen,
habe gesehen, dass sich anscheinend etwas bei EspHome getan hat.

Aktuell hab ich erstmal einen Ultraschall-Ölstand-Sensor realisiert, welchen ich allerdings noch einbauen muss.

Viele Grüße
Rüdiger

Moin zusammen,

ich habe das gleiche Display und versuche auch immer zwischendurch, ob sich inzwischen etwas getan hat. Leider bisher ohne Erfolg.

Bei mir habe ich das Display sowohl an einem D1 mini v.4.0.0 als auch an einem ESP32-WROOM-32D probiert. Leider ohne Erfolg.

Vielleicht lässt sich dieses Thema wieder erwärmen :slight_smile:

Hallo! Bei mir funktioniert das Display.
image
image

esphome:
  name: 3-esp32-s3-display-test
  friendly_name: 3 ESP32 S3 Display Test
  platformio_options:
      build_flags: "-DBOARD_HAS_PSRAM"
      board_build.arduino.memory_type: qio_opi

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:
  level: ERROR # ERROR weniger Ausgaben durch das Display, beim programmieren auf auf DEBUG stellen

# Enable Home Assistant API
api:
  encryption:
    key: "HIER DEINEN KEY VERWENDEN"

ota:
  - platform: esphome
    password: "HIER DEIN PASSWORT VERWENDEN"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "3-Esp32-S3-Display-Test"
    password: "HIER DEIN PASSWORT VERWENDEN"

captive_portal:
 
 # http://wiki.fluidnc.com/en/hardware/ESP32-S3_Pin_Reference
spi:
    clk_pin: GPIO12 # Display auf Pin SCL
    mosi_pin: GPIO11 # Display auf Pin SDA
    miso_pin: GPIO13 # nicht verwendet - es gibt keine Daten vom Display zum ESP
      
display:
  - platform: ili9xxx # Display 3 OHNE TOUCH
    id: display3
    model: GC9A01A # rund 240x240 Pixel
    cs_pin: GPIO17 # Display auf Pin CS 
    dc_pin: GPIO10 # Display auf Pin DC
    reset_pin: GPIO41 # Display auf Pin RST 
    rotation: 180° # Pins oben
    invert_colors: true
    update_interval: 1s
    lambda: |-
        // Modellbezeichnung anzeigen
        it.print(75, 40, id(arial20), id(weiss), "GC9A01A"); 
        // Wifi Signal und Uhrzeit anzeigen
        it.strftime(80, 80, id(arial20), id(hellblau), "%H:%M:%S", id(zeit).now());
        it.printf(80, 120, id(arial20), id(hellblau), "%.0f%%", id(wifi_signal_Prozent).state);
        it.print(60, 120, id(icon20), id(hellblau), "\U000F05A9");  // WIFI (wifi) 
        // und ein paar sinnlose Darstellungen
        it.filled_ring(120, 120, 100, 110, gelb);
        it.filled_ring(120, 120, 110, 120, hellblau);
        it.filled_rectangle(80, 150, 20, 20, rot);
        it.print(130, 100, id(icon80), id(gelb), "\U000F0599");  // Sonne (weather-sunny) 
        it.print(90, 160, id(icon80), id(orange), "\U000F01F5");  // Smile (emoticon-happy-outline)

###### FARBEN ###### # https://www.farb-tabelle.de/de/farbtabelle.htm
color: 
  - id: rot
    red_int: 255
    green_int: 0
    blue_int: 0
  - id: gruen
    hex: 00FF00
  - id: dunkelgruen
    red_int: 0
    green_int: 170
    blue_int: 0
    white_int: 0
  - id: blau
    hex: 0000FF
  - id: hellblau
    hex: 8EE5EE
  - id: gelb
    hex: FFFF00
  - id: orange
    hex: FFA500
  - id: braun
    hex: A52A2A    
  - id: magenta
    hex: FF00FF
  - id: grau
    hex: BEBEBE
  - id: weiss
    red_int: 255
    green_int: 255
    blue_int: 255

###### SCHRIFTARTEN ######
font:
  - file: "arial.ttf"
    id: arial10
    size: 10
  
  - file: "arial.ttf"
    id: arial15
    size: 15
  
  - file: "arial.ttf"
    id: arial20
    size: 20

  - file: "arial.ttf"
    id: arial25
    size: 25

  - file: "arial.ttf"
    id: arial40
    size: 40

  - file: "arial.ttf"
    id: arial80
    size: 80

  - file: "materialdesignicons-webfont.ttf" # https://pictogrammers.com/library/mdi/
    id: icon80
    size: 80
    glyphs: [
      
      "\U000F0599", # Sonne (weather-sunny) 
      "\U000F05A9", # WIFI (wifi) 
      "\U000F01F5", # Smile (emoticon-happy-outline)
          ]
    
  - file: "materialdesignicons-webfont.ttf" # https://pictogrammers.com/library/mdi/
    id: icon20
    size: 20
    glyphs: [
      
      "\U000F0599", # Sonne (weather-sunny) 
      "\U000F05A9", # WIFI (wifi) 
      "\U000F01F5", # Smile (emoticon-happy-outline)
          ]

sensor:
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    id: wifi_signal_Prozent
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"
    device_class: ""

time:
  - platform: homeassistant
    id: zeit   

Und als Uhr aber mit dem Ziffernblatt als Bild. Das Zifferblatt könnte man natürlich auch zeichnen.

esphome:
  name: 3-esp32-s3-display-test
  friendly_name: 3 ESP32 S3 Display Test
  platformio_options:
      build_flags: "-DBOARD_HAS_PSRAM"
      board_build.arduino.memory_type: qio_opi

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:
  level: ERROR # ERROR weniger Ausgaben durch das Display, beim programmieren auf auf DEBUG stellen

# Enable Home Assistant API
api:
  encryption:
    key: " DEIN KEY"

ota:
  - platform: esphome
    password: "DEIN PASSWORT"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "3-Esp32-S3-Display-Test"
    password: "DEIN PASSWORT"

captive_portal:

image:
  - file: "Zifferblatt.png" # im Internet gefunden - sollte durchsichtig sein!
    id: zifferblatt
    type: RGB565
    resize: 240x240  # Falls nötig
 
 # http://wiki.fluidnc.com/en/hardware/ESP32-S3_Pin_Reference
spi:
    clk_pin: GPIO12 # Display auf Pin SCL
    mosi_pin: GPIO11 # Display auf Pin SDA
    miso_pin: GPIO13 # nicht verwendet
      
display:
  - platform: ili9xxx # Display 3 OHNE TOUCH
    id: display3
    model: GC9A01A # rund 240x240 Pixel
    cs_pin: GPIO17 # Display auf Pin CS 
    dc_pin: GPIO10 # Display auf Pin DC
    reset_pin: GPIO41 # Display auf Pin RST 
    rotation: 180° # Pins oben
    invert_colors: true
    update_interval: 1s
    lambda: |-
      it.image(0, 0, id(zifferblatt));  // Zeigt das Zifferblatt an
      // Mittelpunkt des Displays
      const int center_x = 120;
      const int center_y = 120;
      const int radius = 110;

      // Hintergrund alle Stunde neu zeichnen (Ziffernblatt)
      if (id(home_time).now().minute == 0 && id(home_time).now().second == 0) {
          it.fill(schwarz);  // Bildschirm löschen
          
          // Ziffernblatt zeichnen
          for (int h = 0; h < 12; h++) {
              float angle = (h * 30) * (M_PI / 180); // 30° pro Stunde
              int x1 = center_x + (radius - 10) * cos(angle);
              int y1 = center_y + (radius - 10) * sin(angle);
              int x2 = center_x + radius * cos(angle);
              int y2 = center_y + radius * sin(angle);
              it.line(x1, y1, x2, y2, weiss);  // Weiße Stundenmarken
          }
      }

      // Aktuelle Zeit abrufen
      int hour = id(home_time).now().hour % 12; // 12-Stunden-Format
      int minute = id(home_time).now().minute;
      int second = id(home_time).now().second;

      // WICHTIG: 90° versetzt, weil 0° in Mathe auf der x-Achse liegt!
      float offset = -M_PI / 2;  

      // Zeigerlängen
      const int hour_length = 50;
      const int minute_length = 80;
      const int second_length = 90;

      // Winkelberechnung
      float hour_angle = (hour * 30 + minute * 0.5) * (M_PI / 180) + offset;
      float minute_angle = (minute * 6) * (M_PI / 180) + offset;
      float second_angle = (second * 6) * (M_PI / 180) + offset;

      // Zeiger zeichnen
      it.line(center_x, center_y, center_x + hour_length * cos(hour_angle), center_y + hour_length * sin(hour_angle), weiss);
      it.line(center_x, center_y, center_x + minute_length * cos(minute_angle), center_y + minute_length * sin(minute_angle), weiss);
      it.line(center_x, center_y, center_x + second_length * cos(second_angle), center_y + second_length * sin(second_angle), rot);
      
      // zur Kontrolle - Digitalzeit anzeigen
      //it.strftime(80, 80, id(arial20), id(hellblau), "%H:%M:%S", id(home_time).now());


###### FARBEN ###### # https://www.farb-tabelle.de/de/farbtabelle.htm
color: 
  - id: schwarz
    red_int: 0
    green_int: 0
    blue_int: 0
  - id: rot
    red_int: 255
    green_int: 0
    blue_int: 0
  - id: gruen
    hex: 00FF00
  - id: dunkelgruen
    red_int: 0
    green_int: 170
    blue_int: 0
    white_int: 0
  - id: blau
    hex: 0000FF
  - id: hellblau
    hex: 8EE5EE
  - id: gelb
    hex: FFFF00
  - id: orange
    hex: FFA500
  - id: braun
    hex: A52A2A    
  - id: magenta
    hex: FF00FF
  - id: grau
    hex: BEBEBE
  - id: weiss
    red_int: 255
    green_int: 255
    blue_int: 255

###### SCHRIFTARTEN ######
font:
  - file: "arial.ttf"
    id: arial10
    size: 10
  
  - file: "arial.ttf"
    id: arial15
    size: 15
  
  - file: "arial.ttf"
    id: arial20
    size: 20

  - file: "arial.ttf"
    id: arial25
    size: 25

  - file: "arial.ttf"
    id: arial40
    size: 40

  - file: "arial.ttf"
    id: arial80
    size: 80

  - file: "materialdesignicons-webfont.ttf" # https://pictogrammers.com/library/mdi/
    id: icon80
    size: 80
    glyphs: [
      
      "\U000F0599", # Sonne (weather-sunny) 
      "\U000F05A9", # WIFI (wifi) 
      "\U000F01F5", # Smile (emoticon-happy-outline)
          ]
    
  - file: "materialdesignicons-webfont.ttf" # https://pictogrammers.com/library/mdi/
    id: icon20
    size: 20
    glyphs: [
      
      "\U000F0599", # Sonne (weather-sunny) 
      "\U000F05A9", # WIFI (wifi) 
      "\U000F01F5", # Smile (emoticon-happy-outline)
          ]

sensor:
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    id: wifi_signal_Prozent
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"
    device_class: ""

time:
  - platform: homeassistant
    id: home_time