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

Blocks for read/write BLE characteristics of an external device #5941

Open
Flangad opened this issue Sep 12, 2024 · 3 comments
Open

Blocks for read/write BLE characteristics of an external device #5941

Flangad opened this issue Sep 12, 2024 · 3 comments

Comments

@Flangad
Copy link

Flangad commented Sep 12, 2024

Hi
I would like to be able to control a LEGO Boost (or LEGO wedo/Spike) Hub with Micro:bit.
The hub connect via bluetooth Low Energy (BLE).
Makecode for Micro:bit allows to send/receive messages through UART on BLE, but the LEGO hub doesn't support UART. The hub only support direct BLE characteristics writing/reading.
You can find here an example of the messages that we need to be able to send:
https://github.com/JorgePe/BOOSTreveng
So, is it possible to add blocks on makecode that would allow to directly read/write BLE characteristics of an external device ?
after that, it would probably be easy to make an extension or custom functions to make the integration between micro:bit and LEGO Hubs, and probably many other integrations
(sorry if my request is stupid, i'm totaly newbe)

@Flangad Flangad changed the title Blocks for read/write BLE characteristics of an externe device Blocks for read/write BLE characteristics of an external device Sep 12, 2024
@abchatra
Copy link
Contributor

I am not a BLE expert. @martinwork @carlosperate any ideas? Is this possible?

@martinwork
Copy link
Contributor

Hi @Flangad, I don't know about LEGO Boost, but the answer in JorgePe/BOOSTreveng#39 sounds right.

By default, micro:bit works as a Bluetooth peripheral. Two peripherals cannot connect to one another. Search online for "bluetooth central vs peripheral".

Building micro:bit software in C++ to support the central role is an advanced task.
https://github.com/lancaster-university/codal-microbit-v2/issues?q=is%3Aissue+is%3Aopen+central

Perhaps have a look at MIT App Inventor to create a phone/tablet app to talk to both peripherals? Search for "mit app inventor micro:bit uart" and "mit app inventor lego boost".

This looks interesting! https://www.facebook.com/groups/SPIKEcommunity/posts/spike-prime-remote-using-microbit-v2-its-also-possible-and-the-remote-code-and-f/1349366148774947/

@Flangad
Copy link
Author

Flangad commented Sep 13, 2024

OK, thx for your answer.. not really good news.
LEGO PoweredUP (last generation) angular motors are great because

  • they are stepper motors : they act like both DC "continuous" motor and Servo "angular" motors, but also as sensors that send their anglular position to the controler,
  • and of course they are integrated with the great LEGO Technic construction system
    But they have proprietary interface and connector, and can connect only to LEGO Spike/Mindstorm (last generation)/Boost hub

So maybe the only "clean" solution to get those great motors controled by micro:bit would be to find an electronic hardware manufacturer who develop an interface module that could connect one side I2C/grove to microbit and other side directly connect 2/4 or 6 Lego PoweredUP Motors with their specific connectors. I understand this would be a more serious path than trying to establish a bluetooth connection between micro:bit and LEGO poweredUP HUB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants