satrik / homebridge-bslamp2

Homebridge plugin to control Mi Bedside Lamps 2
MIT License
5 stars 0 forks source link

ERROR LOADING PLUGIN homebridge-bslamp2: #8

Closed GittyV closed 1 year ago

GittyV commented 1 year ago

Hi,

I'm getting a new error since yesterday without any changes to configuration where the lamp is not being recognised. Excerpts from reboot log below.

[4/20/2023, 9:43:17 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[4/20/2023, 9:43:17 PM] [HB Supervisor] Started Homebridge v1.6.0 with PID: 4776
[4/20/2023, 9:43:17 PM] Loaded config.json with 1 accessories and 3 platforms.
[4/20/2023, 9:43:17 PM] Loaded 0 cached accessories from cachedAccessories.
[4/20/2023, 9:43:17 PM] ---
[4/20/2023, 9:43:17 PM] ====================
[4/20/2023, 9:43:17 PM] ERROR LOADING PLUGIN homebridge-bslamp2:
[4/20/2023, 9:43:17 PM] Error: EAFNOSUPPORT, Address family not supported by protocol
    at new BluetoothHciSocketWrapped (/homebridge/node_modules/@abandonware/bluetooth-hci-socket/lib/native.js:9:5)
    at new Hci (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/lib/hci-socket/hci.js:99:18)
    at new NobleBindings (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:27:15)
    at module.exports (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/lib/resolve-bindings.js:34:12)
    at module.exports (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/with-custom-binding.js:3:53)
    at Object.<anonymous> (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/index.js:1:50)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Function.Module._load (node:internal/modules/cjs/loader:958:12)
[4/20/2023, 9:43:17 PM] ====================
[4/20/2023, 9:46:07 PM] Loading 1 accessories...
[4/20/2023, 9:46:07 PM] No plugin was found for the accessory "MiBedsideLamp2" in your config.json. Please make sure the corresponding plugin is installed correctly.

I did notice when troubleshooting that when reinstalling, there is a '@abandonware/bluetooth-hci-socket' related error (similar to issue 7) however installing it manually doesn't solve the problem. Wondering if anyone else had a similar experience recently?

GittyV commented 1 year ago

Of note aswell, when trying to use the bslamp utility, it throws the following error.

/homebridge/node_modules/@abandonware/bluetooth-hci-socket/lib/native.js:9
    super(...args);
    ^

Error: EAFNOSUPPORT, Address family not supported by protocol
    at new BluetoothHciSocketWrapped (/homebridge/node_modules/@abandonware/bluetooth-hci-socket/lib/native.js:9:5)
    at new Hci (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/lib/hci-socket/hci.js:99:18)
    at new NobleBindings (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:27:15)
    at module.exports (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/lib/resolve-bindings.js:34:12)
    at module.exports (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/with-custom-binding.js:3:53)
    at Object.<anonymous> (/homebridge/node_modules/homebridge-bslamp2/node_modules/@abandonware/noble/index.js:1:50)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12) {
  errno: 97,
  code: 'EAFNOSUPPORT',
  syscall: 'socket'
}

Node.js v18.16.0
satrik commented 1 year ago

hey, I can't reproduce your problems. just tested to reinstall the plugin and it works. I still get the error for the bluetooth-hci-socket package while the installation, but it doesn't matter because the plugin doesn't use bluetooth. your error messages indicates a problem with the bluetooth adapter like described here.

you could also try to start homebridge without --strict-plugin-resolution. maybe you have installed anything global and than the path to the modules /var/lib/homebridge/node_modules would be wrong.

but as already said, you don't need to install the missing package as there is not a single function in the plugin which will use anything of this package. you should be fine in just installing the plugin (ignore just the error).

GittyV commented 1 year ago

Hi,

ive re-enabled the Bluetooth adapter and the issue has seemingly resolved. I’m not 100% clear why this has come up now without any other changes to configuration. Will mark this as closed.