• $ sudo hcitool lescan
    Set scan parameters failed: Input/output error
    

    I tried the suggestions here but to no avail. Also found this launchpad bug.

    $ node advertising_nodejs.js
    node:internal/modules/cjs/loader:1042
      throw err;
      ^
    
    Error: Cannot find module 'bluetooth-hci-socket'
    Require stack:
    - /home/user/node_modules/noble/lib/hci-so­cket/hci.js
    - /home/user/node_modules/noble/lib/hci-so­cket/bindings.js
    - /home/user/node_modules/noble/lib/resolv­e-bindings.js
    - /home/user/node_modules/noble/index.js
    - /home/user/advertising_nodejs.js
        at Module._resolveFilename (node:internal/modules/cjs/loader:1039:1­5)
        at Module._load (node:internal/modules/cjs/loader:885:27­)
        at Module.require (node:internal/modules/cjs/loader:1105:1­9)
        at require (node:internal/modules/cjs/helpers:103:1­8)
        at Object.<anonymous> (/home/user/node_modules/noble/lib/hci-s­ocket/hci.js:6:26)
        at Module._compile (node:internal/modules/cjs/loader:1218:1­4)
        at Module._extensions..js (node:internal/modules/cjs/loader:1272:1­0)
        at Module.load (node:internal/modules/cjs/loader:1081:3­2)
        at Module._load (node:internal/modules/cjs/loader:922:12­)
        at Module.require (node:internal/modules/cjs/loader:1105:1­9) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/home/user/node_modules/noble/lib/hci-s­ocket/hci.js',
        '/home/user/node_modules/noble/lib/hci-s­ocket/bindings.js',
        '/home/user/node_modules/noble/lib/resol­ve-bindings.js',
        '/home/user/node_modules/noble/index.js'­,
        '/home/user/advertising_nodejs.js'
      ]
    }
    
    Node.js v18.13.0
    

    Then tried this. Now getting

    $ sudo npm install bluetooth-hci-socket --unsafe-perm
    npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@3. I'll try to do my best with it!
    
    > usb@1.9.2 install /home/user/node_modules/usb
    > node-gyp-build
    
    gyp ERR! configure error 
    gyp ERR! stack Error: Python executable "/usr/bin/python" is v3.11.1, which is not supported by gyp.
    gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
    gyp ERR! stack     at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_mo­dules/node-gyp/lib/configure.js:492:19)
    gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_mo­dules/node-gyp/lib/configure.js:474:14)
    gyp ERR! stack     at ChildProcess.exithandler (child_process.js:267:7)
    gyp ERR! stack     at emitTwo (events.js:126:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
    gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    gyp ERR! System Linux 6.1.7-2-siduction-amd64
    gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_mo­dules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/user/node_modules/usb
    gyp ERR! node -v v8.9.0
    gyp ERR! node-gyp -v v3.6.2
    gyp ERR! not ok 
    
    > bluetooth-hci-socket@0.5.1 install /home/user/node_modules/bluetooth-hci-so­cket
    > node-gyp rebuild
    
    gyp ERR! configure error 
    gyp ERR! stack Error: Python executable "/usr/bin/python" is v3.11.1, which is not supported by gyp.
    gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
    gyp ERR! stack     at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_mo­dules/node-gyp/lib/configure.js:492:19)
    gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_mo­dules/node-gyp/lib/configure.js:474:14)
    gyp ERR! stack     at ChildProcess.exithandler (child_process.js:267:7)
    gyp ERR! stack     at emitTwo (events.js:126:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
    gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    gyp ERR! System Linux 6.1.7-2-siduction-amd64
    gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_mo­dules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/user/node_modules/bluetooth-hci-so­cket
    gyp ERR! node -v v8.9.0
    gyp ERR! node-gyp -v v3.6.2
    gyp ERR! not ok 
    npm WARN user No description
    npm WARN user No repository field.
    npm WARN user No license field.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@1.9.2 (node_modules/usb):
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@1.9.2 install: `node-gyp-build`
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! bluetooth-hci-socket@0.5.1 install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the bluetooth-hci-socket@0.5.1 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2023-01-24T17_04_32_579­Z-debug.log
    
About

Avatar for user152434 @user152434 started