5 Replies Latest reply on Nov 14, 2015 12:26 PM by massca

    XDK iBeacon Example Problem

    Flo1991

      Hey everybody,

       

      since several days I try to get the iBeacon Template in the XDK work. The Image on the Edison is the newest.

      I'm tried the example on Windows 7 64 Bit and Win 10 64 Bit and always get errors that files can not be read, if I try to build the project.

       

      Example:

      Could not read file: C:/Users/XXX/Documents/ibeacon1/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js

       

      The Files exist and even I cannot open some Files in the XDK manually.

      Error Message:

      An error occured when trying to open the file C:/Users/XXX/Documents/ibeacon1/node_modules/noble/node_modules/bluetooth-hci-socket/node_modules/usb/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/index.js. (error Unknown)

       

      Can anyone help me with this problem?

      Is it reproducible?

      I already tried running the XDK as admin but it did not make a difference...

       

      Flo1991

        • 1. Re: XDK iBeacon Example Problem
          Intel_Peter

          Hello Flo1991,

           

          First of all, did you make sure to be running the latest version of the XDK? If so, did you update the XDK daemon and the libraries on the board? If you haven't I suggest you to do so.

           

          Now how does the error appear? Were you following this guide: IoT - Creating a Bluetooth* Smart/Low Energy iBeacon application | Intel® Developer Zone? If so, did you make sure to successfully perform every step on the section "Enabling BLE on your board"?

           

          If you still run into some issues after all these checks, you may be interested in this other guide: Lets turn Intel Edison into an iBeacon · w4ilun/edison-guides Wiki · GitHub or this one gomobile/iotapp-template-ble-ibeacon · GitHub. Why don't you take a look at them? You might find them useful.

           

          Peter.

          • 2. Re: XDK iBeacon Example Problem
            Flo1991

            Thank you Peter for your reply.

             

            Everything is up to date. I followed this guide and got the errors...

            hciconfig says:

            hci0:   Type: BR/EDR  Bus: UART

                    BD Address: 98:4F:EE:03:DA:CE  ACL MTU: 1021:8  SCO MTU: 64:1

                    UP RUNNING PSCAN

                    RX bytes:1294 acl:0 sco:0 events:72 errors:0

                    TX bytes:2170 acl:0 sco:0 commands:72 errors:0

             

            I still get the same error...

            if I run "npm install on device" I can build the project, but if I run it I get the error:                                                                                                                                                 

            ERROR:     throw err;                                                                                                                                                      

               ERROR:        ^                                                                                                                                                         

            ERROR: Error: Cannot find module '../build/Release/binding.node'                                                                                                           

                at Function.Module._resolveFilename (module.js:338:15)                                                                                                                 

                at Function.Module._load (module.js:280:25)                                                                                                                            

                at Module.require (module.js:364:17)                                                                                                                                   

                at require (module.js:380:17)                                                                                                                                          

                at Object.<anonymous> (/home/root/.node_app_slot/node_modules/bleno/node_modules/bluetooth-hci-socket/lib/native.js:3:15)                                              

                at Module._compile (module.js:456:26)                                                                                                                                  

                at Object.Module._extensions..js (module.js:474:10)                                                                                                                    

                at Module.load (module.js:356:32)                                                                                                                                      

                at Function.Module._load (module.js:312:12)                                                                                                                            

                at Module.require (module.js:364:17)            

             

            I tried the description from w4ilun and got some errors by installing noble:

             

            root@EdisonTiny:~# npm install noble

            npm WARN optional dep failed, continuing xpc-connection@0.1.4

            \

            > usb@1.0.6 install /home/root/node_modules/noble/node_modules/bluetooth-hci-soc ket/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

            ../libusb/libusb/os/threads_posix.c:24:0: warning: "_GNU_SOURCE" redefined

            #  define _GNU_SOURCE

            ^

            <command-line>:0:0: note: this is the location of the previous definition

              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.0.6

             

            > bluetooth-hci-socket@0.4.0 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.2.0 node_modules/noble

            ├── bplist-parser@0.0.6

            ├── debug@2.2.0 (ms@0.7.1)

            └── bluetooth-hci-socket@0.4.0 (nan@2.1.0)

             

             

            Any suggestions?

            • 3. Re: XDK iBeacon Example Problem
              Flo1991

              Update:

              Today I tried several things and got the following results:

              - the build error "Could not read file: C:/Users/XXX/Docu..." is a Windows problem, Ubuntu 64 Bit has no problems

              - I figured out problems that these folders can sometimes not be deleted and can not be zipped using the Windows zipping option (no error is viewed, it just doesnt do anything, 7-Zip works without problems)

              - building on the device works

              - at the morning I had problems to run the programm, installing "bleno" to the app-folder on the edison fixed the problem

              - in the afternoon that problem has gone ?!?...

               

              So there are more than just one problem:

              - XDK problem, files can not be read (independent of Intel Edison)

              - Run BLE Applikations on Intel Edison (currently no problems, strange behaviour refering to the need of bleno in app-folder)

               

              Conclusion: currently the XDK cannot be used with BLE (I tried out both examples), if the files are build offline

              Building on the Edison is no problem.

               

              If the programm doesnt work, "bleno" must be installed in the application folder (/home/root/.node_app_slot/)

               

              As I run the iBeacon I got another strange behaviour:

              Always when the app is started or stopped I get an "clock skew detected"

               

              Flo1991

              • 4. Re: XDK iBeacon Example Problem
                Flo1991

                Hopefully last Update:

                New XDK Version 2571 seems to fix the problem - thank you Intel

                if the example does not work, install bleno in the application folder (/home/root/.node_app_slot/)

                ---------------------------------------------

                cd /home/root/.node_app_slot/

                npm install bleno   

                ---------------------------------------------

                 

                Flo1991

                • 5. Re: XDK iBeacon Example Problem
                  massca

                  Hi,

                  I got the problem also on XDK 2571 (for OSX). The manual installation workaround works but I hope Intel will fix this BUG soon.