Closed ThomasFarstrike closed 6 months ago
Since noone stepped up, I've started working on this, as the deadline is fast approaching!
I implemented all of the above. Being in this "forever awake" mode (when battery powered) or "awake for a while" (while manually started) took some rework because it changes the previous model of "boot, display stuff, sleep until next boot".
This is ready and deployed in v2.0.0 in the webinstaller.
When the Lightning Piggy receives a payment, it would be nice if this is immediately visible on the display, as instant feedback is more gratifying for the users, confirms that all works well, etc.
Therefore, we should add an "awake mode" so the device doesn't go to sleep after refreshing everything, but instead stays awake and polls the lnbits backend every X seconds (example: 10 seconds) or better yet, keeps a websocket open so it gets instant notifications (if lnbits supports this). Then, if the amount of sats changed, it should update the sats amount on the display and the payment messages so the user sees the incoming payment. In awake mode, it should also refresh the other display items (wifi signal strength etc) every so often.
The piggy should stay in "awake mode" as long as:
The piggy should stay in "awake mode" for a few minutes if:
Finally, the sleep duration of the piggy should depend on the battery voltage. Something like: