diff --git a/hwilib/devices/trezorlib/client.py b/hwilib/devices/trezorlib/client.py index 1c57f74..d7b2bc0 100644 --- a/hwilib/devices/trezorlib/client.py +++ b/hwilib/devices/trezorlib/client.py @@ -178,7 +178,10 @@ class TrezorClient: @tools.session def init_device(self): - resp = self.call_raw(messages.Initialize(state=self.state)) + resp = self.call_raw(messages.GetFeatures()) + # If GetFeatures fails, try initializing and clearing inconsistent state on the device + if isinstance(resp, messages.Failure): + resp = self.call_raw(messages.Initialize()) if not isinstance(resp, messages.Features): raise exceptions.TrezorException("Unexpected initial response") else: