Avatar for user73560

user73560

Member since Feb 2017 • Last active May 2018
  • 8 conversations
  • 78 comments

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user73560

    Hi @Gordon,

    The fix you provided is working fine, thank you!

    Anyway I have a situation where Device2 for some reason hangs, i.e. it cannot be accessed via bluetooth unless it is restarted. Is it possible to get the last exception or failure somehow ?

    Thank you!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user73560

    Hi @Gordon,

    Yes this is the code of Device2 and Device 1 code can be seen above, which just switch on/off the led and counts the successful invocations.

    All this scenario is simulated because of a real use-case where Device2 have to invoke about 200 times a function on Device1 for a 2 hours and all the time I found Device2 reset and without any data.

    Thank you!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user73560

    Hi @Gordon,

    I mean that on the 89 successful execution of a function to the remote device, the current device receive New interpreter error: CALLBACK,MEMORY and the device stops working.

    Thank you!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user73560

    Hi @Gordon,

    I tried with 1v97.5 version of the firmware, it stopped on the 89 iteration with same error.

    Thank you!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user73560

    Hi @Gordon,

    I have two devices:

    Device1 has:

    var s = false;
    var c = 0;
    function o() {
      c++;
      s=!s;
      LED2.write(s);
    }
    

    Device2 has:

    var busy = false;
    var gatt;
    setInterval(function() {
      console.log("Trying to connect...");
      if (!busy) {
        busy = true;
        NRF.connect("xx:xx:xx:xx:xx:xx random").then(function(g) {
          gatt = g;
          return gatt.getPrimaryService("6e400001-b5a3-f3­93-e0a9-e50e24dcca9e");
        }).then(function(s) {
          return s.getCharacteristic("6e400002-b5a3-f393-­e0a9-e50e24dcca9e");
        }).then(function(c) {
          return c.writeValue("o()\n");
        }).then(function() {
          busy=false;
          if(gatt !== undefined)gatt.disconnect();
          console.log("Write value success!");
        }).catch(function(e) {
          busy=false;
          if(gatt !== undefined)gatt.disconnect();
          console.log("Write value error. ", e);
        });
      } else {
        console.log("Device is busy!");
      }
    },1000);
    

    Device 2 end dump is:

    Uncaught Error: Unhandled promise rejection: Error: Got BLE error 0x8 (INVALID_STATE)
    Trying to connect...
    Trying to connect...
    Device is busy!
    Trying to connect...
    Device is busy!
    Write value success!
    Trying to connect...
    Trying to connect...
    Device is busy!
    Trying to connect...
    Device is busy!
    Write value success!
    Trying to connect...
    ERROR: Ctrl-C while processing interval - removing it.
    Execution Interrupted during event processing.
    New interpreter error: CALLBACK,MEMORY
    Write value success!

    In this concrete test Device 2 succeeded to call function on Device 1 successfully 87 times and crashed, but sometimes it is 75, 78.

    Please advice!
    Thank you!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user73560

    Hi @Gordon,

    Everything is working fine, it is side effect of my assumption that NRF.requestDevice could filter by id which is the mac address, but it is not. As a result my device is connected to the first found Puck and tries to execute this function there which is not available.

    Is it possible to support NRF.requestDevice filtration by id ?

    Thank you!

    • 2 comments
    • 53 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for user73560

    Hi Gordon,

    I am working with firmware 1v97.2 and received following error:

    New interpreter error: FIFO_FULL
    WARNING: jsble_exec_pending: Unknown enum type 116

    Thank you!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for user73560

    Hi @Gordon,

    I would like to write value on another Puck following example at https://www.espruino.com/Puck.js+Control­ling+Other+Pucks

    When I write value sometimes I have :

    Uncaught Error: Got BLE error 0x8 (INVALID_STATE)
    at line 192 col 10});

    but in most of the cases it says that the write value is executed successfully, but on the controlled puck nothing happens ? I am using 1v95.71

    Thank you!

    • 3 comments
    • 190 views
Actions