Skip to content

Commit

Permalink
Merge branch 'bbqr' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
odudex committed Jun 7, 2024
2 parents ef3d211 + 786c5e9 commit 7f779cc
Show file tree
Hide file tree
Showing 134 changed files with 7,052 additions and 4,020 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ simulator/sd
# allow files: firmware.bin, .sig, .sha256.txt
!tests/*
!tests/files/*

# ignore build-release files
krux-*/ktool*
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ max-bool-expr=5
max-branches=22

# Maximum number of locals for function / method body.
max-locals=25
max-locals=26

# Maximum number of parents for a class (see R0901).
max-parents=7
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ RUN apt-get update -y && \
python3-setuptools

RUN mkdir -p /opt && \
git clone --recursive https://github.com/kendryte/kendryte-gnu-toolchain && \
cd kendryte-gnu-toolchain && \
git checkout fbf55383711b68c00ecf67e23959822180010398 && \
git clone --depth 1 --recurse-submodules --shallow-submodules --branch v8.2.0-20190409 https://github.com/kendryte/kendryte-gnu-toolchain

RUN cd kendryte-gnu-toolchain && \
export PATH=$PATH:/opt/kendryte-toolchain/bin && \
./configure --prefix=/opt/kendryte-toolchain --with-cmodel=medany --with-arch=rv64imafc --with-abi=lp64f --enable-threads=posix --enable-libatomic && \
make -j8
Expand Down
190 changes: 94 additions & 96 deletions README.md

Large diffs are not rendered by default.

41 changes: 22 additions & 19 deletions docs/faq.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@
If the buttons on keypad input screens appear to be in the wrong order, this might be due to inverted X coordinates. To correct this:

1. Go to Settings > Hardware > Display.
2. Change the value of Flipped X Coordinates.
2. Change the value of `Flipped X Coordinates`.

### Incorrect Colors
If the colors displayed on the interface or camera preview are incorrect, you can try the following options:

#### Inverted Colors
If, for example, the background color is white when it should be black, go to Settings > Hardware > Display and toggle `Inverted Colors` .
If, for example, the background color is white when it should be black, go to *Settings > Hardware > Display and toggle* `Inverted Colors` .

#### BGR Colors
If, for example, you are using the Orange theme, and instead of orange the colors appear bluish, toggle `BGR Colors` in the display settings.

#### LCD Type
**Warning!** Only try changing this setting if you failed to fix colors with previous ones.

If adjusting `BGR Colors` and `Inverted Colors` doesn't fix the color issue, try changing the LCD Type:
If adjusting `BGR Colors` and `Inverted Colors` doesn't fix the color issue, try changing the `LCD Type`:

