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

Duplo Train Hub - peripherial connection to port not happening, intermittently #2

Open
esklarski opened this issue Jul 5, 2020 · 4 comments

Comments

@esklarski
Copy link

esklarski commented Jul 5, 2020

When trying to connect to a Duplo Train hub I often get a recurring loop where the output in the terminal is just:
Waiting for peripheral motor to attach to a port
Waiting for peripheral motor to attach to a port
Waiting for peripheral motor to attach to a port
Waiting for peripheral motor to attach to a port
Waiting for peripheral motor to attach to a port

That runs until I exit (ctrl+c) power cycle the hub and try again. I'll sometimes need to go through this numerous times to get the hub to connect, but when it does it works fine.

I cannot be sure this is an issue with Bricknil as it could maybe be Bleak, Bluez, the OS or something else. I am using the devel branch in a fresh virtual environment, with only the other dependencies installed, on an up-to-date Ubuntu 20.04 install (Python: 3.8.2). Coding in VScode.

I have tested the hub with the android app and it runs flawlessly, so I don't suspect it as a problem.

This problem has occurred with all combinations of bricknil and bleak I have tried, however this combination ('devel' + 'bleak 0.7.0') is the only one that does not regularly crash somewhere along the process (so you've fixed that problem :-) ).

Any thoughts on where to start troubleshooting would be great as at the moment there are no error messages thrown and the loop seems happy to run indefinitely never connecting, until I try again.

@janvrany
Copy link
Owner

I've had similar issue and after a lot of debugging, it turned out to be an issue with Bleak and BlueZ backend. Maybe you can try latest devel branch (pushed just minutes ago) to see whether it fixes your problem too?

If it is still relevant at all, after so long...

@esklarski
Copy link
Author

Well it is still relevant as I never did diagnose the problem. But I also haven't tried at all in the past 4 months.

But I will give it a try with updated components.

@esklarski
Copy link
Author

Looking through recent changes I see I am definitely behind the times. You've made some changes since I last looked that might also have fixed this.

I will give it a go some time soon.

@justxi
Copy link

justxi commented Jan 24, 2021

I have observed this behaviour randomly using bricknil 0.9.3 from virantha.

@esklarski If you try latest version from @janvrany, please drop a note if it works, because I have currently problem using it with a city train (60197), while bricknil 0.9.3 from virantha works.

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

3 participants