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

Decoding hub broadcast signals on the computer #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pbochynski
Copy link

@pbochynski pbochynski commented Nov 29, 2022

Added example of how to decode hub broadcast data with bleak library.
Resolves the first part of this issue: pybricks/support#800
It requires a patch for the experimental firmware that sends the proper message length.

@laurensvalk
Copy link
Member

Thank you!

I think we will be able to look at this after we release V3.2, so it may be a while before it gets merged.

@dlech
Copy link
Member

dlech commented Nov 29, 2022

One thing to consider here is that Bleak is doing active scanning. So this should probably come with a warning that if you leave the script running a long time, it can drain the batteries of any other BLE devices you have in the neighborhood. It is possible to do passive scanning with Bleak to avoid this on Windows and Linux (Linux requires new enough BlueZ, kernel and manual configuration).

@laurensvalk
Copy link
Member

The broadcasting feature is now part of the release and has undergone a few small changes since this PR was made.

If you'd like to update the sample program or the PR, feel free to let us know.

@pbochynski
Copy link
Author

@laurensvalk If you still see the value in this PR, I can adapt the PR to the new release.

@laurensvalk
Copy link
Member

Sure, that would be awesome!

If you have any other MicroPython boards (pico, pyboard, etc), another nice project would be to let those broadcast/scan just like the LEGO hubs. This could make it easy to integrate LEGO with other IoT stuff.

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

Successfully merging this pull request may close these issues.

3 participants