• Dear Puck.js developers,

    Thanks for the great work, I'm impressed by the Puck.js quality.

    If I use the firmware v2.03 (I reverted to v2.02 for now) when I perform a simple connection of this kind :

     NRF.requestDevice({ filters: [{ services: ['4300'] }] }).then(function(device) {
          console.log("Device found !");
          return device.gatt.connect();
        }).then(function(g) {
          console.log("Now gatt.getPrimaryService");
          gatt = g;
          return gatt.getPrimaryService("4300");
        }).then(function(service) {
          return service.getCharacteristic("53415554-4552-2D2D-4241-53454C2DCAFE");
        }).then(function(characteristic) {
          console.log("Writing !");
          //glob_characteristic = characteristic;
          digitalPulse(LED3,1,[10,200,10,200,10]);
          characteristic.writeValue([JSON.stringify({"chan" : 6, "v" : global_counter++})]);
          gatt.disconnect();
        }).then(function() {
          console.log("Write finished !");
          digitalPulse(LED2,1,[10,200,10,200,10]);
          gatt.disconnect();
          console.log("Done!");
          busy=false;
        }).catch(function(e) {
          digitalPulse(LED1,1,10);
          console.log("ERROR",e);
          busy=false;
        });
    
    

    I get during gatt.connect an error message on the console:

    clearTimeout(undefined) cannot be used, please use clearTimeout();

    I don't do any clearTimeout myself, so it must be some of NRF code that is doing this.

    Another error that I could workaround is that if I return the promise of the line

    characteristic.writeValue([JSON.stringify({"chan" : 6, "v" : global_counter++})]);

    And don't forcibly disconnect, then the write while effective on the BLE device accessed, will take ages to complete ( like 15 seconds ) and it won't really complete it will go in catch() for a Disconnected error.

    Cheers,

About

Avatar for daminetreg @daminetreg started