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

Get rid of libusbio #523

Closed
wants to merge 14 commits into from
Closed

Get rid of libusbio #523

wants to merge 14 commits into from

Conversation

sosthene-nitrokey
Copy link
Contributor

@sosthene-nitrokey sosthene-nitrokey commented Mar 25, 2024

Needs testing on windows and macos
edit: meissner hijacking this

  • mac test confirmation (@mmerklinger )
  • linux nk3 in firmware
  • linux nk3 in bootloader still crashes (weird hid stuff I don't understand @daringer - fixed)
  • windows works (@jj-so )

Copy link
Contributor

@jj-so jj-so left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing on Windows 11 was successful.

@daringer
Copy link
Collaborator

updated PR desc

@mmerklinger
Copy link
Contributor

Tested on macOS 14 (ARM64). Listing and reading the version works. Then I attempted an update of the NK3. This fails, leaving the NK3 in bootloader mode. Running the update again returns the same error. Removing the forced two-step update process has the same outcome.

nitropy_output.txt
nitropy.log.iymm54or.txt

@daringer
Copy link
Collaborator

ah ok - the error on mac is the same as on linux:

230      WARNING pynitrokey.cli An unhandled exception occurred
Traceback (most recent call last):
  File "/Users/testuser/Projects/pynitrokey/venv/lib/python3.9/site-packages/pynitrokey/trussed/bootloader/lpc55_upload/utils/interfaces/device/usb_device.py", line 78, in open
    self._device = hid.device.open_path(self.path)
TypeError: descriptor 'open_path' for 'hid.device' objects doesn't apply to a 'bytes' object

quite obviously it is not using hid.device correctly....

@daringer
Copy link
Collaborator

works with lpc on linux for me now, @mmerklinger please check

robin-nitrokey added a commit to Nitrokey/nitrokey-sdk-py that referenced this pull request Aug 6, 2024
This commit is extracted from: Nitrokey/pynitrokey#523

This introduces a dependency on the hidapi library.  If the library is
not present when trying to list or open a LPC55 bootloader device, an
exception will be raised.

Co-authored-by: Sosthène Guédon <[email protected]>
robin-nitrokey added a commit to Nitrokey/nitrokey-sdk-py that referenced this pull request Aug 6, 2024
This commit is extracted from: Nitrokey/pynitrokey#523

This introduces a dependency on the hidapi library.  Per default, the
hid module raises an exception if hidapi is not present.  We catch this
exception and show a warning instead so that the SDK can still be used
for other devices if hidapi is missing.

Co-authored-by: Sosthène Guédon <[email protected]>
robin-nitrokey added a commit to Nitrokey/nitrokey-sdk-py that referenced this pull request Aug 6, 2024
This commit is extracted from: Nitrokey/pynitrokey#523

It introduces a dependency on the hidapi library.  Per default, the hid
module raises an exception if hidapi is not present.  We catch this
exception and show a warning instead so that the SDK can still be used
for other devices if hidapi is missing.

Co-authored-by: Sosthène Guédon <[email protected]>
robin-nitrokey added a commit to Nitrokey/nitrokey-sdk-py that referenced this pull request Aug 6, 2024
This commit is extracted from: Nitrokey/pynitrokey#523

It introduces a dependency on the hidapi library.  Per default, the hid
module raises an exception if hidapi is not present.  We catch this
exception and show a warning instead so that the SDK can still be used
for other devices if hidapi is missing.

Co-authored-by: Sosthène Guédon <[email protected]>
@robin-nitrokey
Copy link
Member

robin-nitrokey added a commit to Nitrokey/nitrokey-sdk-py that referenced this pull request Aug 7, 2024
This commit is extracted from: Nitrokey/pynitrokey#523

If the hid module cannot be loaded, a warning is raised so that the SDK
can still be used for other devices if hidapi is not working correctly.

Co-authored-by: Sosthène Guédon <[email protected]>
robin-nitrokey added a commit to Nitrokey/nitrokey-sdk-py that referenced this pull request Aug 7, 2024
This commit is extracted from: Nitrokey/pynitrokey#523

If the hid module cannot be loaded, a warning is raised so that the SDK
can still be used for other devices if hidapi is not working correctly.

Co-authored-by: Sosthène Guédon <[email protected]>
robin-nitrokey added a commit to Nitrokey/nitrokey-sdk-py that referenced this pull request Aug 12, 2024
This commit is extracted from: Nitrokey/pynitrokey#523

If the hid module cannot be loaded, a warning is raised so that the SDK
can still be used for other devices if hidapi is not working correctly.

Co-authored-by: Sosthène Guédon <[email protected]>
robin-nitrokey added a commit to Nitrokey/nitrokey-sdk-py that referenced this pull request Aug 12, 2024
This commit is extracted from: Nitrokey/pynitrokey#523

If the hid module cannot be loaded, a warning is raised so that the SDK
can still be used for other devices if hidapi is not working correctly.

Co-authored-by: Sosthène Guédon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants