Drivers for Waveshare 2.13inch E-Ink display

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by OutoftheBOTS_ » Wed May 16, 2018 10:23 am

I haven't read the datasheet for the exact epaper your using but most epaper screens can't do partial updates. You have to make a full screen buffer and write the whole screen.

So you would need to make some small mods to pythoncoder writer.py code were you could possibly pass it a framebuffer for the screen and the write.py writes to the framebuffer rather then the screen then returns this buffer and your program can then send this buffer to the epaper.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by deshipu » Wed May 16, 2018 12:43 pm

Of course the e-ink screens can do partial updates. It involves some work with most display controllers, but it's perfectly doable.

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by devnull » Wed May 16, 2018 1:38 pm

OK, I have it working now with Peter's writer class.

Still have some problems with the display not clearing and white on Black instead of black on white.

So this is using 1.54" waveshare display on 'official' ESP32 latest build.

I can't see to make the writer class write black on white, is there a way to invert the colours ?

https://github.com/peterhinch/micropyth ... /writer.py

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by devnull » Wed May 16, 2018 2:36 pm

Hmmmm, well it is kind of working, but each time I write a textstring, the text is displayed on the screen at the correct position, and then the entire screen blinks / switches white, black, white, black, white black over the period of about 2 seconds.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by pythoncoder » Wed May 16, 2018 4:19 pm

I'm not well placed to help here as I haven't got the same hardware. But the update mechanism for the display my driver supports is to flash the screen several times before displaying the text. This is normal for E-ink displays.

Partial updates work, but not very well in my experience. They avoid the 2-3 seconds of blinking but at the cost of some ghosting. Perhaps other E-ink displays work better in that respect than the one I use, but I did quite a bit of work on this comparing my driver with one for the Raspberry Pi: both performed similarly in terms of update time and partial updates/ghosting.

As for changing the framebuf/writer to invert the colours that needs a bit of thought but is doubt it's too hard.
Peter Hinch
Index to my micropython libraries.

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by devnull » Thu May 17, 2018 1:55 pm

Thanks, I was not aware that this flashing was normal for the e-paper displays as this is the first time I have used one.

So anyway, now I can reliably format sizable fonts and draw lines on the screen, my next objective is to display images as icons.

So I have converted a 40x40 mono image bitmap icon to bytearray and I can display this image at any position on the screen.

Problem is I cannot seem to combine these text and image layouts with an icon.

When I load the image over the existing divider lines and text, wha happens is the display sometimes shows only the icon, or only the text & plotted lines and sometimes both, but I can't seem to reliably have all 3 together, it seems that there are separate 2 pages, one with the image and another with the text & plotted lines.

I am using mcauser's driver, and the function to load the image is set_frame_memory() https://github.com/mcauser/micropython- ... ld/test.py

Any suggestions on what the problem / solution may be ?

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by devnull » Fri May 18, 2018 3:45 am

I Have spent several hours testing the behaviour of the e-paper displays specifically doing partial update to avoid the 2 or 3 seconds of blinking screens.

I have discovered that if you do a partial update, with each update the contrast of the screen is reduced, and this means if you are attempting to say update the screen every 5 seconds with real-time data (such as time or temperature) , that the screen contrast will get lighter and lighter, although the reduction does seem to reduce or stop after about 30 updates.

This is much more apparent using black background and white foreground (text).

Is there a solution to this, the screen blinking 5 or 6 times really is not pretty and to do this every 5 seconds would make it un-usable !

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by OutoftheBOTS_ » Fri May 18, 2018 5:23 am

My understanding of epaper screens is their big advantage is ultra low power usage and good visibility in direct sunlight. Downside is more fragile than TFT, mono colour and very slow updates. I think they are more suited to applications where updates are less frequent and low power use is needed. i.e an application that uses deep sleep to save battery then wakes up every 15mins and reads sensors and updates screen then goes back into deep sleep.

If you need constant updates and power consumption doesn't matter then you might be better with OLED or TFT

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by deshipu » Fri May 18, 2018 6:56 am

devnull wrote:
Fri May 18, 2018 3:45 am
Is there a solution to this, the screen blinking 5 or 6 times really is not pretty and to do this every 5 seconds would make it un-usable !
Well, if you look at what the book readers do, you will see the solution that they came up with: keep a counter of the partial updates, and once it reaches a certain threshold, do a full update.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Writer class

Post by pythoncoder » Fri May 18, 2018 7:51 am

Thanks to diginfo on GitHub this now includes an option to display characters in black-on-white.
Peter Hinch
Index to my micropython libraries.

Post Reply