Post
Topic
Board Hardware wallets
Re: [NOW AVAILABLE] BTChip / Ledger HW1 : Bitcoin Hardware Wallet in a USB smartcard
by
Wotan777
on 15/05/2015, 17:38:17 UTC
I tried to install btchip-python under Win 7, 64 bit.

- installed python-2.7.9.amd64.msi
- added to PATH C:\Python27\;C:\Python27\Scripts\
- installed Microsoft Visual C++ VCForPython27.msi
- pip install cython
- pip install hidapi
- downloaded https://github.com/walac/pyusb/archive/pyusb-master.zip
- cd pyusb-master
- python setup.py install
- downloaded https://github.com/LedgerHQ/btchip-python/archive/btchip-python-master.zip
- cd btchip-python-master
- python setup.py install
- cd samples
- python getFirmwareVersion.py
[hang up]

I tried to run pyusb again:
cd pyusb-master\tests
python testall.py
PyUSB ValueError: No backend available

I Googled to this error, and found: http://stackoverflow.com/questions/5152133/pyusb-backend-not-accessible
It said that "You need to install libusb-1.0, libusb-0.1, or openusb as a backend to pyusb."

I downloaded libusb-win32-bin-1.2.6.0
cd libusb-win32-bin-1.2.6.0\bin
inf-wizard.exe

created a driver kit for
Vendor ID        Product ID      Description
0x2581            0x2B7C          Plug-up

Then installed the created driver.

Now pyusb tests run without errors.
Also, btchip-python is operational, gets back the firmware version, but not always:

btchip-python-master\samples>python getFirmwareVersion.py
=> e0c4000000
<= 010001040e014e9000
1.4.14

btchip-python-master\samples>python getFirmwareVersion.py
=> e0c4000000
Traceback (most recent call last):
  File "getFirmwareVersion.py", line 25, in
.
.
    timeout
  File "C:\Python27\lib\site-packages\usb\backend\libusb0.py", line 381, in _che
ck
    raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] libusb0-dll:err [_usb_reap_async] reaping reques
t failed, win error: "A device connected to the system doesn't operate properly"

The next test runs only ONCE conrrectly, then gives an error, then gangs up.
After pwercycle, the same...

\btchip-python-master\tests>python testConnectivity.py
btchip firmware version:
=> e0c4000000
<= 010001040e014e9000
{'compressedKeys': True, 'version': '1.4.14', 'specialVersion': 0}
some random number from the dongle:
=> e0c0000014
<= f673c10e1ce482848366cbc75fe42cd61f41ea3f9000
['0xf6', '0x73', '0xc1', '0xe', '0x1c', '0xe4', '0x82', '0x84', '0x83', '0x66',
'0xcb', '0xc7', '0x5f', '0xe4', '0x2c', '0xd6', '0x1f', '0x41', '0xea', '0x3f']

\btchip-python-master\tests>python testConnectivity.py
btchip firmware version:
=> e0c4000000
Traceback (most recent call last):
  File "testConnectivity.py", line 29, in
    print(app.getFirmwareVersion())
  File "C:\Python27\lib\site-packages\btchip_python-0.1.14-py2.7.egg\btchip\btch
ip.py", line 363, in getFirmwareVersion
    response = self.dongle.exchange(bytearray(apdu))
  File "C:\Python27\lib\site-packages\btchip_python-0.1.14-py2.7.egg\btchip\btch
ipComm.py", line 79, in exchange
    self.device.write(0x02, tmp[offset:offset + 64], 0)
  File "C:\Python27\lib\site-packages\usb\core.py", line 898, in write
    self.__get_timeout(timeout)
  File "C:\Python27\lib\site-packages\usb\backend\libusb0.py", line 499, in intr
_write
    timeout)
  File "C:\Python27\lib\site-packages\usb\backend\libusb0.py", line 552, in __wr
ite
    timeout
  File "C:\Python27\lib\site-packages\usb\backend\libusb0.py", line 381, in _che
ck
    raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] libusb0-dll:err [_usb_reap_async] reaping reques
t failed, win error: Egy rendszerhez csatlakoztatott eszk÷z nem műk÷dik.

btchip-python-master\tests>python testConnectivity.py
btchip firmware version:
=> e0c4000000
[HANG UP]



Please help! How to go on?