ioBroker / ioBroker.rflink

Support of RFLink
MIT License
11 stars 10 forks source link

serialport - Errors wit new RPI4 - iobroker install #39

Closed forelleblau closed 2 years ago

forelleblau commented 2 years ago

While setting up a new RPI 4

Linux raspberrypi4 5.10.63-v7l+ #1488 SMP Thu Nov 18 16:15:28 GMT 2021 armv7l

with a direct ioBroker installation with node 14.x and also with a node 12.x installation

both after installing 'build-essential' and @serialport rebuild I get the following errors installing the rflink - Adapter:

$ iobroker add rflink auto --host raspberrypi4

NPM version: 6.14.15

npm install iobroker.rflink@2.1.6 --loglevel error --prefix "/opt/iobroker" (System call)

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:78:51: 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] 78 | uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen); | ^~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:135:53: 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] 135 | uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate); | ^~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:175:52: 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] 175 | uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose); | ^~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:215:52: 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] 215 | uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush); | ^~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:270:50: 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] 270 | uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet); | ^~~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:314:50: 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] 314 | uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet); | ^~~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:363:58: 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] 363 | uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate); | ^~~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:409:52: 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] 409 | uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain); | ^~~~~~~~

../src/serialport.cpp: At global scope:../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses] 430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local& v8str)) { | ^../src/serialport.cpp:449:30: warning: unnecessary parentheses in declaration of ‘ToStopBitEnum’ [-Wparentheses] 449 | SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) { | ^

In file included from ../../../../../nan/nan.h:58, from ../src/./serialport.h:6, from ../src/serialport.cpp:1:/home/iobroker/.cache/node-gyp/12.22.8/include/node/node.h:736:7: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Local, v8::Local, void)’} [-Wcast-function-type] 736 | (node::addon_register_func) (regfunc), \ | ^~~~~~~~~/home/iobroker/.cache/node-gyp/12.22.8/include/node/node.h:770:3: note: in expansion of macro ‘NODE_MODULE_X’ 770 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) | ^~~../src/serialport.cpp:483:1: note: in expansion of macro ‘NODE_MODULE’ 483 | NODE_MODULE(serialport, init); | ^~~~~

../src/serialport_unix.cpp: In function ‘int setup(int, OpenBaton*)’:../src/serialport_unix.cpp:176:82: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1005 [-Wformat-truncation=] 176 | snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path); | ^~../src/serialport_unix.cpp:176:13: note: ‘snprintf’ output 20 or more bytes (assuming 1043) into a destination of size 1024 176 | snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path); | ~~^~~~~~~~~~~~~~~~~~~~~~~~

../src/serialport_unix.cpp: In function ‘void EIO_Open(uv_work_t*)’:../src/serialport_unix.cpp:86:84: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1003 [-Wformat-truncation=] 86 | snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path); | ^~../src/serialport_unix.cpp:86:13: note: ‘snprintf’ output 22 or more bytes (assuming 1045) into a destination of size 1024 86 | snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path); | ~~^~~~~~~~~~~~~~~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:78:51: 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] 78 | uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen); | ^~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:135:53: 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] 135 | uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate); | ^~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:175:52: 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] 175 | uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose); | ^~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:215:52: 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] 215 | uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush); | ^~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:270:50: 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] 270 | uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet); | ^~~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:314:50: 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] 314 | uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet); | ^~~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:363:58: 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] 363 | uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate); | ^~~~~~~~~~

../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:../src/serialport.cpp:409:52: 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] 409 | uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain); | ^~~~~~~~

../src/serialport.cpp: At global scope:../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses] 430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local& v8str)) { | ^

../src/serialport.cpp:449:30: warning: unnecessary parentheses in declaration of ‘ToStopBitEnum’ [-Wparentheses] 449 | SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) { | ^

In file included from ../../../../../nan/nan.h:58, from ../src/./serialport.h:6, from ../src/serialport.cpp:1:/home/iobroker/.cache/node-gyp/12.22.8/include/node/node.h:736:7: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Local, v8::Local, void)’} [-Wcast-function-type] 736 | (node::addon_register_func) (regfunc), \ | ^~~~~~~~~/home/iobroker/.cache/node-gyp/12.22.8/include/node/node.h:770:3: note: in expansion of macro ‘NODE_MODULE_X’ 770 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) | ^~~../src/serialport.cpp:483:1: note: in expansion of macro ‘NODE_MODULE’ 483 | NODE_MODULE(serialport, init); | ^~~~~

../src/serialport_unix.cpp: In function ‘int setup(int, OpenBaton*)’:../src/serialport_unix.cpp:176:82: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1005 [-Wformat-truncation=] 176 | snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path); | ^~../src/serialport_unix.cpp:176:13: note: ‘snprintf’ output 20 or more bytes (assuming 1043) into a destination of size 1024 176 | snprintf(data->errorString, sizeof(data->errorString), "Error %s Cannot open %s", strerror(errno), data->path); | ~~^~~~~~~~~~~~~~~~~~~~~~~~

../src/serialport_unix.cpp: In function ‘void EIO_Open(uv_work_t*)’:../src/serialport_unix.cpp:86:84: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1003 [-Wformat-truncation=] 86 | snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path); | ^~../src/serialport_unix.cpp:86:13: note: ‘snprintf’ output 22 or more bytes (assuming 1045) into a destination of size 1024 86 | snprintf(data->errorString, sizeof(data->errorString), "Error: %s, cannot open %s", strerror(errno), data->path); | ~~^~~~~~~~~~~~~~~~~~~~~~

host.raspberrypi4 install adapter rflink

