mjwwit / node-red-contrib-ikea-tradfri

Node-RED nodes to get updates from and control devices connected to an IKEA TRADFRI gateway
3 stars 3 forks source link

Node report no config - gateway is connected - not working #19

Closed DKAndreas closed 1 year ago

DKAndreas commented 2 years ago

Sometimes the node is missing connection to ikea gateway, even though it shows green. Debug shows warning string from tradfri-light-control “No accessories or groups in message or node configuration!”. Once I restart node-red or refresh flow, then it works.

one thing is the error, But I have to do this manually everytime - as I cannot create a flow that catch the warning text from debug and restart node-red thereby.

Request for fix and change warning text to error (so I can catch the error) :-)

mjwwit commented 2 years ago

This is interesting, I've never seen this behavior. Are you sure that is the only error that is shown?

I've configured the node to reconnect to the gateway should the connection be lost. This behavior should be reflected in the node status however.

Did you select accessories/groups in the node configuration?

DKAndreas commented 2 years ago

Yeah, that strange part is: it is not disconnected ? It just seems like no accessories or bulbs applicable in node - thereby no accept of any message.

Pls. See attached picture - maybe it makes more sense ? image

mjwwit commented 2 years ago

These errors show up only when the nodes receive a message, but there are no accessories or groups to apply the operation for. I wonder if there's also an error that shows up only when this behavior begins, so the first time there are no accessories or groups. Would you be able to search through the logs and find out if there's an error to explain why there are no connected accessories? Thanks!

DKAndreas commented 2 years ago

I tried to restart my flow, while logging.

Sometimes the tradfri node could connect quickly, sometimes it stocked with the message I mentioned earlier (problem as previously described)

Seems like the rootcause is maximum limit on event emitter memory leak???

Im using raspberry pi 4 (4gb), running node red as service. Lots of cpu and ram available


29 Sep 22:33:04 - [info] Stopped flows 29 Sep 22:33:04 - [info] Starting flows 29 Sep 22:33:05 - [info] Started flows (node:18590) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connection alive listeners added to [TradfriClient]. Use emitter.setMaxListeners() to increase limit (node:18590) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connection lost listeners added to [TradfriClient]. Use emitter.setMaxListeners() to increase limit (node:18590) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connection failed listeners added to [TradfriClient]. Use emitter.setMaxListeners() to increase limit (node:18590) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 reconnecting listeners added to [TradfriClient]. Use emitter.setMaxListeners() to increase limit (node:18590) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ping succeeded listeners added to [TradfriClient]. Use emitter.setMaxListeners() to increase limit (node:18590) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ping failed listeners added to [TradfriClient]. Use emitter.setMaxListeners() to increase limit

29 Sep 22:33:10 - [info] [tradfri-config:Ikea] Connected to TRADFRI gateway 29 Sep 22:33:10 - [warn] [tradfri-light-control:ec3a982c0ec5e94e] No accessories or groups in message or node configuration! 29 Sep 22:33:10 - [warn] [tradfri-light-control:ec3a982c0ec5e94e] No accessories or groups in message or node configuration! 29 Sep 22:33:10 - [warn] [tradfri-light-control:ec3a982c0ec5e94e] No accessories or groups in message or node configuration! 29 Sep 22:33:10 - [warn] [tradfri-light-control:ec3a982c0ec5e94e] No accessories or groups in message or node configuration! 29 Sep 22:33:10 - [warn] [tradfri-light-control:ec3a982c0ec5e94e] No accessories or groups in message or node configuration! 29 Sep 22:33:10 - [warn] [tradfri-light-control:ec3a982c0ec5e94e] No accessories or groups in message or node configuration! 29 Sep 22:33:10 - [warn] [tradfri-light-control:ec3a982c0ec5e94e] No accessories or groups in message or node configuration!

29 Sep 22:33:14 - [info] [tradfri-config:Ikea] Accessory updated: 65538

DKAndreas commented 2 years ago

@mjwwit could it be a issue of max request to ikea hub during?

Reason: I also have Phillips hue node: they added a maximum request per second in config node, as over 10 request per second will have the phillips hub to fail.

How about the ikea hub? It may react similar ?

mjwwit commented 2 years ago

Given how quirky the gateway is this really wouldn't surprise me. If you're up for it this would be something that's rather easy to test? If it turns out there is a requests/sec limitation in the gateway, I can probably implement a workaround delaying requests if they would exceed this limit.

mjwwit commented 1 year ago

Closing this issue due to inactivity.