Microbit signal data out over bluetooth?

Posted on
Page
of 2
Prev
/ 2
  • Hi, thanks for the great post! I'm trying to get this going on a BBC MicroBit with Espruino v1.89 but running in to an Out of Memory error.

    If I use this snippet, there's no issue and Chrome detects the beacon on my iOS device:

    NRF.setAdvertising({
      0xFEAA : [
      0x10, // frame_type (URL)
      0xEE, // the RSSI dBm we've measured for this beacon 1 meter away
      0x03, // 3 = https://
      'g','o','o','.','g','l','/','t','Z','W',­'U','U','X'
      ]
    }, {interval:100,discoverable:true,showName­:false}); 
    

    However, if I use this snippet, I get the Out of Memory error when it finishes sending:

    NRF.setAdvertising([0x03,  // Length of Service List
      0x03,  // Param: Service List
      0xAA, 0xFE,  // Eddystone ID
      0x13,  // Length of Service Data
      0x16,  // Service Data
      0xAA, 0xFE, // Eddystone ID
      0x10,  // Frame type: URL
      0xF8, // Power
      0x03, // https://
      'g','o','o','.','g','l','/','B','3','J',­'0','O','c'],
        {interval:100});
    

    Any thoughts?

  • As soon as I posted that, I realised the difference is that the first explicitly sets the service UUID, where as the second snippet does not.

    If I update the second snippet to the following, it still seems to give the same error:

    NRF.setAdvertising({
      0xFEAA :[
        0x03,  // Length of Service List
        0x03,  // Param: Service List
        0xAA, 0xFE,  // Eddystone ID
        0x13,  // Length of Service Data
        0x16,  // Service Data
        0xAA, 0xFE, // Eddystone ID
        0x10,  // Frame type: URL
        0xF8, // Power
        0x03, // https://
        'g','o','o','.','g','l','/','B','3','J','0','O','c'
      ]
    }, {interval:100}); 
    
  • I think the main problem is that right now, the micro:bit version has too little memory available to be much use (1v87 used to be better). I've filed a bug to try and fix it (you can follow it here) but I'm a bit busy right now.

    In the mean time, anything you can do to get memory usage down is good - so if you just remove all the comments and stick everything on one line, that might make it work for you?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Microbit signal data out over bluetooth?

Posted by Avatar for JackBennett @JackBennett

Actions