5 Replies Latest reply on Apr 6, 2016 12:01 PM by coloradocarlos

    Cannot install Noble and BLENo

    tejaChintalapati

      Hello!

       

      The project I'm working on requires BLE. I followed instructions from Configure Intel Edison for Bluetooth LE (Smart) Development - Rex St John and tried installing Noble and Bleno but, Edison can't parse the JSON. Please help me understand why this is is happening and the fix for this problem.

       

      Screen Shot 2016-02-25 at 08.12.04.png

       

      Hardware: Edison

      Firmware: Yocto Linux 1.7.4

       

      Thanks

      Teja

        • 1. Re: Cannot install Noble and BLENo
          Intel_Peter

          Hello tejaChintalapati,

           

          That's strange I have completely different outputs when trying to install Noble and Bleno, were you using a custom image? Of if you weren't, which image are you using? You can find out the version of your Edison's image with the command configure_edison --version.

           

          These are my outputs:

           

          On Noble:

           

          root@Peter:~# npm install noble
          npm WARN optional dep failed, continuing xpc-connection@0.1.4
          npm WARN engine usb@1.1.1: wanted: {"node":">=0.12.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
          
          
          > usb@1.1.1 install /home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb
          > node-pre-gyp install --fallback-to-build
          
          
          make: Entering directory '/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/build'
            CC(target) Release/obj.target/libusb/libusb/libusb/core.o
            CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
            CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
            CC(target) Release/obj.target/libusb/libusb/libusb/io.o
            CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
            CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
            CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
            CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
            CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
            CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
          ../libusb/libusb/os/linux_udev.c:40:21: fatal error: libudev.h: No such file or directory
           #include <libudev.h>
                               ^
          compilation terminated.
          libusb.target.mk:121: recipe for target 'Release/obj.target/libusb/libusb/libusb/os/linux_udev.o' failed
          make: *** [Release/obj.target/libusb/libusb/libusb/os/linux_udev.o] Error 1
          make: Leaving directory '/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/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:820:12)
          gyp ERR! System Linux 3.10.17-poky-edison+
          gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding/usb_bindings.node" "--module_name=usb_bindings" "--module_path=/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding"
          gyp ERR! cwd /home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb
          gyp ERR! node -v v0.10.38
          gyp ERR! node-gyp -v v1.0.1
          gyp ERR! not ok
          node-pre-gyp ERR! build error
          node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding' (1)
          node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
          node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
          node-pre-gyp ERR! stack     at maybeClose (child_process.js:766:16)
          node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:833:5)
          node-pre-gyp ERR! System Linux 3.10.17-poky-edison+
          node-pre-gyp ERR! command "node" "/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
          node-pre-gyp ERR! cwd /home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb
          node-pre-gyp ERR! node -v v0.10.38
          node-pre-gyp ERR! node-pre-gyp -v v0.6.4
          node-pre-gyp ERR! not ok
          Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding' (1)
          npm WARN optional dep failed, continuing usb@1.1.1
          
          
          > bluetooth-hci-socket@0.4.2 install /home/root/node_modules/noble/node_modules/bluetooth-hci-socket
          > node-gyp rebuild
          
          
          make: Entering directory '/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/build'
            CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
            SOLINK_MODULE(target) Release/obj.target/binding.node
            SOLINK_MODULE(target) Release/obj.target/binding.node: Finished
            COPY Release/binding.node
          make: Leaving directory '/home/root/node_modules/noble/node_modules/bluetooth-hci-socket/build'
          noble@1.3.0 node_modules/noble
          ├── bplist-parser@0.0.6
          ├── debug@2.2.0 (ms@0.7.1)
          └── bluetooth-hci-socket@0.4.2 (nan@2.2.0)
          root@Peter:~#
          

           

          On Bleno:

           

          root@Peter:~# npm install bleno
          npm WARN optional dep failed, continuing xpc-connection@0.1.4
          npm WARN engine usb@1.1.1: wanted: {"node":">=0.12.x"} (current: {"node":"0.10.38","npm":"1.4.28"})
          
          
          > usb@1.1.1 install /home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb
          > node-pre-gyp install --fallback-to-build
          
          
          make: Entering directory '/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/build'
            CC(target) Release/obj.target/libusb/libusb/libusb/core.o
            CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o
            CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o
            CC(target) Release/obj.target/libusb/libusb/libusb/io.o
            CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o
            CC(target) Release/obj.target/libusb/libusb/libusb/sync.o
            CC(target) Release/obj.target/libusb/libusb/libusb/os/poll_posix.o
            CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o
            CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o
            CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_udev.o
          ../libusb/libusb/os/linux_udev.c:40:21: fatal error: libudev.h: No such file or directory
           #include <libudev.h>
                               ^
          compilation terminated.
          libusb.target.mk:121: recipe for target 'Release/obj.target/libusb/libusb/libusb/os/linux_udev.o' failed
          make: *** [Release/obj.target/libusb/libusb/libusb/os/linux_udev.o] Error 1
          make: Leaving directory '/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/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:820:12)
          gyp ERR! System Linux 3.10.17-poky-edison+
          gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding/usb_bindings.node" "--module_name=usb_bindings" "--module_path=/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding"
          gyp ERR! cwd /home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb
          gyp ERR! node -v v0.10.38
          gyp ERR! node-gyp -v v1.0.1
          gyp ERR! not ok
          node-pre-gyp ERR! build error
          node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding' (1)
          node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
          node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
          node-pre-gyp ERR! stack     at maybeClose (child_process.js:766:16)
          node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:833:5)
          node-pre-gyp ERR! System Linux 3.10.17-poky-edison+
          node-pre-gyp ERR! command "node" "/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
          node-pre-gyp ERR! cwd /home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb
          node-pre-gyp ERR! node -v v0.10.38
          node-pre-gyp ERR! node-pre-gyp -v v0.6.4
          node-pre-gyp ERR! not ok
          Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding/usb_bindings.node --module_name=usb_bindings --module_path=/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/node_modules/usb/src/binding' (1)
          npm WARN optional dep failed, continuing usb@1.1.1
          
          
          > bluetooth-hci-socket@0.4.2 install /home/root/node_modules/bleno/node_modules/bluetooth-hci-socket
          > node-gyp rebuild
          
          
          make: Entering directory '/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/build'
            CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o
            SOLINK_MODULE(target) Release/obj.target/binding.node
            SOLINK_MODULE(target) Release/obj.target/binding.node: Finished
            COPY Release/binding.node
          make: Leaving directory '/home/root/node_modules/bleno/node_modules/bluetooth-hci-socket/build'
          bleno@0.3.5 node_modules/bleno
          ├── bplist-parser@0.0.6
          ├── debug@2.2.0 (ms@0.7.1)
          └── bluetooth-hci-socket@0.4.2 (nan@2.2.0)
          root@Peter:~#
          

           

          And I can see both modules in my Edison:

           

          Capture.PNG

           

          Peter.

          • 2. Re: Cannot install Noble and BLENo
            tejaChintalapati

            Peter,

             

            Thank you for the reply. I'm not using custom image. My version # is 159.

             

            Thanks

            Teja

            • 3. Re: Cannot install Noble and BLENo
              Intel_Peter

              In that case, I'd suggest you to reflash your board and try again since I'm using the same image and I had no issues with the node modules. It might also be related to your network, does it have any security like a firewall?

               

              Peter.

              • 4. Re: Cannot install Noble and BLENo
                tejaChintalapati

                I successfully installed cylon-intel-iot. So, the Firewall problem is ruled out.

                 

                And I'll update you after re-flashing the firmware.

                • 5. Re: Cannot install Noble and BLENo
                  coloradocarlos

                  I found I needed to install libusb-1.0-dev to work around the missing libudev.h when building the BLE samples.


                  My /etc/opkg/base-feeds.conf contains:

                  src/gz all http://repo.opkg.net/edison/repo/all
                  src/gz edison http://repo.opkg.net/edison/repo/edison
                  src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32
                  

                   

                  Then:

                  opkg update
                  opkg install libusb-1.0-dev
                  cd ~/.node_app_slot
                  npm rebuild
                  

                   

                  My Edison version:

                  cat /etc/version
                  201603141535