Display zum laufen bringen

Hallo community,

Display: Heltec WiFi Kit 32 V3.1
zum ausprobieren in Arduino ausprobiert: WIFI Kit 32 Factory Test
Fehlermeldung: A fatal error occurred: This chip is ESP32-S3 not ESP32. Wrong --chip argument?
Recherche ergab neues Plugin installieren: 'A fatal error occurred: This chip is ESP32-S3 not ESP32. Wrong --chip argument?' (When uploading SPIFFS) (ESPTOOL-684) · Issue #882 · espressif/esptool
Plugin nicht installierbar weil JAR-Datei nicht funktioniert / kaputt

Frage: Wo bekomme ich ein funktionierendes Plug-in her?

Ich werde wahrscheinlich noch öfter Fragen stellen, weil ich komplett neu mit Python und Arduino bzw. programmieren von Displays bin. Programmieren ist mir aber mit C / Matlab vertraut.

Im englischen Teil des Forum müssen die Beiträge und Diskussionen in englischer Sprache verfasst werden. Deswegen wurde diese Diskussion in den deutschen Teil des Forums verschoben.

mfg ein Moderator.

Ich würde bei Heltec gucken. Da ist ein Verweis auf GitHub - HelTecAutomation/Heltec_ESP32: Arduino library for Heltec ESP32 (or ESP32+LoRa) based boards

Und in der V3 sollte ein ESP32-S3 drin sein, das habe ich auch rausgekriegt.
Vielleicht nimmst du besser den WiFi_Kit_32_V3_FactoryTest

Hallo michael_x,
danke für die schnelle Antwort.
Ich habe mal den V3 factory test laufen lassen.
Leider Fehlermeldung:
redefinition of 'SSD1306Wire factory_display'
30 | SSD1306Wire factory_display(0x3c, 500000, SDA_OLED, SCL_OLED, GEOMETRY_128_64, RST_OLED); // addr , freq , i2c group , resolution , rst

was ist hier konkret redefiniert worden?

Du hast in den Einstellungen einen ESP32 eingestellt.
Heltec schreibt:

Unter: Werkzeuge Board kann ich einen ESP32S3 auswählen. Du hast einen ESP32 ausgewählt.

Du brauchst mindestens die Version 3.0.2 für das Boardframework
-> Werkzeuge Board Boardverwalter

Denn später kommt noch dazu:

Hallo miteinander,
ich habe folgende esp32 Boards installiert: Arduino ESP32 V2.0.18, esp32 (Espressif) V3.3.4, Heltec ESP32 Dev-boards V3.0.3

Hast du toll gemacht.

Ist das i.O.? Oder zu viel? oder muss noch etwas dazu?

update:
ich habe das Display mit Beispiel-code zum Laufen bekommen.
Ausgewählt habe ich COM3 mit Heltec WiFi Kit32 (V3)
Im Beispiel-code WiFi_Kit_32_V3 war ein Wort vergessen worden: static

static SSD1306Wire factory_display(0x3c, 500000, SDA_OLED, SCL_OLED, GEOMETRY_128_64, RST_OLED); // addr , freq , i2c group , resolution , rst

Diese Demo läuft nun

@batler Wenn ich mich hier kurz anhängen darf: Wo hast du das Factory Example gefunden?

Ich hab in Arduino unter File -> Examples -> Examples for Heltec WifiKit 32(V3) lauter allgemeine Programme die mit dem board gar nicht laufen oder etwas damit zu tun haben.

Also du hast normalen OLED 128 x 64 drauf mit ssd1306 Controller drauf. Um mehr rausholen, bedeutet Schriftarten usw. kannst die U8G2 Bibliothek nehmen.
Einziges was ich nicht weiß ob die U8G2 funktioniert mit ESP Core höher als 2.0.17
Wo bei das Board brauch nicht unbedingt höheres Core. Es gibt sehr viele Bibliotheken was sind noch nicht auf 3.xx umgeschrieben, angepasst.
Man kann noch bei nutzung anderer Display Bibliotheken den I²C Takt auf 500000 stellen in dem man im Setup

Wire.begin(17,18);// SDA,SCL
Wire.setClock(500000);

einträgt, schreibt.

Hi bersaelor,
ich kann leider nicht mehr genau sagen woher ich es habe.
Zunächst dachte ich aus den Beispielen von Arduino. Es kann aber auch aus dem Netz gewesen sein.

Hier das funktionsfähige Beispiel, falls Interesse besteht:


// For a connection via I2C using the Arduino Wire include:
#include <Wire.h>               //display initialization
#include "HT_SSD1306Wire.h"     //display initialization
#include "images.h"

static SSD1306Wire  display(0x3c, 500000, SDA_OLED, SCL_OLED, GEOMETRY_128_64, RST_OLED); 
// 0x3c: I²C address of the display , 500000: I²C clock frequency in Hz , SDA_OLED: SDA pin for the I²C bus , SCL_OLED: SCL pin for the I²C bus, 
// resolution GEOMETRY_128_64 x=128px y=64px , RST_OLED: Reset pin for the display

#define DEMO_DURATION 3000
typedef void (*Demo)(void);

int demoMode = 0;
int counter = 1;        //Zähler vordefiniert

// enable external voltage (Vext) to power the display (if needed):
void setup() {
  Serial.begin(115200); // baudrate
  Serial.println();
  Serial.println();
  VextON();             // Turn on external voltage
  delay(100);           // Wait for display power stabilization 100 sec

  // Initialising the UI will init the display too.
  display.init();      // Initialisierung des Displays
                       // display.clear();  Display löschen
                      // display.display(); Display updaten
                      // display.setContrast(255);  Kontrastlevel einstellen (0-255)

  display.setFont(ArialMT_Plain_10);    // allg. Textschriftart und Größe festgelegt, z.B. ArialMT_Plain_10: Small 10px font, ArialMT_Plain_16: Medium 16px font, ArialMT_Plain_24: Large 24px font
                                        // max. 64px font hier möglich

}

// TEXT AUF BILDSCHIRM ANZEIGEN LASSEN
void drawFontFaceDemo() {
    // Font Demo1
    // create more fonts at http://oleddisplay.squix.ch/
    display.setTextAlignment(TEXT_ALIGN_LEFT);
    display.setFont(ArialMT_Plain_10);
    display.drawString(0, 0, "Hello world");
    display.setFont(ArialMT_Plain_16);
    display.drawString(0, 10, "Hello world");
    display.setFont(ArialMT_Plain_24);
    display.drawString(0, 26, "Hello world");
}

// TEXT AUF BILDSCHIRM FLIESSEN LASSEN
void drawTextFlowDemo() {
    display.setFont(ArialMT_Plain_10);            //Schriftgröße
    display.setTextAlignment(TEXT_ALIGN_LEFT);    //Anordnung Schrift (linksbündig: TEXT_ALIGN_LEFT, zentriert: TEXT_ALIGN_CENTER, rechtsbündig: TEXT_ALIGN_RIGHT)
    display.drawStringMaxWidth(0, 0, 128,        //drawStringMaxWidth: multi-line text with automatic wrapping (text at spaces and hyphens to fit within the specified width);
                                                 // Anordnung Schrift: x-Startpunkt, y-Startpunkt, max. Breite, Ausgabe des Textes innerhalb " "
      "Lorem ipsum\n dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore." );
}


// TEXT AUF VERSCH. ARTEN ANORDNEN
void drawTextAlignmentDemo() {
  // Text alignment demo
  char str[30];
  int x = 0;
  int y = 0;
  display.setFont(ArialMT_Plain_10);
  // The coordinates define the left starting point of the text
  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.drawString(x, y, "Left aligned (0,0)");

  // The coordinates define the center of the text
  display.setTextAlignment(TEXT_ALIGN_CENTER);
  x = display.width()/2;           //Berechnung desr Mitte im Display
  y = display.height()/2-5;
  sprintf(str,"Center aligned (%d,%d)",x,y);
  display.drawString(x, y, str);

  // The coordinates define the right end of the text
  display.setTextAlignment(TEXT_ALIGN_RIGHT);
  x = display.width();
  y = display.height()-12;
  sprintf(str,"Right aligned (%d,%d)",x,y);
  display.drawString(x, y, str);
}

