0

2.7" eInk screen not working
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

2.7" eInk screen not working

by aprzy15 on Wed Feb 20, 2019 6:21 pm

Hi,

I recently purchased two 2.7" eInk screens and am having some difficulty getting them to work. I have been trying to get the EPD test to run, but every time I run it it flashes the screen a bunch and ends up displaying this:
Image

I am using an arduino UNO, this is how I have the pins set up
Vin -> 5V
GND -> GND
SCK -> 13
MISO -> 12
MOSI -> 11
ECS -> 6
D/C -> 9
SRCS -> 8
RST -> 5
BUSY -> 4

Both screens display the same erroneous picture, and I have checked the connections to make sure there is continuity between the pins on the screen and the Arduino.
Any ideas are appreciated.

Code: Select all | TOGGLE FULL SIZE
#include "Adafruit_EPD.h"

#define EPD_CS     6
#define EPD_DC      9
#define SRAM_CS     8
#define EPD_RESET   5 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY    4 // can set to -1 to not use a pin (will wait a fixed delay)

/* Uncomment the following line if you are using 1.54" tricolor EPD */
//Adafruit_IL0373 display(152, 152 ,EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

/* Uncomment the following line if you are using 2.15" tricolor EPD */
//Adafruit_IL0373 display(212, 104 ,EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

/* Uncomment the following line if you are using 2.7" tricolor EPD */
Adafruit_IL91874 display(264, 176 ,EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);

void setup() {
  display.begin();
  display.clearBuffer();

  //draw some pretty lines
  for (int16_t i=0; i<display.width(); i+=4) {
    display.drawLine(0, 0, i, display.height()-1, EPD_BLACK);
  }

  for (int16_t i=0; i<display.height(); i+=4) {
    display.drawLine(display.width()-1, 0, 0, i, EPD_RED);
  }
 
  //refresh the display
  display.display();
}

void loop() {
  //don't do anything!
}

aprzy15
 
Posts: 2
Joined: Wed Feb 20, 2019 6:02 pm

Re: 2.7" eInk screen not working

by adafruit_support_carter on Wed Feb 20, 2019 6:39 pm

Can you try using the example from the library:
https://github.com/adafruit/Adafruit_EP ... cstest.ino
change the pins to match as needed:
https://github.com/adafruit/Adafruit_EP ... st.ino#L13
and uncomment the constructor for your display:
https://github.com/adafruit/Adafruit_EP ... st.ino#L26

See if you get odd behavior with that also.

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: 2.7" eInk screen not working

by dohnut on Wed Feb 27, 2019 12:43 am

Was a solution found for this issue?

I'm trying to get the same display to work and I have the exact same problem. Pixel for pixel. The only difference is, my wiring is identical to the code example(s) whereas the OP's wiring was a little different (but still should have been fine).

Code: Select all | TOGGLE FULL SIZE
#define EPD_CS     10
#define EPD_DC      9
#define SRAM_CS     8
#define EPD_RESET   5
#define EPD_BUSY    3

This is on a Rev 2 UNO with the 2.7" display (product 4098). I've verified continuity of all wiring between the display and UNO.

I've tried both the EPDTest (which to OP was trying) and the graphicstest projects. Everything compiles and uploads fine, however, neither work with this display.

dohnut
 
Posts: 4
Joined: Sat Feb 23, 2019 2:07 am

Re: 2.7" eInk screen not working

by adafruit_support_carter on Wed Feb 27, 2019 2:13 pm

@dohnut Please start a new thread for your issue.

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: 2.7" eInk screen not working

by adafruit_support_carter on Thu Mar 07, 2019 7:17 pm

We recreated this on our end. It seems to be a bug in the current release version of the library. A fix has been added and will be in the next release. If you're OK with a manual library install, you can grab the latest from the repo:
https://github.com/adafruit/Adafruit_EPD

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: 2.7" eInk screen not working

by Bruce_H on Sun Mar 17, 2019 6:46 pm

I am having the same problems as others with the Adafruit 2.7" EPD, even with the latest examples (as of 17 Mar 2019) on GITHUB and the most current Arduino libraries. My screen looks the same as someone else posted - a bunch of lines in the lower 1 x 1 cm left corner of the screen. EPD test displays a dark screen after several flashes, text test shows horizontal lines on a pink background and SD test blacks out ~2/3 of the screen (can change which region is blacked out by changing rotation value).
Please let us know when the problem is solved and new code is posted. Thanks!

Bruce_H
 
Posts: 4
Joined: Thu Mar 24, 2016 12:59 am

Re: 2.7" eInk screen not working

by adafruit_support_carter on Mon Mar 18, 2019 12:59 pm

How did you install the libraries?

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: 2.7" eInk screen not working

by Bruce_H on Mon Mar 18, 2019 2:39 pm

I installed the libraries through the Library manager. I currently have Adafruit EPD v. 1.02 and Adafruit GFX v. 1.4.6.
For Arduino code, I used both Examples in the Adafruit EPD library pull down menu and also copied directly from the GitHub files that were updated about a week ago (referenced in previous posts to this forum string).
Thanks.

Bruce_H
 
Posts: 4
Joined: Thu Mar 24, 2016 12:59 am

Re: 2.7" eInk screen not working

by adafruit_support_carter on Mon Mar 18, 2019 2:53 pm

The library hasn't had a version bump since the fixes were added. Therefore, they won't come in through the Library Manager. Have you done a manual library install before?

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: 2.7" eInk screen not working

by Bruce_H on Mon Mar 18, 2019 2:59 pm

No. I did look in my Mac's Document folder under Arduino Libraries and there is a file Adafruit_EPD with files from 1979 and an Adafruit_EPD-master with files from Jan 6, 2019 and Examples folder from Feb 18, 2019.