upload [3] rflink.admin /opt/iobroker/node_modules/iobroker.rflink/admin/words.js words.js application/javascript

upload [2] rflink.admin /opt/iobroker/node_modules/iobroker.rflink/admin/rflink.png rflink.png image/png

upload [1] rflink.admin /opt/iobroker/node_modules/iobroker.rflink/admin/parse.js parse.js application/javascript

upload [0] rflink.admin /opt/iobroker/node_modules/iobroker.rflink/admin/index.html index.html text/html

host.raspberrypi4 object system.adapter.rflink created/updated

host.raspberrypi4 create instance rflink

host.raspberrypi4 object rflink.0.availableVersion created

host.raspberrypi4 object rflink.0.firmwareVersion created

host.raspberrypi4 object rflink.0.rawData created

host.raspberrypi4 object rflink.0.inclusionOn created

host.raspberrypi4 object rflink.0.info.connection created

host.raspberrypi4 object rflink.0.info created

host.raspberrypi4 object system.adapter.rflink.0.logLevel created

host.raspberrypi4 object system.adapter.rflink.0.sigKill created

host.raspberrypi4 object system.adapter.rflink.0.eventLoopLag created

host.raspberrypi4 object system.adapter.rflink.0.outputCount created

host.raspberrypi4 object system.adapter.rflink.0.inputCount created

host.raspberrypi4 object system.adapter.rflink.0.uptime created

host.raspberrypi4 object system.adapter.rflink.0.memRss created

host.raspberrypi4 object system.adapter.rflink.0.memHeapTotal created

host.raspberrypi4 object system.adapter.rflink.0.memHeapUsed created

host.raspberrypi4 object system.adapter.rflink.0.cputime created

host.raspberrypi4 object system.adapter.rflink.0.cpu created

host.raspberrypi4 object system.adapter.rflink.0.compactMode created

host.raspberrypi4 object system.adapter.rflink.0.connected created

host.raspberrypi4 object system.adapter.rflink.0.alive created

host.raspberrypi4 Set default value of rflink.0.info.connection: false

host.raspberrypi4 object system.adapter.rflink.0 created

Process exited with code 0

After installing an instance it is not possbile to set the Com-Port in the adapter-settings.

Apollon77 commented 2 years ago

These are just warnings. Ignore them

forelleblau commented 2 years ago

Would I, but the adapter does not work. I 'cant set a com Port

Apollon77 commented 2 years ago

What tells the log when you try?? Best set log to Debug loglevel

forelleblau commented 2 years ago
rflink.0 | 2022-01-03 14:41:35.993 | debug | sendTo "listUart" to system.adapter.admin.0 from system.adapter.rflink.0 -- | -- | -- | -- rflink.0 | 2022-01-03 14:41:35.992 | info | List of port: [] rflink.0 | 2022-01-03 14:41:34.801 | debug | sendTo "listUart" to system.adapter.admin.0 from system.adapter.rflink.0 rflink.0 | 2022-01-03 14:41:34.800 | info | List of port: [] rflink.0 | 2022-01-03 14:41:33.591 | debug | sendTo "listUart" to system.adapter.admin.0 from system.adapter.rflink.0 rflink.0 | 2022-01-03 14:41:33.590 | info | List of port: [] rflink.0 | 2022-01-03 14:41:32.658 | debug | sendTo "readNewVersion" to system.adapter.admin.0 from system.adapter.rflink.0 rflink.0 | 2022-01-03 14:41:32.471 | debug | sendTo "listUart" to system.adapter.admin.0 from system.adapter.rflink.0 rflink.0 | 2022-01-03 14:41:32.470 | info | List of port: [] rflink.0 | 2022-01-03 14:41:29.441 | error | No serial port defined rflink.0 | 2022-01-03 14:41:29.371 | info | starting. Version 2.1.6 in /opt/iobroker/node_modules/iobroker.rflink, node: v12.22.8, js-controller: 3.3.22 rflink.0 | 2022-01-03 14:41:29.273 | debug | statesDB connected rflink.0 | 2022-01-03 14:41:29.272 | debug | States connected to redis: 127.0.0.1:9000 rflink.0 | 2022-01-03 14:41:29.266 | debug | States create User PubSub Client rflink.0 | 2022-01-03 14:41:29.264 | debug | States create System PubSub Client rflink.0 | 2022-01-03 14:41:29.257 | debug | Redis States: Use Redis connection: 127.0.0.1:9000 rflink.0 | 2022-01-03 14:41:29.255 | debug | objectDB connected rflink.0 | 2022-01-03 14:41:29.247 | debug | Objects connected to redis: 127.0.0.1:9001 rflink.0 | 2022-01-03 14:41:29.227 | debug | Objects client initialize lua scripts rflink.0 | 2022-01-03 14:41:29.226 | debug | Objects create User PubSub Client rflink.0 | 2022-01-03 14:41:29.225 | debug | Objects create System PubSub Client rflink.0 | 2022-01-03 14:41:29.223 | debug | Objects client ready ... initialize now rflink.0 | 2022-01-03 14:41:29.190 | debug | Redis Objects: Use Redis connection: 127.0.0.1:9001 host.raspberrypi4 | 2022-01-03 14:41:28.221 | info | instance system.adapter.rflink.0 started with pid 3444
forelleblau commented 2 years ago

Habe es mit Workaround lösen können: habe bei system.adapter.rflink.0 die Angabe zum Port mauell eingetragen. So funktioniert der Adapter. Wenn ich das hier: https://github.com/ioBroker/ioBroker.rflink/issues/9#issuecomment-363896349 versuche, fehlt das Verzeichnis bin im serialport-Verzeichnis.