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

Better page breaking - particularly for the first section #7

Open
cgreening opened this issue Oct 1, 2021 · 15 comments
Open

Better page breaking - particularly for the first section #7

cgreening opened this issue Oct 1, 2021 · 15 comments
Labels
difficult enhancement New feature or request help wanted Extra attention is needed prio: low Low priority

Comments

@cgreening
Copy link
Collaborator

There's quite a bit of pre-ample in the Gutenberg books - I think it's possible to skip this - just not sure how at the moment.

@cgreening cgreening added enhancement New feature or request help wanted Extra attention is needed labels Oct 1, 2021
@martinberlin
Copy link
Collaborator

martinberlin commented Oct 3, 2021

I think in addition to this each page change should do a complete refresh otherwise the last page merges with the new one like you can see in this picture of the Rabbits book
0CC78B88-6711-4BDF-B845-E3189C5D6FEC

  • Add also page indicator in header or footer: 1 / total pages
  • Save in NVS the last read page in a key/value table

Key: name of EPub Value: last page open

so you can open the book and continue reading after resetting he device.

@cgreening
Copy link
Collaborator Author

That's interesting - how did you make it do that? Was it after the device had gone to sleep and woken up?

It's supposed to save the current state of the display so when it wakes up it knows how to update the screen - I wonder if that's not working when using spiffs.

@martinberlin
Copy link
Collaborator

That's done simply loading the book with Spiffs and just going to next page till that one. But you can also experience it when going backwards.
If the new page are is smaller than the last page, then that part that is not drawn stays and blends with the new one.
I believe an epd_fullclear is needed between pages.

@cgreening
Copy link
Collaborator Author

Very weird managed to recreate it after going into deep sleep with SPIFFS. Makes me think that the EPD hydrate and dehydrate is not working properly.

There's a clear screen at the start of the page render, but if the back buffer has not been restored properly it won't know to update the area of the screen that has old content in it.

@cgreening
Copy link
Collaborator Author

For some reason the code in EpdRenderer.h - virtual void dehydrate() isn't working... when it tries to save the back buffer it doesn't write any bytes.

I (36947) main: Saving state
I (36947) EPD: Dehydrating EPD
I (37477) EPD: Front buffer compressed size: 35875
I (38167) EPD: Front buffer saved 35875
I (38697) EPD: Back buffer compressed size: 35875
I (40557) EPD: Back buffer saved 0
I (40557) EPD: Dehydrated EPD

@cgreening
Copy link
Collaborator Author

This may help - b6a0b68

I suspect that a move to LittleFS would improve things considerably. From what I can see SPIFFS is struggling to find free space for the file so although it opens ok, it doesn't actually write any data. I've got it retrying on failure and also bumped up the SPIFFS garbage collection count.

I'll add more graceful handling when it does fail so that it gets back into a sensible state.

@cgreening
Copy link
Collaborator Author

I've added this issue to move over to LittleFS - #13

@martinberlin
Copy link
Collaborator

martinberlin commented Oct 4, 2021

Great. When I find some time I will fork this and try to add touch.
Only show stopper is that touch consumes aprox. 1.5 to 2 mA/Hour so it kind of drains your battery. But it will be nice to have it, since with that we can have more input options, like for example a slider from 1 to last page, so you can jump to a page.

Also like I commented up there, to save last page read, will be a great usability help so you can keep on reading after deepsleep without need to navigate again to that page.

@cgreening
Copy link
Collaborator Author

Also like I commented up there, to save last page read, will be a great usability help so you can keep on reading after deepsleep without need to navigate again to that page.

I'll take a look at this as it should be working.

@martinberlin
Copy link
Collaborator

Additionally and not strictly related to this issue, there are some book cover images that are not being loaded (Maybe it's because I'm on SPIFFS?)
For example one of my favorite poetry books:
https://sync.luckycloud.de/d/bf3a5b1d14f949b89955/?p=%2FePub&mode=list
poesia_aPizz.epub

Other than that the book is being opening correctly and I can read it.

@cgreening
Copy link
Collaborator Author

I've added an issue for the missing cover image - #14

It may be that the image is not compatible - progressive jpegs are not supported. But I'll investigate tonight.

@cgreening
Copy link
Collaborator Author

Fixed

@martinberlin
Copy link
Collaborator

martinberlin commented Oct 5, 2021

About #14 please don't close so fast before an additional test
It's not working for me and caught in a restart loop again. It seems the culprit is this poetry book:
https://github.com/atomic14/diy-esp32-epub-reader/blob/main/data/poesia_aPizz.epub

For others now the cover is appearing and working correctly. Any idea why it hangs with this particular book?

@cgreening
Copy link
Collaborator Author

Updated a comment on issue #14 - the book has some invalid utf-8 sequences which was crashing the font code in epdiy - that's now fixed upstream so should work if the git submodules update properly (having some issues with my understanding of git submodules...)

@martinberlin
Copy link
Collaborator

Ah now. Great you are doing it good, you just have to update it locally and then push the branch like you did.
The detail is that to update from my side I just need to do:
$ git submodule update
From https://github.com/atomic14/epdiy

  • branch 07925dc10e8bdf3c537270605bbe50705c9fdff2 -> FETCH_HEAD
    Submodule path 'lib/epdiy/epdiy': checked out '07925dc10e8bdf3c537270605bbe50705c9fdff2'

Not: git submodule update --remote (That won't update anything)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficult enhancement New feature or request help wanted Extra attention is needed prio: low Low priority
Projects
None yet
Development

No branches or pull requests

2 participants