G6EJD / ESP32-e-Paper-Weather-Display

An ESP32 and 2.9", 4.2" or 7.5" ePaper Display reads Weather Underground data via their API and then displays the weather
Other
959 stars 206 forks source link

GxEPD2_750c_Z08 epd not worked because out of RAM #115

Closed esonhon closed 3 years ago

esonhon commented 4 years ago

I think we should use GxEPD2's paged drawing feature to reduce the RAM size (or Heap size?) Now, if I defined my screen with GxEPD2_3C < GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT> display(GxEPD2_750c_Z08(/CS=/ EPD_CS, /DC=/ EPD_DC, /RST=/ EPD_RST, /BUSY=/ EPD_BUSY)); // GDEW075Z08 800x480

Got the link error: /.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\firmware.elf section .dram0.bss' will not fit in regiondram0_0_seg' /.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit. /.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 17464 bytes

G6EJD commented 3 years ago

Well you could propose a solution... I doubt the savings will amount to much(~17K)

clusterice commented 3 years ago

Hi esonhon

This is not an issue. You have two possibilities to fix this:

Change the constructor to:

GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 2> display(GxEPD2_750c_Z08(/*CS=*/ EPD_CS, /*DC=*/ EPD_DC, /*RST=*/ EPD_RST, /*BUSY=*/ EPD_BUSY));

Witch means you only use the half buffer at one time and change the drawing routine to pagewise drawing:

      if (RxWeather && RxForecast) { // Only if received both Weather or Forecast proceed
        StopWiFi(); // Reduces power consumption.
        display.firstPage();
        do {
        DisplayWeather();
        } while (display.nextPage()); // Full screen update mode
      }

Clusterice

G6EJD commented 3 years ago

Thank you @clusterice for suggesting this solution.