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

ANT dongle not disconnected properly, then reported "No (free) ANT-dongle found" #203

Closed
WouterJD opened this issue Jan 12, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@WouterJD
Copy link
Owner

You just had to make sure that each of the Apps had fully disconnected from the dongle and there were no "orphaned" processes hanging about using Task Manager if required

I tried running Bkool, RouvyAR and Zwift at this point but (of course) they couldn't see the brake unit as I only had the one Ant+ dongle. The second dongle turned up this morning and I have just successfully run pairing of the brake unit with all three Apps. It is the case that swapping between the Apps can sometimes leave orphaned processes, and I needed to "end task" on a few occassions to release the new Ant+ dongle if the App had been closed, but had some components still running in the background.

@WouterJD WouterJD added the bug Something isn't working label Jan 12, 2021
@WouterJD
Copy link
Owner Author

First reported by @RichardE-UK.

I have this issue now and then myself; to be investigated and suggestions welcome.
It not only occurs when FortiusAnt was killed but also when apparently closed normal. So perhaps dongle not closed properly.

@WouterJD
Copy link
Owner Author

@switchabl do you have suggestions how to properly close the ANTdongle so that it does not remain connected?

@switchabl
Copy link
Contributor

@WouterJD Normally that should happen automatically (but I think I've had this issue a couple of times myself). Maybe calling usb.util.dispose_resources would help. Maybe not.
https://github.com/pyusb/pyusb/blob/a16251f3d62de1e0b50cdfb431482d08a34355b4/docs/tutorial.rst#dont-be-selfish
https://github.com/pyusb/pyusb/blob/ffe6faf42c6ad273880b0b464b9bbf44c1d4b2e9/usb/util.py#L206

@MeanHat
Copy link

MeanHat commented Feb 17, 2021

I've been testing a Tacx Fortius using Windows and Dynastream Ant dongle today and have come across the same error report. FortiusANT worked initially but is now reporting "No (free) ANT-dongle found" despite not opening a CTP and rebooting PC. I've used Task Manager to close any obvious processes but with no success. I wanted to let you know @WouterJD to provide another data point.

@WouterJD
Copy link
Owner Author

@MeanHat @switchabl The "only" way to reset is to remove the dongle and re-insert.
It seems the dongle itself is hanging and/or the physical re-insert resets the device-driver.

@WouterJD
Copy link
Owner Author

WouterJD commented Feb 18, 2021

@switchabl I have added:

        # https://github.com/pyusb/pyusb/blob/ffe6faf42c6ad273880b0b464b9bbf44c1d4b2e9/usb/util.py#L206
        AntDongle.devAntDongle.reset()
        for cfg in AntDongle.devAntDongle:
            for intf in cfg:
                if debug.on(debug.Function): f ("AntDongle.release_interface()")
                usb.util.release_interface(AntDongle.devAntDongle, intf)
        usb.util.dispose_resources(AntDongle.devAntDongle)

and will see whether this helps.

@WouterJD
Copy link
Owner Author

The additional "cleanup" code does not change the behaviour.
Sometimes python does not end, sometimes the dongle gets in undefined state and must be reset (remove/insert from USB port)

@WouterJD
Copy link
Owner Author

THis happens and no additional suggestions received. Closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants