New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Waveshare 7.5in V2 e-paper dim and grainy when using lines or rectangles #2216
Comments
waveshare_epaper source |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I observe similar behavior with the same model (7.5inV2 waveshare e-paper). I'm not working with rects and lines though, only fonts. |
Yes, the issue is still there. I think what we are short of is a developer who knows the waveshare code and has time to look at how the code in ESPHome needs to be modified for the various “v2” boards out now. I presume the waveshare displays do not have a named “owner” within the ESPHome community. I tried to eyeball the example code on Waveshare’s own wiki and compare with the code of ESPHome but could not spot anything glaring. But then again it’s probably way beyond my skillset, so I am afraid I was able to spot the issue but probably not able to identify the cause and suggest a fix myself. |
I would like to share also my experience. **** NOTE change needed for latest Waveshare HAT versions **** Thanks to all EspHome team for the great work made!!! and thanks for a possible solution/Fix |
Having same issued with 7.5inV2 and Waveshare ESP32 Driver Board. |
I have tried with two separate 7.5inV2 displays with two separate waveshare ESP32 driver boards with two separate cables, so I doubt it would be a faulty capacitor on one board / display (or some other hardware fault). I am still thinking it’s a software issue with ESPhome that can be fixed. I guess we are short of a coding “champion” for the ESPhome support for waveshare displays, who might have an idea on how to fix it. |
Should be resolved by esphome/esphome#3121 if you're seeing these symptoms on a 7.5in-BV2, which is the version with red color. |
No difference so far on 7.5inv2 (B/W), still degrades over time/pattern. |
Just tested again with ESPHome 2022.3.2, and the issue of grainy / dim display is very much still there, even with changing the reset_duration parameter to 2ms (instead of default 200ms) which was suggested by some. It seems that the Waveshare e-paper example code at least for Arduino had some bugs fixed 8-9 months ago; have those made it into ESPHome's code for Waveshare 7.50inV2? |
To this day, it still looks terrible under certain circumstances (lines and rectangles seem indeed to make the issue worse). The first version of the screen I had, which had a wider connector on the screen end, didn't exhibit the issue (but had a failing line of pixels so I had to return it)... Settings tried:
|
I had the same issue when using However, it works perfectly with these settings:
|
Hmm. I swapped to the B/W/R model. Definitely noticing it on this one now, so it seems the issue varies for each panel. Their documentation say that you can use either 3.3v or 5v for the input, but the FAQ states the rated voltage is 2.3-3.6v and says to use a level converter if you use 5v. However, the spec guide says it can accept up to 6v while the panel is limited to 3.6v. The documentation is hard to understand because of translation issues. They seem to imply that there both is and isn't a level converter in the driver board. The FAQ also suggests increasing VCOM voltage or reducing "the position of the round brush". From what I can see, VCOM is being set to 1.9v. The docs seem to suggest that it be set to the same as the supply range, 2.3v-3.6v ±0.1. I might be reading it wrong though. I don't know much at all about microcontrollers. I don't know what they mean by the round brush, though. When I have time, I'm going to test this theory and bump it up slightly to see if there's an improvement. |
Okay, I increased VCOM up to 2.3v. Unfortunately it still hasn't really improved, so it's not that. |
Are there any improvement? which version of 7.5in is 100% compatible? |
Sorry - forgot to ever come back. That did not work for me, but I think I have found the issue. I have been using a forked version of the Waveshare component that added support for Red in the BRW model. Unfortunately, I don't know for certain what will need to be changed here. I have been able to get it almost perfect for me, although there is some minor graininess. However, if you are using the same version (ESPHome Model 7.50in-bv2), try this: Download the Go to the line Change the code to match below:
Command power is changed, booster is added, and VCOM DC Settings are added. You may find it helpful to remove the PLL settings. If you are using a different model, I'm not sure what the correct answer is. You can download the spec sheet for your model and try making the changes to your config. |
@droans any updates on integrating the fix above? |
There are many ways to add it. You could clone the source and redownload every now and then, download just the files in the waveshare folder to You will want to add this to your ESPHome device config:
Keep in mind that this isn't perfect. Red seems to be nearly perfect for me while black shows slight issues in fine text or when there is still too much. However, it still displays black much more clearly than the default config. If you want to try and mess around with the code to improve your display, here's where you'll begin. From my experience so far, the VCOM DC setting and VCOM/Data Interval settings are the most likely culprit. For more help, here is a link to the dev guide for the BWR 7.5" Waveshare Display. There's a lot of information here. The command table begins on page 22 with the section afterwards providing more information. |
@droans seems to work a lot better! Any chance of gettings this improved component merged? |
Might try at some point, but honestly the changes were mostly educated stabs in the dark. It also seems likely even more improvements can be made to improve the display and some code I adjusted likely didn't make much difference. The original code also came from someone else. I'm not certain how compatible it is with just the B/W version or if it would need to be a new module. |
Since my project uses this exact same screen and it has been kinda popular, a few of us are beginning to run into this issue since it was published 6 months ago. Do you know what it takes to get these bug fixes and changes to be merged? |
Nice surprise seeing you here - my display was based on your original project with some changes made to better suit my needs. Thank you for providing the inspiration and config! I'm not sure what would be needed, but I think we'd need someone who could better understand the code. I know next to nothing about these displays or C++ and honestly just used the documentation and a bunch of trial and error to figure out what worked. It's likely there are even more changes that could be made to improve the displays. I'd guess our best bets would be to reach out to the devs on Discord and ask them to take a look or to ask Waveshare to submit a PR to improve the code. I'm not a developer, but I'm guessing "It works, but I don't know why" isn't really a good reason to submit a pull request. |
I tried 7.50inv2b but it wouldn’t render at all. |
Has anyone gotten a 7.5 V2 B/W model stable? |
Hi, I have a similar problem with the model 7.5 480x800 and use the model: 7.50inV2alt. |
I flashed my Waveshare ESP32 driver with the Wi-Fi Demo from Waveshare (https://www.waveshare.com/wiki/E-Paper_ESP32_Driver_Board#WiFi_Demo), and it doesn't exhibit the "grain" issue at all. There are still some banding on some images, but it's an overall very nice improvement over ESPHome's implementation. However, I tried building a custom ESPHome component with the parameters from the demo, and couldn't get it to improve significantly. If anyone wants to give it a try... |
I think I found the solution after giving it another shot during this long week-end in France. 😃 Using the datasheet and the Arduino examples of the screen, I came up with this configuration (modified waveshare_epaper.cpp source file, search for "MMI" comments to see changes): void WaveshareEPaper7P5InV2alt::initialize() {
ESP_LOGI(TAG, "MMI160723 initialize");
this->reset_();
// COMMAND POWER SETTING
this->command(0x01);
// 1-0=11: internal power
this->data(0x07); // MMI: changed it from 0x17
this->data(0x17); // VGH&VGL
this->data(0x26); // VSH - MMI: changed value from max voltage 0x3F to recommended datasheet value --> reduces black streaks on white vertical space. This setting is comparable to "Contrast" on old crystal liquid displays.
this->data(0x26); // VSL - MMI: same as VSH (High) but for Low
this->data(0x11); // VSHR
// VCOM DC Setting
this->command(0x82);
this->data(0x24); // VCOM
// Booster Setting
this->command(0x06);
this->data(0x27);
this->data(0x27);
this->data(0x2F);
this->data(0x17);
// MMI: disabled command as not present in the Arduino example, disabling may not be needed
// OSC Setting
// this->command(0x30);
// this->data(0x06); // 2-0=100: N=4 ; 5-3=111: M=7 ; 3C=50Hz 3A=100HZ
// POWER ON
this->command(0x04);
delay(100); // NOLINT
this->wait_until_idle_();
// COMMAND PANEL SETTING
this->command(0x00);
this->data(0x3F); // KW-3f KWR-2F BWROTP 0f BWOTP 1f
// COMMAND RESOLUTION SETTING
this->command(0x61);
this->data(0x03); // source 800
this->data(0x20);
this->data(0x01); // gate 480
this->data(0xE0);
// COMMAND ...?
this->command(0x15);
this->data(0x00);
// COMMAND VCOM AND DATA INTERVAL SETTING
this->command(0x50);
this->data(0x10);
this->data(0x00); // MMI: changed to value found in Arduino example, may not be needed
// COMMAND TCON SETTING
this->command(0x60);
this->data(0x22);
// Resolution setting
this->command(0x65);
this->data(0x00);
this->data(0x00); // 800*480
this->data(0x00);
this->data(0x00);
this->wait_until_idle_();
uint8_t lut_vcom_7_i_n5_v2[] = {
0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0xF, 0x1, 0xF, 0x1, 0x2, 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
};
uint8_t lut_ww_7_i_n5_v2[] = {
0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
};
uint8_t lut_bw_7_i_n5_v2[] = {
0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
};
uint8_t lut_wb_7_i_n5_v2[] = {
0x80, 0xF, 0xF, 0x0, 0x0, 0x3, 0x84, 0xF, 0x1, 0xF, 0x1, 0x4, 0x40, 0xF, 0xF, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
};
uint8_t lut_bb_7_i_n5_v2[] = {
0x80, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x40, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
};
uint8_t count;
this->command(0x20); // VCOM
for (count = 0; count < 42; count++)
this->data(lut_vcom_7_i_n5_v2[count]);
this->command(0x21); // LUTBW
for (count = 0; count < 42; count++)
this->data(lut_ww_7_i_n5_v2[count]);
this->command(0x22); // LUTBW
for (count = 0; count < 42; count++)
this->data(lut_bw_7_i_n5_v2[count]);
this->command(0x23); // LUTWB
for (count = 0; count < 42; count++)
this->data(lut_wb_7_i_n5_v2[count]);
this->command(0x24); // LUTBB
for (count = 0; count < 42; count++)
this->data(lut_bb_7_i_n5_v2[count]);
ESP_LOGI(TAG, "MMI initialize END");
} Please test and tell me if it works for you! |
Hi, external_components:
But I get this errors. |
I think the dev branch has some breaking changes related to the display integration. I would fork the code from the current version branch you have (mine is 2023.6.5). I personally copied and edited the files locally: external_components:
- source:
type: local
path: waveshare_epaper_mmi
components: [waveshare_epaper] |
Thank you, i used now the last release version 2023.6.5 and used the local way. Now it worked and I will see a better image and will let it run for some time and check, if there any changes over time. |
@Egglestron I also tested your changes and it looks much better on my e-Paper. Thanks for your investigation! |
That sounds wonderful. How and when will the change come as an update? What are the next steps? |
I've tested the changes, and it seems to look much better now. I tried applying those changes to void I'll conduct some further tests in the next few days, but it's looking very promising. If it doesn't cause any issues, perhaps we could submit a pull request. Thank you very much for your time, @Egglestron ! |
Could you please give a link to the modified version for WaveshareEPaper7P5InV2? I've one to test. |
I second that request, just stumbled upon this issue when I was looking for a solution, so I'd be happy to test; I have 2 7.50inV2alt-devices up and running at the moment and they are both very grainy. Tell me how to test and I'll gladly do! |
After some preliminary tests, the changes for version v2 (non-alt) don't seem to work. After disconnecting the ESP32 board, the image appeared with very little contrast, but while it was functioning, it looked fine. I don't know what could be causing it to work sometimes and not others. The changes I made were the same as for WaveshareEPaper7P5InV2alt. I don't have much knowledge of C, so everything has been trial and error. On the other hand, the alt version seems to work consistently. To use this, just add the following to the corresponding ESPHome YAML file:
The fork only contains the changes for the WaveshareEPaper7P5InV2alt version. |
Wow! This fix made it a LOT better! Only a little grainy when refreshing now, but the display now is absolutely great after the refresh! |
I've made further changes to reduce the remaining graininess: // COMMAND POWER SETTING
this->command(0x01);
// 1-0=11: internal power
this->data(0x07);
this->data(0x17); // VGH&VGL
this->data(0x3F); // VSH
this->data(0x26); // VSL
this->data(0x11); // VSHR Setting VSH at 0x3F made it even better for me! :) |
Thank you, I testet it and it is better. ;) |
Hi All, |
@prapador fix seems to work here as well, hopefully it will not gradually faint with time as have been my main issue with other configurations. |
Just mentioning that all credits go to @Egglestron changes are not mine :) |
I haven't experienced any degradation issues during this past week, and in my case, the contrast is excellent. I believe we should submit a pull request to the ESPhome repository if no one has detected any problems. What do you think? |
I can't install... I used this: external_components:
|
Make sure that you have at least version 2023.6.5. |
Perfect, that was the problem. THX :-) |
I'm currently making a pull request with my latest changes. I'll keep you posted! |
Here also no problems. Tried both changes, didnt make a difference fie me, all good. |
Operating environment/Installation (Hass.io/Docker/pip/etc.):
Hass.io
ESP (ESP32/ESP8266, Board/Sonoff):
ESP32 Waveshare Driver Board
ESPHome version (latest production, beta, dev branch)
1.19.4
Affected component:
Waveshare e-paper display
https://esphome.io/components/display/waveshare_epaper.html
Description of problem:
All items on a Waveshare 7.5in V2 e-paper display (black & white) go dim and grainy if the items to be displayed include horizontal lines, rectangles or filled rectangles. The wider the line or rectangle, the more marked the effect is. Other shapes or text do not cause the issue.
Below is example code that has the issue. If I comment out the "it.filled_rectangle" lines in the code, then the text on screen becomes crisp and clear, but if the rectangles are included, when the screen refreshes, for a split second on refresh it is clear but the black 'ink' dims out instantly. The issue is exactly the same if I use "it.line" or "it.rectangle" of similar dimensions.
If I only use very short horizontal lines or rectangles then the issue is less noticeable, but for long horizontal lines and rectangles the entire display goes dim.
Problem-relevant YAML-configuration entries:
Logs (if applicable):
Additional information and things you've tried:
I have tried this with two separate Waveshare 7.5in V2 e-paper displays, and two separate ESP32 driver boards, and get the same results for each combination, so it does not seem to be a faulty hardware issue.
The text was updated successfully, but these errors were encountered: