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

[Bug] Problems using camera to scan QR from Coldcard Q screen #467

Open
nervetrip opened this issue Oct 11, 2024 · 11 comments
Open

[Bug] Problems using camera to scan QR from Coldcard Q screen #467

nervetrip opened this issue Oct 11, 2024 · 11 comments

Comments

@nervetrip
Copy link

nervetrip commented Oct 11, 2024

No matter what I do, I can't get Krux running on Yahboom to scan any QR codes displayed on a Coldcard Q.

Here's a throwaway seed phrase on the Q with screen brightness turned to the minimum (25%) and a desk lamp illuminating the area:
PXL_20241011_082345137 MP~2

Krux refuses to focus properly when scanning the Q screen. I've tried so many times with different distances, angles, screen brightness, ambient light levels, etc. These pictures illustrate what I'm seeing on the Yahboom screen. Note that my fingers are fully in focus, but Krux can't seem to focus on the QR code. I took the pics when it was as good as I could get it, it certainly was often even worse.
PXL_20241011_082435944 MP
PXL_20241011_082410766 MP

However, Krux scans QR codes from my computer screen without any issues. The QR code is fully in focus on the Krux screen:
PXL_20241011_084413132 MP

Lastly, I can take a picture of the QR code on the Coldcard screen, display it on my computer, and then Krux successfully scans it.
PXL_20241011_085109778 MP

Although you'll note that it scans all the seed words in capital letters, and indicates that the 12th word is invalid. I assume this is an unrelated issue (not due to camera focus problems described in this issue). I'm thinking that loading this style of QR code content is probably a feature enhancement for Krux.

I'm not sure if this issue qualifies as a bug, feature enhancement, or user error. But I'm hoping firmware/camera tweaks might improve QR code scanning from Coldcard screens. And if it's user error, I'm open to suggestions on how to improve QR scans.

@jdlcdl
Copy link
Collaborator

jdlcdl commented Oct 11, 2024

I'm thinking that loading this style of QR code content is probably a feature enhancement for Krux.

I agree, it looks like the qrcode represents first 4 chars of each word in uppercase (while krux can scan complete words in lowercase). Im not aware that it knows to downshift case and to extrapolate the full word... yet.

Does the yahboom have a camera lens wheel where you can fiddle with focus? If it does, that might be the trick for reading the q screen. ???

Nice write-up!

@odudex
Copy link
Member

odudex commented Oct 11, 2024

Thank you for the detailed report!
I have a Q here and want to confirm the issue.
By rotating the camera lenses (this can be tricky at first), you can adjust the focus and be able to scan closer, smaller QRs from phones and smaller devices. Anti-glare, activated by pressing the bottom button while scanning with Yahboom, could also help in these cases.
However, Krux can't read this standard (chopped uppercase words). I didn't know it until I saw this issue. Krux can read plain text words, SeedQR (word number), and CompactSeedQR (mnemonic bytes).
As Krux already has code to autocomplete chopped words, we could implement this quickly. But it would help a lot if Q could increase the QR frame to the recommended 2 QR blocks (currently 1) or, even better, use the full screen to show the QR.

@jdlcdl
Copy link
Collaborator

jdlcdl commented Oct 11, 2024

it would help a lot if Q could increase the QR frame to the recommended 2 QR blocks (currently 1)

Ahhh, Now I see it. The full-white quiet-zone margin around the qrcode contents.

@odudex
Copy link
Member

odudex commented Oct 11, 2024

Krux 24.10.beta4 can now read Q QR backup. At least from computer screen 😀
Unfortunately the devices cameras are low quality, so to read from Q you would need bring the focus very close, or use magnifying lenses, so your focus keeps well adjusted for computer screen.
On the Q side, a wider white frame or an upscale would help.

@nervetrip
Copy link
Author

nervetrip commented Oct 11, 2024

Thanks for the help!

By rotating the camera lenses (this can be tricky at first)

