adafruit-bluefruit-le-desktop icon indicating copy to clipboard operation
adafruit-bluefruit-le-desktop copied to clipboard

Simplified version for begginers ?

Open Yu-b opened this issue 7 years ago • 2 comments

Hi ! I've been able to connect my ble device with your software. I m trying to interact with my device directly through the console terminal with noble, but I ve not been able to succeed so far ...

Could you please provide the minimal code necessary to recognize ble devices and establish connection ?

That would help me a lot !!!

Yu-b avatar Apr 26 '17 14:04 Yu-b

It is great to have example code to start with. I too am new to a lot of this and am racing to try to learn the various types of languages and interfaces. I have been able to do a fair amount with the bluefruit via the arduino ide, and am familiar with visual studio, but have never used node.js.

I installed and followed all the instructions, however I get a ton of errors when I run npm install in the soruce directory. The error says it fails on "node-gyp rebuild" Below is the output when trying npm install.

After I can at least get it to compile and run on windows 10, I will start looking at the code to see if I can update it to my needs. What I really want is just a simple UART interface, of which I'm most familiar with Visual Studio C++ / C# and have been able to do arduino interface programs via the serial port.

Thanks for any help you can provide,

`D:\ble>npm install

[email protected] install D:\ble\node_modules\nslog node-gyp rebuild

D:\ble\node_modules\nslog>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. main.cc nslog_win.cc win_delay_load_hook.cc d:\ble\node_modules\nan\nan_new.h(34): warning C4996: 'v8::Value::ToInt32': was declared deprecated (compiling source file ..\src\main.cc ) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(8202): note: see declaration of 'v8::Value::ToInt32' (compiling source file ..\src\main .cc) d:\ble\node_modules\nan\nan_new.h(39): warning C4996: 'v8::Value::ToUint32': was declared deprecated (compiling source file ..\src\main.c c) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(8196): note: see declaration of 'v8::Value::ToUint32' (compiling source file ..\src\mai n.cc) d:\ble\node_modules\nan\nan_implementation_12_inl.h(49): warning C4996: 'v8::BooleanObject::New': was declared deprecated (compiling sour ce file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(4008): note: see declaration of 'v8::BooleanObject::New' (compiling source file ..\src
main.cc) d:\ble\node_modules\nan\nan_implementation_12_inl.h(166): warning C4996: 'v8::ScriptCompiler::Compile': was declared deprecated (compilin g source file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(1355): note: see declaration of 'v8::ScriptCompiler::Compile' (compiling source file .. \src\main.cc) d:\ble\node_modules\nan\nan_implementation_12_inl.h(173): warning C4996: 'v8::ScriptCompiler::Compile': was declared deprecated (compilin g source file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(1355): note: see declaration of 'v8::ScriptCompiler::Compile' (compiling source file .. \src\main.cc) d:\ble\node_modules\nan\nan_implementation_12_inl.h(205): warning C4996: 'v8::String::NewFromOneByte': was declared deprecated (compiling source file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(2336): note: see declaration of 'v8::String::NewFromOneByte' (compiling source file ..
src\main.cc) d:\ble\node_modules\nan\nan_implementation_12_inl.h(217): warning C4996: 'v8::String::NewExternal': was declared deprecated (compiling so urce file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(2373): note: see declaration of 'v8::String::NewExternal' (compiling source file ..\src \main.cc) d:\ble\node_modules\nan\nan_implementation_12_inl.h(237): warning C4996: 'v8::ScriptCompiler::CompileUnbound': was declared deprecated (c ompiling source file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(1336): note: see declaration of 'v8::ScriptCompiler::CompileUnbound' (compiling source file ..\src\main.cc) d:\ble\node_modules\nan\nan_implementation_12_inl.h(244): warning C4996: 'v8::ScriptCompiler::CompileUnbound': was declared deprecated (c ompiling source file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(1336): note: see declaration of 'v8::ScriptCompiler::CompileUnbound' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(262): error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)': function template has already been defined (compiling source file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(255): note: see declaration of '_NanEnsureLocal' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(288): warning C4996: 'v8::Isolate::IdleNotification': was declared deprecated (compiling source file ..\src \main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(6115): note: see declaration of 'v8::Isolate::IdleNotification' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(472): error C2039: 'GCEpilogueCallback': is not a member of 'v8::Isolate' (compiling source file ..\src\mai n.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(5443): note: see declaration of 'v8::Isolate' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(472): error C2065: 'GCEpilogueCallback': undeclared identifier (compiling source file ..\src\main.cc) [D:\b le\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(473): error C2146: syntax error: missing ')' before identifier 'callback' (compiling source file ..\src\mai n.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(473): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\main.cc) [D:\ble\node _modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(473): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\main .cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(478): error C2039: 'GCEpilogueCallback': is not a member of 'v8::Isolate' (compiling source file ..\src\mai n.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(5443): note: see declaration of 'v8::Isolate' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(478): error C2065: 'GCEpilogueCallback': undeclared identifier (compiling source file ..\src\main.cc) [D:\b le\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(478): error C2146: syntax error: missing ')' before identifier 'callback' (compiling source file ..\src\mai n.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(478): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\main.cc) [D:\ble\node _modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(478): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\main .cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(483): error C2039: 'GCPrologueCallback': is not a member of 'v8::Isolate' (compiling source file ..\src\mai n.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(5443): note: see declaration of 'v8::Isolate' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(483): error C2065: 'GCPrologueCallback': undeclared identifier (compiling source file ..\src\main.cc) [D:\b le\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(484): error C2146: syntax error: missing ')' before identifier 'callback' (compiling source file ..\src\mai n.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(484): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\main.cc) [D:\ble\node _modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(484): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\main .cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(489): error C2039: 'GCPrologueCallback': is not a member of 'v8::Isolate' (compiling source file ..\src\mai n.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(5443): note: see declaration of 'v8::Isolate' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(489): error C2065: 'GCPrologueCallback': undeclared identifier (compiling source file ..\src\main.cc) [D:\b le\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(489): error C2146: syntax error: missing ')' before identifier 'callback' (compiling source file ..\src\mai n.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(489): error C2143: syntax error: missing ';' before '{' (compiling source file ..\src\main.cc) [D:\ble\node _modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(489): error C2447: '{': missing function header (old-style formal list?) (compiling source file ..\src\main .cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(660): error C3083: 'smalloc': the symbol to the left of a '::' must be a type (compiling source file ..\src \main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(660): error C2039: 'FreeCallback': is not a member of 'node' (compiling source file ..\src\main.cc) [D:\ble \node_modules\nslog\build\nslog.vcxproj] C:\Users\Zac.node-gyp\6.10.3\include\node\node_object_wrap.h(8): note: see declaration of 'node' (compiling source file ..\src\main.cc ) D:\ble\node_modules\nan\nan.h(660): error C2061: syntax error: identifier 'FreeCallback' (compiling source file ..\src\main.cc) [D:\ble\n ode_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(664): error C2065: 'callback': undeclared identifier (compiling source file ..\src\main.cc) [D:\ble\node_mo dules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(664): error C2065: 'hint': undeclared identifier (compiling source file ..\src\main.cc) [D:\ble\node_module s\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(671): error C2665: 'node::Buffer::New': none of the 4 overloads could convert all the argument types (compi ling source file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] C:\Users\Zac.node-gyp\6.10.3\include\node\node_buffer.h(46): note: could be 'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate *,char *,std::size_t)' (compiling source file ..\src\main.cc) C:\Users\Zac.node-gyp\6.10.3\include\node\node_buffer.h(34): note: or 'v8::MaybeLocalv8::Object node::Buffer::New(v8::Isolate *,v8::Localv8::String,node::encoding)' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(671): note: while trying to match the argument list '(v8::Isolate *, const char *, uint32_t)' (compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(675): error C2440: 'return': cannot convert from 'v8::MaybeLocalv8::Object' to 'v8::Localv8::Object' (c ompiling source file ..\src\main.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(675): note: No constructor could take the source type, or constructor overload resolution was ambiguous ( compiling source file ..\src\main.cc) D:\ble\node_modules\nan\nan.h(682): error C2039: 'Use': is not a member of 'node::Buffer' (compiling source file ..\src\main.cc) [D:\ble
node_modules\nslog\build\nslog.vcxproj] C:\Users\Zac.node-gyp\6.10.3\include\node\node_buffer.h(11): note: see declaration of 'node::Buffer' (compiling source file ..\src\mai n.cc) D:\ble\node_modules\nan\nan.h(682): error C3861: 'Use': identifier not found (compiling source file ..\src\main.cc) [D:\ble\node_modules
nslog\build\nslog.vcxproj] D:\ble\node_modules\nan\nan.h(709): warning C4996: 'v8::ScriptCompiler::Compile': was declared deprecated (compiling source file ..\src\m ain.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(1355): note: see declaration of 'v8::ScriptCompiler::Compile' (compiling source file .. \src\main.cc) D:\ble\node_modules\nan\nan.h(716): warning C4996: 'v8::ScriptCompiler::Compile': was declared deprecated (compiling source file ..\src\m ain.cc) [D:\ble\node_modules\nslog\build\nslog.vcxproj] c:\users\zac.node-gyp\6.10.3\include\node\v8.h(1355): note: see declaration of 'v8::ScriptCompiler::Compile' (compiling source file .. \src\main.cc) gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Windows_NT 10.0.14393 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\ble\node_modules\nslog gyp ERR! node -v v6.10.3 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v6.10.3 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the nslog package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs nslog npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls nslog npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! D:\ble\npm-debug.log`

zschramm avatar May 25 '17 21:05 zschramm

same here, kurento libs trigger the error

alessandrov avatar Feb 15 '18 11:02 alessandrov