NEWS
[GELÖST] ble Adapter macht Probleme auf Raspi 5
-
bluetooth-hci-socket wird auf aktuellen Systemen auch gar nicht mehr verwendet. Auf meinem jedenfalls nicht...
echad@chet:/opt/iobroker $ npm ls iobroker.ble bluetooth-hci-socket iobroker.inst@3.0.0 /opt/iobroker └── iobroker.ble@0.14.0
-
@glasfaser said in ble Adapter macht Probleme auf Raspi 5:
sudo -H -u iobroker npm install bluetooth-hci-socket
admin@iobroker:~ $ cd /opt/iobroker admin@iobroker:/opt/iobroker $ sudo -H -u iobroker npm install bluetooth-hci-socket npm ERR! code 1 npm ERR! path /opt/iobroker/node_modules/bluetooth-hci-socket npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! make: Entering directory '/opt/iobroker/node_modules/bluetooth-hci-socket/build' npm ERR! CXX(target) Release/obj.target/binding/src/BluetoothHciSocket.o npm ERR! make: Leaving directory '/opt/iobroker/node_modules/bluetooth-hci-socket/build' npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@10.0.1 npm ERR! gyp info using node@18.19.0 | linux | arm64 npm ERR! gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3" npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/opt/iobroker/node_modules/bluetooth-hci-socket/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/iobroker/.cache/node-gyp/18.19.0/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/home/iobroker/.cache/node-gyp/18.19.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/iobroker/.cache/node-gyp/18.19.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/opt/iobroker/node_modules/bluetooth-hci-socket', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! ../src/BluetoothHciSocket.cpp: In static member function ‘static void BluetoothHciSocket::Init(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’: npm ERR! ../src/BluetoothHciSocket.cpp:128:81: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’ npm ERR! 128 | target->Set(Nan::New("BluetoothHciSocket").ToLocalChecked(), tmpl->GetFunction()); npm ERR! | ~~~~~~~~~~~~~~~~~^~ npm ERR! In file included from /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-function.h:15, npm ERR! from /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8.h:33, npm ERR! from /home/iobroker/.cache/node-gyp/18.19.0/include/node/node.h:73, npm ERR! from /home/iobroker/.cache/node-gyp/18.19.0/include/node/node_buffer.h:25, npm ERR! from ../src/BluetoothHciSocket.cpp:7: npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-template.h:513:46: note: candidate: ‘v8::MaybeLocal<v8::Function> v8::FunctionTemplate::GetFunction(v8::Local<v8::Context>)’ npm ERR! 513 | V8_WARN_UNUSED_RESULT MaybeLocal<Function> GetFunction( npm ERR! | ^~~~~~~~~~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-template.h:513:46: note: candidate expects 1 argument, 0 provided npm ERR! ../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::poll()’: npm ERR! ../src/BluetoothHciSocket.cpp:251:22: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated [-Wdeprecated-declarations] npm ERR! 251 | Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv); npm ERR! | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ npm ERR! In file included from ../src/BluetoothHciSocket.cpp:8: npm ERR! ../../nan/nan.h:1053:46: note: declared here npm ERR! 1053 | NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback( npm ERR! | ^~~~~~~~~~~~ npm ERR! ../src/BluetoothHciSocket.cpp: In member function ‘void BluetoothHciSocket::emitErrnoError()’: npm ERR! ../src/BluetoothHciSocket.cpp:269:74: error: no matching function for call to ‘v8::Object::Get(v8::Local<v8::String>)’ npm ERR! 269 | Local<Function> errorConstructor = Local<Function>::Cast(globalObj->Get(Nan::New("Error").ToLocalChecked())); npm ERR! | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ npm ERR! In file included from /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-array-buffer.h:13, npm ERR! from /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8.h:24: npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-object.h:290:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)’ npm ERR! 290 | V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, npm ERR! | ^~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-object.h:290:43: note: candidate expects 2 arguments, 1 provided npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-object.h:293:43: note: candidate: ‘v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)’ npm ERR! 293 | V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, npm ERR! | ^~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-object.h:293:43: note: candidate expects 2 arguments, 1 provided npm ERR! ../src/BluetoothHciSocket.cpp:275:53: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Local<v8::Value> [1])’ npm ERR! 275 | Local<Value> error = errorConstructor->NewInstance(1, constructorArgs); npm ERR! | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-function.h:38:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const’ npm ERR! 38 | V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( npm ERR! | ^~~~~~~~~~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-function.h:38:44: note: candidate expects 3 arguments, 2 provided npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-function.h:41:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’ npm ERR! 41 | V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( npm ERR! | ^~~~~~~~~~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-function.h:41:44: note: candidate expects 1 argument, 2 provided npm ERR! ../src/BluetoothHciSocket.cpp:282:20: warning: ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated [-Wdeprecated-declarations] npm ERR! 282 | Nan::MakeCallback(Nan::New<Object>(this->This), Nan::New("emit").ToLocalChecked(), 2, argv); npm ERR! | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ npm ERR! ../../nan/nan.h:1053:46: note: declared here npm ERR! 1053 | NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback( npm ERR! | ^~~~~~~~~~~~ npm ERR! ../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindRaw(Nan::NAN_METHOD_ARGS_TYPE)’: npm ERR! ../src/BluetoothHciSocket.cpp:395:33: error: no matching function for call to ‘v8::Value::IntegerValue()’ npm ERR! 395 | devId = arg0->IntegerValue(); npm ERR! | ~~~~~~~~~~~~~~~~~~^~ npm ERR! In file included from /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-primitive.h:11, npm ERR! from /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-object.h:11: npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-value.h:413:40: note: candidate: ‘v8::Maybe<long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const’ npm ERR! 413 | V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue( npm ERR! | ^~~~~~~~~~~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-value.h:413:40: note: candidate expects 1 argument, 0 provided npm ERR! ../src/BluetoothHciSocket.cpp: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE BluetoothHciSocket::BindUser(Nan::NAN_METHOD_ARGS_TYPE)’: npm ERR! ../src/BluetoothHciSocket.cpp:417:33: error: no matching function for call to ‘v8::Value::IntegerValue()’ npm ERR! 417 | devId = arg0->IntegerValue(); npm ERR! | ~~~~~~~~~~~~~~~~~~^~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-value.h:413:40: note: candidate: ‘v8::Maybe<long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const’ npm ERR! 413 | V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue( npm ERR! | ^~~~~~~~~~~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/v8-value.h:413:40: note: candidate expects 1 argument, 0 provided npm ERR! ../src/BluetoothHciSocket.cpp: At global scope: npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/node.h:1014:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type] npm ERR! 1014 | (node::addon_register_func) (regfunc), \ npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ npm ERR! /home/iobroker/.cache/node-gyp/18.19.0/include/node/node.h:1048:3: note: in expansion of macro ‘NODE_MODULE_X’ npm ERR! 1048 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) npm ERR! | ^~~~~~~~~~~~~ npm ERR! ../src/BluetoothHciSocket.cpp:499:1: note: in expansion of macro ‘NODE_MODULE’ npm ERR! 499 | NODE_MODULE(binding, BluetoothHciSocket::Init); npm ERR! | ^~~~~~~~~~~ npm ERR! make: *** [binding.target.mk:111: Release/obj.target/binding/src/BluetoothHciSocket.o] Error 1 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23) npm ERR! gyp ERR! System Linux 6.1.0-rpi8-rpi-2712 npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd /opt/iobroker/node_modules/bluetooth-hci-socket npm ERR! gyp ERR! node -v v18.19.0 npm ERR! gyp ERR! node-gyp -v v10.0.1 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: /home/iobroker/.npm/_logs/2024-02-10T22_35_01_714Z-debug-0.log admin@iobroker:/opt/iobroker $
-
@thomas-braun said in ble Adapter macht Probleme auf Raspi 5:
npm ls iobroker.ble bluetooth-hci-socket
sieht bei mir ähnlich aus:
admin@iobroker:/opt/iobroker $ npm ls iobroker.ble bluetooth-hci-socket iobroker.inst@3.0.0 /opt/iobroker └── iobroker.ble@0.14.0
wird dies denn zwingend für den ble Adapter benötigt ?
-
@wauzzi sagte in ble Adapter macht Probleme auf Raspi 5:
npm ERR! gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
keine Ahnung was das mit python3 zu tun hat
-
Grundvoraussetzungen sind da?
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev libcap2-bin sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
-
@thomas-braun said in ble Adapter macht Probleme auf Raspi 5:
sudo setcap cap_net_raw+eip $(eval readlink -f
which node
)offensichtlich, ja. Wenn ich dies beurteilen würde
admin@iobroker:/opt/iobroker $ sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev libcap2-bin Reading package lists... Done Building dependency tree... Done Reading state information... Done bluetooth is already the newest version (5.66-1+rpt1+deb12u1). bluez is already the newest version (5.66-1+rpt1+deb12u1). libbluetooth-dev is already the newest version (5.66-1+rpt1+deb12u1). libudev-dev is already the newest version (252.22-1~deb12u1). libcap2-bin is already the newest version (1:2.66-4). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. admin@iobroker:/opt/iobroker $ sudo setcap cap_net_raw+eip $(eval readlink -f `which node`) admin@iobroker:/opt/iobroker $
-
-
Kommt wohl öfters der Fehler vor :
-
@thomas-braun said in ble Adapter macht Probleme auf Raspi 5:
iob logs --watch | uniq
2024-02-10 23:45:58.679 - info: ble.0 (1699) starting. Version 0.14.0 in /opt/iobroker/node_modules/iobroker.ble, node: v18.19.0, js-controller: 5.0.17 2024-02-10 23:45:58.740 - info: ble.0 (1699) loaded plugins: Xiaomi, mi-flora, ruuvi-tag, BTHome, _default 2024-02-10 23:45:58.741 - info: ble.0 (1699) enabled plugins: _default 2024-02-10 23:45:58.741 - info: ble.0 (1699) monitoring all services 2024-02-10 23:45:58.790 - info: ble.0 (1699) starting scanner process... 2024-02-10 23:45:58.901 - error: ble.0 (1699) Cannot find module '@abandonware/bluetooth-hci-socket' Require stack: - /opt/iobroker/node_modules/@abandonware/noble/lib/hci-socket/hci.js - /opt/iobroker/node_modules/@abandonware/noble/lib/hci-socket/bindings.js - /opt/iobroker/node_modules/@abandonware/noble/lib/resolve-bindings.js - /opt/iobroker/node_modules/@abandonware/noble/with-custom-binding.js - /opt/iobroker/node_modules/@abandonware/noble/index.js - /opt/iobroker/node_modules/iobroker.ble/build/scanProcess.js 2024-02-10 23:45:58.679 - info: ble.0 (1699) starting. Version 0.14.0 in /opt/iobroker/node_modules/iobroker.ble, node: v18.19.0, js-controller: 5.0.17 2024-02-10 23:45:58.740 - info: ble.0 (1699) loaded plugins: Xiaomi, mi-flora, ruuvi-tag, BTHome, _default 2024-02-10 23:45:58.741 - info: ble.0 (1699) enabled plugins: _default 2024-02-10 23:45:58.741 - info: ble.0 (1699) monitoring all services 2024-02-10 23:45:58.790 - info: ble.0 (1699) starting scanner process... 2024-02-10 23:45:58.901 - error: ble.0 (1699) Cannot find module '@abandonware/bluetooth-hci-socket' Require stack: - /opt/iobroker/node_modules/@abandonware/noble/lib/hci-socket/hci.js - /opt/iobroker/node_modules/@abandonware/noble/lib/hci-socket/bindings.js - /opt/iobroker/node_modules/@abandonware/noble/lib/resolve-bindings.js - /opt/iobroker/node_modules/@abandonware/noble/with-custom-binding.js - /opt/iobroker/node_modules/@abandonware/noble/index.js - /opt/iobroker/node_modules/iobroker.ble/build/scanProcess.js
-
Dann versuch
cd /opt/iobroker/node_modules sudo -H -u iobroker npm i @abandonware/bluetooth-hci-socket --omit=dev
-
@thomas-braun said in ble Adapter macht Probleme auf Raspi 5:
Dann versuch
cd /opt/iobroker/node_modules sudo -H -u iobroker npm i @abandonware/bluetooth-hci-socket --omit=dev
Ja Geil !!!! Hat geklappt !!! Alles grün und die BT Geräte werden gefunden. MEGA !!!!
Vielen lieben Dank Thomas
Auch vielen lieben an alle anderen die mir versucht haben zu helfenJetzt kann Charlie wieder selbst nach Hause kommen
https://youtu.be/6ebXPKz4bSc?si=bCU5lA-OjBXOasHM -
@wauzzi
Hallo,
wegen solcher Probleme mit BLE habe ich schon länger ein Skript "fixble.sh" folgenden Inhalts:#! iobroker stop sudo apt update sudo apt upgrade cd /opt/iobroker/node_modules/iobroker.ble npm install --omit=dev iobroker fix sudo reboot
Dieses startet u.a. npm install.
Datin wird eine Abfrage gestellt, ob man etwas erneuern will.
Ich würde das Skript gerne auch unattended (per cron) laufen lassen. (Wie) kann man dabei erreichen, dass diese Abfrage immer als mit "Y" beantwortet gilt, ohne dass ein Eingriff nötig ist?
Dank im Voraus