HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waveshare

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
andymassey
 
Posts: 4
Joined: Wed Dec 04, 2019 9:51 am

HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waveshare

Post by andymassey »

** Complete Newbie alert!! Please be kind... **

My components:
1. Adafruit HUZZAH32 - ESP32 Feather https://learn.adafruit.com/adafruit-huz ... r/overview
2. Adafruit eInk Breakout Friend https://www.adafruit.com/product/4224
3. Waveshare 400x300, 4.2inch E-Ink raw display, three-color https://www.waveshare.com/4.2inch-e-paper-b.htm

My Sketch (via Mac Arduino 1.8.10) – Adafruit EPD Example Sketch "text_test":

Code: Select all

/***************************************************
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/

#include <Adafruit_GFX.h>    // Core graphics library
#include "Adafruit_EPD.h"

#define EPD_CS     13
#define EPD_DC     12
#define SRAM_CS    27
#define EPD_RESET  33 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY   15 // 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 1.54" monochrome EPD */
//Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

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

/* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
//Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

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

/* Uncomment the following line if you are using 2.9" EPD */
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
//#define FLEXIBLE_290

/* Uncomment the following line if you are using 4.2" tricolor EPD */
Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

void setup(void) {
  Serial.begin(115200);
  Serial.print("Hello! EPD Test");

  display.begin();
#if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
  // The flexible displays have different buffers and invert settings!
  display.setBlackBuffer(1, false);
  display.setColorBuffer(1, false);
#endif

  Serial.println("Initialized");

  display.setRotation(2);

  // large block of text
  display.clearBuffer();
  display.setTextWrap(true);

  display.setCursor(10, 10);
  display.setTextSize(1);
  display.setTextColor(EPD_BLACK);
  display.print("Get as much education as you can. Nobody can take that away from you");

  display.setCursor(50, 70);
  display.setTextColor(EPD_RED);
  display.print("--Eben Upton");

  display.display();
}

void loop() {
  delay(500);
}

Wiring:
eInk Friend --> HUZZAH32
VIN --> 3V
3V3 --> [nothing]
GND --> GND
SCK --> SCK/5
MISO --> MISO/19
MOSI --> MOSI/18
ECS --> 13/A12
D/C --> 12/A11
SRCS --> 27/A10
RST --> 33/A9
BUSY --> 15/A8
ENA --> En

My problem:
• Uploading completes fine.
• Serial Monitor displays: "Hello! EPD Test".
• Nothing appears on eInk screen.

Help! What am I doing wrong?? I'm assuming it's the wiring. I was very surprised not to find details of how to connect two Adafruit components together (the HUZZAH32 and eInk Breakout Friend) on Adafruit's website – but also couldn't find anyone else having done so when I Googled it either.

Appreciate any help you can provide! Thanks.

User avatar
andymassey
 
Posts: 4
Joined: Wed Dec 04, 2019 9:51 am

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by andymassey »

May I bump this please?

I'm still having no luck – have tried other Waveshare e ink screens (2.7 and a monochrome 4.2). Have also tried different wiring and pin assignation (someone told me to avoid pin 12). But can't get anything to work.

Please help!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by adafruit_support_mike »

I'm afraid we don't know anything about the Waveshare display. There's a chance that it might want a different software interface than the displays we carry.

Your best bet will be to check with the folks at Waveshare and see if they have any support code for that device.

User avatar
jwtadmin
 
Posts: 53
Joined: Thu Jan 07, 2016 2:50 pm

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by jwtadmin »

Same issue - the picture of the friend breakout actually shows that waveshare eink display with that part number.

Any chance you can contact the person who took that picture and find out what they used for their sketch?

https://www.adafruit.com/product/4224

Also on the preparing images one it also uses the same part number.

User avatar
andymassey
 
Posts: 4
Joined: Wed Dec 04, 2019 9:51 am

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by andymassey »

Yes, I'd noticed that the part number was the same too – so I imagined that the Waveshare and Adafruit eInk displays were probably the same.

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by adafruit2 »

i'd try a non ESP32 since ESP32 can be finicky - do you have any other processor types?

User avatar
jwtadmin
 
Posts: 53
Joined: Thu Jan 07, 2016 2:50 pm

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by jwtadmin »

I also ran this on my Feather M0 Express with no luck.

I did get the python library working with this display

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by adafruit2 »

interesting, so it works in circuitpython mode - you know your wiring is good?

User avatar
andymassey
 
Posts: 4
Joined: Wed Dec 04, 2019 9:51 am

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by andymassey »

I tried it with a different (non Adafruit) ESP32, but not a different micro controller model. I only have an ESP8266 as an alternative.

Would it be possible to ask the person who did the photographs what they did, as jwtadmin suggested?

