Trying to build BLE app but can't install pc-ble-driver-js

Hello, I am developing an nRF Connect for Desktop application and want to integrate functionality from the BLE application into my own tool. Specifically, I want to be able to program the connected dev kit with the appropriate connectivity firmware, retrieve and enumerate on the available Bluetooth connections, connect to a specific device and then read and write to it.

While looking at the source code for the BLE application (v4.0.4), I discovered it uses pc-ble-driver-js, which seems like it's been deprecated, since support for it was removed from pc-nrfconnect-shared back in 6.6.2. My application is being built on the existing Programmer application (v4.2.0), so is it even possible to use pc-ble-driver-js in my application? Is there a replacement for pc-ble-driver-js? I've been trying to install it in my application and just keep running into problems. 

I'm running x64 Windows 11, nRF Connect for Desktop is v4.3.0, node is v20.11.0, npm is v10.2.4, and I believe electron is v22.3.5 based on what's in the package-lock.json file.

I have tried following the instructions here, to no avail. I created the .npmrc file in the root of my application and set the runtime and target variables:

but I just get the following errors:

PS C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab> npm install pc-ble-driver-js
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See v8.dev/.../math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see github.com/.../3142
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\pc-ble-driver-js
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node do_prebuild.js --decompress-only || node do_prebuild.js --install-only || node do_prebuild.js
npm ERR! options.shared_install_dir:C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\pc-ble-driver-js\Release
npm ERR! Decompressing local prebuild.
npm ERR! Unable to decompress local prebuild. File does not exist: prebuilds\pc-ble-driver-js-v2.8.2-electron-v110-win32-x64.tar.gz
npm ERR! options.shared_install_dir:C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\pc-ble-driver-js\Release
npm ERR! Installing prebuild from developer.nordicsemi.no.
npm ERR! Trying to install prebuild from developer.nordicsemi.no...
npm ERR! Runtime: electron
npm ERR! Target: 22.3.5
npm ERR! Running command: npx prebuild-install -r electron -t 22.3.5 --verbose
npm ERR!
npm ERR! C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\prebuild-install\node_modules\node-abi\index.js:36
npm ERR! throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '. Updating "node-abi" might help solve this issue if it is a new release of ' + runtime)
npm ERR! ^
npm ERR!
npm ERR! Error: Could not detect abi for version 22.3.5 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron
npm ERR! at getAbi (C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\prebuild-install\node_modules\node-abi\index.js:36:9)
npm ERR! at module.exports (C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\prebuild-install\rc.js:52:57)
npm ERR! at Object.<anonymous> (C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\prebuild-install\bin.js:8:25)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1376:14)
npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1207:32)
npm ERR! at Module._load (node:internal/modules/cjs/loader:1023:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
npm ERR! at node:internal/main/run_main_module:28:49
npm ERR!
npm ERR! Node.js v20.11.0
npm ERR!
npm ERR! =================================================================
npm ERR! Install from developer.nordicsemi.no failed.
npm ERR!
npm ERR! NOTE:
npm ERR! The prebuild-install module will use a different strategy for fetching prebuilt binaries and will try to download from Github instead if it finds a token in ~/.prebuild-installrc
npm ERR! Ensure that this token is not present by either deleting or temporarily moving it: ~/.prebuild-installrc
npm ERR! =================================================================
npm ERR! Error message was: Error: Command failed: npx prebuild-install -r electron -t 22.3.5 --verbose
npm ERR! C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\prebuild-install\node_modules\node-abi\index.js:36
npm ERR! throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '. Updating "node-abi" might help solve this issue if it is a new release of ' + runtime)
npm ERR! ^
npm ERR!
npm ERR! Error: Could not detect abi for version 22.3.5 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron
npm ERR! at getAbi (C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\prebuild-install\node_modules\node-abi\index.js:36:9)
npm ERR! at module.exports (C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\prebuild-install\rc.js:52:57)
npm ERR! at Object.<anonymous> (C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\prebuild-install\bin.js:8:25)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1376:14)
npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1207:32)
npm ERR! at Module._load (node:internal/modules/cjs/loader:1023:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
npm ERR! at node:internal/main/run_main_module:28:49
npm ERR!
npm ERR! Node.js v20.11.0
npm ERR!
npm ERR! options.shared_install_dir:C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\pc-ble-driver-js\Release
npm ERR! runtime: electron, from_abi:110
npm ERR! Prebuilding for versions: 22.0.0-alpha.1.
npm ERR! Done with error:
npm ERR! Error: Could not find prebuild. Error: Error: Command failed: npm bin
npm ERR!
npm ERR! at run_prebuild (C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab\node_modules\pc-ble-driver-js\do_prebuild.js:37:15)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

npm ERR! A complete log of this run can be found in: C:\Users\ejfis\AppData\Local\npm-cache\_logs\2024-01-25T22_23_05_073Z-debug-0.log
PS C:\Users\ejfis\.nrfconnect-apps\local\pc-nrfconnect-pocketlab>

I even tried to build it using vcpkg as instructed here (instructions in pc-ble-driver-js) and here (instructions in vcpkg repo) and that didn't work either because asio:x64-windows failed when I tried to install nrf-ble-driver:

PS C:\Users\ejfis\dev> .\vcpkg\vcpkg install nrf-ble-driver:x64-windows
Computing installation plan...
The following packages will be built and installed:
* asio:[email protected]
* cli11:[email protected]
* fmt:[email protected]
nrf-ble-driver:[email protected]#1
* spdlog:[email protected]
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Restored 0 package(s) from C:\Users\ejfis\AppData\Local\vcpkg\archives in 102 us. Use --debug to see more details.
Installing 1/5 asio:[email protected]...
Building asio:[email protected]...
-- Using cached chriskohlhoff-asio-asio-1-29-0.tar.gz.
-- Cleaning sources at C:/Users/ejfis/dev/vcpkg/buildtrees/asio/src/sio-1-29-0-772787661e.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Users/ejfis/dev/vcpkg/downloads/chriskohlhoff-asio-asio-1-29-0.tar.gz
-- Using source at C:/Users/ejfis/dev/vcpkg/buildtrees/asio/src/sio-1-29-0-772787661e.clean
-- Found external ninja('1.11.0').
-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
Command failed: "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -v
Working Directory: C:/Users/ejfis/dev/vcpkg/buildtrees/asio/x64-windows-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
C:\Users\ejfis\dev\vcpkg\buildtrees\asio\config-x64-windows-dbg-CMakeCache.txt.log
C:\Users\ejfis\dev\vcpkg\buildtrees\asio\config-x64-windows-rel-CMakeCache.txt.log
C:\Users\ejfis\dev\vcpkg\buildtrees\asio\config-x64-windows-out.log

Call Stack (most recent call first):
installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:252 (vcpkg_execute_required_process)
ports/asio/portfile.cmake:16 (vcpkg_cmake_configure)
scripts/ports.cmake:170 (include)


error: building asio:x64-windows failed with: BUILD_FAILED
Elapsed time to handle asio:x64-windows: 2.6 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
github.com/.../issues
You can submit a new issue at:
github.com/.../new

PS C:\Users\ejfis\dev>

Since I followed the instructions to checkout tags/2020.07, I decided to try updating vcpkg to see if asio would build but I got the same results. 

Parents
  • Hello again, 

    I've had a talk with the relevant team, and yes pc-ble-driver-js is deprecated, the advice is not using it. Even though it is still available, no maintenance work will be put on it. The new ble lib is on the road map, but it is currently not a priority, and therefore unfortunately won't be avaiable any time soon. 

    Regards,

    Elfving

Reply
  • Hello again, 

    I've had a talk with the relevant team, and yes pc-ble-driver-js is deprecated, the advice is not using it. Even though it is still available, no maintenance work will be put on it. The new ble lib is on the road map, but it is currently not a priority, and therefore unfortunately won't be avaiable any time soon. 

    Regards,

    Elfving

Children
No Data
Related