Various posts on this forum have been for the WeAct Studio ePaper screens. In particular I found the 2.9" BWR screen here and was able to get mine working almost immediately.
Trying to add to my ePaper collection, I saw the WeAct 4.2" screens and went to give them a go only to find that it also required some special steps and it seemed to only be for the BW screen and not the BWR. Lot’s of searching later and I didn’t find a driver for the BWR screen.
To wrap this up and give back to the community I have created a WeAct Studio ePaper repository located at (that maybe one day will just get implemented into ESPHome…but, until then)
This repository/code covers:
ESPHome pull request #6209 by MrMDavidson for the WeAct Studio 4.2" BW screen.
ESPHome pull request #6226 by jbergler for the WeAct Studio 2.9" BWR screen.
And…my implementation of the WeAct Studio 4.2" BWR screen which is technically just a modification of the code jbergler provided to work with the larger screen.
In addition…as of the time of this post, it also includes all the current WaveShare ePaper models as well (so using this code, for the moment, won’t take away support for any other WaveShare ePaper screens you may be using).
If anyone has any additional WeAct Studio ePaper models they have working (and is not currently included in what the public has available to it) or, knows of any additional custom PR implementations needed to get one to work, I would be happy to add it to the repository for all to use (just let me know).
Although this is a deviation from the ESPHome code, I added an additional function in the waveshare_epaper.h file (in my repository that is) as follows:
The purpose was to immediately go to deep sleep the moment the display was done updating. Without outside access to the busy pin (and I didn’t want to waste another pin jumpering it just to read it), this wasn’t possible and using a timer to ‘guess’ wasn’t ideal. This function perfectly solves the problem and optimizes my battery usage.
Would be nice if this function was implemented into the main esphome code, but…I’m not sure if any of the WeAct screen code will be, so this is as good as it gets for now.
Thanks @RaceNJason this looks so good that i thought it was time I tried to get my head around building with Esp-32s, so have ordered the WeAct 2.9 screen to have a go!
Problem is I am now lost as to where to start - I had some success with Arduino bits years ago - but very rusty now tbh!
So far I have added my ESP32 into ESPHomeBuilder, so it’s there and online. I’ve copied the GitHub folder across to ESPHome too …but what code do I put where …which pins do I connect the screen too, and where do i specify which I’m using in the code …I really need a “How to for dummies” I think - if anyone can point me in the direction of one?
In no way am I’m trying to be mean in this response…but, selecting a particular post and then asking the people involved in that post to teach you basics is not a good way to proceed regardless of your skill level. In essence you need to start with basics to learn and understand the concepts and yaml programming language first and foremost. The number one reason this is important is because you can take all sorts of examples out on the internet and apply them to your setup…but, what do you do when you want to modify it or when something goes wrong? Continually going back to the source and asking everyone else will quickly get you ignored when everyone sees that you are not willing to put forth any effort other then to ask someone else to fix it. In simple terms…the level of questions you are asking means you have done very little to research this yourself (i.e. I’m pretty sure on my Git repository for this, there is an example yaml file…it ONLY shows the key lines for the ePaper component because it assumes you already know how to create a project and then copy over those elements).
Go to Google and search for “ESPHome ePaper”. Read the whole article and follow it closely (Waveshare E-Paper Display - ESPHome - Smart Home Made Simple). Also important to follow this component’s parent class Display Component - ESPHome - Smart Home Made Simple since that explains drawing and other stuff. Plenty to learn and play with…if you take the time to read it. ESPHome component pages is absolutely the first place to start when implementing a device.
Go to ESP32 Development Boards List - Detailed Information, look up your board and see what pins are available. Use this resource for all future projects in regards to what pins you can use (learn this, not all pins on a ESP32 dev board are really available to use).
The 2.9" BW screen I’m pretty sure does not require any custom components since it is supported in the native ESPHome ePaper component…which means you don’t need to copy anything from anything I’ve done and can use the examples ESPHome provides on their component page. If you have the BWR screen then you need the custom component (but…I think you can actually still use the original BW driver and just won’t get Red).
If you have a single question after implementation, go ahead and post it. Otherwise, you may want to just try something with ESPHome that doesn’t require attaching a device to it. Or better yet, start with blinking an LED as most do. Going from nothing to ePaper display is a bigger jump than nothing to blinking an LED.
Thanks for links that’s fantastic - I genuinely appreciate you taking the time to post them.
I wasn’t looking to be spoon fed or waste your time, so apologies if that wasn’t clear in my original post - just my Googling sent me round in circles and didn’t turn up the resources you’ve kindly recommended. Hopefully your post will help any future hobbyists who like me want to learn something new and stumble across this thread too.
Jason,
I no longer see my entry from yesterday. Did I do it incorrectly? I am a newbie to the community. Michael (ottes) said to reach out to you.
Please advise.
I don’t see where your original post went. It can take me some time to get to these (if I do) because I don’t check these things often. You note that you cannot get 4.2 model to work while also noting that calling full_update_every causes an error. I’m not sure where you got the full_update_every function/variable because the 4.2 model doesn’t support partial updates (at least the BWR model doesn’t, have not tested the BW only model or looked at it’s code).
I also know I had to recently make a modification to make the code compatible again because of a macro change and I made sure to update the github repository. I’ve just finished doing some WeAct Studio 4.2" BWR display projects using the code that is on GitHub. So if something isn’t working I would suspect you either have the wrong code somehow or are connecting one or more of the display wires to pins that you shouldn’t. There is no note as to which pins I use for the display and I know with the S3 mini boards I’m using there is a very limited combination I can use (otherwise startup pin conflicts can occur). If you are using the correct code I would suspect this as the primary culprit…
Thank you for replying. Two things: Actually, the issue is that when I add the suggested external repository you mentioned (ottes42) it will not compile at all IF I choose weact_epaper. It works for waveshare_epaper. For weact, It throws the following error in core/gpio.h, and although I am a programmer, .c++ is not my language.
ERROR:
Compiling .pioenvs/e-paper42-test/src/esphome/components/weact_epaper/waveshare_42v2.cpp.o
In file included from src/esphome/core/hal.h:4,
from src/esphome/core/application.h:12,
from src/esphome/components/spi/spi.h:2,
from src/esphome/components/weact_epaper/weact_epaper.h:4,
from src/esphome/components/weact_epaper/waveshare_213v3.cpp:1:
src/esphome/components/weact_epaper/waveshare_213v3.cpp: In member function 'virtual void esphome::weact_epaper::WaveshareEPaper2P13InV3::dump_config()':
src/esphome/core/gpio.h:18:30: error: expected ';' before 'log_pin'
18 | #define LOG_PIN(prefix, pin) log_pin(TAG, prefix, pin)
| ^~~~~~~
src/esphome/components/weact_epaper/waveshare_213v3.cpp:183:3: note: in expansion of macro 'LOG_PIN'
183 | LOG_PIN(" Reset Pin: ", this->reset_pin_)
| ^~~~~~~
*** [.pioenvs/e-paper42-test/src/esphome/components/weact_epaper/waveshare_213v3.cpp.o] Error 1
It does not matter which board I choose.
The second thing is, with NO changes to wiring or devkit, it works perfectly with the WeAct sample code Arduino gui including partial updates and update_every, which is why I mentioned it.
The code I am running in HA is the sample Hello World code provided, but I tried my own code too with the same results.
Any help is appreciated. I posted this issue to Michael (ottes42) and he said he did not make modifications and to look for the author.
Thank you for your time. I can send you any additional documentation you need at your request.
Use my code on my GitHub repository…I’ve updated the LOG_PIN code to conform to the recent macro change which fixes this error. Otherwise you need to either contact ottes42 to request that he updates his code accordingly or split his (or my) code into your own repository and make the changes yourself.
If you want a quick hack fix…go into the code pages themselves (in the custom repository) and search for LOG_PIN. Everywhere you find it make sure it has a semi-colon at the end and that’s it.
You did use the GitHub link to my repository at the very top of this page and then copy/paste the custom configurations folder and modified your yaml project file as the directions stated…yes? I started to look for ottes42 post/code and cannot find it anywhere. So I’m starting to wonder what code repository you used in order to get to where you are now since I don’t know who this Michael (ottes42) is that you refer to or why his code is different then what I’ve said to use.
Or…did you just download my code before the macro change and haven’t updated it since I made the changes and that’s why you are getting these compile errors now? In which case you just need to recopy the files.
Thank you, I did try your repository first and it did nothing , but did NOT generate that error I showed you.
I will re-pull your repository, and darned if I didn’t think it was on this page I found the reference to use it. I will look back at my notes.
(His reference)
external_components:
Jason,
Issue resolved, but not as we expected. I did pull your code after you had corrected it, but still no response from the panel no matter what model I chose.
I went back to the code at source: github://ottes42/WeAct-Studio_ePaper, downloaded it to my local components directory, made the changes you suggested and voila!, it worked when I chose model 4.20in-v2. I have a WeAct 4.20" B/W model.
I thought you would like to know. That repository renames the waveshare_epaper to weact_epaper and there must be something different in there (v2 support?)
THANK YOU for pointing me in the right directions as my c++ is MOST basic.
Phil
Model ‘4.20in-v2’ is actually a natively supported model (via WaveShare ePaper component) that also works for 4.2" BW WeAct displays and is therefore not part of my code (although it is in my repository, it is there from a copy/paste of Espressif’s native code only).
For the BW model you should not need any custom code since this is a natively supported display. If you remove all the custom component stuff and just leave the ‘4.20in-v2’ model it should pick this up off the ESP base code and work as expected (although it won’t have my custom IsIdle() function). Since the native code was already working for my WeAct 4.2" BW model there was no need to change/modify it to anything else.
My code specifically handles the WeAct 2.9" and 4.2" BWR models or the ‘2.90in3c’ and ‘4.20in3c’ models. Everything else is just from Espressif’s native code. So if my code doesn’t work for the ‘4.20in-v2’ model then I’d guess you’re somehow not implementing the code correctly or you have remnants of my code and this other individual’s code together (you should only have one or the other but not both) and it’s doing something weird since for that model it should be the same everywhere (actually I’m pretty sure the other code you are using probably doesn’t do anything with the ‘4.20in-v2’ model either since why would anyone if it is part of the ESP native code?).
If you want to post your yaml, I’d take a quick look at it to see what it is you’re doing. Otherwise my suggestion is as above, which is to remove all the custom component stuff. Delete the custom code entirely from your folders and just use the base ESP native code. This also means if/when Espressif updates their code, your project will automatically get the update. Using these custom components you will not get the mainstream update until the owner of the repository updates their own code (which can be problematic as you’ve seen here).
If you ever get the 4.2" WeAct BWR model, then my code will be of use…
Dears,
I have a WeAct 4.2" BW display labeled as HE042A87. I found a note somewhere saying that this marking means it is an “old version” of the display. Is there any chance to use it with an ESP32 and ESPHome? I’ve tried various tips I found online, but I still can’t get anything to appear on the screen. Any suggestions/tips?