pylgbst icon indicating copy to clipboard operation
pylgbst copied to clipboard

Lego Boost reconnection issue

Open Lamb0524 opened this issue 4 years ago • 1 comments

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

Lamb0524 avatar Oct 14 '21 12:10 Lamb0524

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.

undera avatar Oct 14 '21 13:10 undera