Closed pmcdowall closed 1 year ago
Definitely specific to your hardware/OS.
@donavanbecker I've tried updating from 2.5.1 to 2.5.3 on my Raspberry Pi Zero W flashed with Homebridge's own image multiple times now. (Thanks god I have a backup image of the SD card). I have issues too and the switchbot plugin stopps working / detecting BLE connections after updating.
I can't update to 2.5.3 neither.
(##################) ⠏ reify:googleapis: timing reifyNode:node_modules/@switchbot/home
@abandonware/bluetooth-hci-socket@0.5.3-10 install node-pre-gyp install --fallback-to-build --update-binary
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/abandonware/node-bluetooth-hci-socket/releases/download/0.5.3-10/bluetooth_hci_socket-0.5.3-10-node-v108-linux-arm.tar.gz
make: Entering directory '/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/build'
CXX(target) Release/obj.target/bluetooth_hci_socket/src/BluetoothHciSocket.o
make: g++: No such file or directory
make: *** [bluetooth_hci_socket.target.mk:111: Release/obj.target/bluetooth_hci_socket/src/BluetoothHciSocket.o] Error 127
make: Leaving directory '/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.10.103-v7l+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--update-binary" "--module=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node" "--module_name=bluetooth_hci_socket" "--module_path=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
gyp ERR! cwd /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket
gyp ERR! node -v v18.15.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --update-binary --module=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node --module_name=bluetooth_hci_socket --module_path=/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/bluetooth-hci-socket/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
node-pre-gyp ERR! stack at ChildProcess.
@abandonware/noble@1.9.2-20 install node-gyp-build
make: Entering directory '/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/noble/build'
SOLINK_MODULE(target) Release/obj.target/noble.node
make: g++: No such file or directory
make: *** [noble.target.mk:20: Release/obj.target/noble.node] Error 127
make: Leaving directory '/usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/noble/build'
gyp ERR! build error ⠏ reify:googleapis: timing reifyNode:node_modules/@switchbot/home
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.10.103-v7l+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/noble
gyp ERR! node -v v18.15.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/@switchbot/homebridge-switchbot/node_modules/@abandonware/noble
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2023-04-11T16_30_26_651Z-debug-0.log
Operation failed. Please review log for details.
@pmcdowall A workaround I found is by Installing Bluetooth tools in DSM as referred to here.
@pmcdowall A workaround I found is by Installing Bluetooth tools in DSM as referred to here.
This doesn't work for me. It still fails the same way.
@marvinjoa Thanks! A modified version of your fix worked for me. SSH into my Synology NAS and then;
sudo hb-shell
cd /volume1/homebridge/
npm i @abandonware/bluetooth-hci-socket
npm i @abandonware/noble
Exit the shell, return to Homebridge UI and update Switchbot. Successfully completes update to 2.5.3.
This should be raise as an issue on noble and Bluetooth-hci-socket.
@marvinjoa Thanks! A modified version of your fix worked for me. SSH into my Synology NAS and then;
sudo hb-shell
cd /volume1/homebridge/
npm i @abandonware/bluetooth-hci-socket
npm i @abandonware/noble
Exit the shell, return to Homebridge UI and update Switchbot. Successfully completes update to 2.5.3.
@pmcdowall Happy it worked for you! I had the backup steps just to make sure I don't mess up, but it seems fine without it.
This should be raise as an issue on noble and Bluetooth-hci-socket.
@donavanbecker I am not 100% convinced that it is a problem with those dependencies. Especially it seems that it is not only a Raspberry Pi issue as you deemed it, but also a Synology issue, although here it is a noble install issue vs the hci socket issue on raspian. To be fair I cannot write code myself from scratch, but I understand it partially and have a basic understanding for this stuff.
What happens during the failed plugin update is that it asks for the compiled version on GitHub instead of building it itself. And the compiled version doesn't exist.
When manually npm installing both it will download and install both normally. During the plugin update the dependencies were build from scratch again. Maybe there is an issue with the installation script or the parameters set during the plugin update.
I don't set any special scripts for it. Definitely dependencies.
In case anyone else is running into this issue and the fixes above didn't work for them, reinstalling Entware and the native BLE build dependencies did the trick for me.
It seems that sometime between my initial installation of the plugin and the most recent updates, something broke in my Entware environment that made the bluetooth-hci + noble builds fail.
Thanks for all the hints @fluffy-critter, @pmcdowall, and @neegool!
I have added your tips to Bluetooth Issues Wiki: Bluetooth Issues
Describe the Bug
The update cannot be completed due to a 404 error on a file called during the update. Subsequent update steps fail due to the missing file.
To Reproduce
Update to 2.5.3 using Homebridge (may be specific to my install/hardware)
Expected Behavior
Update completes successfully.
Relevant Log Output
Config for homebridge-switchbot
Screenshots
No response
Device and Model
Not applicable
Node.js Version
v16.20.0
NPM Version
v8.19.4
Homebridge Version
v1.6.0
Homebridge Switchbot Plugin Version
2.5.2
Homebridge Config UI X Plugin Version
v4.50.2
Operating System
Synology DSM 7.1.1-42962 Update 4