Bruce_H
 
Posts: 4
Joined: Thu Mar 24, 2016 12:59 am

Re: 2.7" eInk screen not working

by adafruit_support_carter on Mon Mar 18, 2019 3:27 pm

The fix is newer than Jan. 6. Since you have a folder named Adafruit_EPD-master, it sounds like you tried a manual install. Let's just try it again.

  • Move the two folders, Adafruit_EPD and Adafruit_EPD-master somewhere other than your Ardunio folder
  • go here: https://github.com/adafruit/Adafruit_EPD
  • click the "Clone or download" button and then "Download ZIP"
  • unzip that, rename the folder to Adafruit_EPD and put it in your Arduino/libraries folder

And then you should have the latest version of the library.

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Re: 2.7" eInk screen not working

by Bruce_H on Mon Mar 18, 2019 3:50 pm

Yes!! That worked. I had not tried the 'clone or download'. That worked with EPDtest, sdBitmap, and texttest. Thanks for you help.

Bruce_H
 
Posts: 4
Joined: Thu Mar 24, 2016 12:59 am

Re: 2.7" eInk screen not working

by adafruit2 on Tue Mar 19, 2019 1:22 am

pardon the delay - many bugs needed fixing - the repo is now up to date and released with latest code!

adafruit2
Site Admin
 
Posts: 18583
Joined: Fri Mar 11, 2005 7:36 pm

Re: 2.7" eInk screen not working

by deryaakitis on Thu Aug 08, 2019 1:01 pm

Hi, I am trying to display a bmp file with 2.13" diagonal e-Ink display by using Metro M4 express boot. When I try the basic code (from CircuitPython website) below, it seems like working well, it follows the code to the end and prints every command they I put in the code on the pc screen. But nothing changes on the
IMG_9970-min.JPG
added [code] tags
IMG_9970-min.JPG (925.49 KiB) Viewed 26 times
e-Ink display device.Do you have an idea about how I can make it work?

output:
Code: Select all | TOGGLE FULL SIZE
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Creating display
File opened
Size: 66200
Image offset: 54
Header size: 40
Width: 212
Height: 104
Bit depth: 24
Image OK! Drawing...
Finished drawing
done

code:
Code: Select all | TOGGLE FULL SIZE
import digitalio
import busio
import board
from adafruit_epd.epd import Adafruit_EPD
from adafruit_epd.il0373 import Adafruit_IL0373

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.D9)
dc = digitalio.DigitalInOut(board.D10)
srcs = None
rst = None
busy = None

print("Creating display")
display = Adafruit_IL0373(104, 212, spi, # 2.13" Tri-color display
cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs,
rst_pin=rst, busy_pin=busy)

display.rotation = 3

FILENAME = "blinka.bmp"

def read_le(s):
# as of this writting, int.from_bytes does not have LE support, DIY!
result = 0
shift = 0
for byte in bytearray(s):
result += byte << shift
shift += 8
return result

class BMPError(Exception):
pass

def display_bitmap(epd, filename):

try:
    f = open("/" + filename, "rb")
except OSError:
    print("Couldn't open file")
    return

print("File opened")
try:
    if f.read(2) != b'BM':  # check signature
        raise BMPError("Not BitMap file")

    bmpFileSize = read_le(f.read(4))
    f.read(4)  # Read & ignore creator bytes

    bmpImageoffset = read_le(f.read(4))  # Start of image data
    headerSize = read_le(f.read(4))
    bmpWidth = read_le(f.read(4))
    bmpHeight = read_le(f.read(4))
    flip = True

    print("Size: %d\nImage offset: %d\nHeader size: %d" %
          (bmpFileSize, bmpImageoffset, headerSize))
    print("Width: %d\nHeight: %d" % (bmpWidth, bmpHeight))

    if read_le(f.read(2)) != 1:
        raise BMPError("Not singleplane")
    bmpDepth = read_le(f.read(2))  # bits per pixel
    print("Bit depth: %d" % (bmpDepth))
    if bmpDepth != 24:
        raise BMPError("Not 24-bit")
    if read_le(f.read(2)) != 0:
        raise BMPError("Compressed file")

    print("Image OK! Drawing...")

    rowSize = (bmpWidth * 3 + 3) & ~3  # 32-bit line boundary

    for row in range(bmpHeight):  # For each scanline...
        if flip:  # Bitmap is stored bottom-to-top order (normal BMP)
            pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize
        else:  # Bitmap is stored top-to-bottom
            pos = bmpImageoffset + row * rowSize

     
        f.seek(pos)
        rowdata = f.read(3*bmpWidth)
        for col in range(bmpWidth):
            b, g, r = rowdata[3*col:3*col+3]  # BMP files store RGB in BGR
            if r < 0x80 and g < 0x80 and b < 0x80:
                epd.pixel(col, row, Adafruit_EPD.BLACK)
            elif r >= 0x80 and g >= 0x80 and b >= 0x80:
                pass  # epd.pixel(row, col, Adafruit_EPD.WHITE)
            elif r >= 0x80:
                epd.pixel(col, row, Adafruit_EPD.RED)
except OSError:
    print("Couldn't read file")
except BMPError as e:
    print("Failed to parse BMP: " + e.args[0])
finally:
    f.close()
print("Finished drawing")
display.fill(Adafruit_EPD.WHITE)
display_bitmap(display, FILENAME)
display.display()

print ("done")

deryaakitis
 
Posts: 12
Joined: Thu Aug 08, 2019 12:54 pm

Re: 2.7" eInk screen not working

by adafruit_support_carter on Thu Aug 08, 2019 1:14 pm

@deryaakitis Please start a new thread for your issue.

adafruit_support_carter
 
Posts: 12675
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.