esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
292 stars 36 forks source link

Issue with image command and waveshare 7.50inv2 screen #6361

Open jobi opened 1 month ago

jobi commented 1 month ago

The problem

I recently bought this Waveshare e-ink display with this ESP32 driver board. I'm trying to use esphome to display screenshots of a home assistant dashboard on the e-ink screen.

I have configured the online image component to periodically download an image, and trigger an update of the display component, to display the downloaded image. I'm testing with a small test image - small_sample

My problem is that when I issue the image command, the display briefly seems to show the image correctly, then it seems to flash again and ends up showing what looks like pale, inverse version of the original image:

IMG_4131

I have tried to capture this in this video.

Issuing a print command with some text instead seems to work fine.

Below I provide the relevant sections of the configuration file. I have tried a few variations (using some of the other model variants, not setting reset_duration but so far haven't been able to solve the issue.

Thanks

Which version of ESPHome has the issue?

2024.10.0

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

N/A

What platform are you using?

ESP32

Board

Waveshare Universal e-Paper Driver Board with WiFi/Bluetoth SoC ESP32

Component causing the issue

display / waveshare_epaper

Example YAML snippet

online_image:
  - url: <the url to the image on a local web server>
    format: png
    id: dashboard
    update_interval: 60s
    on_download_finished:
      component.update: my_display

display:
  - platform: waveshare_epaper
    id: my_display
    cs_pin: 15
    dc_pin: 27
    busy_pin:
      number: GPIO25
      inverted: true
    reset_pin: 26
    model: 7.50inv2
    update_interval: never
    reset_duration: 2ms
    lambda: |
     //it.print(0, 0, id(segoe), "E-Paper is awesome!");
     it.image(0, 0, id(dashboard));

Anything in the logs that might be useful for us?

Not much that I can see:

[19:53:13][C][waveshare_epaper:2498]: Waveshare E-Paper
[19:53:13][C][waveshare_epaper:2498]:   Rotations: 0 °
[19:53:13][C][waveshare_epaper:2498]:   Dimensions: 800px x 480px
[19:53:13][C][waveshare_epaper:2499]:   Model: 7.5inV2rev2
[19:53:13][C][waveshare_epaper:2500]:   Reset Pin: GPIO26
[19:53:13][C][waveshare_epaper:2501]:   DC Pin: GPIO27
[19:53:13][C][waveshare_epaper:2502]:   Busy Pin: GPIO25
[19:53:13][C][waveshare_epaper:2503]:   Update Interval: never
....
[19:50:35][I][online_image:103]: Updating image
[19:50:35][D][http_request.arduino:124]: Content-Length: 7696
[19:50:35][D][online_image:128]: Starting download
[19:50:35][I][online_image:144]: Downloading image
[19:50:35][D][online_image:074]: Allocating new buffer of 7254 Bytes...
[19:50:35][D][online_image:081]: New size: (208, 279)
[19:50:35][W][component:237]: Component online_image took a long time for an operation (183 ms).
[19:50:35][W][component:238]: Components should block for at most 30 ms.
[19:50:35][W][component:237]: Component online_image took a long time for an operation (142 ms).
[19:50:35][W][component:238]: Components should block for at most 30 ms.
[19:50:35][D][online_image:153]: Image fully downloaded
[19:50:36][I][waveshare_epaper:2464]: Power on the display and hat
[19:50:41][W][component:237]: Component online_image took a long time for an operation (5074 ms).
[19:50:41][W][component:238]: Components should block for at most 30 ms.
[19:51:02][I][safe_mode:041]: Boot seems successful; resetting boot loop counter

Additional information

No response

jobi commented 4 weeks ago

Switching the switch on the ESP32 driver board from B to A seems to have improved things a lot. I still have an issue where the text appears correctly but the image appears to have inverted colors:

IMG_4132

guillempages commented 3 weeks ago

Looks related to #6274. Can you try the solution proposed there (using it.image(0, 0, id(dashboard), COLOR_OFF, COLOR_ON); in your lambda? I.e. explicitly specifiying the color on and color off colors?

Some (most?) Eink displays treat "COLOR_ON" as black, while color displays treat "COLOR_ON" as white. This is not a problem of the online_image component; you would have the same issue if you actually test that with a local image.

m1212e commented 1 day ago

Got the exact same problem, noticed that I can display things fine when inverting the colors and using BINARY on the display. But only if there is not more than 50% content on the display. Very strange. Did you manage to resolve this?