Error running sample project

Guys im trying to run the sample project on a Windows 10 machine. Im using node.js as development tool. Once i try to run the code following error appears

C:\Users\jorgjime\Documents\JJIMENEZ\Apps\Node\node_modules\ffi\lib\dynamic_library.js:74
    throw new Error('Dynamic Linking Error: ' + err)
    ^

Error: Dynamic Linking Error: Win32 error 126
    at new DynamicLibrary (C:\Users\jorgjime\Documents\JJIMENEZ\Apps\Node\node_modules\ffi\lib\dynamic_library.js:74:11)
    at Object.Library (C:\Users\jorgjime\Documents\JJIMENEZ\Apps\Node\node_modules\ffi\lib\library.js:45:12)
    at Object.<anonymous> (C:\Users\jorgjime\Documents\JJIMENEZ\Apps\Node\node_modules\metawear\MetaWear-SDK-Cpp\bindings\javascript\cbindings.js:667:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

I followed all the steps to install metawear (windows-build-tools, node-gyp, bluetooth-hci-socket, metawear) but seems to have a linking problem

Any ideas would be really appreciated

Thanks 

Comments

  • What are the contents of the "libmetawear-path" file?
  • Hello

    You mean the lib folder (D:\Apps\Node\node_modules\metawear\MetaWear-SDK-Cpp\dist\release\lib\x64) ?

    This is what i got 

    libmetawear.so
    libmetawear.so.0
    libmetawear.so.0.10.0

    Appreciate your comments

    Regards
  • Another question, i needed to install the JS/C++ version a Cygwin with proper make executable due to the following script
    "scripts": {
    "install": "make OPT_FLAGS=-Wno-strict-aliasing -C MetaWear-SDK-Cpp/ -j",
    "uninstall": "make -C MetaWear-SDK-Cpp/ clean",
    "pretest": "jshint *.js lib/. test/.",
    "test": "mocha"
    }
    Is there any other way to install the Js/c++ version (using visual studio compiler or something similar?)

  • No, I meant the "libmetawear-path" file which I presume was non-existent before.  

    The C++ project has MSBuild files that can build the library with VS2017 however all of the testing we've done so far for the node package were on *nix systems.
  • Thanks Eric, I recreated project in a Ubuntu vm , everything ran and compiled... once i try to run example test i got

    /home/osboxes/nodeapp/node_modules/metawear/lib/metawear.js:64
    Object.assign(MetaWear, cbindings);
           ^
    TypeError: Object function Object() { [native code] } has no method 'assign'
        at Object.<anonymous> (/home/osboxes/nodeapp/node_modules/metawear/lib/metawear.js:64:8)
        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)
        at require (module.js:380:17)
        at Object.<anonymous> (/home/osboxes/nodeapp/node_modules/metawear/index.js:1:78)
        at Module._compile (module.js:456:26)
        at Object.Module._extensions..js (module.js:474:10)


    Any ideas?

    Thanks
  • What version of nodejs are you using?
  • Thanks Eric, it finally worked. I´d like to ask you if you have some examples to retrieve data from other sensors, i only have example for accelerometer.

    Thanks in advance
  • No, those are the only examples we have in javascript.  You can checkout the C++ documentation for code snippets on the other sensors.


    The javascript SDK mirrors the C++ functions 1:1 down.
  • Thanks Eric, I was able to make the sensor work retrieving data, sometimes i got a problem and this error appears

    Error: Peripheral already connected

    Its an error from noble, do you know how to handle it properly in nodejs

    Thanks

    • How often does this problem appear?
    • Can you reliable reproduce the issue?
    • How were you using the board prior to receiving this error message
    You can try connecting to the board again or resetting the Bluetooth adapter.
  • Hello Eric, we’re using the device for demos . So if I take the device with my hand and hold it in the palm or in my fist to warm it up happens, also if put the device on a drawer to simulate lack of light happens too, these are the moments I can reproduce the issue
  • This sounds like this is an issue with Noble and it would be better to ask this question on the Noble GitHub page.  Before that, create a new JS project that only uses Noble to connect, perform a service discovery, then disconnect, and see if you get the same error as before.
This discussion has been closed.