reelyactive / pi-suite

Enable context-aware physical spaces with a Raspberry Pi and Pareto Anywhere open source software. We believe in an open Internet of Things.
https://reelyactive.github.io/diy/pi-suite/
MIT License
22 stars 5 forks source link

HCI Bluetooth sniffing throwing error #8

Open Landennelson06 opened 3 years ago

Landennelson06 commented 3 years ago

Error in terminal:

reelyActive barnowl instance is listening for an open IoT
reelyActive Chickadee instance is curious to associate metadata in an open IoT
node:events:353
      throw er; // Unhandled 'error' event
      ^

Error: EPERM, Operation not permitted
    at setScanEnable (/home/pi/reelyActive/pi-suite/node_modules/barnowl-hci/lib/socketlistener.js:166:10)
    at openHciSocket (/home/pi/reelyActive/pi-suite/node_modules/barnowl-hci/lib/socketlistener.js:86:3)
    at new SocketListener (/home/pi/reelyActive/pi-suite/node_modules/barnowl-hci/lib/socketlistener.js:39:5)
    at BarnowlHci.addListener (/home/pi/reelyActive/pi-suite/node_modules/barnowl-hci/lib/barnowlhci.js:45:20)
    at prepareInterface (/home/pi/reelyActive/pi-suite/node_modules/barnowl/lib/barnowl.js:107:21)
    at Barnowl.addListener (/home/pi/reelyActive/pi-suite/node_modules/barnowl/lib/barnowl.js:55:27)
    at HLCServer.addListener (/home/pi/reelyActive/pi-suite/node_modules/hlc-server/lib/hlcserver.js:164:18)
    at Object.<anonymous> (/home/pi/reelyActive/pi-suite/bin/pi-suite-hci:13:5)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
Emitted 'error' event on BluetoothHciSocket instance at:
    at setScanEnable (/home/pi/reelyActive/pi-suite/node_modules/barnowl-hci/lib/socketlistener.js:166:10)
    [... lines matching original stack trace ...]
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) {
  errno: 1,
  code: 'EPERM',
  syscall: 'write'
}
npm ERR! code 1
npm ERR! path /home/pi/reelyActive/pi-suite
npm ERR! command failed
npm ERR! command sh -c node bin/pi-suite-hci

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-12-30T15_46_07_696Z-debug.log

Cannot get Log file as i do not have Root permissions.

jeffyactive commented 3 years ago

Hi @Lann4daze, using the HCI Bluetooth interface typically requires running as root, else you will experience permission errors as you observe in the console log you provided. If you don't have root permissions, you won't be able to run pi-suite-hci but rather only pi-suite (which you can test to confirm that the error is due to lack of HCI permissions).

Kindly close the issue if the root cause is lack of root permissions (no pun intended). Thanks and have a happy and safe New Year!