1. After changing this setting, you will be warned that the device will reboot automatically if this change does not resolve the issue (if it fails, the screen will turn black, and you'll not see anything).
2. After proceeding with the warning, if you see a message prompting you to press the `PREVIOUS` (UP) button, it means that the new setting worked. Follow the instructions and press UP.
3. If you notice menu options but the colors are still wrong, try again with different combinations of `Inverted Colors` and `BGR Colors`. This time, it is likely you will find a combination that correctly displays the colors of themes and the camera feed.

If, after the warning in step 1, the screen turns black and you don't see anything, don't panic or press any buttons. Just wait 5 seconds, and the device will automatically reboot with the previous display settings. This means you should keep the default LCD Type setting and maybe try again with `Inverted Colors` and `BGR Colors`.
If, after the warning in step 1, the screen turns black and you don't see anything, don't panic or press any buttons. Just wait 5 seconds, and the device will automatically reboot with the previous display settings. This means you should keep the default `LCD Type` setting and maybe try again with `Inverted Colors` and `BGR Colors`.

If you accidentally pressed `PREVIOUS` (UP) and saved the wrong setting, you will have to perform a wipe to remove all stored settings to be able to see the screen working again. On Linux, go to the folder where you downloaded the Krux firmware and use Ktool to fully wipe your device:

Expand Down Expand Up @@ -56,9 +57,9 @@ Your device should charge and turn on when connected to a USB-A port, even if it
- If the device is already turned on and connected to a USB-C port, it may not charge or be recognized by the computer. In this case, turn off the device to initiate recognition and charging. Once turned off and reconnected, the device should restart, be recognized by the computer, and charging should be triggered by USB-C hosts.
If your device is not charging or being recognized as expected, try using a different USB port or a different computer to determine if the issue is with the device or the host's USB port.

## Why isn't my M5stickV device being recognized and charged when connected to the computer's USB-C?
## Why isn't my M5StickV device being recognized and charged when connected to the computer's USB-C?
----8<----
m5stickv-usb-c.md
m5stickv-usb-c.en.txt
----8<----

## Why does my Krux device randomly freeze or restart when connected to the computer?
Expand All @@ -70,7 +71,7 @@ Make sure your device is being detected and serial ports are being mounted by ru
```bash
ls /dev/ttyUSB*
```
Expect one port to be listed for devices like M5stickV and Maix Dock `/dev/ttyUSB0`, and two ports for Maix Amigo and Maix Bit `/dev/ttyUSB0 /dev/ttyUSB1`.
Expect one port to be listed for devices like M5StickV and Maix Dock `/dev/ttyUSB0`, and two ports for Maix Amigo and Maix Bit `/dev/ttyUSB0 /dev/ttyUSB1`.

If you don't see them, your OS may not be loading the correct drivers to create the serial ports to connect to. Ubuntu has a known bug where the `brltty` driver "kidnaps" serial devices. You can solve this problem by removing it:
```bash
Expand Down Expand Up @@ -98,35 +99,37 @@ The level of detail that you see is what Krux sees. If the QR code shown on the

If you have adjusted the lens already, the device may be too far away or too close to the code to read it. Start by holding the device as close to the QR code as possible and pulling away slowly until all or most of the QR code is viewable within the screen. If the code on the screen looks crisp, Krux should read it quickly and give you immediate feedback.

If you are in a dark environment, you can hold down the `ENTER` button of the M5StickV or Maix Amigo to turn on their LED light to potentially increase visibility. M5stickV and Amigo also has an anti-glare mode to better capture images from high brightness screens or with incident light, to enable/disable the anti-glare just press the PAGE button while scanning.
----8<----
camera-scan-tips.en.txt
----8<----

## Why am I getting an error when I try to scan a QR code?
If Krux is recognizing that it sees a QR code but is displaying an error message after reading it, the likely reason is that the QR code is not in a format that Krux works with. We have listed the supported formats below:

For BIP-39 mnemonics:

1. BIP-39 Plaintext (Used by Krux and [https://iancoleman.io/bip39/](https://iancoleman.io/bip39/))
2. SeedSigner [SeedQR and CompactSeedQR](https://github.com/SeedSigner/seedsigner/blob/dev/docs/seed_qr/README.md) Formats
3. [UR Type `crypto-bip39`](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md)
4. Encrypted QR Code (Format created by Krux, [more info here](getting-started/features/encrypted-mnemonics.md))
- BIP-39 Plaintext (Used by Krux and [https://iancoleman.io/bip39/](https://iancoleman.io/bip39/))
- SeedSigner [SeedQR and CompactSeedQR](https://github.com/SeedSigner/seedsigner/blob/dev/docs/seed_qr/README.md) Formats
- [UR Type `crypto-bip39`](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md)
- Encrypted QR Code (Format created by Krux, [more info here](getting-started/features/encrypted-mnemonics.md))

For Wallet output descriptor:

1. JSON with at least a `descriptor` key containing an output descriptor string
2. Key-value INI files with at least `Format`, `Policy`, and `Derivation` keys
3. [UR Type `crypto-output`](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-010-output-desc.md)
- JSON with at least a `descriptor` key containing an output descriptor string
- Key-value INI files with at least `Format`, `Policy`, and `Derivation` keys
- [UR Type `crypto-output`](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-010-output-desc.md)

For PSBT (Partially Signed Bitcoin Transactions):

1. Base43, Base58, and Base64-encoded bytes
2. Raw Bytes
3. [UR Type `crypto-psbt`](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md)
- Base43, Base58, and Base64-encoded bytes
- Raw Bytes
- [UR Type `crypto-psbt`](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-006-urtypes.md)

Additionally, Krux recognizes animated QR codes that use either the plaintext `pMofN` (the Specter QR format) or binary [`UR`](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md) encodings.

## Why can't my computer read the QR code that Krux displays?
If you are using an M5StickV, the small screen makes it difficult for laptop webcams to capture enough detail to parse the QR codes it displays.
You can toggle brightness of QR codes from public keys and PSBTs by pressing PAGE button.
You can toggle brightness of QR codes from public keys and PSBTs by pressing `PAGE` button.
In the future, more work will be done to support displaying lower density QR codes. For now, a workaround you can do is to take a picture or video of the QR code with a better-quality camera (such as your phone), then enlarge and display the photo or video to your webcam. Alternatively, it may be simpler to use a mobile wallet such as BlueWallet with the M5StickV since phone cameras don't seem to have issues reading the small QR codes. You can also save the PSBT on a microSD card for Krux to sign and then save the signed transaction to the microSD card to transfer the file to the computer or phone.

## Why isn't Krux detecting my microSD card or presenting an error?
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/features/QR-transcript-tools.en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
When you export a mnemonic, encrypted mnemonic or a generic text QR code, alternative visualization modes will be available. To change modes swipe sideways, or press `Page` buttons if the device doesn't have touchscreen. Find transcribe templates [here](https://github.com/odudex/krux_binaries/tree/main/templates).
When you export a mnemonic, encrypted mnemonic or a generic text QR code, alternative visualization modes will be available. Swipe left :material-gesture-swipe-left: or right :material-gesture-swipe-right: to change modes, or if your device doesn't have a touchscreen, press the `PAGE` buttons. Find transcribe templates [here](https://github.com/odudex/krux_binaries/tree/main/templates).

### Standard Mode
<img src="../../../img/maixpy_m5stickv/standard-qr-code-125.png" align="right">
Expand Down
18 changes: 13 additions & 5 deletions docs/getting-started/features/printing.en.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
Krux has the ability to print all QR codes it generates, including mnemonic, xpub, wallet backup, and signed PSBT, via a locally-connected thermal printer over its serial port. Consult the [part list](../../parts.md/#optional-thermal-printer) page for supported printers.
----8<----
warning-printer.en.txt
----8<----

Krux has the ability to print mnemonic backup (Words, Numbers, Tiny Seed template; but not Stackbit 1248) and any QR code (SeedQR, signed PSBT, Address, XPUB, Wallet output descriptor, ...) via a locally-connected TTL serial thermal printer. Consult the [parts list](../../parts.md/#optional-thermal-printer) page for supported printers.

<img src="../../../img/maixpy_amigo/print-qr-printing-150.png">
<img src="../../../img/maixpy_m5stickv/print-qr-printing-125.png">

<video width="430" height="300" controls>
<video width="430" controls>
<source src="../../../img/printing-qr.mp4" type="video/mp4"></source>
</video>

<video width="400" height="300" controls>
<video width="400" controls>
<source src="../../../img/scanning-printed-qr.mp4" type="video/mp4"></source>
</video>

<video width="480" controls>
<source src="../../../img/printing-scanning-psbt.mp4" type="video/mp4"></source>
</video>


<img src="../../../img/maixpy_m5stickv/print-qr-prompt-125.png" align="right">
<img src="../../../img/maixpy_amigo/print-qr-prompt-150.png" align="right">

Once connected and powered on, all screens that display a QR code will begin showing a follow-up screen asking if you want to `Print to QR?`.
Once enabled the printer driver to thermal in the [Krux settings](./getting-started/settings.md/#thermal), all screens that display a QR code will offer the option to `Print to QR`. Other formats of mnemonic backup will also ask if you want to `Print to QR?`.

There are many ways you can use this functionality, including:

- Printing backups of your mnemonics and multisig wallets
- Printing backups of your mnemonics and multisig wallet output descriptor
- Printing your xpubs and receive addresses to share
- Printing signed messages and PSBTs

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/features/sd-card-update.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ To perform an upgrade, simply copy the [official release](https://github.com/sel
Once installation is complete, eject the microSD card and delete the firmware files before reinserting and rebooting. Otherwise you will be prompted to install it again.

----8<----
sd-card-info-faq.md
sd-card-info-faq.en.txt
----8<----
Only official releases are signed and can be installed via microSD card.
4 changes: 2 additions & 2 deletions docs/getting-started/features/tools.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Here are some useful tools that are available as soon as Krux starts! These are
<img src="../../../img/maixpy_m5stickv/check-sd-card-125.png" align="right">
<img src="../../../img/maixpy_amigo/check-sd-card-150.png" align="right">

You can check if a SD card can be detected and read by your device and explore its content.
You can check if a SD card can be detected and read by your device and explore its content. If there are too many files to fit on one screen, swipe up :material-gesture-swipe-up: or down :material-gesture-swipe-down: to navigate between the screens if your device has a touchscreen.

<div style="clear: both"></div>

Expand All @@ -23,7 +23,7 @@ Quickly print a test QR code to check and optimize your printer setup.
<img src="../../../img/maixpy_m5stickv/create-qr-code-125.png" align="right">
<img src="../../../img/maixpy_amigo/create-qr-code-150.png" align="right">

Enter a text input to create, print or transcript a QR code that can be later used as an encryption key or as a passphrase.
Enter a text input to create, print or transcript a QR code that can be later used as an encryption key or as a passphrase. Swipe left :material-gesture-swipe-left: or right :material-gesture-swipe-right: to change modes if your device has a touchscreen.

<div style="clear: both"></div>

Expand Down
Loading

0 comments on commit 7f779cc

Please sign in to comment.