bluetooth connect after pairing

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
erkman
Posts: 4
Joined: Sun Sep 05, 2021 5:22 am

bluetooth connect after pairing

Post by erkman » Sun Sep 05, 2021 5:32 am

Hi

I have a Microbit, I'm new to microbit, and in python, but not for other scripting languages (over 7 years of experience), so what is interesting, that I would like to run a bluetooth script based on this webpage: https://ukbaz.github.io/howto/ubit_workshop.html maybe the first one send a text to the microbit via raspi, (my is running ubuntu very well, bluetooth pairing also works with microbit, so this is not the question here)

But after pairing I can connect at first time only to the microbit. After the first connect no more connections (after disconnect and connecti again) are possyble.

In my thougs it seems, that the microbit is not broadcasting anymore, is there a way in micropython with the standarc microbit bluetooth connection to boradcast again after disconnection?

Why? Because by the first bluetooth connection the Microbit displays an X for (I think connected device, that's ok), but you cannot communicate with it.

Does anybody have an idea?

THanks is advance.

jim200
Posts: 4
Joined: Tue Jul 13, 2021 10:59 pm

Re: bluetooth connect after pairing

Post by jim200 » Mon Sep 06, 2021 9:46 am

First off I have not played around much with Bluetooth on the Microbit because I’ve been put off because it is resource intensive. I believe it has improved in v2 and I note the article you referred to was updated this year. So the first thing to check is that you are using the same kit as the article and you have the latest version of the firmware installed.

I have done a little project using a phone connected to a Microbit, but I found I needed to keep the BLE services to a minimum for it to remain stable. Maybe try turning off some of the services and see how it behaves.

erkman
Posts: 4
Joined: Sun Sep 05, 2021 5:22 am

Re: bluetooth connect after pairing

Post by erkman » Mon Sep 06, 2021 2:56 pm

Yes. Sorry I use the v2 and the fantastic thing ír was that you have to diaconnect the device from usb to power on from another source e. x. batteries, and then after powering up it works.

What a new problem maybe you could help: communication. How to send a text string via python bluetooth serial? Not the normal socket because microbit cannot interpret it. I can connect now with script but that's all.

jim200
Posts: 4
Joined: Tue Jul 13, 2021 10:59 pm

Re: bluetooth connect after pairing

Post by jim200 » Mon Sep 06, 2021 10:02 pm

Well for the first problem, it sounds like a power issue. At a guess, perhaps your USB cable is not delivering sufficient current. Check the cable or try a different one.

On the second problem, I have no experience, sorry.

Post Reply