• Ok, so I added setConnectionInterval in the code, but I do not see a major difference.

    response="";
    NRF.setConnectionInterval(100);
    
    setInterval(function () {
    print("connecting");
      
      
    NRF.requestDevice({ filters: [{ services: ['1823'] }] }).then(function(device) {
      require("ble_http").httpRequest(device, "pur3.co.uk/hello.txt", function(d) {
        response=JSON.stringify(d);
        print(response);
      });
    });
    }, 10000);
    

    Selection from output

    connecting
    Connected
    Uncaught Error: Unhandled promise rejection: Disconnected
    WARNING: Softdevice error BLE error 0x11 (BUSY) (bluetooth.c:818)
    connecting
    Connected
    Got service
    Got characteristic
    Set URI
    Got characteristic
    Written GET
    Disconnected
    {"buffer":[72,101,108,108,111,32,87,111,­114,108,100,33,10],"byteOffset":0,"byteL­ength":13}
    connecting
    Uncaught Error: Unhandled promise rejection: No device found matching filters
    connecting
    Uncaught Error: Unhandled promise rejection: No device found matching filters
    connecting
    Connected
    Got service
    Got characteristic
    Set URI
    Got characteristic
    Written GET
    Disconnected
    {"buffer":[72,101,108,108,111,32,87,111,­114,108,100,33,10],"byteOffset":0,"byteL­ength":13}
    connecting
    Connected
    Got service
    Got characteristic
    Set URI
    Got characteristic
    Written GET
    Disconnected
    {"buffer":[72,101,108,108,111,32,87,111,­114,108,100,33,10],"byteOffset":0,"byteL­ength":13}
    connecting
    Connected
    Uncaught Error: Unhandled promise rejection: Disconnected
    WARNING: Softdevice error BLE error 0x11 (BUSY) (bluetooth.c:818)
    connecting
    Connected
    Got service
    Got characteristic
    Set URI
    Got characteristic
    Written GET
    Disconnected
    {"buffer":[72,101,108,108,111,32,87,111,­114,108,100,33,10],"byteOffset":0,"byteL­ength":13}
    connecting
    Connected
    Got service
    Got characteristic
    Set URI
    Got characteristic
    Written GET
    Disconnected
    {"buffer":[72,101,108,108,111,32,87,111,­114,108,100,33,10],"byteOffset":0,"byteL­ength":13}
    connecting
    Connected
    Uncaught Error: Unhandled promise rejection: Disconnected
    connecting
    Connected
    Uncaught Error: Unhandled promise rejection: Disconnected
    connecting
    Connected
    Uncaught Error: Unhandled promise rejection: Disconnec
    

    The dreaded "Unhandled promise rejection ..." is still prominently present, with a scarce "BLE busy..".

About

Avatar for gerardwr @gerardwr started