Open pbochynski opened 2 years ago
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.
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).
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.
@laurensvalk If you still see the value in this PR, I can adapt the PR to the new release.
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.
Added example of how to decode hub broadcast data with
bleak
library. Resolves the first part of this issue: https://github.com/pybricks/support/issues/800 It requires a patch for the experimental firmware that sends the proper message length.