Avatar for user73560

user73560

Member since Feb 2017 • Last active May 2017
  • 4 conversations
  • 41 comments

Most recent activity

  • in Puck.js
    Avatar for user73560

    Hi @Gordon,

    Thank you for the bonding functionality, I tested it with latest build and it seems to work! How can I execute espruino.com/Puck.js+BLE+UAR­T with bonding ? In general, accessing the primaryService and characteristics should happen after bonding right ? Do you have any docs for it ?

    Thank you.

  • in Puck.js
    Avatar for user73560

    Hi @Gordon,

    IP is the MAC address of the device that can connect to the Puck.

    Concerning the process of update through firmware, how secure is it ? Once the package is on the party which is doing the update could it be decoded and source revealed, if we talk about the "bin" and "dat" file in the firmware I think not, but please confirm.

    If not, should I build from github.com/espruino/Espruino with my code added in it ? Should I write the new firmware functions in "C" or I can pass my existing my Javascript code and Espurino translate it to C and include it into the distribution package ?

    Thank you.

  • in Puck.js
    Avatar for user73560

    Hi @Gordon,

    I think that a workable security scenario could be:

    1) Provide a password and decrease transfer speed on start up - this will protect the uploaded code from being viewed or modified. Here we will save a mapping between the Puck MAC address and the generated password.

    2) Once the client receive the Puck with the uploaded code it should create "bonded" connection from the Gateway(Android phone, for example which will gather all the data), and will set IP for access where onConnect will disconnect any different than the provided IP connections and will automatically generate a password for all getter characteristics to protect them from other unauthorized third parties.

    3) If the Puck requires a new code, the most secure way of doing that is to send to the client physically a Puck with the new code, secured in same way as described above in 1), where it has a mapping between IP and password only for the Pucks that have to be updated. The new Puck should initiate "bonded" connection one by one with all Pucks that have to be updated and will "self-propagate the code".

    What do you think ?

    Thank you.

  • in Puck.js
    Avatar for user73560

    Hi @Gordon,

    Thank you for your advises!

    • Suppose the code is saved and the "Password" in 1) is lost, how could the Puck be flashed for a new code to be saved ?

    • Is it possible two Pucks to be bonded, if so could you give an example ?

    Thank you!

  • in Puck.js
    Avatar for user73560

    Hi,

    Do you think that following approaches are good for production:

    1) Provide password and decrease the transfer speed

    E.on('init', function() {
      E.setPassword("Password");
      E.lockConsole();
      NRF.setLowPowerConnection(true);
    });
    

    All possible password combinations based on this math.stackexchange.com/questions­/2103361/derive-an-algorithm-for-computi­ng-the-number-of-restricted-passwords-fo­r-the-gen#2103361
    combined with the low response speed, practically makes the Puck unbreakable ?

    2) Protect your functions with password ?

    function someFunction(pwd, parameters) {
      if (pwd!='FunctionPassword') {
        NRF.disconnect();
      }
      // process the request
    }
    

    Thank you.

  • in Puck.js
    Avatar for user73560

    Hi @Gordon,

    You are right. The main issue was how to enter new line character, but that can be done typing "g(5)" followed by "shift + enter" for new line character and then press "send" button and the characteristics return the expected result.

    Thank you.

  • in Puck.js
    Avatar for user73560

    Hi @Gordon,

    The fix is working as expected.

    Thank you.

  • in Puck.js
    Avatar for user73560

    Hi @Gordon,

    Thank you for the advice! I installed "nRF UART 2.0" and tried

    var v;
    function g(s) {
      v=s;
      Bluetooth.write(s);
    }
    

    If you write without a semicolumn once you connected to the Puck it says "unexpected EOF". With a semicolumn I succeeded to light the LED on from here espruino.com/Puck.js+BLE+UAR­T

    If you write the function(with or without) a semicolumn in "nRF UART 2.0" or "nRF Connect" with notifications enabled I receive what I wrote, for example in "nRF UART 2.0" I have:

    TX:g(5);
    RX:g(5);

    TX:g(9)\n
    RX:g(9)\n

    Do you think this could be Android specific issue as appeared in the Security thread ?

    Thank you.

  • in Puck.js
    Avatar for user73560

    Hi @Gordon,

    Yes recording in 8 bits is reasonable.

    I would like to send the clip to the client. I have following questions based on the code:

    var soundBuff;
    NRF.setServices({
      0xBCDE : {
        0xABCD : {
          value : "N/A",
          readable : true,   // optional, default is false
          writable : true,   // optional, default is false
          notify : true,   // optional, default is false
          onWrite : function(evt) { // optional
            var clipSeconds = evt.data[0];
            var w = new Waveform(512*clipSeconds,{bits:8});
            w.on("finish", function(buf) {
              soundBuff=buf;
              NRF.updateServices({
                0xBCDE : {
                  0xABCD : {
                    value : buf,
                    notify: true
                  }
                }
              });
            });
            w.startInput(D2,512);
          }
        }
      }
    });
    
    1. Is this the right way of doing this ?
    2. How can I free memory once the data is sent to the client ?
    3. How can I view the result with "nRF Connect"

    Thank you.

Actions