Compiling error on LilyGo 2.13 ePaper display (DEPG0213BN)

Hello!

I'm trying to use a LilyGo 2.13 ePaper display. The model is DEPG0213BN.

I followed the steps in the github repository: Xinyuan-LilyGO/LilyGo-T5-Epaper-Series.

  1. I installed Adafruit-GFX library, and the GxEPD library from this repository: GitHub - lewisxhe/GxEPD: A simple E-Paper display library with common base class and separate IO class for Arduino.

  2. I copied all the files from GxEPD/src at master · lewisxhe/GxEPD · GitHub to my libraries folder.

  3. I took the example code from the github repository at Xinyuan-LilyGO/LilyGo-T5-Epaper-Series/blob/master/examples/GxEPD_Example/GxEPD_Example.ino

  4. I uncommented the following lines:

#define LILYGO_T5_V213

and

#include <GxDEPG0213BN/GxDEPG0213BN.h>    // 2.13" b/w  form DKE GROUP
  1. In my Arduino IDE, I have "ESP32 Dev Module" selected as board.

  2. When trying to compile, I get the error:

In file included from /Users/xxxxx/Arduino/libraries/GxEPD-lewisxhe/GxEPD.h:20:0,
                 from /Users/xxxxx/Arduino/GxEPD_Example/GxEPD_Example.ino:10:
/Users/xxxxx/Arduino/libraries/GxEPD-lewisxhe/GxFont_GFX.h:77:13: error: 'int16_t GxFont_GFX::getUTF8Width(const char*)' cannot be overloaded
     int16_t getUTF8Width(const char *str);
             ^
/Users/xxxxx/Arduino/libraries/GxEPD-lewisxhe/GxFont_GFX.h:45:13: error: with 'int16_t GxFont_GFX::getUTF8Width(const char*)'
     int16_t getUTF8Width(const char *str);
             ^

Any idea how to solve this?

Thanks!

See added getUTF8Width method for U8g2 fonts by pianojockl · Pull Request #1 · lewisxhe/GxEPD · GitHub

Thanks very much @ZinggJM !

I commented the 2 sections from that commit in my local library. Now I have this error:

sketch/GxEPD_Example2.ino.cpp.o:(.literal._Z5setupv+0x3c): undefined reference to `GxDEPG0213BN::init(unsigned int)'
sketch/GxEPD_Example2.ino.cpp.o:(.literal._Z5setupv+0x44): undefined reference to `GxDEPG0213BN::fillScreen(unsigned short)'
sketch/GxEPD_Example2.ino.cpp.o:(.literal._Z5setupv+0x58): undefined reference to `GxDEPG0213BN::update()'
sketch/GxEPD_Example2.ino.cpp.o:(.literal._Z14drawCornerTestv+0x0): undefined reference to `GxDEPG0213BN::drawCornerTest(unsigned char)'
sketch/GxEPD_Example2.ino.cpp.o:(.literal._Z4loopv+0xc): undefined reference to `GxDEPG0213BN::powerDown()'
sketch/GxEPD_Example2.ino.cpp.o:(.literal.startup._GLOBAL__sub_I_io+0x8): undefined reference to `GxIO_SPI::GxIO_SPI(SPIClass&, signed char, signed char, signed char, signed char)'

But the files bellow do contain the init function fine:

GxDEPG0213BN/GxDEPG0213BN.h
GxDEPG0213BN/GxDEPG0213BN.cpp

In my sketch, even if I switch the naming trick to the actual name of the class, I still get the same error.

//GxEPD_Class display(io, EPD_RSET, EPD_BUSY);
GxDEPG0213BN display(io, EPD_RSET, EPD_BUSY);

Problem solved!

Besides commenting the 2 lines as I mentioned above... The other issue was step 2 on my original post.

I copied the files from GxEPD/src at master · lewisxhe/GxEPD · GitHub to my libraries folder, as such:

/Users/xxxxx/Arduino/libraries/GxEPD-lewisxhe/GxEPD.h (to pick one file as example)

But I needed to copy the full repository, including the "src" folder, to look like this:

/Users/xxxxx/Arduino/libraries/GxEPD-lewisxhe/src/GxEPD.h (to pick one file as example)

This is what I have in my folder now, after renaming GxEPD-lewisxhe to GxEPD:

libraries ls -la GxEPD 
total 1112
drwxr-xr-x@ 13 levy  staff     416 Feb  5 21:42 .
drwxr-xr-x@ 33 levy  staff    1056 Feb  5 21:42 ..
drwxr-xr-x@ 13 levy  staff     416 Feb  5 21:42 .git
-rw-r--r--@  1 levy  staff     841 Feb  5 21:42 CONTRIBUTING.md
-rw-r--r--@  1 levy  staff    2893 Feb  5 21:42 ConnectingHardware.md
-rw-r--r--@  1 levy  staff   35141 Feb  5 21:42 LICENSE
-rw-r--r--@  1 levy  staff  500090 Feb  5 21:42 MyEPDs_UpdateInfos.pdf
-rw-r--r--@  1 levy  staff    8886 Feb  5 21:42 README.md
drwxr-xr-x@ 15 levy  staff     480 Feb  5 21:42 examples
drwxr-xr-x@  3 levy  staff      96 Feb  5 21:42 extras
-rw-r--r--@  1 levy  staff     448 Feb  5 21:42 issue_template.md
-rw-r--r--@  1 levy  staff     460 Feb  5 21:42 library.properties
drwxr-xr-x@ 51 levy  staff    1632 Feb  5 21:45 src

