phetsims / paper-land

Build and explore multimodal web interactives with pieces of paper!
https://phetsims.github.io/paper-land/
MIT License
10 stars 1 forks source link

(Microbit) BLE Connection usually requires at least one Display refresh and device connection attempt #247

Open brettfiedler opened 1 month ago

brettfiedler commented 1 month ago

For the micro:bit, it's pretty much guaranteed that I need to Connect to BLE for the device, pair it, then refresh the Display (board.html), and pair again before it's successful.

On the first shot, the micro:bit seems to disconnect itself with the following message:

{placeholder}

Not sure what is causing it. It is consistent regardless of the number of BLE services enabled on the MakeCode side. This documentation seems to imply there could be a memory issue

Using Bluetooth services is memory hungry. By default, some of the memory normally used by Nordic's Bluetooth protocol stack (known as a SoftDevice), is reclaimed by the micro:bit runtime as general purpose memory for your applications. if you enable more Bluetooth services, then you may need to provide more memory back to Soft Device to ensure proper operation. If after enabling this service your Bluetooth application cannot access the service reliably, you should consider increasing the value of MICROBIT_SD_GATT_TABLE_SIZE in your inc/MicroBitConfig.h. The more service you add, the larger this will need to be, up to the limit defined in MicroBitConfig.h.