There's a ring with tiny notches around the lens on the Yahboom, but I can't tell if I'm spinning it. Is there a trick to twisting it? Are needlenose pliers needed, or is it easy to spin and I just can't tell its spinning?

Anti-glare, activated by pressing the bottom button while scanning with Yahboom, could also help in these cases.

I just tried this and it maybe made a slight difference in the appearance, but didn't solve the problem. I also tried adding a magnifying glass, but couldn't get that working either. I was able to get slightly more "square pixels", but the magnifying glass was warping the QR which may have been an issue.

However, Krux can't read this standard (chopped uppercase words).

Thanks for fixing this so quickly! I just flashed the new firmware and confirmed it works - also from a computer screen, not from the device.

But it would help a lot if Q could increase the QR frame to the recommended 2 QR blocks (currently 1) or, even better, use the full screen to show the QR.

I can't seem to locate where to report Coldcard bugs and feature requests. Does anyone know?

@tadeubas
Copy link
Contributor

I've submitted an e-mail to Coldcard support with a link to this issue, asking for a QR increase in size and wider white on external borders.

@odudex
Copy link
Member

odudex commented Oct 12, 2024

There's a ring with tiny notches around the lens on the Yahboom, but I can't tell if I'm spinning it. Is there a trick to twisting it? Are needlenose pliers needed, or is it easy to spin and I just can't tell its spinning?

It's a risky operation. The lenses are threaded, so by rotating them, you move them back and forth. They put a small drop of glue on this thread, so the best thing to do is remove the Yahboom's back lead, find and remove the glue with a toothpick or an exacto knife. Then delicately use needle-nose pliers to rotate the lenses. You may need a second pair of pliers to hold the camera's base. Be careful; everything is delicate, from the cable to the lenses.

@nervetrip
Copy link
Author

It's a risky operation. The lenses are threaded, so by rotating them, you move them back and forth. They put a small drop of glue on this thread, so the best thing to do is remove the Yahboom's back lead, find and remove the glue with a toothpick or an exacto knife. Then delicately use needle-nose pliers to rotate the lenses. You may need a second pair of pliers to hold the camera's base. Be careful; everything is delicate, from the cable to the lenses.

This is very helpful. I haven't tried it yet, but maybe I'll work up the guts at some point once I'm frustrated enough with CC QR codes not scanning. I'm not holding my breath that Coinkite will resolve the issue on their end.

Do QR codes on the Coldcard Q scan without issues on any of the other devices Krux is compatible with? Maybe I should try another device. I'd like to scan from the Q, as it would improve my workflow.

@odudex
Copy link
Member

odudex commented Oct 16, 2024

20241016_083718.mp4

If you bring focal distance closer, it will easily scan.

@nervetrip
Copy link
Author

nervetrip commented Oct 18, 2024

@odudex Perfect, your video looks like exactly what I'm hoping for!

I took my Yahboom apart and attempted to remove the glue with an exacto knife. I think I got all of it, plus some of the camera casing is chewed up a bit. There could be some glue left in-between the base and the ring, its hard to tell.

But I still couldn't get it to twist. It almost seemed like it may be one piece and won't twist, but it's really hard to tell. I didn't put a ton of pressure on twisting because I didn't want to break it.

So I put it back together and its still the same as it was. 😢 I may try again later.

EDIT: Got it working! 🎊

Trick was to hold the base tightly and grip the ring with pliers. Then twist it counter-clockwise. I heard a small "crack" when the glue broke free. I then experimented with the focal distance by twisting it further counter-clockwise, probably about one half to one full turn. Now I can scan QR codes on the Coldcard with Krux on my Yahboom!

Thank you so much for the support.

@odudex
Copy link
Member

odudex commented Oct 18, 2024

Great!
Once you release the thread, it becomes easy to move; usually, you can do it with your fingers.
Focus is a recurrent issue we have. Autofocus would be a great upgrade to Krux, and there are autofocus compatible cameras, I may try one soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants