• Hi there,

    I am trying to use the Puck.js as a central device, connecting to a peripheral device (BTLE actuator).
    I suppose that the procedure is as following:

    1. NRF.requestDevice() with either name or id of the peripheral device already known and used as filter
    2. connect the gatt
    3. bond with .startBonding

    Whenever my Puck.js executes the gatt.connect(), I have 2 problems appearing: First one is that the Puck.js disconnects from the IDE, and second one is that connection fails with error "ERROR Connection Timeout".

    I tried to execute the code found here http://www.espruino.com/Reference#l_Blue­toothRemoteGATTServer_startBonding

    var gatt;
    NRF.requestDevice({ filters: [{ name: 'My BT actuator name' }] }).then(function(device) {
      console.log("found device");
      return device.gatt.connect();
    }).then(function(g) {
      gatt = g;
      console.log("connected");
      return gatt.startBonding();
    }).then(function() {
      console.log("bonded", gatt.getSecurityStatus());
      gatt.disconnect();
    }).catch(function(e) {
      console.log("ERROR",e);
    });
    

    First step of requesting the device seems to be OK as I can read found devicein the console when the puck.js doesn't disconnect from the IDE.

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v92 Copyright 2016 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    >
    =undefined
    found device
    ERROR Connection Timeout
    >
    

    Any idea on what goes wrong?

About