quentinms / homebridge-aranet4

An Homebridge plugin to get data from an Aranet4
Apache License 2.0
36 stars 1 forks source link

Bridge/accessory stops sending updates #20

Open finestructure opened 1 year ago

finestructure commented 1 year ago

Twice over the last couple of days my Aranet4 stopped sending updates. Both times I noticed the following warning in the logs:

(node:538) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
(node:538) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 childBridgeStatusUpdate listeners added to [HomebridgeIpcService]. Use emitter.setMaxListeners() to increase limit
(node:538) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 end listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
(node:538) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit

Could this be related?

Plugin Config:

{
    "bridge": {
        "name": "Homebridge 47AE",
        "username": "xxxxx",
        "port": 51907,
        "pin": "xxxxx",
        "advertiser": "bonjour-hap"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "Aranet4 Platform",
            "co2AlertThreshold": 1006,
            "batteryAlertThreshold": 10,
            "sensorDataRefreshInterval": 300,
            "bluetoothReadyTimeout": 10,
            "bluetoothDeviceSearchTimeout": 10,
            "_bridge": {
                "username": "xxxxx",
                "port": 56655
            },
            "platform": "Aranet4"
        }
    ]
}

Environment:

quentinms commented 1 year ago

I noticed I got those warnings when the Mac went asleep.

[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
[12/22/2022, 3:35:27 AM] [Aranet4] poweredOff
(node:18712) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 stateChange listeners added to [Noble]. Use emitter.setMaxListeners() to increase limit

But it's a different error message than you (it's on [Noble], not [HomebridgeIpcService] or [Socket]).

I'm currently running #24 locally, and I'll see if it helps.

For your original error, there are a few similar issues in the homebridge repo https://github.com/search?q=repo%3Ahomebridge%2Fhomebridge+Possible+EventEmitter+memory+leak+detected&type=issues, some which have potential work arounds, or on reddit (https://old.reddit.com/r/homebridge/comments/vnl5qb/raspberry_pi_issues_running_homebridge_when/) so it might be a Homebridge issue rather than something with this plugin specifically.

max-christian commented 1 year ago

Did #24 help with this, @quentinms & @finestructure ? Just installed the plugin and it only ran for a few hours before losing contact.

pi@homebridge:/var/lib/homebridge $ grep Aranet4 homebridge.log
[01/11/2023, 18:29:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 18:34:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 18:39:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 18:44:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 18:49:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 18:54:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 18:59:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:04:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:09:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:14:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:19:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:24:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:29:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:34:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:39:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:44:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:49:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:54:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 19:59:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:04:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:09:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:14:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:19:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:24:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:29:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:34:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:39:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:44:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:49:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:54:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 20:59:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:04:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:09:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:14:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:19:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:24:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:29:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:34:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:39:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:44:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:49:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:54:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 21:59:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:04:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:09:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:14:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:19:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:24:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:29:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:34:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:39:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:44:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:49:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
[01/11/2023, 22:54:32] [Aranet4 Platform] Connecting to c1e91f3cf3b0 : connecting
finestructure commented 1 year ago

I've stopped using home bridge because it wasn't reliable for me but I might try again in the future.