IBM-Cloud / iot-sensor-tag

Sample code for connecting to a TI Sensor Tag and using that data in apps deployed to Bluemix.
Apache License 2.0
33 stars 45 forks source link

npm install - fatal error: bluetooth/bluetooth.h: No such file or directory #1

Closed eguo closed 9 years ago

eguo commented 9 years ago

Can some help me with this problem:

I have following error when I run npm install inside /iot-sensor-tag/publish folder.

"...Release/obj.target/hci-ble/src/hci-ble.o ../src/hci-ble.c:9:33: fatal error: bluetooth/bluetooth.h: No such file or directory compilation terminated. make: *\ [Release/obj.target/hci-ble/src/hci-ble.o] Error 1 make: Leaving directory..."

This is in a Galaxy S4 Active Android phone running debian linux.

See complete output here:

root@localhost:/opt/konectera/gitwork/iot-sensor-tag/publish# npm install npm WARN package.json @ No repository field. /

noble@0.3.5 install /opt/konectera/gitwork/iot-sensor-tag/publish/node_modules/sensortag/node_modules/noble node install.js

noble install: platform is "linux' noble install: running node-gyp ... make: Entering directory '/opt/konectera/gitwork/iot-sensor-tag/publish/node_modules/sensortag/node_modules/noble/build' CC(target) Release/obj.target/hci-ble/src/hci-ble.o ../src/hci-ble.c:9:33: fatal error: bluetooth/bluetooth.h: No such file or directory

include <bluetooth/bluetooth.h>

                             ^

compilation terminated. hci-ble.target.mk:78: recipe for target 'Release/obj.target/hci-ble/src/hci-ble.o' failed make: *\ [Release/obj.target/hci-ble/src/hci-ble.o] Error 1 make: Leaving directory '/opt/konectera/gitwork/iot-sensor-tag/publish/node_modules/sensortag/node_modules/noble/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12) gyp ERR! System Linux 3.4.0-1429916 gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" gyp ERR! cwd /opt/konectera/gitwork/iot-sensor-tag/publish/node_modules/sensortag/node_modules/noble gyp ERR! node -v v0.10.32 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not ok noble install: done

npm ERR! noble@0.3.5 install: node install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the noble@0.3.5 install script. npm ERR! This is most likely a problem with the noble package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node install.js npm ERR! You can get their info via: npm ERR! npm owner ls noble npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.4.0-1429916 npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! cwd /opt/konectera/gitwork/iot-sensor-tag/publish npm ERR! node -v v0.10.32 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! not ok code 0

eguo commented 9 years ago

Saw sandeepmistry's comment in this post: https://github.com/sandeepmistry/bleno/issues/69

It turns out to be a missing component. Here are the output to show how it worked:

root@localhost:/opt/konectera/gitwork/iot-sensor-tag/publish# apt-get install libbluetooth-dev Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libbluetooth3 Suggested packages: pkg-config The following NEW packages will be installed: libbluetooth-dev libbluetooth3 0 upgraded, 2 newly installed, 0 to remove and 263 not upgraded. Need to get 229 kB of archives. After this operation, 622 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://ftp.de.debian.org/debian/ testing/main libbluetooth3 armhf 5.23-1 [78.3 kB] Get:2 http://ftp.de.debian.org/debian/ testing/main libbluetooth-dev armhf 5.23-1 [150 kB] Fetched 229 kB in 2s (88.9 kB/s) Selecting previously unselected package libbluetooth3:armhf. (Reading database ... 35437 files and directories currently installed.) Unpacking libbluetooth3:armhf (from .../libbluetooth3_5.23-1_armhf.deb) ... Selecting previously unselected package libbluetooth-dev. Unpacking libbluetooth-dev (from .../libbluetooth-dev_5.23-1_armhf.deb) ... Setting up libbluetooth3:armhf (5.23-1) ... Setting up libbluetooth-dev (5.23-1) ... Processing triggers for libc-bin ... root@localhost:/opt/konectera/gitwork/iot-sensor-tag/publish# npm install npm WARN package.json @ No repository field. \

noble@0.3.5 install /opt/konectera/gitwork/iot-sensor-tag/publish/node_modules/sensortag/node_modules/noble node install.js

noble install: platform is "linux' noble install: running node-gyp ... make: Entering directory '/opt/konectera/gitwork/iot-sensor-tag/publish/node_modules/sensortag/node_modules/noble/build' CC(target) Release/obj.target/hci-ble/src/hci-ble.o LINK(target) Release/hci-ble LINK(target) Release/hci-ble: Finished CC(target) Release/obj.target/l2cap-ble/src/l2cap-ble.o LINK(target) Release/l2cap-ble LINK(target) Release/l2cap-ble: Finished make: Leaving directory '/opt/konectera/gitwork/iot-sensor-tag/publish/node_modules/sensortag/node_modules/noble/build' noble install: done sensortag@0.1.9 node_modules/sensortag └── noble@0.3.5 (debug@0.7.4) root@localhost:/opt/konectera/gitwork/iot-sensor-tag/publish# ls -ltr total 28 -rw-------. 1 root root 6975 Sep 25 22:54 sensor-tag.js -rwx------. 1 root root 215 Sep 25 22:54 package.json -rwx------. 1 root root 5329 Sep 25 22:54 README.md -rwx------. 1 root root 100 Sep 25 23:46 config.properties drwx------. 7 root root 4096 Sep 26 01:59 node_modules root@localhost:/opt/konectera/gitwork/iot-sensor-tag/publish# node sensor-tag.js Device MAC Address: d222be535b30 The device MAC address does not match the ID in the configuration file. Make sure the Sensor Tag is on! MQTT client connected to IBM IoT Cloud.

ryanjbaxter commented 9 years ago

@eguo installing libbluetooth-dev is mentioned in publish/README.md, did you miss that?

eguo commented 9 years ago

My bad. I missed it. :(

Eddy

On Fri, Sep 26, 2014 at 3:06 PM, Ryan Baxter notifications@github.com wrote:

@eguo https://github.com/eguo installing libbluetooth-dev is mentioned in publish/README.md, did you miss that?

— Reply to this email directly or view it on GitHub https://github.com/IBM-Bluemix/iot-sensor-tag/issues/1#issuecomment-57006555 .

belun commented 9 years ago

i had this problem when installing cylon-ble which needed noble, which required libbluetooth-dev. how was i supposed to find out about that depedency?

npm install noble was just failing

ryanjbaxter commented 9 years ago

@belun as mentioned above it is mentioned in the README in the publish directory

belun commented 9 years ago

@ryanjbaxter i did not mean to appear stupid, on purpose indeed, it is mentioned here: https://www.npmjs.com/package/noble it is just that, i thought, you do "npm install something", and npm it takes care of the dependencies (or it, at least, tells you that you have some native extra dependencies, when an install of your module fails)

ryanjbaxter commented 9 years ago

@belun the problem is that libbluetooth-dev is not a node module it is an OS level dependency so npm install cannot install it.