Comments (5)
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.
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.
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:
- upload the provided JustWorks hex file
- pair the microbit manually in macos (I suppose this can be done like this: https://support.apple.com/guide/mac-help/connect-a-bluetooth-device-blth1004/mac )
- try to connect to the microbit: https://kaspersmicrobit.readthedocs.io/en/stable/test-all-services/ (If you connect using an address you need to provide the UUID )
- If you afterwards want to use the "no pairing required" method again, don't forget to un-pair or remove the connection in macos again, else it will probably not work.
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.
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.
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)
- Error importing kasper HOT 9
- bleak.exc.BleakError: Device with address D6:66:C1:A7:CF:0F was not found. HOT 6
- [bug] bleak.exc.BleakError: Characteristic (...) was not found! HOT 19
- Python program freeze when using microbit.uart.send_string() HOT 5
- Cannot detect microbit HOT 31
- io_pin : can you explain how to read/write to 1 particular pin? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kaspersmicrobit.