Coder Social home page Coder Social logo

Comments (15)

martin-lizner avatar martin-lizner commented on July 19, 2024

This bug does not happen on KeepKey device. Which could mean that there is something different/wrong with Trezor FW. If we have an idea where to focus, Trezor dev might help with that.

from multibit-hardware.

prusnak avatar prusnak commented on July 19, 2024

Update from trezor/trezor-mcu#98 (comment) - this also happens for Keepkey if passphrase is involved.

from multibit-hardware.

bgok avatar bgok commented on July 19, 2024

@prusnak Thanks for the heads up. we will confirm today.

from multibit-hardware.

bgok avatar bgok commented on July 19, 2024

@prusnak @jhoenicke Confirmed. We will wait for a response from @gary-rowe on gary-rowe/hid4java#42. If we don't hear back soon, we plan to fork and fix.

from multibit-hardware.

gary-rowe avatar gary-rowe commented on July 19, 2024

Hi all,

Been off grid recently so I've not seen this solution. I'll have some time tomorrow to dig into hid4java and find a solution.

Cheers,

Gary

from multibit-hardware.

gary-rowe avatar gary-rowe commented on July 19, 2024

I've pushed a quick workaround to hid4java (develop branch) that MultiBit Hardware could make use of as an interim measure for testing.

Do the following:

  1. Update and Maven install hid4java develop branch as develop-SNAPSHOT
  2. Reference this in MultiBit Hardware pom.xml
  3. Update the following line in KeepKeyV1HidHardwareWallet and TrezorV1HidHardwareWallet:
hidServices = HidManager.getHidServices(true, 1000);

Once verified, I'll prepare a formal release of hid4java (likely 0.5.0) and push it to Maven Central. The value 1000 may be too generous and may lead to slow responses to attach/detach events.

from multibit-hardware.

prusnak avatar prusnak commented on July 19, 2024

from multibit-hardware.

prusnak avatar prusnak commented on July 19, 2024

from multibit-hardware.

bgok avatar bgok commented on July 19, 2024

Thanks for looking at this, @gary-rowe.

from multibit-hardware.

gary-rowe avatar gary-rowe commented on July 19, 2024

@prusnak My apologies. I didn't read your earlier comment referencing the Trezor firmware bug and simply assumed it was a simple case of reducing the frequency and not changing the nature of the scan entirely. If I can get away with a "pause scanning" API call in hid4java then that will simplify things greatly.

@bgok No worries - are you a collaborator on MultiBit Hardware? If so, would you be OK with making the code changes in MultiBit Hardware to support calls to pause scanning during device initialisation detection?

from multibit-hardware.

bgok avatar bgok commented on July 19, 2024

@gary-rowe I haven't had a chance to review the HID handling code yet, but it seems like a reasonable approach.

@martin-lizner Will this work for your project?

from multibit-hardware.

martin-lizner avatar martin-lizner commented on July 19, 2024

Thanks everybody for taking care! Great community!

...bad news, with latest hid4java master Im not even able to get my trezor device (both 1.3.5 and 1.3.6 fw) to ready state. And it does not matter what I set in HidManager.getHidServices.

1.3.6 fw just shows CONNECTED state and waits
1.3.5 returns ERROR o.m.h.h.t.w.v.TrezorV1HidHardwareWallet - Unknown HID version.

Please note that Im using devel branch of multibit hw with trezor 1.3.6 PR merged. This PR works fine with hid4java 0.4.0 (except reported long delays) for both firmwares.

from multibit-hardware.

jhoenicke avatar jhoenicke commented on July 19, 2024

Isn't the usage in the trezor pull request wrong? The report ID should not be put into the array, but that is what the last parameter is for.

 /**...
   * @param device   The device
   * @param data     The report data to write (should not include the Report ID)
   * @param len      The length of the report data (should not include the Report ID)
   * @param reportId The report ID (or (byte) 0x00)
   *
   * @return The number of bytes written, or -1 if an error occurs
   */
  public static int write(HidDeviceStructure device, byte[] data, int len, byte reportId) {

from multibit-hardware.

jhoenicke avatar jhoenicke commented on July 19, 2024

To clarify, the first byte written to buffer (0 for 1.3.6, 63 for <1.3.5) in AbstractTrezorHardwareWallet.java is the report_id and should not be written to the buffer. The buffer should be one byte shorter. I think the return value includes the report_id in the count though).

from multibit-hardware.

martin-lizner avatar martin-lizner commented on July 19, 2024

@jhoenicke thanks for the review, you may be right! To be honest, me + @prusnak little improvised to fix the code as fast as possible for 1.3.6 support, so we may not found the cleanest way. Anyway that PR is totally working as proven both in my app and MB HW examples project. I will try to find better code solution and if possible make a new pull request in order to MB HW to support 1.3.6 Trezor firmware.

But pls don't get distracted from the real issue, this has probably no connection at all with the problem we are talking about in this thread - long init delay after soft detach.

from multibit-hardware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.