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

Issues in detecting hardware wallets using master branch on Ubuntu #1126

Closed
nondiremanuel opened this issue Jun 20, 2024 · 3 comments · Fixed by #1134
Closed

Issues in detecting hardware wallets using master branch on Ubuntu #1126

nondiremanuel opened this issue Jun 20, 2024 · 3 comments · Fixed by #1134
Milestone

Comments

@nondiremanuel
Copy link
Collaborator

Here is the description of what I did:

  • I inizialized my Jade/Ledger on the device
  • Updated udev rules (see below) in my OS
  • Cloned liana master branch from liana repo
  • Ran liana via "cargo run" in the /gui folder
  • Plugged in the Jade/Ledger

Trying to setup a new wallet, Jade and Ledger were not detected in Liana on any network. I tried with Electrum and it was working.

Doing some debugging with @edouardparis, we randomly found out that for some reason running a parallel async-hwi/cli (even if without results itself) the hardware wallets are then correctly detected from Liana on my laptop. When I kill the async-hwi/cli before unlocking the device and selecting it in a path, it disappears.

I have an old trial (liana_quicktry) version of Liana and the Ledger seems to be correctly detected (not testable with the Jade, which was not supported).

To recap, what I need to do right now to see Jade/Ledger on Liana master is the following:

  • Run liana via "cargo run" in the /gui folder
  • Run async-hwi/cli on a separate git clone via "cargo run -- device list". Note that I don't get any result from running this command
  • Plug in the hardware wallet (it can be done also earlier in the process)
  • Look for the hww in Liana setup phase (and it works)

I don't know the reason of this behavior and if it's something related to my laptop setup. This is my system info / configuration;

  • OS: Ubuntu 22.04.4 LTS
  • Kernel: 6.5.0-35-generic
  • user groups: nondiremanuel adm dialout cdrom sudo dip plugdev lpadmin lxd sambashare
  • udev rules related to jade: I have 2 different files:
    55-usb-jade.rules
    KERNEL=="ttyUSB*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="jade%n" KERNEL=="ttyACM*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="jade%n"
    21-jade.rules
    KERNEL=="ttyACM*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", MODE="0660", GROUP="plugev", TAG+="uaccess", TAG+="udev-acl", SYMLINK+="jade%n"
  • udev rules related to ledger:
    20-hwi.rules
# HW.1, Nano
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="1b7c|2b7c|3b7c|4b7c", TAG+="uaccess", TAG+="udev-acl"

# Blue, NanoS, Aramis, HW.2, Nano X, NanoSP, Stax, Ledger Test,
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", TAG+="uaccess", TAG+="udev-acl"

# Same, but with hidraw-based library (instead of libusb)
KERNEL=="hidraw*", ATTRS{idVendor}=="2c97", MODE="0666"
@pythcoiner
Copy link
Collaborator

you have the issue only w/ jade or also w/ ledger nano?
FYI i already noticed that the jade need to be 'pinged' by an application in order to be unlocked, maybe its related?

@nondiremanuel
Copy link
Collaborator Author

with both Jade and Ledger Nano S+ (which instead is visible in the liana_quicktry version based on v5)

@edouardparis
Copy link
Member

We found the reason:

While scanning for serial port, the serial interface for jade and specter were accepting Pci ports and ping them to know if there was a hardware wallet on the other side of the communication channel. A Pci port can hold the communication while not responding.

So while Manuel was trying to list with liana the hardware wallet, the listing of hws was taken on hold by the gui trying to talk to a ttyS4 interface. But if Manuel was running async-hwi device list, this same interface was reserved by the command and the listing of the gui could continue.
You may ask why then the error was not happening with liana gui v5, that has the same behaviour with specter using serial, well I did certainly have a kind of error like this long time ago and I had introduce a timeout in case.
https://github.com/wizardsardine/liana/blob/master/gui/src/hw.rs#L418 (timeout that I did not implement for jade)

So the fix should be:

  1. get ride of Pci port scanning on async-hwi side. Do not check for Pci in serial com async-hwi#90
  2. then get ride of the specter timeout that will be useless.

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

Successfully merging a pull request may close this issue.

3 participants