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

Ledger Nano S Plus doesn't work (No hardware device detected) #9399

Open
BobOmbuzal opened this issue Jan 2, 2025 · 4 comments
Open

Ledger Nano S Plus doesn't work (No hardware device detected) #9399

BobOmbuzal opened this issue Jan 2, 2025 · 4 comments

Comments

@BobOmbuzal
Copy link

The device DOES work with the original "Ledger Live" AppImage, i was able to set it up,
update to the latest firmware (1.3.1 19. Dec 2024)
install an app (BTC, 2.3.0) and
create an account.

Electrum though does not detect it.
Installed the dependencies, then only 20-hw1.rules for the Ledger device.
I see it connecting in 'dmesg -w' when i plug it in, and when i start the BTC App on the Ledger again.
I get these new devices: (user is in the dialout group)

$ ls -l /dev/hidraw4 /dev/usb/hiddev0
crw-rw-rw-+ 1 root root 240, 4 Jan  2 20:33 /dev/hidraw4
crw-rw----+ 1 root root 180, 0 Jan  2 20:33 /dev/usb/hiddev0
crw-rw---- 1 root dialout 188, 0 Jan  2 20:58 /dev/ttyUSB0

$ getfacl /dev/hidraw4 /dev/usb/hiddev0
getfacl: Removing leading '/' from absolute path names
# file: dev/hidraw4
# owner: root
# group: root
user::rw-
user:bombo:rw-
group::rw-
mask::rw-
other::rw-

# file: dev/usb/hiddev0
# owner: root
# group: root
user::rw-
user:bombo:rw-
group::---
mask::rw-
other::---

Then i start the AppImage and click "Create new wallet" then Keystore: "[x] Use a hardware device" then i get "Scanning devices..."

No hardware device detected.

On Linux, you might have to add a new permission to your udev rules.

Debug message
  jade: (error getting device infos)
   premature end of stream (expected to read 1 bytes, got 0 instead)

the stdout says

$ ./electrum-4.5.8-x86_64.AppImage 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-bombo'
 65.68 | W | plugins.jade.jadepy.jade | No module named 'electrum.plugins.jade.jadepy.jade_ble'
 65.68 | W | plugins.jade.jadepy.jade | BLE scanning/connectivity will not be available
 68.83 | E | plugin.DeviceMgr | failed to create client for jade at /dev/ttyUSB0: CBORDecodeEOF('premature end of stream (expected to read 1 bytes, got 0 instead)')
 68.83 | W | gui.qt.wizard.wallet.WCChooseHWDevice | error getting device infos for jade: premature end of stream (expected to read 1 bytes, got 0 instead)

I tried it with the non-AppImage version too.
First i installed a venv for the dependences:

python3 -m venv --system-site-packages ledger
ledger/bin/pip3 install hidapi btchip-python ecdsa ledger-bitcoin
ledger/bin/pip3 install cryptography ckcc-protocol keepkey safet bitbox02 pyserial cbor2
ledger/bin/pip3 install trezor[hidapi]==0.13.9

ledger/bin/pip3 install protobuf==5.29.2
ledger/bin/pip3 install pycryptodomex==3.21.0

then started it with:

ledger/bin/python3 Electrum-4.5.8/run_electrum

with exactly the same result.

Versions of the Python packages:

$ ledger/bin/pip3 list|grep -e trezor -e hidapi -e btchip-python -e ecdsa -e ledger-bitcoin -e cryptography -e ckcc-protocol -e keepkey -e safet -e bitbox02 -e pyserial -e cbor2 -e protobuf -e pycryptodomex

bitbox02                6.3.0               
btchip-python           0.1.32              
cbor2                   5.6.5               
ckcc-protocol           1.4.0               
cryptography            2.8                 
ecdsa                   0.19.0              
hidapi                  0.14.0.post4        
keepkey                 6.3.1               
ledger-bitcoin          0.3.0               
protobuf                5.29.2              
pycryptodomex           3.21.0              
pyserial                3.4                 
safet                   0.1.5               
trezor                  0.13.9              

Tried it on ubuntu and debian bookworm.

@bazzlove

This comment was marked as off-topic.

@SomberNight
Copy link
Member

the stdout says

$ ./electrum-4.5.8-x86_64.AppImage 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-bombo'
 65.68 | W | plugins.jade.jadepy.jade | No module named 'electrum.plugins.jade.jadepy.jade_ble'
 65.68 | W | plugins.jade.jadepy.jade | BLE scanning/connectivity will not be available
 68.83 | E | plugin.DeviceMgr | failed to create client for jade at /dev/ttyUSB0: CBORDecodeEOF('premature end of stream (expected to read 1 bytes, got 0 instead)')
 68.83 | W | gui.qt.wizard.wallet.WCChooseHWDevice | error getting device infos for jade: premature end of stream (expected to read 1 bytes, got 0 instead)

Note: you can run with the -v flag to get more detailed logs.

It is weird and completely unexpected that the DeviceMgr tries to create a jade client for a Ledger device.
(jade is the plugin for the Blockstream Jade hw device, ledger is the plugin for the family of devices sold by Ledger)

see (and lines below):

DEVICE_IDS = [(0x2581, 0x1807), # HW.1 legacy btchip

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

No branches or pull requests

7 participants
@SomberNight @BobOmbuzal @bazzlove and others