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

Multiple retries may be necessary #6

Open
lesamouraipourpre opened this issue Jun 29, 2021 · 0 comments
Open

Multiple retries may be necessary #6

lesamouraipourpre opened this issue Jun 29, 2021 · 0 comments

Comments

@lesamouraipourpre
Copy link

While testing U2IF I've noticed that it sometimes takes more than one try to connect to the device:

>>> dev = machine.Device()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/projects/u2if/.env/lib/python3.7/site-packages/source/machine/helper.py", line 9, in __call__
    cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
  File "/mnt/projects/u2if/.env/lib/python3.7/site-packages/source/machine/u2if.py", line 22, in __init__
    raise ValueError("No board found")
ValueError: No board found
>>> dev = machine.Device()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/projects/u2if/.env/lib/python3.7/site-packages/source/machine/helper.py", line 9, in __call__
    cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
  File "/mnt/projects/u2if/.env/lib/python3.7/site-packages/source/machine/u2if.py", line 22, in __init__
    raise ValueError("No board found")
ValueError: No board found
>>> dev = machine.Device()
>>> dev.firmware_version
[0, 5, 0]
>>> dev.vid
51966
>>> dev.pid
16389

In the example above it took 3 attempts to connect to a RP2040 Pico. Given that the hid library seems to only return null/None with no apparent errors thrown would it be possible to add some kind of connection retry mechanism?

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

No branches or pull requests

1 participant