ESP32S3 With Waveshare epaper

Hi guys i could use help with a project i am working on currently. i made a custom board for the ESP32 S3 WROOM 1 module and i want to use it to read from an online database and display the data on the epaper display. i am using the 2'9 inch epaper module from waveshare.
I've been trying to use the GxEPD2 library but i cant get even the example codes to show anything on the display. I had to remap the SPI default pins and im wondering if that is causing the problems. I should also mention that this is my first arduino project and first project using the esp32 aswell. Is it possible to remap the SPI pins and use the library without going into the library and making changes in it ? this is a simple code i made to try and make the display to show something

#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#include <SPI.h>

// Select the display driver 
GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT / 2> display(GxEPD2_290(/*CS=*/ 13, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));

SPIClass mySPI(HSPI); // Create SPI object for HSPI

void setup() {
  Serial.begin(115200);
  Serial.println();
  Serial.println("setup");

  // Remap SPI pins for ESP32-S3
  mySPI.begin(12, 15, 11, 13); // CLK, MISO, MOSI, CS

  // Initialize the display with SPI settings
  display.init(115200, true, 10, false, mySPI, SPISettings(1000000, MSBFIRST, SPI_MODE0));

  display.setRotation(1);

  display.fillScreen(GxEPD_WHITE);
  display.setTextColor(GxEPD_BLACK);
  display.setFont(&FreeMonoBold9pt7b);

  const char text[] = "Hello E-Paper!";
  int16_t tbx, tby;
  uint16_t tbw, tbh;
  display.getTextBounds(text, 0, 0, &tbx, &tby, &tbw, &tbh);
  uint16_t x = (display.width() - tbw) / 2 - tbx;
  uint16_t y = (display.height() - tbh) / 2 - tby;

  display.setCursor(x, y);
  display.print(text);

  display.display(false);
  display.powerOff();
  Serial.println("setup done");
}

void loop() {

}

Take a look at GxEPD2_Example.ino line 184:

#elif (defined(ARDUINO_ARCH_ESP32) && defined(ARDUINO_LOLIN_S2_MINI))
  // SPI.begin(sck, miso, mosi, ss); // preset for remapped pins
  SPI.begin(18, -1, 16, 33); // my LOLIN ESP32 S2 mini connection

on sone ESP32 variants HSPI doesn't work. Remap the global instance SPI.

I have deleted your other cross-post @fosteras.

Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting can result in a suspension from the forum.

In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

Hi, thanks for the reply. I tryed real hard :D. could'nt get it to work, i the library isnt really made with custom pins in mind, i might be just bad at it though thats more propable :smiley: . anyway i tried using the libraries directly from waveshare and after a couple of tries i got it working :)) .

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.