Waveshare eink 2in7 screen flockering after power cycle

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Posts: 20
Joined: Sun Dec 01, 2019 3:04 pm

Waveshare eink 2in7 screen flockering after power cycle

Post by djipey » Sun Mar 22, 2020 8:03 am


I managed to fully use a Waveshare eink screen 2in7. I use this driver: https://github.com/mcauser/micropython- ... per2in7.py. I use to display information from sensors: temperature, humidity, etc.

This is how I setup the screen:

Code: Select all

def setup_screen():
    # SPIV on ESP32
    sck = Pin(18)
    miso = Pin(19)  # Not physically connected
    mosi = Pin(23)
    dc = Pin(22)
    cs = Pin(5)
    rst = Pin(21)
    busy = Pin(4)

    spi = SPI(2, baudrate=115200, polarity=1, phase=1, sck=sck, mosi=mosi, miso=miso)

    screen = epaper2in7.EPD(spi, cs, dc, rst, busy)

    print("Screen ready")

    return screen
And this is how I use it:

Code: Select all

buf = bytearray(config.SCREEN_W * config.SCREEN_H // 8)
fb = framebuf.FrameBuffer(buf, config.SCREEN_W, config.SCREEN_H, framebuf.MONO_HLSB)

black = 1
white = 0

fb.blit(pics.fb_thermometer, 0, 2)
The first time I upload some files to the board (ESP32 dev kit) and reboot (by disconnecting/connecting the USB cable), the screen works fines and displays what I want. And it works indefinitely: my program loops and read sensors every 10 seconds and displays the info on the screen. The screen refreshes smoothly. The system ran overnight without problem.

Now, when I disconnect the board (to move it somewhere else), the screen seems to have some sort of memory effect. I know eink screens display the same thing until they are refreshed, but that's not what I'm talking about. When I reconnect the board, the screen displays the new data, but then hangs indefinitely: the image is first very clear, then it fades almost completely (white background), then the screen gets slightly dark, and the pattern starts at the begin. This is happening even if I disconnect the screen's power pin. And I don't understand why.

To make it work again, I need to upload any file to the board (with ampy), and then disconnect/reconnect the board.

Any idea why this is happening?

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

Re: Waveshare eink 2in7 screen flockering after power cycle

Post by pythoncoder » Sun Mar 22, 2020 8:50 am

I haven't used the Waveshare devices but I have written a driver for another e-ink display. They are curious things which can exhibit various memory effects. My driver was ported from the display manufacturer's C code and uses its algorithm which repeatedly flashes the screen before a full update. If the Waveshare driver doesn't do this, I'd suggest, on initial power up, displaying a full frame of white, followed by a frame of black (possibly more than once) before displaying your actual predominantly white frame.
Peter Hinch

Post Reply