Most recent activity
-
If I reconnect to the device using the WEB IDE then push the button I get this error:
Uncaught Error: BLE HID not enabled at line 1 col 104 ...0,0,0],function(){a&&a()})}) ^ in function "tap" called from line 9 col 4 }); ^ in function called from system
This should be normal through as the HID is not enabled if it is not connected as a HID device.
unpairing, re-pairing doesn't enable it.
unpairing, reseting the puck, re-pairing doesn't enable it. -
-
ahah! Yes the IDE was holding on to the connection.
So now it connects with 1v92. And I am now trying the HID software from your example:
var kb = require("ble_hid_keyboard"); NRF.setServices(undefined, { hid : kb.report }); function btnPressed() { // Send 'a' kb.tap(kb.KEY.A, 0, function() { // Followed by capital 'A' kb.tap(kb.KEY.A, kb.MODIFY.SHIFT); }); } // trigger btnPressed whenever the button is pressed setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50});
- Device is connected with 1v92 to the web ide.
- run flash code in left side.
- upload the HID from you example.
- save()
- disconnect from Web IDE. !
- un-pair
- re-pair
- press puck button with pc cursor in a text box... nothing happens
NB the device is not appearing in the list of keyboard devices
- Device is connected with 1v92 to the web ide.
-
Ah yep that is likely the reason it didn't register when it did connect.
But I just can't connect 1v92 reliably to windows 10.
My procedure:
- upload 1v90 (No issues connecting with this version)
- pair with puckjs
- run web ide and connect to puckjs
- run flash code in #9 in left hand side of web ide.
- clear saved code by deleting everything in the code box on the right hand side and uploading.
- save() in left hand side.
- upload 1v92
- puckjs is still paired at this point, in the web ide disconnect and reconnect. Run the flash code in #9.
- un-pair
- re-pair - Fail. Won't reconnect.
Didn't even get to the part where I upload the HID code. What am I doing wrong?
- upload 1v90 (No issues connecting with this version)
-
That definitely sounds like the right strategy, starting from a known state.
I ran the flash in code #9 and loaded the new firmware, then ran the code again and initially eveything was ok. It paired after being un-paired everything worked as expected, yay. Then I loaded the HID code in #8 and then un-paired and re-paired, everything seemed to be working it appeared as a keyboard device but I tested it and the button was not registering key commands. Un-paired it and tried to repair but this time it wasn't re-pairing, damn.
Seems to be something to do with being a HID device.
-
Sorry Gordon I am mixing in three different issues.
1st issue was the not saving issue which was fixed with the Flash code.
2nd issue was the pairing issue when i'm using the 1v92 code pairing with windows 10. It just won't pair no matter what I do. This is the real issue for me.
3rd issue was something I noticed when upgrading from 1v91 to 1v92 that made the 3 lights blink. When I had the HID code loaded on 1v91 and then upgraded to 1v92 it made the 3 lights blink continuously. Not really a big problem if the code isn't loaded when upgrading firmware.
All three are I think are independent of each other.
I will have to wait till Monday to give it a try as I left everything at the office.
-
I had the 3 light issue with this code loaded going from 1v91 -> 1v92 if that helps:
var kb = require("ble_hid_keyboard"); var on = false; function onInit() { NRF.setServices(undefined, { hid : kb.report }); setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50}); flashLED(); } function btnPressed() { kb.tap(kb.KEY["c"], 0); } var flashLED = function() { on = !on; LED1.write(on); var interval; if(on) { interval = 5; } else { interval = 3000; } setTimeout(flashLED, interval); };
-
Ok so i figure out that the three light flashing when I upgraded the firmware is occuring with this code loaded:
var kb = require("ble_hid_keyboard"); var on = false; function onInit() { NRF.setServices(undefined, { hid : kb.report }); setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50}); flashLED(); } function btnPressed() { kb.tap(kb.KEY["c"], 0); } var flashLED = function() { on = !on; LED1.write(on); var interval; if(on) { interval = 5; } else { interval = 3000; } setTimeout(flashLED, interval); };
But with my other code that I posted there were no lights flashing at me.
When I loaded this code with 1v92 it then tried to re-pair with windows it fails and the light stopped blinking on the puck. And I get the error "Try connecting your device again."
It won't re pair no matter what mode I put it in on 1v92.
It works! Thank you for your help!
So the way it runs is different when it is saved vs just uploaded ?
I'm guessing the onInit function is called on start up of the device, but not called if just uploaded.