-
Notifications
You must be signed in to change notification settings - Fork 65
Description
I have a micro:bit V1.5, and I connect with web bluetooth services, with Chrome on Windows 10. I plot all sensor values over time, using https://github.com/thegecko/microbit-web-bluetooth. The V1.5 keeps running for hours, no problems observed so far.
However, when using the same code with the v2, it "hangs" after a while. It is not disconnecting, or at least the disconnect event handler on the micro:bit itself is not called. This can happen immediately, or after several minutes, it is random.
My codal file is:
{
"target": {
"name": "codal-microbit-v2",
"url": "https://github.com/lancaster-university/codal-microbit-v2",
"branch": "master",
"type": "git",
"test_ignore": true,
"dev": true
},
"config": {
"SOFTDEVICE_PRESENT": 1,
"DEVICE_BLE": 1,
"MICROBIT_BLE_ENABLED": 1,
"MICROBIT_BLE_PAIRING_MODE": 0,
"MICROBIT_BLE_DFU_SERVICE": 1,
"MICROBIT_BLE_WHITELIST": 0,
"MICROBIT_BLE_DEVICE_INFORMATION_SERVICE": 1,
"MICROBIT_BLE_EVENT_SERVICE": 1,
"MICROBIT_BLE_PARTIAL_FLASHING": 0,
"MICROBIT_BLE_SECURITY_LEVEL": "SECURITY_MODE_ENCRYPTION_OPEN_LINK",
"MICROBIT_DMESG_LEVEL": 4,
"DMESG_SERIAL_DEBUG": 1
}
}
I'm basically just using the ble_test
sample.
I enabled debugging just to figure out what might be causing it.
Note that I'm using an open link; it seems Chrome on Windows doesn't support "secure characteristic" yet:
https://chromium-review.googlesource.com/c/chromium/src/+/2805864
I can share all my code (using Docker) and configs if that helps. I'm going to try on MacOS myself.
I used https://github.com/bsiever/microbit-webusb for receiving the serial messages over WebUSB.
The serial log before it hangs is:
Console Data: calling sd_ble_gatts_hvx( 71,lue 38
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 164, 6)
Console Data: Miccalling sd_ble_gatts_hvx( 68, 0x20006224, 38, 6)
Console Data: MicroBitBLEC 2)
Graph Event: :notifyChrValue 38 (for MicroBitBLEChar)
Graph Event: :notifyChrValue 71 (for calling sd_ble_gatts_itBLEChar)
Console Data: calling sd_ble_gatts_hvx( 71, 0xtifyChrValue 68
Console Data: calling sd_ble_gatts_hvx( 68, 0x20006224, 232 sd_ble_gatts_hvx( 38, 0x20005F6C, 184, 6)
Graph Event: :n2) (for MicroBitBLEChar)
Graph Event: :notifyChrValue 38 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hatts_hvx( 71, 0x2000622A, 52, 2)
Graph Event: :notifyChrVa_gatts_hvx( 38, 0x20005F6C, 172, 6) (for MicroBitBLEChar)
Graph Event: :notifyChtifyChrValue 80 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 80, 0x20006268, 30,sd_ble_gatts_hvx( 68, 0x20006224, 144, 6)
Graph Event: :noA, 53, 2) (for MicroBitBLEChar)
Graph Event: RECEIVED UNKNWON FRAME (for UIPM)
Graph Event: :notitBLEChar::notifyChrValue 71 (for MicroBitBLEChar)
Graph Event: :notifyChrValue 68 (for calling sd_ble_gatts_hvx( 71, 0x2croBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 68notifyChrValue 71
Graph Event: :notifyChrValue 68 (for calling sd_ble_gatts_hvx( 71, 0x2000622A, 5oBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 68, _gatts_hvx( 38, 0x20005F6C, 184, 6)
Graph Event: :notifyChle_gatts_hvx( 38, 0x20005F6C, 176, 6) (for MicroBitBLEChar)
Graph Event: :notify6) (for MicroBitBLEChar)
Graph Event: :notifyChrValue 71 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hue 38
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 176, 6)
Console Data: MicrnotifyChrValue 38
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 1F6C, 164, 6)
Graph Event: :notifyChrValue 68 (for MicroBitBLEChar)
Console Data: calling sd_bs_hvx( 71, 0x2000622A, 53, 2)
Graph Event: RECEIVED UNKNWON FRAME (for UIPM)
Console Data: M 38, 0x20005F6C, 176, 6)
Graph Event: :notifyChrValue 38 (for MicroBitBLEChar)
Console Data: otifyChrValue 38
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 16hvx( 38, 0x20005F6C, 180, 6)
Graph Event: :notifyChrValue , 0x2000622A, 52, 2) (for MicroBitBLEChar)
Graph Event: :notifyChrValue 68 (for MicroBitBLEChar)
Console Data: callfyChrValue 68
Console Data: calling sd_ble_gatts_hvx( 68, 0x20006224, 118, , 0x20006224, 188, 6)
Graph Event: :notifyChrValue 71 (for MicroBitBLEChar)
Console Data: cal 6)
Graph Event: :notifyChrValue 71 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_)
Graph Event: RECEIVED UNKNWON FRAME (for UIPM)
Graph Event: :notifyChrVal( 38, 0x20005F6C, 176, 6) (for MicroBitBLEChar)
Graph Event: :notifyChrValue 68 (for MicroBitBLEChar)
Graph Event: RECEIVED UNKNWON FRAME (for UIPM)
Console Data: MicroBitBLEChg sd_ble_gatts_hvx( 68, 0x20006224, 20, 6)
Graph Event: :notifyChrValue 71 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 71, 0x2000622A, 5300622A, 53, 2)
Graph Event: :notifyChrValue 68 (for MicroBitBLEChar)
Console Data: calling sdvx( 68, 0x20006224, 188, 6)
Graph Event: :notifyChrValue 7notifyChrValue 38 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 1hvx( 68, 0x20006224, 126, 6)
Graph Event: :notifyChrValue , 6) (for MicroBitBLEChar)
Graph Event: :notifyChrValue 71 (for MicroBitBLEChar)
Console Data: calling sd_ble_gattsgatts_hvx( 38, 0x20005F6C, 172, 6)
Graph Event: :notifyChrlue 38 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 168, 6)
Console Data: Micalue 71
Console Data: calling sd_ble_gatts_hvx( 71, 0x2000622A, 53, 2)
Console Data: Mic 0x20005F6C, 176, 6)
Graph Event: :notifyChrValue 68 (for MicroBitBLEChar)
Console Data: call, 6)
Graph Event: :notifyChrValue 38 (for MicroBitBLEChar)
Console Data: calling sd_ble_gattsvx( 71, 0x2000622A, 53, 2)
Graph Event: :notifyChrValue 388, 0x20005F6C, 172, 6) (for MicroBitBLEChar)
Graph Event: :notifyChrValue 68 (for MicroBitBLEChar)
Console Data: cag sd_ble_gatts_hvx( 68, 0x20006224, 38, 6)
Graph Event: :ng sd_ble_gatts_hvx( 71, 0x2000622A, 53, 2) (for MicroBitBLEChar)
Graph Event: RECEIVED UNKs_hvx( 71, 0x2000622A, 53, 2) (for UIPM)
Graph Event: RECEIVED UNKNWON FRAME (for UIPM)
Console Data: Mlue 38
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 172, 6)
Console Data: Miclue 38
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 172, 6)
Graph Event: :notifyChrValue 68 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 68, 0x20006224, 152, 6)
Graph Event: :notifyChrValue 71 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 71, 0x2000622A, 54, 2)
Graph Event: :notifyChrValue 38 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 38, 0x20005F6C, 168, 6)
Graph Event: :notifyChrValue 68 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 68, 0x20006224, 108, 6)
Graph Event: :notifyChrValue 71 (for MicroBitBLEChar)
Console Data: calling sd_ble_gatts_hvx( 71, 0x2000622A, 54, 2)