Skip to content
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

B/W support for GooDisplay GDEY029T94 (as used on Adafruit MagTag) #4222

Merged
merged 4 commits into from
Mar 20, 2023

Conversation

AaronJackson
Copy link
Contributor

@AaronJackson AaronJackson commented Dec 23, 2022

What does this implement/fix?

The GooDisplay is a black/white/gray display used on the Adafruit MagTag. This PR adds partial support for the display, but I was unable to get grey working - I don't really understand LUTs etc, so I'm using the one built into the OTP memory. The GooDisplay is mostly waveshare compatible so it doesn't feel right to split it into a separate component entirely.

The change set is not that great, so I understand if you'd rather not merge, or entirely replace it :D I'll pull it in as a custom component anyway, and it might help someone else with their MagTag.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes [issues#3515 (https://github.com/esphome/issues/issues/3514)

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#2765

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040

Example entry for config.yaml:

display:
  - platform: waveshare_epaper
    cs_pin: GPIO8
    dc_pin: GPIO7
    busy_pin: GPIO5
    reset_pin: GPIO6
    model: gdey029t94
    reset_duration: 200ms
    # full_update_every: 30
    update_interval: 20s
    lambda: |-
      ESP_LOGI("display", "Updating display");
      it.rectangle(20, 50, 30, 30);

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@kjell
Copy link

kjell commented Dec 24, 2022

I've been trying fix the "all black pixels" screen on my magtag. This did it. Thanks!

@AaronJackson
Copy link
Contributor Author

Hmm in hindsight this might break something for actual waveshare displays and that does concern me. I'll see if I can come up with a proper fix by adding a separate display type

@AaronJackson AaronJackson marked this pull request as draft December 27, 2022 22:02
@ssieb
Copy link
Member

ssieb commented Dec 27, 2022

This will definitely break things for the currently supported display. Which one do you have?

@AaronJackson
Copy link
Contributor Author

@ssieb https://www.good-display.com/product/389.html This is the one used by the Adafruit MagTag. It's very similar to the 2.9in Waveshare displays but as you can tell by my PR, it uses the 0x13 command for the black/white data. I think another command for grey maybe.

I will try implementing a new display for it but given that it is not a waveshare display I was thinking about calling it something like "gd-2.90in-bwg" for "Good Display 2.9in black/white/grey"

@ssieb
Copy link
Member

ssieb commented Dec 27, 2022

Yes, if it has different commands (and doesn't have color), it should have a separate identifier. Maybe GDEY029T94?

@probot-esphome probot-esphome bot removed the small-pr label Dec 27, 2022
@AaronJackson AaronJackson changed the title Write image data rather than 0x0 for Waveshare 2.9in B B/W support for GooDisplay GDEY029T94 (as used on Adafruit MagTag) Dec 28, 2022
@AaronJackson AaronJackson marked this pull request as ready for review December 28, 2022 14:50
@Zagrophyte
Copy link

Anything left to clear this for merge? Looks like it was successfully changed to add it as a new device as requested.

If you need another tester I could try it out with my MagTag. I'm excited for this PR as it fixes the remaining blocker preventing full use of the MagTag directly within ESPHome.

@AaronJackson
Copy link
Contributor Author

@Zagrophyte if you want to use esphome with your magtag you can just pull in the component as an external component from my fork

external_components:
  - source:
      type: git
      url: https://github.com/AaronJackson/esphome
      ref: waveshare_2p9inb
    refresh: 0s
    components: [ waveshare_epaper ]

display:
  - platform: waveshare_epaper
    cs_pin: GPIO8
    dc_pin: GPIO7
    busy_pin: GPIO5
    reset_pin: GPIO6
    model: gdey029t94
    reset_duration: 200ms
    #full_update_every: 30
    update_interval: 60s
    rotation: 270
    lambda: |-
      ....

It doesn't support grey though. I haven't spent enough time to figure out how LUTs work to add support for this 😅, but it would still be cool to get it merged. It seems to work well though as it stands, had three of them running 24/7 with ESPHome since I last commented on this pr 🙂

@firthh
Copy link

firthh commented Mar 15, 2023

I've been running this for over a month now with no issues. I built it from the fork so I'm really glad that there's an easier way to get this working. It would be even nicer to have it merged.

The only issue I encountered was trying to display a graph and being a bit of an esphome noob I wasn't sure if it was my configuration or something else...

@jesserockz
Copy link
Member

Please add (or link) a docs PR targeting next for this model addition.

@AaronJackson
Copy link
Contributor Author

Thanks @jesserockz - PR for addition to docs esphome/esphome-docs#2765

@jesserockz jesserockz added this pull request to the merge queue Mar 20, 2023
@jesserockz jesserockz merged commit d98d6ff into esphome:dev Mar 20, 2023
@AaronJackson AaronJackson deleted the waveshare_2p9inb branch March 20, 2023 08:52
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants