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

Make this Firmware also EPDiy V6 compatible #53

Merged
merged 11 commits into from Oct 25, 2021
Merged

Conversation

martinberlin
Copy link
Collaborator

@martinberlin martinberlin commented Oct 23, 2021

So we can expand the use also to EPDiy supported epapers instead of only LilyGo EPD47

Linked to #52

@cgreening the core of the problem is that EPDiy cannot install I2C driver when using this repository. It does work perfectly when using EPDiy standalone examples. So there must e something in our side that is interfering with EPDiy. I suspected it was touch since it also uses I2C but there is something more than that, basically it fails instantiating the I2C driver.

@martinberlin martinberlin self-assigned this Oct 23, 2021
@martinberlin martinberlin marked this pull request as draft October 23, 2021 07:19
@martinberlin martinberlin linked an issue Oct 23, 2021 that may be closed by this pull request
@martinberlin martinberlin added bug Something isn't working difficult labels Oct 23, 2021
@cgreening
Copy link
Collaborator

Could it be the battery pin interfering? The LilyGo has the battery voltage divider connected to GPIO_NUM_36 which is ADC1_CHANNEL_0.

  -DBATTERY_ADC_CHANNEL=ADC1_CHANNEL_0

@martinberlin
Copy link
Collaborator Author

martinberlin commented Oct 23, 2021

Can be that is somehow bothering this pin but actually EPDiy does not uses pin 36 in V6 config:
https://github.com/martinberlin/epdiy-rotation/blob/master/display_ops.h

It has to be something that is stopping EPDiy to install I2C. This are the pins used in V6 PCB

#define CFG_SCL GPIO_NUM_33
#define CFG_SDA GPIO_NUM_32
#define CFG_INTR GPIO_NUM_35

@martinberlin martinberlin marked this pull request as ready for review October 23, 2021 19:32
Copy link
Collaborator

@cgreening cgreening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - just wondering if we should change the check from CONFIG_EPD_DISPLAY_TYPE_ED047TC2 to CONFIG_EPD_BOARD_REVISION_LILYGO_T5_47 for the epd_poweron();

lib/Epub/Renderer/EpdRenderer.h Outdated Show resolved Hide resolved
src/main.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@martinberlin martinberlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update done check it before merging

src/main.cpp Outdated Show resolved Hide resolved
@cgreening
Copy link
Collaborator

I've pushed up a couple of commits - might want to review them before merging. I'm happy with the rest of the changes.

I've added rtc pullups and pulldowns which should hopefully fix the instant wakeup - on the Lilygo board there are external pullups so we didn't notice this before.

And I've added code to detect when the display rehydrate fails and force a redraw on the epublist. I think this should not be needed when reading as it doesn't assume anything is already on the screen when it draws.

src/main.cpp Outdated
renderer->flush_display();

// keep track of when the user last interacted and go to sleep after N seconds
int64_t last_user_interaction = esp_timer_get_time();
while (esp_timer_get_time() - last_user_interaction < 120 * 1000 * 1000)
while (esp_timer_get_time() - last_user_interaction < 10 * 1000 * 1000)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice update. After testing I will leave this back to 2 minutes without activity for deepsleep. Otherwise will be quite hard to focus on reading ;)

@martinberlin
Copy link
Collaborator Author

martinberlin commented Oct 25, 2021

Hi @cgreening pulled your update and tried again with -D BUTONS_ACTIVE_LEVEL=0

It also still deepsleeps for one second and wakes up. I must say that I noticed also that the GPIOs are extreme sensible, even if active level=1 I just get the cable touching (Without even putting high at 3.3 v) and it already presses the button.

I (80882) EPD: Buffer saved 0
I (80882) EPD: Dehydrated EPD
I (80882) SPIFFS: SPIFFS unmounted
I (80882) main: Entering deep sleep
ets Jun  8 2016 00:22:57

rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7152
load:0x40078000,len:14760
load:0x40080400,len:3728
entry 0x40080678
I (27) boot: ESP-IDF 4.3.0 2nd stage bootloader
I (27) boot: compile time 17:54:59
I (27) boot: chip revision: 1

Good thing is that I can use it active on high, no problem and on LilyGo EPD47 still seems to run correctly.

And I've added code to detect when the display rehydrate fails and force a redraw on the epublist. I think this should not be needed when reading as it doesn't assume anything is already on the screen when it draws.

This also works correctly! Nice update

@cgreening
Copy link
Collaborator

cgreening commented Oct 25, 2021 via email

@martinberlin martinberlin merged commit ba14e0b into main Oct 25, 2021
@martinberlin martinberlin deleted the feature/epdiy-v6 branch October 29, 2021 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working difficult
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when using EPDiy PCB and a supported epaper
2 participants