Skip to content

[plugin] HTTPInspector: return InputEvent on every call to reset standby/suspend timer#13339

Merged
Frenzie merged 2 commits into
koreader:masterfrom
Frenzie:13303-inputevent
Mar 4, 2025
Merged

[plugin] HTTPInspector: return InputEvent on every call to reset standby/suspend timer#13339
Frenzie merged 2 commits into
koreader:masterfrom
Frenzie:13303-inputevent

Conversation

@Frenzie

@Frenzie Frenzie commented Feb 28, 2025

Copy link
Copy Markdown
Member

Fixes #13303.


This change is Reviewable

@Frenzie Frenzie added this to the 2025.02 milestone Feb 28, 2025
@Frenzie Frenzie added the Plugin label Feb 28, 2025
@Frenzie

Frenzie commented Mar 4, 2025

Copy link
Copy Markdown
Member Author

@poire-z I'm still a bit unsure between this and the other variety. How about you?

@poire-z

poire-z commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

I think this 2-lines PR is fine.
Maybe add a comment in main.lua: -- as a key event, reset any standby/suspend timer

Comment thread plugins/httpinspector.koplugin/main.lua Outdated
@Frenzie Frenzie merged commit 23ed86a into koreader:master Mar 4, 2025
@Frenzie Frenzie deleted the 13303-inputevent branch March 4, 2025 10:26
@Frenzie Frenzie changed the title [plugin] HTTPInspector: return InputEvent on every call [plugin] HTTPInspector: return InputEvent on every call to reset standby/suspend timer Mar 4, 2025
@greentea43

greentea43 commented Sep 6, 2025

Copy link
Copy Markdown

I thought this was fixed, so I downloaded latest beta, but the issue is still there?

  • Autosuspend timeout set to 20 minutes
  • Page turning by sending commands via HTTPInspector
  • Device suspends in 10 MINUTES while reading...
    crash.log

Edit: when disconnected from WiFi and left alone for 20 minutes, device autosuspends as expected. KOReader running in standard mode (not the frameworkless one)

@Frenzie

Frenzie commented Sep 6, 2025

Copy link
Copy Markdown
Member Author

The logs show this PR working as intended.

09/06/25-14:37:39 DEBUG HttpInspector: Received request: GET /koreader/event/GotoViewRel/1 
09/06/25-14:37:39 DEBUG HttpInspector: Sending response: HTTP/1.0 200 OK
Content-Type: text/plain; charset=utf-8
Content-Length: 23
Connection: close

Event sent: GotoViewRel 
09/06/25-14:37:39 DEBUG AutoSuspend: onInputEvent 
09/06/25-14:37:39 DEBUG AutoSuspend: onInputEvent 
09/06/25-14:37:39 DEBUG goto relative screen: 1 in mode: page 

Suspend didn't come from KOReader but from the Kindle itself:

09/06/25-14:37:47 DEBUG Kindle:intoScreenSaver via UNKNOWN_SUSPEND (3) 

@NiLuJe @hius07 Is this something that would be affected by no framework mode?

@NiLuJe

NiLuJe commented Sep 7, 2025

Copy link
Copy Markdown
Member

@NiLuJe @hius07 Is this something that would be affected by no framework mode?

I don't actually remember, but I assume we keep powerd alive, otherwise we'd be sort of crippled ;).

So, to actually answer the question: no, I don't think so ;).

@Frenzie

Frenzie commented Sep 7, 2025

Copy link
Copy Markdown
Member Author

In context I suppose the real question is whether it can be told that yes, we're active right now.

@NiLuJe

NiLuJe commented Sep 7, 2025

Copy link
Copy Markdown
Member

I seem to recall us pinging powerd... somewhere, to ensure it honors our suspend timer and not its baked in one; but I don't recall the exact details (but I would hope this approach would Just Work(TM) without anyone having to think about that implementation detail).

@NiLuJe

NiLuJe commented Sep 7, 2025

Copy link
Copy Markdown
Member

I seem to recall us pinging powerd... somewhere, to ensure it honors our suspend timer and not its baked in one; but I don't recall the exact details (but I would hope this approach would Just Work(TM) without anyone having to think about that implementation detail).

Yep, it's handled by AutoSuspend automagically (by which I mean, it uses the same last_action_time ticker updated by the plugin's onInputEvent handler).

@Frenzie

Frenzie commented Sep 8, 2025

Copy link
Copy Markdown
Member Author

Then it sounds like everything should be working.

This is the last time it triggered before suspend.

09/06/25-14:32:52 DEBUG AutoSuspend: scheduling next t1 timeout check in 299.5326
09/06/25-14:37:47 DEBUG Kindle:intoScreenSaver via UNKNOWN_SUSPEND (3) 

Which would suggest either the default isn't 10 minutes and it's merely 5 (with the update triggering just prior the first time by sheer coincidence) or that it's not working at all.

@NiLuJe

NiLuJe commented Sep 8, 2025

Copy link
Copy Markdown
Member

I imagine they could have somehow tweaked the default timeouts, which device and FW version was that running on?

(I don't remember the command OTOH, but the whole lot of powerd timeouts are stored in the elektra db that's.. somewhere I can't remember in /etc ;p).

@greentea43

greentea43 commented Sep 9, 2025

Copy link
Copy Markdown

No tweaking on user end. PW5, FW 5.14.1.1,, default Amazon timeout is 10 minutes (timeout is non adjustable, unlike on newest firmware versions.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use http inspector to turn pages will not automatically refresh the device's suspend time

4 participants