Waveshare 2.13in display v2 driver

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
Posts: 3
Joined: Sun Jun 02, 2019 2:38 pm

Waveshare 2.13in display v2 driver

Post by mattstock » Sun Jun 02, 2019 2:51 pm

Hi all,

I'm new to the micropython community, and am working on a project that's based around a custom ESP32 board and one of the common Waveshare/Good Display 2.13" black and white e-ink displays. Between ordering my first display and my second, they seem to have replaced the display with one that seems faster/better, but has a completely different programming and initialization method. :-) There seems to be very little code out there for the new "v2" board.

The model numbers seem to vary a bit, but I'm talking about Waveshare SKU 12672 V2, or Good Display GDEH0213B72. The only example code I've found that works with the new board is https://github.com/ZinggJM/GxEPD, which is great but not python and is somewhat hard to read due to the massive amount of subclassing involved due to the hardware and graphics abstractions.

Before I go down the rabbit hole of porting this logic to a micropython module:

1. Has this already been done, or is anyone working on it and would like to collaborate?
2. Are there existing generic graphics modules that someone could point me to?
3. Is there a process I should be following to provide any developed code to the community?

Thanks much, and I am quite impressed with what I've seen in the platform so far.

User avatar
Posts: 426
Joined: Mon Jun 15, 2015 8:03 am

Re: Waveshare 2.13in display v2 driver

Post by mcauser » Mon Jun 03, 2019 4:17 am

Official WaveShare drivers - now includes python2 and 3 (Raspberry Pi):

WaveShare product page:

WaveShare wiki:

1. A while ago, I forked their old python drivers and made a MicroPython friendly version:
They've made more changes since which I'll need to rebase against in the near future.

Heres a pycom flavoured one:

2. There's many supported displays. OLEDs, TFTs, character LCDs etc. Have a search on Github for "MicroPython display driver". Bitbucket and Gitlab too. Have a look at the MicroPython docs on Framebuf.

3. Share your code on Github or your favourite platform and announce with a forum post. Or fork and contribute pull requests to other peoples drivers.
Once you have a working driver, you could even publish it on PyPI so it can be installed using upip.

Posts: 3
Joined: Sun Jun 02, 2019 2:38 pm

Re: Waveshare 2.13in display v2 driver

Post by mattstock » Mon Jun 03, 2019 12:49 pm

Thank you mcauser. I saw your code, and figured that might be the right place to start from. Expect some pull requests if I find the answers I'm looking for.

Unfortunately, Waveshare released the new hardware, and has told me (and the repo seems to confirm) that they have not yet released any sample code or libraries that work with it. It's possible that someone released from Good Display is available (and thus the working ardunio library I reference), but I haven't found anything yet.


I did find the Good Display example code, which seems very promising. I'll see what I can do with that: http://www.e-paper-display.com/products ... d=423.html

Posts: 3
Joined: Sun Jun 02, 2019 2:38 pm

Re: Waveshare 2.13in display v2 driver

Post by mattstock » Sun Jun 30, 2019 2:24 pm

I have made some progress!

I have the full update ESP module logic mostly baked. One issue I did run into is that due to the orientation of the display (long axis is horizontal), I ended up needing a vertical MSB mode for the standard framebuffer I'm using for drawing primitives. I've made a pull request at https://github.com/micropython/micropython/pull/4887 to see if that can get rolled into the standard distribution.

Now that I know I can draw things and in the proper orientation, I'm going to be looking at some of the other framebuffer extensions that allow support for different fonts, etc, as well as potentially implementing partial updates of the screen.

I'll report back once I have a module for this screen that seems fit to share.


User avatar
Posts: 3867
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Re: Waveshare 2.13in display v2 driver

Post by pythoncoder » Mon Jul 01, 2019 6:46 am

Re fonts and framebuffers you might like to look at this solution.
Peter Hinch

Posts: 1
Joined: Mon Aug 12, 2019 6:10 am

Re: Waveshare 2.13in display v2 driver

Post by peternz » Mon Aug 12, 2019 7:17 am

Hi Mattstock,
Have you made any progress on your the driver? I have an ESP32 TTGO T5 V2.0 board with 2.13in e-ink display. I think it has the same GDEH0213B72 chip.

I tried mcauser’s driver. The display flashes black and white a couple of times but only displays random black and white pixels, which looks like sandpaper. I have 2.9 inch display on a Lolin board and can display text on it, so I think my code is ok. Any suggestions would be great.


Post Reply