hbblebc / homebridge-bed-control

Homebridge plugin to control compatible smart beds
Apache License 2.0
7 stars 2 forks source link

Memory leaks showing in basic logging for this plugin on RPi HomeBridge #6

Closed randymassey closed 3 months ago

randymassey commented 1 year ago

Describe The Bug: I have several occurrences of references to numerous memory leaks as well as this plugin slowing down H/bridge warnings in my logs & needing to add listeners.. Most things do work, but it has been consistently producing these messages in the logs. I also can't subtract one of the items that shows via the plugin, (I have a single platform Sleep Number), I cannot subtract the Left Side light control using the Accessory Ignore list, (tho I am able to successfully ignore other items not relevant to the single platform.

To Reproduce: Just operate the plugin / Add Ignore Value for the Left side light control.

Expected behavior: No logging errors & accessory ignore value should function.

Logs: [24/12/2022, 01:32:24] [homebridge-bed-control] Restoring existing bed from cache: RandyLand i8 (node:1144) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit (node:1144) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit [24/12/2022, 01:32:38] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 01:32:44] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. (node:1144) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 childBridgeStatusUpdate listeners added to [HomebridgeIpcService]. Use emitter.setMaxListeners() to increase limit (node:1144) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit (node:1144) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit

Show the Homebridge logs here, remove any sensitive information.

More log:

[24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Target Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Target Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:32] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Heating Cooling State' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Target Heating Cooling State' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Heating Cooling State' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Target Heating Cooling State' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:34] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Target Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Brightness' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Target Heating Cooling State' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info. [24/12/2022, 15:10:40] [homebridge-bed-control] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' didn't respond at all!. Please check that you properly call the callback! See https://homebridge.io/w/JtMGR for more info.

More logging info that is different from 1.2.23:

[02/01/2023, 19:09:49] [homebridge-bed-control] This plugin threw an error from the characteristic 'Current Temperature': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:49] [homebridge-bed-control] This plugin threw an error from the characteristic 'Current Temperature': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:49] [homebridge-bed-control] This plugin threw an error from the characteristic 'Current Heating Cooling State': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:49] [homebridge-bed-control] This plugin threw an error from the characteristic 'Target Heating Cooling State': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:49] [homebridge-bed-control] This plugin threw an error from the characteristic 'Current Heating Cooling State': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:49] [homebridge-bed-control] This plugin threw an error from the characteristic 'Target Heating Cooling State': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:49] [homebridge-bed-control] This plugin threw an error from the characteristic 'On': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:50] [homebridge-bed-control] This plugin threw an error from the characteristic 'Brightness': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:50] [homebridge-bed-control] This plugin threw an error from the characteristic 'Brightness': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:56] [homebridge-bed-control] This plugin threw an error from the characteristic 'Brightness': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info. [02/01/2023, 19:09:56] [homebridge-bed-control] This plugin threw an error from the characteristic 'Brightness': Unhandled error thrown inside read handler for characteristic: Request failed with status code 404. See https://homebridge.io/w/JtMGR for more info.

Plugin Config:



    "_bridge": {
        "port": 32347,
        "username": "0E:E5:11:XXXX"
    },
    "ignore": [
        "-9223372019930635385.leftSide.headControl",
        "-9223372019930635385.leftSide.footControl",
        "-9223372019930635385.anySide"
    ],
    "bedPlatform": "sleep number",
    "email": xxxxxxxx",
    "platform": "BedControl",
    "delay": 2,
    "updateInterval": 0,
    "password": 

**Screenshots:**
Adding screenshot of UI config for ignore list.  I do not presently have the log image to show it rejecting the left side light control, but it will produce an error in the log when added & rebooting.

**Environment:**

* **Plugin Version**: v1.2.3
* **Homebridge Version**: v1.6.0 & tested 2.0.x Beta (same result, those logs not included, logs from v1.6.0
* **Node.js Version**: v18.12.1
* **NPM Version**: v8.19.2 then tested updated to v9.2.0
* **Operating System**: Raspbian Bullseye current @ v1.0.38.

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
![Screen Shot 2022-12-24 at 3 16 54 PM](https://user-images.githubusercontent.com/67206403/209453107-def7b31a-410d-498c-8fcc-5fa41bc666a7.png)
hbblebc commented 3 months ago

Try the latest version and let me know if you are still seeing this. I wasn't able to reproduce it but I did fix a few other things and this may have been a side effect.

hbblebc commented 3 months ago

Let me know if this issue pops up again.