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

Lego Boost reconnection issue #106

Open
Lamb0524 opened this issue Oct 14, 2021 · 1 comment
Open

Lego Boost reconnection issue #106

Lamb0524 opened this issue Oct 14, 2021 · 1 comment

Comments

@Lamb0524
Copy link

Lamb0524 commented Oct 14, 2021

Hi, undera, may I ask a question about reconnection of pylgbst.
hub = MoveHub(get_connection_auto(hub_name="LEGO Move Hub")) try: demo = DEMO_CHOICES[options.demo] demo(hub) finally: hub.disconnect()

When the programs exits, the light above the green button remains blue for seconds.
If add hub = MoveHub(get_connection_auto(hub_name="LEGO Move Hub")) after finally block, the program points out that processing thread and communication thread have exited, and throws an exception of 'Device not found'.
Is there any idea about the reconnection of pylgbst?
Looking forward for your reply.

Lamb

@undera
Copy link
Owner

undera commented Oct 14, 2021

Blue light can remain on with some BLE libraries, and there's no harm in that AFAIK. You can call switch_off to force hub to power off (https://github.com/undera/pylgbst/blob/master/pylgbst/hub.py#L192).

Regarding reconnecting issue, I advice to switch to Bleak connection type. If the problem persists, post here debug log of that, for better diagnostics.

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

2 participants