Conclusion: the Arduino IDE was able to locate GxDEPG0213BN/GxDEPG0213BN.h but not GxDEPG0213BN/GxDEPG0213BN.cpp. Apparently *.cpp files needs to be within a "src" folder.

I have tried to run the newer version of LilyGo 2.13 ePaper display DEPG021BN with GxEPD2 from ZinggJM (which works very well for the prior version from 2019 using GxEPD_213_B73). With the newer version (DEPG021BN) I tried GxEPD2_213_B74 which displays fine but I was not able to do partial update. Hints very welcome.

So I ended up here trying lewisxhe/GxEPD and got the same problem as described in this thread. I had some troubles understanding what is part of the solution and what is not. So I summarize my findings here:
I am working on a Debian Linux system using Arduino 1.8.13 from arduino.cc

I started with an emty test sketchbook folder and git clone

1) mkdir -p ~/sketchbook_LILYGO-T5_test/libraries/
    cd ~/sketchbook_LILYGO-T5_test/libraries/
    git clone https://github.com/lewisxhe/GxEPD.git

2) installed Adafruit GFX Library with Arduino Library Manager
    let it install Adafruit BusIO

3) uncommented line 7 in file PartialUpdateExample.ino
    #define LILYGO_T5_V213

4) tried to compile GxEPD PartialUpdateExample and got:
    In file included from /home/dada/sketchbook_LILYGO-T5_test/libraries/GxEPD/src/GxEPD.h:20:0,
                 from /home/dada/sketchbook_FOREIGN/libraries/GxEPD/examples/PartialUpdateExample/PartialUpdateExample.ino:17:
/home/dada/sketchbook_LILYGO-T5_test/libraries/GxEPD/src/GxFont_GFX.h:77:13: error: 'int16_t GxFont_GFX::getUTF8Width(const char*)' cannot be overloaded
     int16_t getUTF8Width(const char *str);
/home/dada/sketchbook_LILYGO-T5_test/libraries/GxEPD/src/GxFont_GFX.h:45:13: error: with 'int16_t GxFont_GFX::getUTF8Width(const char*)'
     int16_t getUTF8Width(const char *str);
 
5) git log --pretty=oneline --abbrev-commit
         (HEAD -> master, origin/master, origin/HEAD) 
           Merge pull request #1 from pianojockl/master
       11c9aa1 Added GxDEPG0097BW
       21c5430 Added depend
       ...

6a) solution 1  If you use git
     git checkout 11c9aa1
     HEAD is now at 11c9aa1 Added GxDEPG0097BW
     PartialUpdateExample compiles fine and runs without problems :)

6b) If you do not want to use git just comment the lines 
       from the bad last commit out to look like this:
       file libraries/GxEPD/src/GxFont_GFX.cpp lines 68-71
         // int16_t GxFont_GFX::getUTF8Width(const char *str)
         // {
         //  return _U8G2_FONTS_GFX.getUTF8Width(str);
         // }

      and file libraries/GxEPD/src/GxFont_GFX.cpp line 45
         // int16_t getUTF8Width(const char *str);

   Problem solved :)

The problem came from commit c5b9292 as ZinggJM indicates in answer #2.
I did not have to change anything in the file tree regarding 'src/' directory.

PS: I still would prefer to use GxEPD2 from ZinggJM to use the same code as I do for the older board version. Why can't I do partial update on DEPG021BN boards as I did with the older board version?

@anon15581508, Hi, welcome back!

You might take a look at GxEPD2_display_selection_new_style.h.
In the comments you can see which controllers the display panels use.

The panel of your display doesn't come from Good Display. It has no differential refresh waveform table in OTP. This is the same issue as with the 2.9" V2 version from Waveshare:

//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94  128x296, SSD1680
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94_V2 // GDEM029T94  128x296, SSD1680, Waveshare 2.9" V2 variant

You could persuade LiliGo to provide me with a free sample.
Or you can either modify the class GxEPD2_290_T94_V2 for use with your display (WIDTH, HEIGHT,?..), or add the differential refresh wavetable from GxEPD2_290_T94_V2 to GxEPD2_213_B74.

Jean-Marc

Edit:

If a topic is marked solved, it is better practice to start a new topic, instead of hijacking it.
Then you can provide a title that better matches your issue or question.

Great suggestion Jean-Marc, i just did what you said and after modifying those files (GxEPD2_290_T94_V2.cpp, GxEPD2_290_T94_V2.h) , changing size and timing in .h file renaming to GxEPD2_213_BN and inserting the relevant include in GxEPD2_BW.h all the examples worked like a charm (just using new selection style and adding the proper define in GxEPD2_selection_check.h for each example)

thanks for your great library

Emilio