I've just bought (but not yet had chance to test) Waveshare's Universal e-Paper Raw Panel Driver to use as an alternative to the eInk Breakout Friend.

User avatar
jwtadmin
 
Posts: 53
Joined: Thu Jan 07, 2016 2:50 pm

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by jwtadmin »

Quick update from my tinkering session last night.

The Python code below works so the wiring is correct - I am using the feather wing - on the breakout you need to wire to the correct pins.

I was also able to get it to work in Arduino - though I needed to use the GxEPD2 library - still working on the SD card - not sure what CS pin to use for the code.

In the GxEPD2 - I am using a HUZZAH classic(not the 32 version)

The correct pins and line to use for the 4.2 is:
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> display(GxEPD2_420(/*CS=D8*/ 0, /*DC=D3*/ 15, /*RST=D4*/ -1, /*BUSY=D2*/ -1));

CS=0
DC=15
RST=-1
Busy=-1


The challenge in much of this is to do the pin mapping correctly for your board - on the feather's you need to follow the physical pin to the logical pin mapping - Adafruit provides these but to be honest I never paid too much attention to this:
https://cdn-learn.adafruit.com/assets/a ... 1504885873

This is getting beyond newbie level - but if you have many hours you are willing to commit to trial and error you will learn something!

The examples and control in the GxEPD2 library are pretty amazing and I am only starting to be able to de-construct them and put them into my own sketch.



Code: Select all

"""Simple test script for 4.2" 400x300 black and white displays.

Supported products:
  * WaveShare 4.2" Black and White
    * https://www.waveshare.com/product/modules/oleds-lcds/e-paper/4.2inch-e-paper.htm
    * https://www.waveshare.com/product/modules/oleds-lcds/e-paper/4.2inch-e-paper-module.htm
  """

import time
import board
import displayio
import terminalio
import adafruit_il0398


displayio.release_displays()

# This worked on a feather M0 Express
spi = board.SPI() # Uses SCK and MOSI
epd_cs = board.D9
epd_dc = board.D10
epd_reset = board.D5
epd_busy = board.D6

display_bus = displayio.FourWire(spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset,
                                 baudrate=1000000)
time.sleep(1)

display = adafruit_il0398.IL0398(display_bus, width=400, height=300, seconds_per_frame=20,
                                 busy_pin=epd_busy)

g = displayio.Group()

f = open("/display-ruler.bmp", "rb")
display.rotation = 0
pic = displayio.OnDiskBitmap(f)
t = displayio.TileGrid(pic, pixel_shader=displayio.ColorConverter())
g.append(t)

display.show(g)

display.refresh()

time.sleep(120)

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by adafruit2 »

ok great!

User avatar
RobertLL
 
Posts: 3
Joined: Fri Feb 28, 2020 12:45 pm

Re: HUZZAH32 ESP32 Feather and eInk Breakout Friend to Waves

Post by RobertLL »

I spent quite some time trying to get the Adafruit Feather ESP32 to work with a 2.9 inch waveshare display. None of the GxEPD or GxEPD2 sample code would work. The GxEPD/GxEPD2 sample code is quite complex.

However, I was able to get this simple "Hello World" sketch to work using the pin connection set forth below. The key is that EPD CLK goes to the SCK/5 pin and EPD DIN goes to MOSI/18.

Code: Select all

#include <GxEPD2_BW.h>
#include <Fonts/FreeMono12pt7b.h>

// Connections for Adafruit ESP32 Feather
static const uint8_t EPD_BUSY = 32;  // Ada 32 to EPD BUSY
static const uint8_t EPD_CS   = 15;  // Ada 15 to EPD CS
static const uint8_t EPD_RST  = 27; // Ada 27 to EPD RST
static const uint8_t EPD_DC   = 33; // Ada 33 to EPD DC
static const uint8_t EPD_SCK  = 5; // Ada 5 to EPD CLK
static const uint8_t EPD_MISO = 19; // Master-In Slave-Out not used, as no data from display
static const uint8_t EPD_MOSI = 18; // Ada 18 to EPD DIN

//Include the appropriate line from the 'GxEPD2_Example' code for your particular display.
//This works for the 2.9 inch black and white display.  Add pin numbers.
GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display(GxEPD2_290(EPD_CS, EPD_DC, EPD_RST, EPD_BUSY));

void setup() {

  // Initialize display and set font
  display.init();
  display.setRotation(3);     // landscape orientaion 
  display.setFullWindow();  
  display.setFont(&FreeMono12pt7b);
  display.setTextColor(GxEPD_BLACK, GxEPD_WHITE); 

  // Write something to display buffer
  display.fillScreen(GxEPD_WHITE); 
  display.setCursor(2, 20); 
  display.print("Hello World!"); 

  // Update display
  display.display();
}

void loop() {
  // These aren't the droids you're looking for. 
}

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”