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

trezor emulator: can't set up the device #646

Open
danielabrozzoni opened this issue Nov 15, 2022 · 11 comments
Open

trezor emulator: can't set up the device #646

danielabrozzoni opened this issue Nov 15, 2022 · 11 comments
Labels

Comments

@danielabrozzoni
Copy link

danielabrozzoni commented Nov 15, 2022

Hey,
I'm trying to set up a trezor emulator using this command:

❯ hwi --device-type trezor -i setup

The emulator prompts me with a "Enter new pin" screen and, immediately after, hwi returns this error:

❯ hwi --device-type trezor -i setup                           
{"error": "PIN requested but no sequence was configured", "code": -13}

If I try to enter the new PIN in the emulator, it freezes.

Any idea how to solve this?

I'm using hwi 2.1.1 and trezor-firmware on commit 4e800b6ffde97862026c6196f7d983d62a05ea71

@prusnak
Copy link
Collaborator

prusnak commented Dec 5, 2022

I'm using hwi 2.1.1 and trezor-firmware on commit 4e800b6ffde97862026c6196f7d983d62a05ea71

Can you try HWI from master and trezor-firmware from master?

@danielabrozzoni
Copy link
Author

I'm hitting the same problem on hwi master (857e935) and on trezor-firmware master (trezor/trezor-firmware@4528577)

Selection_121

@prusnak
Copy link
Collaborator

prusnak commented Dec 6, 2022

@matejcik can you have a look?

@matejcik
Copy link
Contributor

matejcik commented Dec 6, 2022

The error message seems to be coming out of debuglink. Looks like HWI is setting up TrezorClientDebugLink for the client instance, which wants to enter the PIN for you, except there is no PIN preconfigured.

In your usecase I presume hwi should be using regular TrezorClient instead of TrezorClientDebugLink.

@danielabrozzoni
Copy link
Author

Thanks for looking into it!

Btw, I just noticed that I hit the same bug when using restore, I assume the fix will be similar to the fix for setup - but I can create a different issue if that's not the case

@prusnak
Copy link
Collaborator

prusnak commented Dec 6, 2022

@danielabrozzoni does this commit help with the issue? prusnak@80b13fb

@danielabrozzoni
Copy link
Author

Yep, both restore and setup are fixed there

@prusnak
Copy link
Collaborator

prusnak commented Dec 6, 2022

@achow101 Why do you use TrezorClientDebugLink for communicating with the emulator? It does seems strange ...

@prusnak
Copy link
Collaborator

prusnak commented Dec 6, 2022

ISTM that these two commits are better way how to implement things?

prusnak@80b13fb
+
prusnak@eb263e3

(both in branch https://github.com/prusnak/HWI/tree/trezor-remove-debuglink)

Or is there something I am missing?

@achow101
Copy link
Member

achow101 commented Dec 6, 2022

Why do you use TrezorClientDebugLink for communicating with the emulator? It does seems strange ...

So that the tests can provide the pin and passphrase programatically.

@prusnak
Copy link
Collaborator

prusnak commented Dec 7, 2022

So that the tests can provide the pin and passphrase programatically.

I think we should update the code in a way that TrezorClientDebugLink is only used from tests and in production we only use TrezorClient (which is imported as Trezor because of the naming conflict).

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

No branches or pull requests

4 participants