Go Down

Topic: Waveshare e-paper displays with SPI (Read 358256 times) previous topic - next topic

dadokkio

I'm trying to generate C array images like the one generated by Image2Lcd.
At the moment I'm writing it as a python notebook with opencv module based on this code

The rendered notebook I'm working on is available on this link

The latest 3 pictures are my result, the image2lcd result and the diff between them.

My result seems to be very similar to the image2lcd result but the rendered results are very different

MY PICTURE


IMAGE2LCD PICTURE


Not considering the thresholds I've used to identify grayscale colors my biggest issue is that my image "is striped" and I'm not able to understand why.

Can someone help?

axelleap

Attached is one of my picture. I will send you more in the future. But for the first it might be ok.
Can you please explain  how you convert a bmp or svg into an array that GxEPD understands ?

I manage to display images ok, but I don't understand how the C array has been generated.
Code: [Select]

#include "gridicons_dropdown.h"
...
display.fillScreen(GxEPD_WHITE);
display.drawExampleBitmap(gridicons_dropdown, 0, 0, 24 , 24, GxEPD_BLACK);
display.update();


For example, this is gridicons_dropdown.h:

Code: [Select]

const unsigned char gridicons_dropdown[] PROGMEM = { /* 0X01,0X01,0XB4,0X00,0X40,0X00, */
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00,
0x7F, 0xFF, 0x00, 0xFF, 0xFF, 0x81, 0xFF, 0xFF,
0xC3, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};


But this does not match the BMP gridicons_dropdown.bmp

Code: [Select]

