asednev / homebridge-plugin-govee

Govee H-series Thermometer Hygrometer plugin for Homebrige.
Apache License 2.0
53 stars 9 forks source link

Govee child bridge suck in restart loop #58

Open mpreissner opened 2 years ago

mpreissner commented 2 years ago

Describe The Bug: With the Govee plugin running on a child bridge, the child bridge is stuck in a restart loop, causing previously discovered accessories to be unavailable to Homekit/Homebridge.

To Reproduce: Configure and run the Govee plugin.

Expected behavior: Govee child bridge comes online and works properly.

Logs:

[14/02/2022, 09:52:33] [Govee] Restarting Process...
[14/02/2022, 09:52:34] [Govee] Launched child bridge with PID 22164
[14/02/2022, 09:52:34] Registering platform 'homebridge-plugin-govee.GoveeHomebridgePlugin'
[14/02/2022, 09:52:34] [Govee] Loaded homebridge-plugin-govee v1.1.4 child bridge successfully
[14/02/2022, 09:52:35] Loaded 2 cached accessories from cachedAccessories.xxxxxxxxxxxx.
[14/02/2022, 09:52:35] [Govee] Finished initializing platform: Govee
[14/02/2022, 09:52:35] [Govee] Loading accessory from cache: xxxxxxxxxxx
[14/02/2022, 09:52:35] [Govee] Loading accessory from cache: xxxxxxxxxxx
[14/02/2022, 09:52:35] Publishing bridge accessory (name: Govee, publishInfo: {
  username: 'xx:xx:xx:xx:xx:xx',
  port: 49339,
  pincode: '***-**-***',
  category: 2,
  bind: undefined,
  mdns: undefined,
  addIdentifyingMaterial: true,
  advertiser: 'ciao'
}).
[14/02/2022, 09:52:35] [Govee] Executed didFinishLaunching callback
[14/02/2022, 09:52:35] [Govee] Start discovery
[14/02/2022, 09:52:35] Homebridge v1.4.0 (HAP v0.10.0) (Govee) is running on port 49339.

/usr/local/lib/node_modules/homebridge-plugin-govee/node_modules/@abandonware/noble/lib/hci-socket/hci.js:121
      this._socket.bindRaw(this._deviceId);
                   ^
Error: ENODEV, No such device
    at Hci.init (/usr/local/lib/node_modules/homebridge-plugin-govee/node_modules/@abandonware/noble/lib/hci-socket/hci.js:121:20)
    at NobleBindings.init (/usr/local/lib/node_modules/homebridge-plugin-govee/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:93:13)
    at Noble.startScanning (/usr/local/lib/node_modules/homebridge-plugin-govee/node_modules/@abandonware/noble/lib/noble.js:145:20)
    at /usr/local/lib/node_modules/homebridge-plugin-govee/node_modules/@abandonware/noble/lib/noble.js:155:44
    at node:internal/util:360:7
    at new Promise (<anonymous>)
    at node:internal/util:346:12
    at Noble.startScanningAsync (/usr/local/lib/node_modules/homebridge-plugin-govee/node_modules/@abandonware/noble/lib/noble.js:155:99)
    at startDiscovery (/usr/local/lib/node_modules/homebridge-plugin-govee/node_modules/govee-bt-client/dist/index.js:84:27)
    at GoveeHomebridgePlatform.discoverDevices (/usr/local/lib/node_modules/homebridge-plugin-govee/src/platform.ts:88:24)
[14/02/2022, 09:52:35] [Govee] Child bridge process ended
[14/02/2022, 09:52:35] [Govee] Process Ended. Code: 1, Signal: null

Plugin Config:

{
    "name": "Govee",
    "batteryThreshold": 25,
    "debug": true,
    "humidityOffset": 0,
    "_bridge": {
        "username": "xx:xx:xx:xx:xx:xx",
        "port": 49339
    },
    "platform": "GoveeHomebridgePlugin"
}

Screenshots:

Environment: