feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Suport for CrowPanel E-Paper displays

Open girlpunk opened this issue 1 year ago • 19 comments

Describe the problem you have/What new integration you would like Support for CrowPanel E-Paper (E-Ink) displays, utilising the same APIs and graphics libraries as the WaveShare ones

Please describe your use case for this integration and alternatives you've tried: I have attempted using the exisitng WaveShare components, however as the drivers for these panels are different (the SSD1683), they are not compatible.

Additional context Example use case: https://www.elecrow.com/wiki/CrowPanel_ESP32_E-paper_5.79-inch_HMI_Display.html Driver datasheet: https://www.elecrow.com/download/product/DIS08792E/SSD1683_Datasheet.PDF

girlpunk avatar Dec 07 '24 17:12 girlpunk

I would also like these, as they are manufactured in a fully ready-to-go case, which simply accepts USB-C power input and then ready to go. Similar to the waveshare cloud devices, but in more form factors/sizes and button controls.

brillb avatar Jan 12 '25 00:01 brillb

Hi. I also tried Waveshare drivers on one of these 4.2 inches e-paper screen device:

esphome:
  name: fishfoodscreen
  friendly_name: FishFoodScreen

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  framework:
    type: esp-idf

logger:

api:
  encryption:
    key: "SomeSecretPasswordo=="

ota:
  - platform: esphome
    password: "someOTAPasswordo=="

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

spi:
  clk_pin: GPIO12
  mosi_pin: GPIO11

display:
  - platform: waveshare_epaper
    model: 4.20in
    cs_pin: GPIO45
    dc_pin: GPIO46
    busy_pin: GPIO48
    reset_pin: GPIO47
    rotation: 270
    update_interval: 30s
    id: my_epaper_display
    lambda: |-
      it.fill(COLOR_OFF);
      it.printf(50, 120, id(font_large), TextAlign::CENTER, "%s", id(datetime_text).state.c_str());
      it.update();

# Font for text rendering
font:
  - file: "fonts/Arial.ttf"
    id: font_large
    size: 32

# Home Assistant datetime helper
text_sensor:
  - platform: homeassistant
    entity_id: input_datetime.plecomida
    id: datetime_text
    on_value:
      then:
        - component.update: my_epaper_display

It doesn't show any error but also screen never gets updated whatsoever. It was a good test...

droberin avatar Feb 15 '25 19:02 droberin

I have the same issue, any news?

janwest2 avatar Mar 05 '25 09:03 janwest2

If anyone wants to tackle this for esphome, I've recently added support to circuitpython for the Crowpanel 4.2", so the appropriate settings and init strings are available. The 4.2 uses a single SSD1683 which, other than the init string and basic parameters like endianness, are fully compatible with any other epaper, so it should be fairly trivial to make work in esphome.

The 5.79", however, is a WHOLE other kettle of fish. It uses a pair of daisy chained SSD1683 controllers, and to display data, you have to paint 400 bits, back up 4 bits, change controller, print 400 bits, repeat 300 times. It will need a whole reworking of the how the data transfer mechanism works.

SeanTheITGuy avatar Mar 07 '25 17:03 SeanTheITGuy

Linking PR: https://github.com/adafruit/circuitpython/pull/10107 Really wish i could do this myself, but C is not my language 😢

WebSpider avatar Mar 11 '25 21:03 WebSpider

I'm not experienced in C or custom components in ESPHome but I was feeling brave the other afternoon but got stuck, I don't know how to even include external components in the build. I added this to my YAML but it doesn't get added to the build. Ideas? `external_components:

  • source: "/config/esphome/" components: [ssd1683]`

Dave-Casey avatar Mar 27 '25 16:03 Dave-Casey

I've made a simple working version for the crowpanel 4.2 epaper display, its a bit rough, and doesn't implement LUT, but it works good enough for me :) See: https://github.com/semvis123/esphome-crowpanel-4.2-epaper

semvis123 avatar May 17 '25 14:05 semvis123

This is exciting @semvis123 , aside from copying the font files into my directory, is it as simple as updating the yaml file or do I need to do other steps to get this working in my environment?

Dave-Casey avatar May 20 '25 21:05 Dave-Casey

@Dave-Casey thanks for your interest, it should be as easy as adjusting the yaml file.

  1. Add the crowpanel epaper component as an external component.
  2. Define pins and display, see my yaml file.
  3. Define the display lambda in the yaml.
  4. Copy the font and icons. (And choose the codepoints you want to use)

For steps 1-3 you can look at my yaml file as a reference.

See: https://esphome.io/components/external_components.html

semvis123 avatar May 20 '25 22:05 semvis123

I followed this and adapted my yaml to match yours with the exception of the unique instance stuff. I created a components folder and copies over your folder contents. I now get this error:

`File "/config/esphome/components/crowpanel_epaper/display.py", line 47, in cv.Required(CONF_DC_PIN): cv.output_pin, ^^^^^^^^^^^^^ AttributeError: module 'esphome.config_validation' has no attribute 'output_pin' Failed config

display.crowpanel_epaper: [source /config/esphome/display-1.yaml:69]

Platform not found: 'display.crowpanel_epaper'. platform: crowpanel_epaper`

Interesting enough output_pin does not appear in the display.py file, it's using cv.output_pin_schema. I apologize, I'm in a bit over my head on this one.

Dave-Casey avatar May 21 '25 04:05 Dave-Casey

@Dave-Casey I've fixed my repo, noticed that the folder structure was not completely correct for the external components. You might need to delete the .esphome folder to purge the cache.

Also I've added a minimal example: https://github.com/semvis123/esphome-crowpanel-4.2-epaper/blob/minimal-example/esphome.yaml

semvis123 avatar May 21 '25 09:05 semvis123

Thanks @semvis123

"Hello world!"

Just wanted to confirm that your code is working on my device now. I had to slightly adjust the YAML example to include the espnow_receiver component as an external component (hosted locally). Here’s a sanitized snippet of what my working config looks like:

external_components:
  - source: github://semvis123/esphome-crowpanel-4.2-epaper
    components: [crowpanel_epaper]
  - source:
      type: local
      path: components/espnow_receiver
    components: [espnow_receiver]

Now I need to figure out how to adapt this to my own projects — let me know as you add improvements!

Dave-Casey avatar May 21 '25 16:05 Dave-Casey

@Dave-Casey Great! Just fyi, the espnow_receiver is some connection logic that I use to connect with my other esp32 that has the sensors. You should be able to remove it safely if you don't have such a setup.

semvis123 avatar May 21 '25 20:05 semvis123

Great work, and thanks!

Now my display works as well

janwest2 avatar May 24 '25 15:05 janwest2

Hi @semvis123

Guess what suddenly happened yesterday when I was tinkering with my paper display, it reversed the paper color from white to black, code still works, but colors er reversed. Do you know how to get back to white paper color?

Best regards Jan

Image

janwest2 avatar May 27 '25 04:05 janwest2

@janwest2 No worries, it should be fixed again, there was a slight mistake in a recent pull request. But it's already fixed. To get the laters version just delete the .esphome folder and it should redownload.

See: https://github.com/semvis123/esphome-crowpanel-4.2-epaper/pull/4

semvis123 avatar May 27 '25 06:05 semvis123

@semvis123 The rebuild solved the issue, but now nothing is displayed anymore, the display blinks every minute, so I think it is running fine. I have cleaned build files and removed any files in /config/esphome/.esphome via the Terminal.

janwest2 avatar May 29 '25 05:05 janwest2

@janwest2 Ah my bad I forgot to update the example code, you now don't need to define the color anymore, and it uses the Color::ON and Color::OFF. I've updated it, so the minimal-example branch should work again. But you might have to do the same change in your code. See https://github.com/semvis123/esphome-crowpanel-4.2-epaper/commit/c2dc0b5dd86d0d9b1a1e19fefe37584d6e188bc3

semvis123 avatar May 29 '25 09:05 semvis123

@semvis123 No problem at all, now it works as before, thanks for your great work and responses :-)

janwest2 avatar May 29 '25 10:05 janwest2

@semvis123 thank you for your implementation, now I can use my WeAct Epaper with esphome

alex-dokienko avatar Aug 18 '25 06:08 alex-dokienko