Is it possible to connect some micro:bit to raspberry

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
syl
Posts: 1
Joined: Thu Oct 15, 2020 9:03 pm

Is it possible to connect some micro:bit to raspberry

Post by syl » Thu Oct 15, 2020 9:05 pm

Hi,
I would like to connect 10 micro:bit(new version or the old one) to a rasberry at the same time. Do you think it's possible with bluetooth ? Or some other way?
Thank you !

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Is it possible to connect some micro:bit to raspberry

Post by jimmo » Tue Oct 20, 2020 12:45 pm

syl wrote:
Thu Oct 15, 2020 9:05 pm
I would like to connect 10 micro:bit(new version or the old one) to a rasberry at the same time. Do you think it's possible with bluetooth ? Or some other way?
It depends what you mean by "connect". :)

It's obviously possible to use a USB hub and physically connect them to the Raspberry Pi.

MicroPython on the micro:bit doesn't support Bluetooth (BLE), however it does support sending basic messages over the same radio that BLE uses. So one way that you can do this is to have one micro:bit connected to the Rasberry Pi over USB that you send commands over the REPL or serial to, which then talks to the other 10 micro:bits over the radio. I have done exactly this with my students in the past. https://microbit-micropython.readthedoc ... radio.html

marccarrion
Posts: 2
Joined: Thu Apr 15, 2021 1:08 pm

Re: Is it possible to connect some micro:bit to raspberry

Post by marccarrion » Thu Apr 15, 2021 1:18 pm

Hi Jimmo, I would be interested on how you connected them.

I'm using one Micro:Bit as Logger. It is connected to a Raspberry PI with the 'screen' command, it receives messages from two other Micro:Bit and logs them to the console.

The messages include the Serial Number of the MicroBit sending the messsage as well as the message itself.

This seems to be working fine. I was wondering how can I also send responses from the 'Logger' to other Micro:Bits and for all Micro:Bits to ignore messages that are not for them. It seems that the best way is to keep the same address for all Micro:Bits (default=0x75626974) and assign a different Group to each Micro:Bit.

Both the Logger and the MicroBits would need a translation table from SerialNumber to Group so they would all know the Group for each Micro:Bit, but I'm concerned that when the Logger changes the group in order to send a response to a particular Micro:Bit, all messages sent to the Logger will be lost. I don't know if it would be better to keep the same group for everyone and use the SerialNumber on each Micro:Bit to discard messages, kind of a broadcast message and let the clients decide what to do.

Any thoughts?

Thanks!!

Post Reply