Skip to content

can't communicate with fw 5.10.1 #25

Description

@SomberNight

Using the latest released version of python-keepkey (4.0.2) (latest on pypi...), on a keepkey with fw 5.8.0, "everything works".
I had upgraded the fw to 5.10.1, and now the library can't communicate with the device. The Chrome app works.

On Linux, I get

$ python3 ./keepkeyctl ping "asd"
Traceback (most recent call last):
File "./keepkeyctl", line 501, in <module>
main()
File "./keepkeyctl", line 485, in main
transport = get_transport(args.transport, args.path)
File "./keepkeyctl", line 81, in get_transport
return HidTransport(d, **kwargs)
File ".../python-keepkey/keepkeylib/transport_hid.py", line 25, in __init__
super(HidTransport, self).__init__(device, *args, **kwargs)
File ".../python-keepkey/keepkeylib/transport.py", line 14, in __init__
self._open()
File ".../python-keepkey/keepkeylib/transport_hid.py", line 69, in _open
self.hid.open_path(self.device)
File "hid.pyx", line 72, in hid.device.open_path
OSError: open failed

On Windows, a blocking call never returns

> python3.6 .\keepkeyctl ping "asd"
Traceback (most recent call last):
File ".\keepkeyctl", line 501, in <module>
main()
File ".\keepkeyctl", line 489, in main
client = KeepKeyClient(transport)
File "...\python-keepkey\keepkeylib\client.py", line 477, in __init__
self.init_device()
File "...\python-keepkey\keepkeylib\client.py", line 484, in init_device
self.features = expect(proto.Features)(self.call)(proto.Initialize())
File "...\python-keepkey\keepkeylib\client.py", line 135, in wrapped_f
ret = f(*args, **kwargs)
File "...\python-keepkey\keepkeylib\client.py", line 148, in wrapped_f
return f(*args, **kwargs)
File "...\python-keepkey\keepkeylib\client.py", line 184, in call
resp = self.call_raw(msg)
File "...\python-keepkey\keepkeylib\client.py", line 148, in wrapped_f
return f(*args, **kwargs)
File "...\python-keepkey\keepkeylib\client.py", line 180, in call_raw
return self.transport.read_blocking()
File "...\python-keepkey\keepkeylib\transport.py", line 90, in read_blocking
data = self._read()
File "...\python-keepkey\keepkeylib\transport_hid.py", line 91, in _read
(msg_type, datalen) = self._read_headers(FakeRead(self._raw_read))
File "...\python-keepkey\keepkeylib\transport.py", line 111, in _read_headers
c = read_f.read(1)
File "...\python-keepkey\keepkeylib\transport_hid.py", line 17, in read
return self.func(size)
File "...\python-keepkey\keepkeylib\transport_hid.py", line 99, in _raw_read
time.sleep(0.001)
KeyboardInterrupt

Using git HEAD (f045866), on Linux, after working around #24 and #23, I get

$ python3 ./keepkeyctl ping "asd"
Traceback (most recent call last):
File "./keepkeyctl", line 506, in <module>
main()
File "./keepkeyctl", line 490, in main
transport = get_transport(args.transport, args.path)
File "./keepkeyctl", line 70, in get_transport
from keepkeylib.transport_hid import HidTransport
File "/home/user/wspace/python-keepkey/keepkeylib/transport_hid.py", line 11, in <module>
import hidraw as hid
File "/home/user/.local/lib/python3.6/site-packages/hidraw/__init__.py", line 6, in <module>
from .hidraw import Info
File "/home/user/.local/lib/python3.6/site-packages/hidraw/hidraw.py", line 3, in <module>
import _hidraw
ModuleNotFoundError: No module named '_hidraw'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions