add a microbit scrolling text example#42
add a microbit scrolling text example#42danjenkins wants to merge 1 commit intoWebBluetoothCG:gh-pagesfrom
Conversation
|
Thank you @danjenkins! 447 files is too big for GitHub to review this patch. Could you split your PR into 2 commits? One without Here's one nit I've noticed: |
|
Thanks @beaufortfrancois ! I'll do that! Sure, I forgot there was an event - why is a promise not returned from disconnect? Seems like it should be (talking spec now) |
|
|
|
@danjenkins |
|
Yeah that makes sense; it's just that when I was writing the code; I wrote it expecting a promise to be there - as it made sense for it to be there - your explanation makes sense but from a developer point of view; Calling disconnect and then having to listen for an event too is a shame - it would be cool if the it did return a promise that got resolved when the event is fired in that specific scenario |
|
I guess I don't follow what you want to use the |
|
@danjenkins Keep in mind that you would probably always want to use the |
|
I guess up until now I never listened for disconnect because it didn't exist... all sample apps should now encourage listening for disconnect as part of server connect sequence |
|
SO MANY SITES!! @beaufortfrancois ! I'll try and tackle this PR in the coming days (currently away from home) |
|
:) For info, all URLs are gathered in https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web |
|
I've just received my BBC micro:bit device and it works smoothly on Android. Sadly, pairing process is not triggered on Chrome OS. I've filed a bug at https://bugs.chromium.org/p/chromium/issues/detail?id=629773 for this. |
|
Did you turn off bluetooth pairing? https://github.com/nimbleape/microbit-led-service ? By default the microbit wants proper pairing but thats not very BLE (think bb8) so you can turn it off - the BBC wanted protection etc for kids. https://github.com/nimbleape/microbit-led-service/blob/master/config.json#L5 |
|
I didn't notice the README file. Thanks! |
|
Ah! :) Yes; still good to know about the pairing issue on ChromeOS |
|
After changing my micro:bit device to more "opened" (not requiring pairing), I'm still having some issues. It looks like the LED service does contain only one characteristic - the led matrix state, not the led text one. @danjenkins Is that something you've seen before? |
|
Wooo... I'm not sure why but disabling DFU service, Event service & standard BLE device information service makes the trick. I can now see all LED service characteristics: |
|
Here's what I would recommend for this patch then:
|
|
For info, here's my micro:bit program I've used to make it work: https://developer.mbed.org/users/fbeaufort/code/microbit-ble-open/ And specifically the diff for diff -r 2fc7d7c2fffc -r 04376b21995b inc/core/MicroBitConfig.h
--- a/inc/core/MicroBitConfig.h Wed Jul 13 12:18:46 2016 +0100
+++ b/inc/core/MicroBitConfig.h Thu Jul 21 07:19:19 2016 +0000
@@ -101,7 +101,7 @@
// For standard S110 builds, this should be word aligned and in the range 0x300 - 0x700.
// Any unused memory will be automatically reclaimed as HEAP memory if both MICROBIT_HEAP_REUSE_SD and MICROBIT_HEAP_ALLOCATOR are enabled.
#ifndef MICROBIT_SD_GATT_TABLE_SIZE
-#define MICROBIT_SD_GATT_TABLE_SIZE 0x300
+#define MICROBIT_SD_GATT_TABLE_SIZE 0x700
#endif
//
@@ -173,7 +173,7 @@
// Enable/Disable BLE pairing mode mode at power up.
// Set '1' to enable.
#ifndef MICROBIT_BLE_PAIRING_MODE
-#define MICROBIT_BLE_PAIRING_MODE 1
+#define MICROBIT_BLE_PAIRING_MODE 0
#endif
// Enable/Disable the use of private resolvable addresses.
@@ -187,7 +187,7 @@
// Open BLE links are not secure, but commonly used during the development of BLE services
// Set '1' to disable all secuity
#ifndef MICROBIT_BLE_OPEN
-#define MICROBIT_BLE_OPEN 0
+#define MICROBIT_BLE_OPEN 1
#endif
// Configure for open BLE operation if so configured
@@ -234,21 +234,21 @@
// This allows over the air programming during normal operation.
// Set '1' to enable.
#ifndef MICROBIT_BLE_DFU_SERVICE
-#define MICROBIT_BLE_DFU_SERVICE 1
+#define MICROBIT_BLE_DFU_SERVICE 0
#endif
// Enable/Disable BLE Service: MicroBitEventService
// This allows routing of events from the micro:bit message bus over BLE.
// Set '1' to enable.
#ifndef MICROBIT_BLE_EVENT_SERVICE
-#define MICROBIT_BLE_EVENT_SERVICE 1
+#define MICROBIT_BLE_EVENT_SERVICE 0
#endif
// Enable/Disable BLE Service: MicroBitDeviceInformationService
// This enables the standard BLE device information service.
// Set '1' to enable.
#ifndef MICROBIT_BLE_DEVICE_INFORMATION_SERVICE
-#define MICROBIT_BLE_DEVICE_INFORMATION_SERVICE 1
+#define MICROBIT_BLE_DEVICE_INFORMATION_SERVICE 0
#endif
//
|
Let me know if you don't want this in this repo and rather it be a separate repo on the nimbleape org
Basic demo that allows you to write to a micro:bit's led service and have text scroll across the LED matrix on the micro:bit - its a standard service on the micro:bit runtime (microbit-dal)
It also adds support for disconnecting from the micro:bit which isn't in any of the other demos yet I think.
Let me know your thoughts - follows the same patterns as other demos - uses polymer but not the polymer web bluetooth components which hides things away....
I have submitted a CLA, waiting to hear back