00000000  42 4d e2 00 00 00 00 00  00 00 82 00 00 00 6c 00  |BM............l.|
00000010  00 00 18 00 00 00 18 00  00 00 01 00 01 00 00 00  |................|
00000020  00 00 60 00 00 00 13 0b  00 00 13 0b 00 00 02 00  |..`.............|
00000030  00 00 02 00 00 00 42 47  52 73 00 00 00 00 00 00  |......BGRs......|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000060  00 00 00 00 00 00 00 00  00 00 02 00 00 00 00 00  |................|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 ff ff  |................|
00000080  ff 00 ff ff ff 00 ff ff  ff 00 ff ff ff 00 ff ff  |................|
*
000000a0  ff 00 ff ff ff 00 ff e7  ff 00 ff c3 ff 00 ff 81  |................|
000000b0  ff 00 ff 00 ff 00 fe 00  7f 00 ff ff ff 00 ff ff  |................|
000000c0  ff 00 ff ff ff 00 ff ff  ff 00 ff ff ff 00 ff ff  |................|
*
000000e2


How can I generate my custom bitmaps please?

FYI, I am using GxEPD, with a 1.54'' black and white screen (GxGDEP015OC1/GxGDEP015OC1.h) connected to a WeMo.

dadokkio

Can you please explain  how you convert a bmp or svg into an array that GxEPD understands ?

How can I generate my custom bitmaps please?

FYI, I am using GxEPD, with a 1.54'' black and white screen (GxGDEP015OC1/GxGDEP015OC1.h) connected to a WeMo.

When I was using monochrome display I found very useful this link .

jzvolanek

When I was using monochrome display I found very useful this link .
Yes this-tool link to generate bitmaps, works very well, I use and tested
  to several kinds of ePaper.

mrmaddin

Hi all,
i'm getting a bit frustrated about the combination of a Waveshare ePaper driver ESP32 and a Waveshare 7.5" b/w display. The simple goal for the first step is to get the GxEPD_Example running. Therefore i changed the ports corresponding to the manual to

#define PIN_BUSY 25
#define PIN_RST 26
#define PIN_DC 27
#define PIN_CS 15

GxIO_Class io(SPI, /*CS=5*/ PIN_CS, /*DC=*/ PIN_DC, /*RST=*/ PIN_RST);
GxEPD_Class display(io, /*RST=*/ PIN_RST, /*BUSY=*/ PIN_BUSY);


But nothing happens :( . This approach worked pretty well with the ESP8266 variant...

The log doesn't look that bad:

st:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

setup done
drawBitmap : 1
drawBitmap : 2
update : 1
update : 0


Any ideas, what is | I do wrong?

Regards, Martin

axelleap

When I was using monochrome display I found very useful this link .
Thanks! This works great!

-- Axelle.

jzvolanek

@mrmaddin

Hello Martin,
1. I would only use the GxEPD2 library!
2. bord Waveshare ePaper driver ESP32 is not very suitable.
but it's your choice!

Try these settings:

Code: [Select]
# include  < GxEPD2_BW.h >
# include  < GxEPD2_3C.h >

 Connections for e.g. Waveshare ESP32 e-Paper Driver Board
static const uint8_t EPD_BUSY = 25;
static const uint8_t EPD_CS   = 15;
static const uint8_t EPD_RST  = 26;
static const uint8_t EPD_DC   = 27;
static const uint8_t EPD_SCK  = 13;
static const uint8_t EPD_MISO = 12; // Master-In Slave-Out not used, as no data from display
static const uint8_t EPD_MOSI = 14;

GxEPD2_BW<GxEPD2_750, GxEPD2_750::HEIGHT> display(GxEPD2_750(/*CS=*/ EPD_CS, /*DC=*/ EPD_DC, /*RST=*/ EPD_RST, /*BUSY=*/ EPD_BUSY));   // B/W display

ZinggJM

@mrmaddin,

The Waveshare ESP32 Driver board uses nonstandard SPI pins. This requires to use the remap feature of the ESP32 processor, for use of HW SPI.

See example GxEPD2_WS_ESP32_Driver.ino

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

mrmaddin

#1733
Feb 26, 2020, 01:48 pm Last Edit: Feb 26, 2020, 01:49 pm by mrmaddin
@jzvolanek & @ZinggJM: Thanks for your help!

Remapping SCK and DIN of the SPI with this line of code resolved the issue.

SPI.begin(13, 12, 14, 15);

bYe Martin

dadokkio

I'm trying to generate C array images like the one generated by Image2Lcd.
At the moment I'm writing it as a python notebook with opencv module based on this code

The rendered notebook I'm working on is available on this link

The latest 3 pictures are my result, the image2lcd result and the diff between them.

My result seems to be very similar to the image2lcd result but the rendered results are very different

MY PICTURE


IMAGE2LCD PICTURE


Not considering the thresholds I've used to identify grayscale colors my biggest issue is that my image "is striped" and I'm not able to understand why.

Can someone help?
I've simplified my code and I made some changes but I am still not able to render the image without horizontal stripes.



Any suggestion? Or link/code where I can understand the right procedure to follow?
Thanks

gilpster

Hi Everyone,

Thank you for wonderful library @ZinggJM.  Got it working fine on an Arduino Uno.

I foolishly thought an Uno Wifi Rev2 was just an Uno with a Wifi Module...  Can't get it working of course, and can't find an reference to it in this thread or GitHub.

Is there any plans to expand the support to cover this controller, or is there a workaround I should know about?

Thanks,

Kenneth


ZinggJM

#1736
Feb 27, 2020, 10:49 am Last Edit: Feb 27, 2020, 11:04 am by ZinggJM
@gilpster,

welcome to the forum. Please read General Guidance and How to use the Forum

It is easy for me to find information about the Uno Wifi Rev2, but it would be faster if you provide a clickable link. So you need some patience.

For future questions, please provide complete information, library used, e-paper used, connection module used and processor board used and selected to compile for.

Most likely we need to find out which pins are the HW SPI pins of your processor board.

Ok, I found the board, but very little info about it. It has an ATMEGA4809, as seen on the schematics. But I don't know which package to use for this board. I am too lazy to search for information.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

gilpster

Hi Jean_Marc,

Sorry, didn't think that would make a difference as I couldn't get anywhere with the board.

was running you GxEPD2 example as listed here:
https://github.com/ZinggJM/GxEPD2/blob/master/examples/GxEPD2_Example/GxEPD2_Example.ino

with the pin suggestions for the Arduino UNO, and the generic __AVR constructor for the 4.2 three colour module (GxEPD2_420c):
https://www.waveshare.com/wiki/4.2inch_e-Paper_Module_(B)

the HW SPI pins for the UNO wifi Rev2 are listed here:
https://forum.arduino.cc/index.php?topic=610312.msg4141216#msg4141216

Worked wonderfully for the UNO but I'm guessing has something to do with the SPI pins - whatever they are.

Kenneth

ZinggJM

#1738
Feb 27, 2020, 11:09 am Last Edit: Feb 27, 2020, 11:28 am by ZinggJM
Please post what board you select to compile for, and if the board is available through Board Manager.

Arduino megaAVR boards.

Quote
Is there any plans to expand the support to cover this controller,
Either it just works with my libraries, or someone would need to donate that board.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

gilpster

Compiling with the 'Arduino Uno Rev 2' board with the ATmega328 emulation.  This auto installed via the 'Arduino megaAVR Boards' download in the board manager.  I run other IoT projects on this board no bother.

Go Up