// Draw a pixel at given position
void drawRectDemo() {
      
    for (int i = 0; i < 10; i++) {
      display.setPixel(i, i);
      display.setPixel(10 - i, i);
    }
    display.drawRect(12, 12, 20, 20);

    // Fill the rectangle
    display.fillRect(14, 14, 17, 17);

    // Draw a line horizontally
    display.drawHorizontalLine(0, 40, 20);

    // Draw a line horizontally
    display.drawVerticalLine(40, 0, 20);
}

// Draw a circels at given position
void drawCircleDemo() {
  for (int i=1; i < 8; i++) {
    display.setColor(WHITE);
    display.drawCircle(32, 32, i*3);     //display.drawCircle(x Start, y Start, Radius); draw circle outline
    if (i % 2 == 0) {
      display.setColor(BLACK);           //Spirale erzeugen indem best. Pixel dunkel geschaltet werden
    }
    display.fillCircle(96, 32, 32 - i* 3);   //display.fillCircle(x Start, y Start, Radius); draw filled circle
  }
}

// Fortschrittsbalken anzeigen mit prozentualer Anzeige
void drawProgressBarDemo() {              
  int progress = (counter / 5) % 100;                    // Zähler zuvor oben initialisiert: int counter = 1; 
  // draw the progress bar                               // Fortschrittsbalken zeichnen
  display.drawProgressBar(0, 32, 120, 10, progress);     // drawProgressBar(x Start, y Start, width, height, percentage)

  // draw the percentage as String
  display.setTextAlignment(TEXT_ALIGN_CENTER);
  display.drawString(64, 15, String(progress) + "%");    // %-Fortschritt anzeigen
}

// ANZEIGE VON statischen BILDERN MIT xbm-files
void drawImageDemo() {
    // see http://blog.squix.org/2015/05/esp8266-nodemcu-how-to-create-xbm.html on how to create xbm files
    display.drawXbm(34, 14, WiFi_Logo_width, WiFi_Logo_height, WiFi_Logo_bits);   //display.drawXbm(x Start, y Start, width, height, bitmap_data); Xbm (X BitMap) = Karte / 2D-Tabelle mit Bit-Zahlen
}

void VextON(void)
{
  pinMode(Vext,OUTPUT);
  digitalWrite(Vext, LOW);
}

void VextOFF(void) //Vext default OFF
{
  pinMode(Vext,OUTPUT);
  digitalWrite(Vext, HIGH);
}


Demo demos[] = {drawFontFaceDemo, drawTextFlowDemo, drawTextAlignmentDemo, drawRectDemo, drawCircleDemo, drawProgressBarDemo, drawImageDemo};
int demoLength = (sizeof(demos) / sizeof(Demo));
long timeSinceLastModeSwitch = 0;

// ERZEUGUNG ANZEIGENSCHLEIFE
void loop() {
  // clear the display
  display.clear();           //.clear(): Clears the display buffer
  // draw the current demo method
  demos[demoMode]();

  display.setTextAlignment(TEXT_ALIGN_RIGHT);
  display.drawString(10, 128, String(millis()));
  // write the buffer to the display
  display.display();         //.display(): Sends the buffer content to the physical display

  if (millis() - timeSinceLastModeSwitch > DEMO_DURATION) {
    demoMode = (demoMode + 1)  % demoLength;
    timeSinceLastModeSwitch = millis();
  }
  counter++;
  delay(10);          // Wait for display power stabilization 10sec
}

Das kommt sicher hier raus.
Sowas sollte man sich auch für die eigene Verwendung speichern. Dann hat man selbst weniger Probleme.