Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. Problem beim Einbinden eines node.js Adapters

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Problem beim Einbinden eines node.js Adapters

    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Boardy last edited by

      Hallo,
      da es für NanoDmx noch nichts gibt hab ich mich mal dran gemacht einen Adapter zu machen... Alles Neuland für mich - ich hoffe das wird was...
      und falls ich grundlegende Fehler mache bin ich für jeden Tip dankbar ...

      IoBroker Läuft in einer Docker Instanz auf dem Nas, Mein Rechner unter Windows 10 - offensichtlich keine optimale Kombination...

      Also als erste das Yotube Turorial von dmxface nachgebaut bis ich einen "installierebaren Adapter " hatte... Logik kommt später... nun dachte ich, man kann einfach in den Dependecies den dmx Node ergänzen?
      "dependencies": {
      "@iobroker/adapter-core": "^1.0.3",
      "dmx": "^0.0.6",
      "serialport": "^9.0.2" <--Macht keinen unterschied wenn ich das weglasse...
      },

      Jedoch kommte es dann beim Laden zu gyp?? Fehlern die ich nicht verstehe...
      Hier unter Windows

      gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.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:194:23)
      gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
      gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
      gyp ERR! System Windows_NT 10.0.18363
      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:\Projekte\GitHub\ioBroker.nanodmx\node_modules\dmx\node_modules\serialport
      gyp ERR! node -v v12.18.4
      gyp ERR! node-gyp -v v5.1.0
      gyp ERR! not ok
      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! serialport@6.2.2 install: `prebuild-install || node-gyp rebuild`
      npm ERR! Exit status 1
      


      und hier bei der Installation im IOBroker

      gyp ERR! System Linux 4.4.59+
      gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"gyp ERR! cwd /opt/iobroker/node_modules/dmx/node_modules/serialportgyp
       ERR! node -v v12.19.0gyp ERR! node-gyp -v v5.1.0gyp ERR! not ok
       
      npm
       ERR! code ELIFECYCLEnpm ERR! errno 1
      


      hier das ganze IOBroker Log:

      [s=]
      $ ./iobroker url "https://github.com/Bordman-ger/ioBroker.nanodmx.git" --debug
      install https://github.com/Bordman-ger/ioBroker.nanodmx/tarball/c107c301493fd4451565a7ac7b25ec801ee934fb
      NPM version: 6.14.8
      npm install https://github.com/Bordman-ger/ioBroker.nanodmx/tarball/c107c301493fd4451565a7ac7b25ec801ee934fb --loglevel error --prefix "/opt/iobroker" (System call)
      > serialport@6.2.2 install /opt/iobroker/node_modules/dmx/node_modules/serialport> prebuild-install || node-gyp rebuild
      make: Verzeichnis „/opt/iobroker/node_modules/dmx/node_modules/serialport/build“ wird betreten
        CXX(target) Release/obj.target/serialport/src/serialport.o
      In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:../../../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)                                                              ^
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:41:48: error: no matching function for call to ‘v8::Value::ToString()’   v8::String::Utf8Value path(info[0]->ToString());                                                ^In file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2668:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(                                            ^~~~~~~~
      /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2668:44: note:   candidate expects 1 argument, 0 providedIn file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8-internal.h:14,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:27,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2684:31: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’                 Local<String> ToString(Isolate* isolate) const);                               ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2684:31: note:   candidate expects 1 argument, 0 provided                 Local<String> ToString(Isolate* isolate) const);                               ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~../src/serialport.cpp:48:53: error: no matching function for call to ‘v8::Value::ToObject()’   v8::Local<v8::Object> options = info[1]->ToObject();                                                     ^In file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2672:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(                                            ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2672:44: note:   candidate expects 1 argument, 0 providedIn file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8-internal.h:14,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:27,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2686:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’                 Local<Object> ToObject(Isolate* isolate) const);                               ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2686:31: note:   candidate expects 1 argument, 0 provided                 Local<Object> ToObject(Isolate* isolate) const);                               ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~
      ../src/serialport.cpp:78:69: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]   uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen);                                                                     ^~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘void EIO_AfterOpen(uv_work_t*)’:../src/serialport.cpp:95:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]   data->callback.Call(2, argv);                              ^In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h:1742:3: note: declared here   Call(int argc, v8::Local<v8::Value> argv[]) const {   ^~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:113:53: error: no matching function for call to ‘v8::Value::ToObject()’   v8::Local<v8::Object> options = info[1]->ToObject();                                                     ^
      In file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2672:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(                                            ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2672:44: note:   candidate expects 1 argument, 0 providedIn file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8-internal.h:14,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:27,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2686:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’                 Local<Object> ToObject(Isolate* isolate) const);                               ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2686:31: note:   candidate expects 1 argument, 0 provided                 Local<Object> ToObject(Isolate* isolate) const);                               ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~
      ../src/serialport.cpp:135:71: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]   uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate);                                                                       ^~~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘void EIO_AfterUpdate(uv_work_t*)’:../src/serialport.cpp:150:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]   data->callback.Call(1, argv);                              ^In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h:1742:3: note: declared here   Call(int argc, v8::Local<v8::Value> argv[]) const {   ^~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:175:70: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]   uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose);                                                                      ^~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘void EIO_AfterClose(uv_work_t*)’:../src/serialport.cpp:188:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]   data->callback.Call(1, argv);                              ^
      In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h:1742:3: note: declared here   Call(int argc, v8::Local<v8::Value> argv[]) const {   ^~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:215:70: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]   uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush);                                                                      ^~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘void EIO_AfterFlush(uv_work_t*)’:../src/serialport.cpp:231:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]   data->callback.Call(1, argv);                              ^
      In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h:1742:3: note: declared here   Call(int argc, v8::Local<v8::Value> argv[]) const {   ^~~~../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:250:53: error: no matching function for call to ‘v8::Value::ToObject()’   v8::Local<v8::Object> options = info[1]->ToObject();                                                     ^
      In file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2672:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(                                            ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2672:44: note:   candidate expects 1 argument, 0 providedIn file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8-internal.h:14,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:27,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2686:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’                 Local<Object> ToObject(Isolate* isolate) const);                               ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:2686:31: note:   candidate expects 1 argument, 0 provided                 Local<Object> ToObject(Isolate* isolate) const);                               ^~~~~~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~
      ../src/serialport.cpp:270:68: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]   uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet);                                                                    ^~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘void EIO_AfterSet(uv_work_t*)’:../src/serialport.cpp:285:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]   data->callback.Call(1, argv);                              ^In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h:1742:3: note: declared here   Call(int argc, v8::Local<v8::Value> argv[]) const {   ^~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:314:68: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]   uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet);                                                                    ^~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘void EIO_AfterGet(uv_work_t*)’:../src/serialport.cpp:329:96: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]     results->Set(Nan::New<v8::String>("cts").ToLocalChecked(), Nan::New<v8::Boolean>(data->cts));                                                                                                ^
      In file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8-internal.h:14,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:27,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:3499:22: note: declared here                 bool Set(Local<Value> key, Local<Value> value));                      ^~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~../src/serialport.cpp:330:96: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]     results->Set(Nan::New<v8::String>("dsr").ToLocalChecked(), Nan::New<v8::Boolean>(data->dsr));                                                                                                ^In file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8-internal.h:14,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:27,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:3499:22: note: declared here                 bool Set(Local<Value> key, Local<Value> value));                      ^~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~
      ../src/serialport.cpp:331:96: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]     results->Set(Nan::New<v8::String>("dcd").ToLocalChecked(), Nan::New<v8::Boolean>(data->dcd));                                                                                                ^In file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8-internal.h:14,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:27,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:3499:22: note: declared here                 bool Set(Local<Value> key, Local<Value> value));                      ^~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~../src/serialport.cpp:336:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]   data->callback.Call(2, argv);                              ^In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h:1742:3: note: declared here   Call(int argc, v8::Local<v8::Value> argv[]) const {   ^~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:363:76: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]   uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate);                                                                            ^~~~~~~~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘void EIO_AfterGetBaudRate(uv_work_t*)’:../src/serialport.cpp:378:106: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]     results->Set(Nan::New<v8::String>("baudRate").ToLocalChecked(), Nan::New<v8::Integer>(data->baudRate));                                                                                                          ^In file included from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8-internal.h:14,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:27,                 from /opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:67,                 from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8.h:3499:22: note: declared here                 bool Set(Local<Value> key, Local<Value> value));                      ^~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’   declarator __attribute__((deprecated(message)))   ^~~~~~~~~~
      ../src/serialport.cpp:383:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]   data->callback.Call(2, argv);                              ^In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h:1742:3: note: declared here   Call(int argc, v8::Local<v8::Value> argv[]) const {   ^~~~
      ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:409:70: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]   uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain);                                                                      ^~~~~~~~~~~~~~
      ../src/serialport.cpp: In function ‘void EIO_AfterDrain(uv_work_t*)’:../src/serialport.cpp:424:30: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated [-Wdeprecated-declarations]   data->callback.Call(1, argv);                              ^
      In file included from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../../../../nan/nan.h:1742:3: note: declared here   Call(int argc, v8::Local<v8::Value> argv[]) const {   ^~~~../src/serialport.cpp: At global scope:../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses] SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {                            ^
      ../src/serialport.cpp:449:30: warning: unnecessary parentheses in declaration of ‘ToStopBitEnum’ [-Wparentheses] SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {                              ^
      ../src/serialport.cpp:460:17: error: variable or field ‘init’ declared void   void init(v8::Handle<v8::Object> target) {                 ^~~~~~../src/serialport.cpp:460:17: error: ‘Handle’ is not a member of ‘v8’
      ../src/serialport.cpp:460:34: error: expected primary-expression before ‘>’ token   void init(v8::Handle<v8::Object> target) {                                  ^
      ../src/serialport.cpp:460:36: error: ‘target’ was not declared in this scope   void init(v8::Handle<v8::Object> target) {                                    ^~~~~~
      ../src/serialport.cpp:460:36: note: suggested alternative: ‘tzset’   void init(v8::Handle<v8::Object> target) {                                    ^~~~~~                                    tzset
      In file included from ../../../../nan/nan.h:56,                 from ../src/./serialport.h:6,                 from ../src/serialport.cpp:1:../src/serialport.cpp:485:25: error: ‘init’ was not declared in this scope NODE_MODULE(serialport, init);                         ^~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:727:36: note: in definition of macro ‘NODE_MODULE_X’       (node::addon_register_func) (regfunc),                          \                                    ^~~~~~~../src/serialport.cpp:485:1: note: in expansion of macro ‘NODE_MODULE’ NODE_MODULE(serialport, init); ^~~~~~~~~~~
      ../src/serialport.cpp:485:25: note: suggested alternative: ‘int’ NODE_MODULE(serialport, init);                         ^~~~/opt/iobroker/.cache/node-gyp/12.19.0/include/node/node.h:727:36: note: in definition of macro ‘NODE_MODULE_X’       (node::addon_register_func) (regfunc),                          \                                    ^~~~~~~../src/serialport.cpp:485:1: note: in expansion of macro ‘NODE_MODULE’ NODE_MODULE(serialport, init); ^~~~~~~~~~~
      make: *** [serialport.target.mk:114: Release/obj.target/serialport/src/serialport.o] Fehler 1
      make: Verzeichnis „/opt/iobroker/node_modules/dmx/node_modules/serialport/build“ wird verlassen
      gyp
       ERR! build error 
      gyp 
      ERR! stack Error: `make` failed with exit code: 2gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)gyp ERR! stack     at ChildProcess.emit (events.js:314:20)gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
      gyp ERR! System Linux 4.4.59+
      gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"gyp ERR! cwd /opt/iobroker/node_modules/dmx/node_modules/serialportgyp
       ERR! node -v v12.19.0gyp ERR! node-gyp -v v5.1.0gyp ERR! not ok
       
      npm
       ERR! code ELIFECYCLEnpm ERR! errno 1
      npm ERR!
       serialport@6.2.2 install: `prebuild-install || node-gyp rebuild`npm ERR! Exit status 1npm ERR! npm ERR! Failed at the serialport@6.2.2 install script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
      
      npm ERR! A complete log of this run can be found in:npm ERR!     /opt/iobroker/.npm/_logs/2020-10-17T12_29_11_056Z-debug.log
      ERROR: host.iobroker_test Cannot install https://github.com/Bordman-ger/ioBroker.nanodmx/tarball/c107c301493fd4451565a7ac7b25ec801ee934fb: 1
      ERROR: process exited with code 25
      


      Was ist der Grund für den Fehler?
      Kann ich die dependencies nicht einfach erweitern?

      Bzw wie geht man sonst vor wenn man einen vorhandene node.js einbinden will

      dmx liegt hier:
      https://github.com/node-dmx/dmx

      Mein Repo hier:
      https://github.com/Bordman-ger/ioBroker.nanodmx

      Ich Danke euch...

      UncleSam 2 Replies Last reply Reply Quote 0
      • UncleSam
        UncleSam Developer @Boardy last edited by

        @Boardy Wenn das Nano DMX dieselbe USB Schnittstelle hat wie mein DMX USB Dongle, dann schau doch mal da rein: https://github.com/UncleSamSwiss/ioBroker.udmx

        Kann noch nicht viel, aber wir könnten das zusammen erweitern.

        PS: der Adapter entspricht nicht den neusten Anforderungen für Adapter Entwicklung - wenn du ein gutes Beispiel willst, nimmst du lieber meinen Loxone Adapter.

        B 1 Reply Last reply Reply Quote 0
        • UncleSam
          UncleSam Developer @Boardy last edited by

          @Boardy sagte in Problem beim Einbinden eines node.js Adapters:

          Was ist der Grund für den Fehler?

          Grundsätzlich hast du wohl alles richtig gemacht, allerdings ist das mit Node und Windows immer so eine Sache. In diesem Fall hat er Probleme serialport zu kompilieren. Wirst du es später auch unter Windows benutzen wollen, oder ist das nur deine Entwicklungsumgebung? Was benutzt du als IDE? Mein Vorschlag wäre sonst: VS Code und Devcontainer.

          B 1 Reply Last reply Reply Quote 0
          • B
            Boardy @UncleSam last edited by Boardy

            @UncleSam deinen Adapter schaue ich mir morgen an...

            Das Windows log war nur Spielerei aber auf dem NAS (Synology) kommt ja was ähnliches also nicht Windows spezifisch... Meine IDE ist noch nicht gut, VSCode hab ich mir heute auch ausgeguckt, Devcontainer kenn ich nicht? Docker unter Windows? muss ich morgen mal ausgiebiger suchen... momentan schieb ich alles auf Github und installiere von dort im IoBrocker auf dem NAS - zum Debuggen natürlich keine Lösung... wie gesagt, komplett alles Neuland (-:

            Und deinen Loxone Adapter schau ich mir auch an - Danke

            1 Reply Last reply Reply Quote 0
            • B
              Boardy @UncleSam last edited by

              @UncleSam sagte in Problem beim Einbinden eines node.js Adapters:

              Kann noch nicht viel, aber wir könnten das zusammen erweitern.

              Ja das sieht doch schon super aus - wüsste jetzt nicht warum das nicht gehen soll? Mir ist dein Daten-Interface zwar noch nicht klar, aber ich will letztlich auch nur Daten vom Homeserver auf den Controller durchreichen, benötige also nur paar Datenpunkte...

              Ich hab mal versucht das nun anzupassen und verstehe im Moment nicht wieso die Fehlermeldung weiterhin kommt
              ade9f4b8-dc1f-4d6a-b12e-344a3c25c5bc-grafik.png
              96b80ffb-921e-4be2-8784-457a68e05664-grafik.png
              66a0742e-e577-45a3-b281-c4bbcbb703a4-grafik.png

              Liegt das ggf an meinem USB Hub das er ihn nicht findet?

              root@IOBroker:/opt/iobroker# udevadm info --name=/dev/ttyACM0 --attribute-walk
              
              Udevadm info starts with the device specified by the devpath and then
              walks up the chain of parent devices. It prints for every device
              found, all possible attributes in the udev rules key format.
              A rule to match, can be composed by the attributes of the device
              and the attributes from one single parent device.
              
                looking at device '/devices/pci0000:00/0000:00:15.0/usb1/1-2/1-2.3/1-2.3:1.0/tty/ttyACM0':
                  KERNEL=="ttyACM0"
                  SUBSYSTEM=="tty"
                  DRIVER==""
              
                looking at parent device '/devices/pci0000:00/0000:00:15.0/usb1/1-2/1-2.3/1-2.3:1.0':
                  KERNELS=="1-2.3:1.0"
                  SUBSYSTEMS=="usb"
                  DRIVERS=="cdc_acm"
                  ATTRS{bmCapabilities}=="6"
                  ATTRS{bInterfaceProtocol}=="01"
                  ATTRS{bInterfaceSubClass}=="02"
                  ATTRS{bNumEndpoints}=="01"
                  ATTRS{supports_autosuspend}=="1"
                  ATTRS{bAlternateSetting}==" 0"
                  ATTRS{bInterfaceClass}=="02"
                  ATTRS{bInterfaceNumber}=="00"
                  ATTRS{authorized}=="1"
              
                looking at parent device '/devices/pci0000:00/0000:00:15.0/usb1/1-2/1-2.3':
                  KERNELS=="1-2.3"
                  SUBSYSTEMS=="usb"
                  DRIVERS=="usb"
                  ATTRS{idVendor}=="03eb"
                  ATTRS{version}==" 2.00"
                  ATTRS{syno_quirks}=="0x0"
                  ATTRS{speed}=="12"
                  ATTRS{urbnum}=="12"
                  ATTRS{removable}=="unknown"
                  ATTRS{ltm_capable}=="no"
                  ATTRS{bConfigurationValue}=="1"
                  ATTRS{bcdDevice}=="0100"
                  ATTRS{bDeviceSubClass}=="00"
                  ATTRS{bDeviceClass}=="02"
                  ATTRS{busnum}=="1"
                  ATTRS{devpath}=="2.3"
                  ATTRS{avoid_reset_quirk}=="0"
                  ATTRS{product}=="NanoDMX Interface"
                  ATTRS{bNumInterfaces}==" 2"
                  ATTRS{bNumConfigurations}=="1"
                  ATTRS{configuration}==""
                  ATTRS{authorized}=="1"
                  ATTRS{idProduct}=="2018"
                  ATTRS{bMaxPacketSize0}=="32"
                  ATTRS{devnum}=="11"
                  ATTRS{serial}=="ffffffd1ffffffb2ffffffd3ffffffb5"
                  ATTRS{bmAttributes}=="80"
                  ATTRS{manufacturer}=="DMX4ALL"
                  ATTRS{quirks}=="0x0"
                  ATTRS{bDeviceProtocol}=="00"
                  ATTRS{syno_vbus_reset}=="0"
                  ATTRS{bMaxPower}=="250mA"
                  ATTRS{maxchild}=="0"
              
                looking at parent device '/devices/pci0000:00/0000:00:15.0/usb1/1-2':
                  KERNELS=="1-2"
                  SUBSYSTEMS=="usb"
                  DRIVERS=="usb"
                  ATTRS{authorized}=="1"
                  ATTRS{idVendor}=="0bda"
                  ATTRS{avoid_reset_quirk}=="0"
                  ATTRS{syno_quirks}=="0x0"
                  ATTRS{maxchild}=="4"
                  ATTRS{bDeviceClass}=="09"
                  ATTRS{syno_vbus_reset}=="4"
                  ATTRS{bMaxPower}=="0mA"
                  ATTRS{bDeviceProtocol}=="02"
                  ATTRS{devpath}=="2"
                  ATTRS{bNumConfigurations}=="1"
                  ATTRS{speed}=="480"
                  ATTRS{quirks}=="0x0"
                  ATTRS{idProduct}=="5411"
                  ATTRS{version}==" 2.10"
                  ATTRS{product}=="4-Port USB 2.0 Hub"
                  ATTRS{busnum}=="1"
                  ATTRS{bDeviceSubClass}=="00"
                  ATTRS{devnum}=="9"
                  ATTRS{serial}=="ffffffd6ffffffa3ffffffebffffffcb"
                  ATTRS{bMaxPacketSize0}=="64"
                  ATTRS{bConfigurationValue}=="1"
                  ATTRS{urbnum}=="59"
                  ATTRS{bcdDevice}=="0121"
                  ATTRS{removable}=="removable"
                  ATTRS{manufacturer}=="Generic"
                  ATTRS{bNumInterfaces}==" 1"
                  ATTRS{bmAttributes}=="e0"
                  ATTRS{configuration}==""
                  ATTRS{ltm_capable}=="no"
              
                looking at parent device '/devices/pci0000:00/0000:00:15.0/usb1':
                  KERNELS=="usb1"
                  SUBSYSTEMS=="usb"
                  DRIVERS=="usb"
                  ATTRS{version}==" 2.00"
                  ATTRS{idVendor}=="1d6b"
                  ATTRS{devnum}=="1"
                  ATTRS{interface_authorized_default}=="1"
                  ATTRS{bConfigurationValue}=="1"
                  ATTRS{syno_vbus_reset}=="9"
                  ATTRS{serial}=="0000:00:15.0"
                  ATTRS{bMaxPower}=="0mA"
                  ATTRS{authorized}=="1"
                  ATTRS{quirks}=="0x0"
                  ATTRS{bMaxPacketSize0}=="64"
                  ATTRS{syno_quirks}=="0x0"
                  ATTRS{bDeviceProtocol}=="01"
                  ATTRS{bDeviceSubClass}=="00"
                  ATTRS{configuration}==""
                  ATTRS{manufacturer}=="Linux 4.4.59+ xhci-hcd"
                  ATTRS{product}=="xHCI Host Controller"
                  ATTRS{speed}=="480"
                  ATTRS{devpath}=="0"
                  ATTRS{maxchild}=="9"
                  ATTRS{removable}=="unknown"
                  ATTRS{urbnum}=="243"
                  ATTRS{avoid_reset_quirk}=="0"
                  ATTRS{bDeviceClass}=="09"
                  ATTRS{bNumInterfaces}==" 1"
                  ATTRS{bmAttributes}=="e0"
                  ATTRS{bcdDevice}=="0404"
                  ATTRS{ltm_capable}=="no"
                  ATTRS{idProduct}=="0002"
                  ATTRS{authorized_default}=="1"
                  ATTRS{busnum}=="1"
                  ATTRS{bNumConfigurations}=="1"
              
                looking at parent device '/devices/pci0000:00/0000:00:15.0':
                  KERNELS=="0000:00:15.0"
                  SUBSYSTEMS=="pci"
                  DRIVERS=="xhci_hcd"
                  ATTRS{devspec}==""
                  ATTRS{enable}=="1"
                  ATTRS{consistent_dma_mask_bits}=="64"
                  ATTRS{local_cpulist}=="0-3"
                  ATTRS{subsystem_vendor}=="0x0000"
                  ATTRS{driver_override}=="(null)"
                  ATTRS{local_cpus}=="f"
                  ATTRS{class}=="0x0c0330"
                  ATTRS{d3cold_allowed}=="1"
                  ATTRS{broken_parity_status}=="0"
                  ATTRS{msi_bus}=="1"
                  ATTRS{dma_mask_bits}=="64"
                  ATTRS{subsystem_device}=="0x0000"
                  ATTRS{irq}=="343"
                  ATTRS{device}=="0x31a8"
                  ATTRS{vendor}=="0x8086"
              
                looking at parent device '/devices/pci0000:00':
                  KERNELS=="pci0000:00"
                  SUBSYSTEMS==""
                  DRIVERS==""
              

              B 1 Reply Last reply Reply Quote 0
              • B
                Boardy @Boardy last edited by Boardy

                Ich hatte die beiden Module aus dem Readme vergessen...

                Per PACKAGES nachgalden: build-essential libudev-dev

                nun bekomme ich im Container log den Fehler :
                9c747eb9-0f49-437f-9f40-b8c554b178b4-grafik.png

                Was kann da klemmen?

                UncleSam 1 Reply Last reply Reply Quote 0
                • UncleSam
                  UncleSam Developer @Boardy last edited by

                  @Boardy sagte in Problem beim Einbinden eines node.js Adapters:

                  Was kann da klemmen?

                  Docker Container? Ist der "privileged"? Sonst hast du wahrscheinlich keinen Zugriff auf den USB des Host.

                  B 1 Reply Last reply Reply Quote 0
                  • B
                    Boardy @UncleSam last edited by

                    @UncleSam Ja das macht Sinn, ich habe es Dank buanet hinbekommen die Devices durchzureichen ohne priviligierten Container, aber node-usb greift ja gar nicht über die devices zu sonder geht auf den host - muss mal sehen ob ich das auch durchreichen kann - privilegiert kommt bei mir nicht in frage... hab es Testweise gerade mal abgeschaltet, da ist zumindest dieser Fehler weg aber es kommen andere - ich glaube ich setzte mien IOBroker erst mal neu auf mittels Best Practic clean istall und dann teste ich mal weiter.

                    B 1 Reply Last reply Reply Quote 0
                    • B
                      Boardy @Boardy last edited by Boardy

                      Hier noch mal das log in hübsch nachdem ich alles neu aufgesetzt habe... wer versteht wo das Problem liegt und wie man es beheben kann?
                      Scheint ja irgendwie an der alten serialport zu liegen - weiß aber gar nicht wo die herkommt...

                      2020-10-23T11_36_11_272Z-debug.log

                      B 1 Reply Last reply Reply Quote 0
                      • B
                        Boardy @Boardy last edited by Boardy

                        Nachdem ich nun noch mal eine IOBrocker instanz mit Node Version
                        node: v10.20.0 npm: 6.14.4 aufgesetzt habe
                        klappt die Installation - es liegt also vermutlich an Node 12.xxx.

                        B 1 Reply Last reply Reply Quote 0
                        • B
                          Boardy @Boardy last edited by

                          Hallo,
                          ich habe nun kräftig umgebaut, bin auf Visual Studio Code umgestiegen, mir dem Generator den Adamter neu angelegt habe auf Typescript umgestellt und hänge nun an dem Aufruf der externen Klasse...
                          Kann mir da jemand eine Tip geben? Kann ich für diese Klasse Typescript deaktivieren?
                          es gibt noch kein declaration module - war wohl etwas ungeschickt gleich auf Typescript zu gehen...

                          Eine Frage zum Debuggen mit devcontainer: da ich den USB Stick im Keller fest verkabelt habe macht es wenig Sinn diesem am lokalen PC zu testen... komme ich ohne Devcontainer weiter oder ist das zu mühsam um sinnvoll was zu machen? (z.B. Status ins Log schreiben geht ja wohl)
                          Meine Typescript Version liegt unter
                          https://github.com/Bordman-ger/ioBroker.nanodmx2.git

                          Ich hatte auch schon versucht, die dmx Files mit in meien Adapter reinzunehmen aber da komme ich in teufels Küche... (daher sind die files aktuell aber noch im Git)

                          Uwe

                          UncleSam 1 Reply Last reply Reply Quote 0
                          • UncleSam
                            UncleSam Developer @Boardy last edited by UncleSam

                            @Boardy sagte in Problem beim Einbinden eines node.js Adapters:

                            es gibt noch kein declaration module - war wohl etwas ungeschickt gleich auf Typescript zu gehen...

                            Kannst du problemlos selber schreiben: z.B. eine Datei "dmx.d.ts" erstellen und dort die Definitionen selber schreiben.
                            Oder du belässt einfach alles bei any und hast (wie in JavaScript) keine Typenprüfung.

                            Eine Frage zum Debuggen mit devcontainer: da ich den USB Stick im Keller fest verkabelt habe macht es wenig Sinn diesem am lokalen PC zu testen... komme ich ohne Devcontainer weiter oder ist das zu mühsam um sinnvoll was zu machen? (z.B. Status ins Log schreiben geht ja wohl)

                            Devcontainer und USB sind nicht gerade die besten Freunde. Insbesondere unter Windows nicht.

                            Es gibt mehrere Möglichkeiten:

                            • du kopierst jeweils deinen Code per WinSCP auf das Gerät, wo der USB-Stick angeschlossen ist
                            • du lädst alles auf GitHub und installierst dann auf dem Gerät via GitHub URL den aktuellsten Stand
                            • du schreibst dir einen kleinen RPC Server/Client und arbeitest "remote": https://github.com/UncleSamSwiss/ioBroker.i2c/tree/master/src/debug

                            Ich hatte auch schon versucht, die dmx Files mit in meien Adapter reinzunehmen aber da komme ich in teufels Küche... (daher sind die files aktuell aber noch im Git)

                            Würde ich nie machen; dafür gibt es ja schliesslich NPM und Node Module.

                            Wieso heisst dein Adapter übrigens "nanodmx2"? Ich würde den dann noch umbenennen.

                            B 1 Reply Last reply Reply Quote 0
                            • B
                              Boardy @UncleSam last edited by Boardy

                              @UncleSam nanaodmx2 weil das die Typescript Variante ist... ja wird natürlich umbenannt wollte nur nicht alles parallel schrotten...

                              Dann versuch ich mich mal mit der Datei "dmx.d.ts" da kann ich ja bei dir im Loxone bischen spicken (-.

                              Ich gehe aktuell den Weg über Git und Adapter install - klappt ganz gut

                              UncleSam 1 Reply Last reply Reply Quote 0
                              • UncleSam
                                UncleSam Developer @Boardy last edited by

                                @Boardy sagte in Problem beim Einbinden eines node.js Adapters:

                                da kann ich ja bei dir im Loxone bischen spicken

                                Ja, gibt nicht gerade viel zu sehen 😄 Ich habe mir das Leben ehrlich gesagt sehr einfach gemacht.

                                https://github.com/UncleSamSwiss/ioBroker.loxone/blob/master/src/node-lox-ws-api.d.ts

                                  declare module 'node-lox-ws-api';
                                

                                Das war's auch schon...

                                B 1 Reply Last reply Reply Quote 0
                                • B
                                  Boardy @UncleSam last edited by

                                  @UncleSam also kein gutes Beispiel? sorry zu viele neues und ich weiß nicht genau nach was ich suchen soll...
                                  Die Klassendefiniton sieht wie folgt aus:
                                  11867906-7a3b-429e-8b2e-417513eb01d4-grafik.png ![Bild Text](Bild Link)

                                  Ich würde zum start erst mal den weg mit any versuchen, aber wie genau muss ich dann den Typ deklarieren ?

                                  declare module "dmx"; <- passt das für eine Klasse?

                                  Ich habe nun mein Git aufgeräumt und bin wieder in
                                  https://github.com/Bordman-ger/ioBroker.nanodmx.git

                                  führt zu diversen Fehlern
                                  fa8ceef3-d297-4fa1-8e3f-42f80678069c-grafik.png

                                  passt das so und meine Fehler sind im Code meines main.js oder ist hier bei der Dekleration noch was falsch? Der Type Error deutet darauf hin?

                                  UncleSam AlCalzone 2 Replies Last reply Reply Quote 0
                                  • UncleSam
                                    UncleSam Developer @Boardy last edited by

                                    Hatte dasselbe Problem. Bei mir war die Lösung

                                    import * as loxoneWsApi from 'node-lox-ws-api';
                                    
                                    // ....
                                    
                                    client = new loxoneWsApi(/* ... */);
                                    

                                    Das kommt aber ganz darauf an, wie der Export bei der benutzten Library aussieht. Vielleicht kann uns @AlCalzone hier weiterhelfen?

                                    declare module sagt einfach: es gibt ein Modul. Was das Modul beinhaltet ist dann eben nicht festgelegt und damit ist alles "any".

                                    1 Reply Last reply Reply Quote 0
                                    • AlCalzone
                                      AlCalzone Developer @Boardy last edited by

                                      @Boardy @UncleSam Der TypeError deutet für mich darauf hin dass du das Paket falsch importierst oder falsch nutzt. Laut Anleitung:

                                      const DMX = require('dmx')
                                      

                                      was in TypeScript übersetzt wie folgt aussehen sollte (ein sog. Standard-Import):

                                      import DMX from "dmx";
                                      

                                      Die Form

                                      import * as DMX
                                      

                                      nutzt man, wenn das Modul mehrere Exporte hat, die du unter dem Namen DMX zusammenfassen möchtest.

                                      Dann gäbe es noch import { something } from "modul", welches nur den Export something importiert.

                                      B 1 Reply Last reply Reply Quote 1
                                      • B
                                        Boardy @AlCalzone last edited by

                                        Cool das hat nun funktioniert (-:

                                        @UncleSam sagte in Problem beim Einbinden eines node.js Adapters:

                                        • du lädst alles auf GitHub und installierst dann auf dem Gerät via GitHub URL den aktuellsten Stand

                                        Das ist für mich der schnellste weg... nun hab ich gesehen dass Visual Studio Code auch remote debuggen kann... geht das auch mit einem nicht privilegierten Container auf dem NAS?

                                        Aktuell hab ich die Syntaxfehler weg und er Adapter statet und stoppt auch gleich wieder... muss mich noch mal durch die adapterdoku wühlen und Beispiele ansehen... falls einer auf den ersten Blick sieht was schief geht wäre ein Hinweis nett (-:
                                        fdc75b78-cace-4582-8339-2176e7bd4f7b-grafik.png

                                        Gibt es vielleicht ein relativ triviales Type Script Besipiel an dem ich mich orientieren kann?
                                        Denke aber mein Hauptproblem ist die DMX Klasse richtig einzubinden...

                                        LG

                                        Uwe

                                        UncleSam 1 Reply Last reply Reply Quote 0
                                        • UncleSam
                                          UncleSam Developer @Boardy last edited by

                                          @Boardy sagte in Problem beim Einbinden eines node.js Adapters:

                                          nun hab ich gesehen dass Visual Studio Code auch remote debuggen kann... geht das auch mit einem nicht privilegierten Container auf dem NAS?

                                          Remote Debugging ist eine Funktionalität von nodejs, somit funktioniert das in jeder denkbaren Kombination.

                                          Die andere Variante, die ich auch schon gemacht habe, ist Remote VS Code. Damit läuft dein VS Code GUI auf deinem PC, aber der Rest von VS Code läuft direkt in der VM: https://code.visualstudio.com/docs/remote/ssh Ich benutze das zB zum auf dem Raspi zu entwickeln, so kann ich immer auf meinem Desktop PC bleiben und trotzdem ohne herum kopieren meinen Code direkt auf dem Raspi laufen lassen.

                                          Gibt es vielleicht ein relativ triviales Type Script Besipiel an dem ich mich orientieren kann?

                                          Mein einfachster Adapter in TypeScript ist:
                                          https://github.com/UncleSamSwiss/ioBroker.luxtronik2

                                          B 1 Reply Last reply Reply Quote 0
                                          • B
                                            Boardy @UncleSam last edited by

                                            @UncleSam Ich kämpfe noch damit, im Docker container SSH zum laufen zu bringen... (BUANET) aber das habe ich an anderer Stelle adressiert...

                                            Ich wäre schon glücklich wenn mein Adapter mal was ins Log schreibt - hast du ne Idee warum der gleich wieder beendet?
                                            https://github.com/Bordman-ger/ioBroker.nanodmx.git

                                            Fehlt wohl noch irgend was elementares - ich halte mich lieber an deinen loxone adapter, der ist auch nicht so viel komplizierter wie der luxtronik2...

                                            UncleSam 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            802
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            dependencies gyp error node.js
                                            3
                                            36
                                            2184
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo