SeedSigner / seedsigner

Use an air-gapped Raspberry Pi Zero to sign for Bitcoin transactions! (and do other cool stuff)
MIT License
699 stars 161 forks source link

Hold QR animation on brightness tips and reset animated QR sequence #495

Closed kdmukai closed 2 months ago

kdmukai commented 1 year ago

Depends on #494

This PR actually only has minimal changes; to get a proper diff you need to compare against https://github.com/kdmukai/seedsigner/tree/qr_encoding_refactor

Description

For fountain encoders, the first n frames are extremely valuable. But since we start the animated QR sequence with the brightness tip overlaid, many of the early frames will be wasted and/or unreadable.

This change pauses the current frame whenever the brightness tip is visible and then restarts the animated QR sequence (per @jdlcdl's suggestion) when the brightness tip deactivates.

Fountain encoders: should be beneficial "Simple" animated encoders (Specter xpub): doesn't really matter Static encoders: no effect

This pull request is categorized as a:

Checklist

If you modified or added functionality/workflow, did you add new unit tests?

If this evolves to support more elaborate changes to the fountain encoder sequence, then dedicated tests will be added.

I have tested this PR on the following platforms/os:

Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.

jdlcdl commented 2 months ago

ACK tested as of commit 2653c8e

This worked for me, rather nicely especially when late about getting the camera focused on seedsigner screen. I see all tests passed above, they passed on a linux desktop and also on my rpi0 dev setup.

newtonick commented 2 months ago

ACK and tested without any issues