Lyliya / homebridge-ledstrip-ble

11 stars 12 forks source link

PlugIn wont load #5

Closed derVicthor closed 1 year ago

derVicthor commented 1 year ago

Hey there,

I've added the plugin, but home bridge shows an error in the LOG

[1/5/2023, 11:40:14 AM] ==================== [1/5/2023, 11:40:14 AM] ERROR LOADING PLUGIN @lyliya/homebridge-ledstrip-ble: [1/5/2023, 11:40:14 AM] TypeError: require(...) is not a function at Object. (/homebridge/node_modules/@lyliya/homebridge-ledstrip-ble/Device.js:1:44) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Function.Module._load (node:internal/modules/cjs/loader:878:12) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/homebridge/node_modules/@lyliya/homebridge-ledstrip-ble/index.js:1:16) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10) [1/5/2023, 11:40:14 AM] ====================

Anything I can do about that?

Thanks!

Lyliya commented 1 year ago

Hey, what version of homebridge / node are you using ?

The plugin stopped working recently because of dependencies to noble and i've been trying to fix it but with no success, I switch to Home Assistant using this plugin https://github.com/dave-code-ruiz/elkbledom to control my ledstrip. I dont know if i will update this plugin anymore

derVicthor commented 1 year ago

Hey there,

thanks for the quick response. I have noble 1.9.2-15 installed within the docker container - installed it manually just in case. Homebridge is on 1.6.0 with node 18.12.1.

Lyliya commented 1 year ago

Thats weird, i use the same version and the plugin initialize correctly

derVicthor commented 1 year ago

Could it be a problem with the dockerized Homebridge?

Lyliya commented 1 year ago

Ok got it, i release a patch, they change the way we need to load noble

derVicthor commented 1 year ago

Amazing! I'll wait for the patch then. Thanks for the quick solution <3

Lyliya commented 1 year ago

It's released 👌

But as i said in first comment, the plugin is not stable at all, it work for me during months, and stopped working, i will probably try to update it, but probably not soon

as you use docker, dont forget to add those lines in your startup script (top right under terminal)

apt-get update && apt-get upgrade -y
apt-get install -y bluetooth bluez libbluetooth-dev libudev-dev
setcap cap_net_raw+eip $(eval readlink -f `which node`)