• Breadcrumbs
    https://github.com/NordicSemiconductor/s­ecure-dfu-web-bluetooth with Espruino as a package.json keyword leads to a

    Error: No compatible USB Bluetooth 4.0 device found!
        at BluetoothHciSocket.bindUser (C:\Users\owen\source\repos\github\Nordi­cSemiconductor\secure-dfu-web-bluetooth\­node_modules\bluetooth-hci-socket\lib\us­b.js:70:11)
    

    A google on bluetooth-hci-socket gives a https://github.com/sandeepmistry/node-bl­uetooth-hci-socket

    And a WIP which does not need any comments: I just edit this post to document for myself where the trail lead on Windows 10

    Edit
    The bluetooth in my device is supported:

    Intel Wireless Bluetooth 7265	0x8087	0x0a2a
    

    Edit:
    zadig did it's work: bluetooth not available to Windows 10, and hoping available for the node of things

    Edit:
    Don't skip steps, go thru the doc and examples to make sure the base of DFU works when there, even if unnessary (DFU could work) time well spent
    https://github.com/sandeepmistry/node-bl­uetooth-hci-socket

    Edit:
    Ensure pre-req for node-bluetooth-hci-socket by doing https://github.com/nodejs/node-gyp#insta­llation for Windows

    Edit:
    "Waiting for installers..." and have done for a long time. May have to bail out and cross fingers.

    Microsoft Windows [Version 10.0.14393]
    (c) 2016 Microsoft Corporation. All rights reserved.
    
    C:\WINDOWS\system32>npm install --global --production windows-build-tools
    
    > windows-build-tools@1.1.0 postinstall C:\Users\owen\AppData\Roaming\npm\node_m­odules\windows-build-tools
    > node ./lib/index.js
    
    Downloading BuildTools_Full.exe
    Downloading python-2.7.11.msi
    [=======================================­=====>] 100.0% of 18.64 MB (2.87 MB/s)
    Downloaded python-2.7.11.msi. Saved to C:\Users\owen\.windows-build-tools\pytho­n-2.7.11.msi.
    Starting installation...
    Launched installers, now waiting for them to finish.
    This will likely take some time - please be patient!
    Waiting for installers... \Successfully installed Visual Studio Build Tools.
    Waiting for installers...
    

    Edit:
    Bailed out but the following gave something I have to understand:

    owen@DESKTOP-O5H58VV MINGW64 /c/source/repos/github/sandeepmistry/nod­e-bluetooth-hci-socket (master)
    $ node examples/le-connection-test.js
    data: 040e0402030c00, 7 bytes
    data: 040f0400020d20, 7 bytes
    
    owen@DESKTOP-O5H58VV MINGW64 /c/source/repos/github/sandeepmistry/nod­e-bluetooth-hci-socket (master)
    $ node examples/le-scan-test.js
    data: 040e04000c200c
    data: 040e04000b2000
    LE Scan Parameters Set
    data: 040e0402030c00
    data: 040e04020c2000
    LE Scan Enable Set
    
    owen@DESKTOP-O5H58VV MINGW64 
    /c/source/repos/github/sandeepmistry/nod­e-bluetooth-hci-socket (master)
    $ node examples/le-advertisement-test.js
    isDevUp = false
    write: 010a200100
    write: 0106200fa000a0000000000000000000000700
    write: 01092020190909657374696d6f74650e160a182e­b8855fb5ddb601000200000000000000
    write: 010820201e0201061aff4c000215b9407f30f5f8­466eaff925556b57fe6d00010002b600
    write: 010a200101
    data:  040e04000a200c
    data:  040e0400062000
    LE Advertising Parameters Set
    data:  040e0401092000
    LE Scan Response Data Set
    data:  040e0400082000
    LE Advertising Data Set
    data:  040e0402030c00
    data:  040e04020a2000
    LE Advertise Enable Set
    

    Edit:

    owen@DESKTOP-O5H58VV MINGW64 /c/source/repos/github/NordicSemiconduct­or/secure-dfu-web-bluetooth (master)
    $ npm install ../../sandeepmistry/node-bluetooth-hci-s­ocket/
    $ npm install
    

    Edit:
    Coffee time and find out what it all means
    Although, I could maybe use an nRF52-DK to solve my case, it requires the device and no "solution" for others that do not have a device to use.

    owen@DESKTOP-O5H58VV MINGW64 /c/source/repos/github/NordicSemiconduct­or/secure-d                                                                                            fu-web-bluetooth (master)
    $ npm test
    
    > secure-dfu@0.0.0 test C:\source\repos\github\NordicSemiconduct­or\secure-dfu-web-bluetooth
    > mocha --reporter spec
    
    
    
    (node:10904) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): requestDevice error: adapter not enabled
      [#file_utils](https://forum.espruino.com­/search/?q=%23file_utils)
        1) should un-zip test_resources/dfu_test_app_hrm_s132.zip­ and print it's contents.
        2) should parse the manifest.json file passed to it and return a json object.
    (node:10904) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: ENOENT: no such file or directory, open 'C:\source\repos\github\NordicSemiconduc­tor\secure-dfu-web-bluetooth\tmp\manifes­t.json'
    (node:10904) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: ENOENT: no such file or directory, open 'C:\source\repos\github\NordicSemiconduc­tor\secure-dfu-web-bluetooth\tmp\nrf5283­2_xxaa.dat'
        3) should parse a .bin / .dat file into an array of bytes. Checks that the first and last bytes are correct.
    
      [#index](https://forum.espruino.com/sear­ch/?q=%23index) -- NOTE: requires nRF52 device running secure_dfu_secure_dfu_ble_s132_pca10040_­debug.hex in range of computer.
        4) should test littleEndian.
        √ should test littleEndianUInt32.
    (node:10904) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): requestDevice error: adapter not enabled
        5) should succesfully scan for, connect to, and discover the services/characteristics of the DFU target device.
        6) should succesfully enable notifications on the control point characteristic.
        7) should send create command.
    
    
      1 passing (4s)
      7 failing
    
      1) [#file_utils](https://forum.espruino.com­/search/?q=%23file_utils) should un-zip test_resources/dfu_test_app_hrm_s132.zip­ and print it's contents.:
         Error: ENOENT: no such file or directory, lstat 'C:\source\repos\github\NordicSemiconduc­tor\secure-dfu-web-bluetooth\tmp'
          at Error (native)
          at Object.fs.lstatSync (fs.js:982:18)
          at Context.it (test\test.js:16:15)
    
      2) [#file_utils](https://forum.espruino.com­/search/?q=%23file_utils) should parse the manifest.json file passed to it and return a json object.:
         Uncaught SyntaxError: Unexpected token u in JSON at position 0
          at Object.parse (native)
          at ReadFileContext.fs.readFile [as callback] (utils\file_utils.js:37:20)
          at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:365:13)
    
      3) [#file_utils](https://forum.espruino.com­/search/?q=%23file_utils) should parse a .bin / .dat file into an array of bytes. Checks that the first and last bytes are correct.:
         Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
    
    
      4) [#index](https://forum.espruino.com/sear­ch/?q=%23index) -- NOTE: requires nRF52 device running secure_dfu_secure_dfu_ble_s132_pca10040_­debug.hex in range of computer. should test littleEndian.:
    
          AssertionError: expected '0,1,2,3' to equal '3,2,1,0'
          + expected - actual
    
          -0,1,2,3
          +3,2,1,0
    
          at Context.it (test\test.js:47:31)
    
      5) [#index](https://forum.espruino.com/sear­ch/?q=%23index) -- NOTE: requires nRF52 device running secure_dfu_secure_dfu_ble_s132_pca10040_­debug.hex in range of computer. should succesfully scan for, connect to, and discover the services/characteristics of the DFU target device.:
         Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
    
    
      6) [#index](https://forum.espruino.com/sear­ch/?q=%23index) -- NOTE: requires nRF52 device running secure_dfu_secure_dfu_ble_s132_pca10040_­debug.hex in range of computer. should succesfully enable notifications on the control point characteristic.:
         TypeError: Cannot read property 'controlPointCharacteristic' of undefined
          at Context.it (test\test.js:106:41)
    
      7) [#index](https://forum.espruino.com/sear­ch/?q=%23index) -- NOTE: requires nRF52 device running secure_dfu_secure_dfu_ble_s132_pca10040_­debug.hex in range of computer. should send create command.:
         TypeError: Cannot read property 'controlPointCharacteristic' of undefined
          at Context.it (test\test.js:120:30)
    
    
    
    npm ERR! Test failed.  See above for more details.
    

    Edit
    puck.js DF:F5:A5:EC:43:1B Returning to Zadig and waiting for a system restoration point

    Edit:
    https://github.com/sandeepmistry/node-bl­uetooth-hci-socket/pull/54

    Edit:
    Getting to nobel, and make sure one see's a video
    https://www.youtube.com/watch?v=mL9B8wuE­dms

    Edit:
    All pre-req met and using Zadig (again)
    https://github.com/nodejs/node-gyp#insta­llation
    https://github.com/sandeepmistry/noble

    Edit:
    noble failure, no adapter, regress to https://github.com/sandeepmistry/node-bl­uetooth-hci-socket and ensure simple steps

    Edit:
    noble

    rm -fr npm_modules
    npm install <path to hci>
    npm install
    

    And ....

    C:\source\repos\github\sandeepmistry\nob­le>node examples\advertisement-discovery.js
    peripheral discovered (dff5a5ec431b with address <df:f5:a5:ec:43:1b, random>, connectable true, RSSI -70:
            hello my local name is:
                    Puck.js 431b
            can I interest you in any of the following advertised services:
                    ["6e400001b5a3f393e0a9e50e24dcca9e"]
    

    Edit:
    This is probably bad and I have to find a way to update the puck.js (where I started)

    C:\source\repos\github\sandeepmistry\nob­le>node examples\advertisement-discovery.js
    (no reply with battery off, button, battery on, green, release button, red)
    
About