Coder Social home page Coder Social logo

Comments (5)

RyanNorge avatar RyanNorge commented on August 17, 2024 1

Work for me with the provided hex file right out of the box! No pairing or anything else required.
However, it didn't work with my own MakeCode project. I'll start a separate issue for that.

Micro:bit version 2.0
Python version 3.11.7
MacBook Pro M1 (so Apple Silicon, not Intel)

One thing I can say is that the "JustWorks" is most likely not going to work on Mac. This is not possible in Bleak (or probably any other library), as per their docs...
https://bleak.readthedocs.io/en/latest/backends/macos.html
"There is also no pairing functionality implemented in macOS right now, since it does not seem to be any explicit pairing methods in the COre Bluetooth."

Great looking project, even if I can't under the doc strings. Thanks for this super helpful tool :)
Anything special you'd like me to check for you?

from kaspersmicrobit.

RyanNorge avatar RyanNorge commented on August 17, 2024 1

Sorry, ignore the thing about opening up a new issue. Now I'm able to 2 different MakeCode projects no problem.

I think it was probably an error on my part. Since I can't recreate the problem I'm going to assume that I didn't turn it on and off again like you suggested in the documentation.

BTW if anyone finds this in the future and is having trouble getting their own project running, make sure you read the excellent documentation for it here...
https://kaspersmicrobit.readthedocs.io/en/stable/makecode-bluetooth/create-a-makecode-project-without-pairing/

from kaspersmicrobit.

janickr avatar janickr commented on August 17, 2024

Hi @RyanNorge,
This is awesome! Thanks for taking the time to log this!
I'll update the compatibility table in the readme.

The docstrings are in dutch because I started this package for my son. Maybe I'll translate them and generate localized apidocs in the future.

Thanks for bringing that sentence from the bleak docs to my attention. I'm not 100% sure about this but I believe this refers to bluetooth pairing initiated by bleak. This method is not used by kaspermicrobit for the "JustWorks" scenario, instead kaspersmicrobit relies on the microbit being paired manually by the user in the os. So maybe there is still a chance that this too works. It would be great if you feel like it and you could If you have some time to test the "JustWorks" pairing on your device:

Feel no obligation, I'm already really happy you posted your experience with the "no pairing required" method. Also, it will probably be difficult for me to provide support in case it doesn't work because I cannot test it on macos myself.

Have a great weekend!

from kaspersmicrobit.

RyanNorge avatar RyanNorge commented on August 17, 2024

No problem, happy to help! I think it's really great that you built/maintain this package. They made it pretty easy to set things up on the micro:bit, thanks for making things a bit easier on the laptop side. So nice you could help your kid with his project :)

I'm not able to get the bluetooth pairing to work. The micro:bit just doesn't show up in the list of bluetooth devices I can connect to. I'm using the .hex file you provide in the readme on GitHub.

I spent a little time looking at this, and it looks like the bluetooth pairing must be done manually by the user. A program pair automatically, and it can't prompt the user to pair, so if it's not on the list then there's not an obvious way to do it. I can see it and read from it as an unpaired device though.

I have the same thing with another bluetooth device I have, where I can read and write but I've never been able to pair. I see other people have had similar problems, my guess is it's just one of those Apple things...

As for the test file, it was a little hit and miss. Here is the output using your supplied hex file, I just took out the bluetooth address and serial number...

Platform: macOS-14.3.1-arm64-arm-64bit
Python version: 3.11.7

Bluetooth address: XXXXXXXX

Service.GENERIC_ACCESS not found

Service.DEVICE_INFORMATION available
Model # : BBC micro:bit V2.0
Serial # : XXXXXXXX
Firmware revision: unknown

Service.ACCELEROMETER available
data: AccelerometerData(x=40, y=140, z=-1040)

Service.BUTTON available
Button a: 0
Button b: 0

Service.LED available

Service.TEMPERATURE available
The temperature is now: 20

Service.UART not found

Service.IO_PIN not found

Service.MAGNETOMETER not found

Service.EVENT not found

from kaspersmicrobit.

janickr avatar janickr commented on August 17, 2024

Thanks for spending your time on this!

Kaspersmicrobit never pairs automatically, you'll always have to do it manually in the OS (there is a page for win and one for linux on the documentation site). I know of the methods in bleak to do this but after playing with that in the past I could not always get reproducible results. So if it works after manually pairing in MacOS, that's great!

About the hit&miss on the test file: was that because you expected some services to be available but they weren't or was it because of other reasons? On the download page there is only one hex file with all services enabled (others enable only a subset because of memory limitations) so maybe you had the one with the accelerometer - buttons - led - temperature subset?

Have a great day!

from kaspersmicrobit.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.