• I am following along with the video:
    Puck.js Bluetooth with the Graphical Editor

    My puck shows up in the Nordic nRF Connect on my iPhone, but it only show the default UART Service, not the service I created and deployed by following the video.

    The IDE show this message:
    BLE connected, queueing BLE restart for later

    I disconnected and reconnected many times.

    version: 1v91

    Any Ideas?
    Thank you.

  • The cause of your problems is most likely the iPhone. They're not expecting Bluetooth devices to actually change, so often don't update the list of services.

    Could you try turning Bluetooth off on the iPhone, then back on? You'd have to do that every time the services change I'm afraid.

  • Yes, that was the problem, I am now able to see the new Service.
    Thank you.

    My IOS nRF app does not allow me to change the data type, I only have a text box with 0x preceding it. Could you tell me is it asking for hex?
    I type in 1 and hit send and the box turns red, so it must not like it. The write types are Command and Request, both choke on me entering 1

  • Honestly I'm not sure what happens in the iOS version - it would appear to be a recent change. You could try 01 or 0x01?

    Also the `Lightblue explorer' app could be worth a try - it's a similar app that might be easier to use

  • Thank you Gordon, I will give those suggestions a try.

  • Hi, sorry for hijacking the thread, but..

    I am having similar problem with the BLE, where i have disconnected from the puck, removed the battery and inserted it again, etc.

    What i'm basically is trying to do is a hold-button and release after ½ second.
    Since this isnt inlcuded in the "ble_hid_keyboard" library, i created my own based upon "tap" function in said library.(1)

    
    var keydown = function(keyCode, modifiers, callback) {
      NRF.sendHIDReport([modifiers,0,keyCode,0­,0,0,0,0], function() {
        if (callback) callback();
      });
    };
    
    var keyrelease = function(keyCode, modifiers, callback) {
      NRF.sendHIDReport([0,0,0,0,0,0,0,0], function() {
        if (callback) callback();
      });
    };
    // ......
    
    var kb = require("ble_hid_keyboard");
    NRF.setServices(undefined, { hid : kb.report });
    
    function btnPressed() {
      ledBlink();
    //  kb.tap(kb.KEY.A, 0, function() {});
      keydown(kb.KEY.F12);
    }
    
    // trigger btnPressed whenever the button is pressed
    setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50})­;
    
    function ledBlink() {
      LED1.write(true);
      setTimeout(function() {
        LED1.write(false);
        keyrelease();
      }, 500);
    
    }
    enter code here
    

    the error i get back is "Uncaught Error: BLE HID not enabled"
    is there a way to check if it is in BLE HID mode before trying to do anything, so ie. i can restart the puck or light up a led to tell me that it isnt ready (besides catching said error in a try-catch)?

    [1]

  • Are you using the 1v92 firmware? I know there was an issue where trying to send a HID packet before HID was initialised (eg the device had been disconnected and reconnected) would leave it in a state where it wouldn't work until after a reboot, but I'm pretty sure I fixed that in 1v92.

    In 1v92 I think it's safest just to try...catch the error when you make the call though. It shouldn't do any harm.

  • Yes, i am using the latest, 1v92 firmware.
    I haven't been keeping up with the updates so i flashed it before doing this.

  • @Gordon what does

    BLE Connected, queueing BLE restart for later
    actually entail? How does one restart BLE? reconnect from the computer? pull the battery?

    I'm having issues with getting it back into the right "mode" for the keyboard to do something other then throwing exceptions with the code above. with or without kb.tap().

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

BLE connected, queueing BLE restart for later (Solved)

Posted by Avatar for Terrence @Terrence

Actions