Support for Waveshare Three-color E-Ink Displays
Describe the problem you have/What new integration you would like
References #77. I've got Waveshare's 3-color e-ink display and it would be nice to have some support for them.
7.50in B-type (red-black-white) 7.50in C-type (yellow-black-white)
Please describe your use case for this integration and alternatives you've tried:
Additional context
After some fiddling around, I can report that implementing color in 7.50 modules is quite hard due to memory. Consider this (numbers in braces are reported by PIO):
- The ESP I use have around 80K(81920) of RAM.
- ESPHOME in minimal configuration consumes around 30K(31300) of RAM.
- Waveshare Display in BW mode consumes
, totaling in
of free space after buffer allocation
- A naive color implementation (2bits) needs a buffer of
, resulting in buffer allocation fail -
.
I'll try to use flash memory for this. This result will also affect our ability to implement color LCD displays.
@ASMfreaK Hmm yeah that's true.
Of course the ESPHome memory usage could be optimized a bit (though most of that number probably comes from the SDK wifi system etc), but that would not solve the problem for longer.
At least on ESP32s this will be a much smaller problem (I think they had like 6 times as much RAM, but don't quote me on that). So if it turns out that it can't run on ESP8266s let's just make it ESP32-only.
I'd also like support for WaveShare's 3 color e-ink displays, but I'm interested in the smaller displays (1.5" 200x200). So let's not make it ESP32 only since the smaller buffer required should fit on an ESP8266.
@sbussinger I've written and tested the code for 7.5in color display. I could extend it for all color displays, but I need someone to test the code.
@sbussinger I've written and tested the code for 7.5in color display. I could extend it for all color displays, but I need someone to test the code.
I have a waveshare 4.20in BWR Display and i'd like to test your code.
@sbussinger I've written and tested the code for 7.5in color display. I could extend it for all color displays, but I need someone to test the code.
you developed 3 color? If I can use 3 color I'll buy it, I wich you can share the code with esphome library. you great !!!
What about implementing the smaller color ones as b/w? I could test 1.54in-c
Any update on this, I have hardware to test this out.
Hello all!
Since then Waveshare has released a flurry of epaper screens - the list is long but a lot of good ones, with partial refresh, almost instant refreshes etc. We can see the list here for example: https://www.waveshare.com/product/displays/e-paper/epaper-2/3.7inch-e-paper.htm It would be good to add those in ESPHome as they seem to be changing the game of epaper display!
Is there a ticket to track color support for these three-color displays?
I can only find a few old references about specific displays (#892, a reference in a PR to another PR, and possibly the referenced PR itself).
i will love the support of the 3 color 4.2 display!
Is there a way to use the colored version without using the red color? just to make it work with b&w?
Is there a way to use the colored version without using the red color? just to make it work with b&w?
The displays are working in b&w there is just no option yet to make use of the color.
So you think this should look ok? The problem is not the color version of the panel?
So you think this should look ok? The problem is not the color version of the panel?
Same issue here. Hoping that there's a way to address this.
Hello, I just finish to create a new waveshare epaper screen with red color management On you yaml file you add:
external_components:
- source:
type: git
url: https://github.com/parats15/esphome.git
ref: waveshare-color
components: [ waveshare_epaper ]
color:
- id: COLOR_RED
red: 100%
green: 0%
blue: 0%
white: 0%`
display:
- platform: waveshare_epaper
model: 7.50inv2b
[....]
For the colors:
- Black : COLOR_ON
- White : COLOR_OFF
- Red : COLOR_RED
https://github.com/esphome/feature-requests/issues/239#issuecomment-888087235 Morever your epaper sceen is an 800 x 480 px https://www.waveshare.com/wiki/Pico-ePaper-7.5-B
https://github.com/esphome/feature-requests/issues/239#issuecomment-993076104 @parats15 First of all thank you for adding the color support!
I got my 7.5" screen working with model: 7.50in, but with model: 7.50inv2b it can't update anymore: [E][waveshare_epaper:107]: Timeout while displaying image!
Is the model just wrong in my case and for mine it's not supported yet?
I got this one (driven by a ESP32 driver board):

Ah, I got the v1 - which is the lower version. Would you be able to provide the color support for that one as well by any chance @parats15?
@TheFitzZZ
I updated my branch, now you can use the red color on model: 7.50in
But I haven't this screen so I don't know if this work correctly.
Keep me posted
Also if you have recently adding the external component, add refresh: 1min in external_components:
https://esphome.io/components/external_components.html
@parats15 thanks for the swift response (and refresh hint)!
The red does work, yet now I have vertical "interlacing" lines:

Any chance to fix that? Also please drop me your paypal or so, that I can buy you a drink :-)
Yes think I found my mistake, I pushed fix
I updated my bio on my github page, Thank
I just pushed another little fix ^^
Brilliant! Sent a little "thank you" via PayPal :-)

So I'm guessing their 7 color displays are out of the question for the moment?
Love to see support for the LOLIN 2.13 3-color model. Created feature request already.
I have implemented red color support for the 4.20in version 1 model. I did a pull request against your version @parats15. Are you considering to do a pull request against the main version?

@patman15 Thank you for adding this screen. It's ok I merged your PR.
@Adrian-at-CrimsonAuzre Yes it's possible to add 7 color control on your screen. Your screen is 600 × 448 × 3bits color => 806400bits in ram. Technically it should work with an ESP32 WROOM 32 board.
Just I need to work in my branch to manage your screen and more than 3 color.
@patman15 Thank you for adding this screen. It's ok I merged your PR.
@parats15 When implementing I noticed a few things:
COLOR_ONis used for drawing on the e-paper which appears black. On the other hand it is defined asconst Color COLOR_ON(255, 255, 255, 255);actually meaning the color white. I looked at the implementation for Inkplate6 which usesCOLOR_OFF(which seems logic to me as the display draws in black). For me it makes issues when moving code from one display to the other as the behavior is exactly opposite. Also I think it could start making issues when rendering pictures for displays with more colors. Easy to change, not sure what you think.- I had to do a separate class for the B/W/R display although it is practically identically to the B/W display except that it uses the second memory page for the red color. I would have needed a function to query which (not how many) colors exist to just merge it to the class that already does the B/W display. Probably this is an issue more towards the upstream?
- The code currently uses a color identity comparison for rendering. I looked at the waveshare documentation on page 7 you can find hints on mappings that would make it a more generic implementation (independent of the supported colors and levels). Nevertheless, it would need a map of colors that a specific display supports.
Let me know if you want me to support you with any of these topics in case you see it the same way. We could also ask the upstream maintainer on how it is intended.