Avatar for ayoganandan1984

ayoganandan1984

Member since May 2019 • Last active Jun 2019
  • 2 conversations
  • 3 comments

Most recent activity

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

    Hello,

    I'm trying to flash v203 firmware and get a "Error:Data object does not match the firmware and hardware requirements, the signature is wrong, or parsing the command failed"
    I tried 3 different puck.js microcontrollers and flashing fails on all 3 and the board is stuck with blue LED on.
    Any recommendations on how to overcome this issue?

    • 5 comments
    • 2,064 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for ayoganandan1984

    Hi Gordon,

    Thank you very much for your reply. I appreciate it.
    When I started the project, I was using setWatch, but the latency between when I press the button and when I receive the callback was in the order of seconds and made it unusable for my purpose. That is why I moved to checking button state in an interval. Is there a way to reduce the latency of the callback?

    Setting NRF.setConnectionInterval(7.5) seems to help a bit, but the error still shows up less frequently than before.

    Thanks for the queue idea. I will give that a shot.

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

    Hello,

    I have hooked up a button to my puck.js and emulating HID keyboard clicks on the button press. It works fine for the most part, except once in a few times, it misses sending a key press over with the a 'BLE HID already sending' error.

    error messageBLE HID already sending
    error messageBLE HID already sending
    Uncaught Error: BLE HID already sending
    at line 1 col 55
    NRF.sendHIDReport([0,0,0,0,0,0,0,0],function(){a&&a()})

                                                      ^
    

    in function called from system

    Looks like some of them get past the try-catch but others don't.

    This happens even if I'm doing these button presses slowly, so it is not an issue of too many button presses going through in a short time frame. Does the port need to be flushed or something?

    I tried upgrading to 2v02.6 cutting edge firmware, but the problem still exists.

    The essence of my code can be found below.

    var kb = require("ble_hid_keyboard");
    NRF.setServices(undefined, { hid : kb.report });
    
    var lastButtonState = 0;
    var busy = 0;
    
    function on_button_pressed() {
    
      var currentButtonState = digitalRead(D28);
      
      if ( currentButtonState === 0) {
        digitalWrite(LED1,0);
      }
      else if (currentButtonState === 1) {
        digitalWrite(LED1,1);
      }
      
      if(lastButtonState !== currentButtonState){
    
          digitalWrite(LED2, 1);
          lastButtonState = currentButtonState;
        
          try{
            
              if(!busy){
                busy = 1;
                if(lastButtonState === 0){
                  kb.tap(kb.KEY.B, 0, function(){});
                }else if(lastButtonState === 1){
                  kb.tap(kb.KEY.A, 0, function(){});
                }
                busy = 0;
              }
            
          }catch(err){
            console.log("error message " + err.message);
            busy = 0;
          }
        
      }else{
        
          digitalWrite(LED2, 0);
        
        
      }
    }
    
    setInterval(function() {
      on_button_pressed();
    }, 5);
    
Actions