Skip to content

Fix simulator QR Codes#827

Open
tadeubas wants to merge 1 commit intoselfcustody:developfrom
tadeubas:fix_simulator_qr
Open

Fix simulator QR Codes#827
tadeubas wants to merge 1 commit intoselfcustody:developfrom
tadeubas:fix_simulator_qr

Conversation

@tadeubas
Copy link
Member

@tadeubas tadeubas commented Feb 7, 2026

What is this PR for?

The Simulator had issues when encoding data into QR codes and when reading QR codes via pyzbar. This PR fixes both problems and restores reliable QR round-trips 😄.

Removed the unnecessary qr_str_to_bytes that was trying to solve those issues.

How to test:

  • Use the Simulator to display a QR code.
  • Take a photo with a phone (or other camera).
  • Read the QR using the Datum tool inside the Simulator.
from krux.qr import to_qr_codes, FORMAT_NONE
from krux.themes import theme, WHITE
from krux.display import display
from krux.input import Input


qr_foreground = WHITE if theme.bg_color == WHITE else None
inp = Input()

data = " woahdi oawij dowaij ,./:[]123! áéíóú àè ìò ù©ç ãẽĩ õũ?"
code_generator = to_qr_codes(data, 999999999, FORMAT_NONE)
code, num_parts = next(code_generator)

# Draw QR code
if qr_foreground:
    display.draw_qr_code(
        code, light_color=qr_foreground
    )
else:
    display.draw_qr_code(code)

Changes made to:

  • Code
  • Tests
  • Docs
  • CHANGELOG

Did you build the code and tested on device?

  • Yes, build and tested on

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Docs update
  • Other

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

Successfully merging this pull request may close these issues.

1 participant