Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge πŸŒ‰, get rid of your proprietary Zigbee bridges πŸ”¨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.84k stars 1.65k forks source link

z2m crashes after some time #24088

Open okastl opened 4 days ago

okastl commented 4 days ago

What happened?

After some time of use, z2m crashes. It may be related to polled haElectricalMeasurement.read from Tuya plugs. No idea, if this is related to a recent z2m or firmware update. Debug log is attached. I will disable polling for now and hope, there will be no more crashes.

[2024-09-24 05:27:52] debug:    zh:controller:endpoint: ZCL command 0x540f57fffe08d3cf/1 haElectricalMeasurement.read(["rmsVoltage","rmsCurrent","activePower"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false})
[2024-09-24 05:27:52] debug:    zh:zstack: sendZclFrameToEndpointInternal 0x540f57fffe08d3cf:23647/1 (0,0,1)
[2024-09-24 05:27:52] debug:    zh:zstack:znp: SREQ: --> AF - dataRequest - {"dstaddr":23647,"destendpoint":1,"srcendpoint":1,"clusterid":2820,"transid":244,"options":0,"radius":30,"len":9,"data":{"type":"Buffer","data":[16,99,0,5,5,8,5,11,5]}}
[2024-09-24 05:27:52] debug:    zh:zstack:unpi:writer: --> frame [254,19,36,1,95,92,1,1,4,11,244,0,30,9,16,99,0,5,5,8,5,11,5,169]
[2024-09-24 05:27:58] debug:    zh:controller:endpoint: Error: ZCL command 0x540f57fffe08d3cf/1 haElectricalMeasurement.read(["rmsVoltage","rmsCurrent","activePower"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (SRSP - AF - dataRequest after 6000ms)
    at Object.start (/opt/storen2mqtt/node_modules/zigbee-herdsman/src/utils/waitress.ts:59:23)
    at /opt/storen2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:300:45
    at Queue.execute (/opt/storen2mqtt/node_modules/zigbee-herdsman/src/utils/queue.ts:36:26)
    at Znp.request (/opt/storen2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:291:27)
    at ZStackAdapter.dataRequest (/opt/storen2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:1201:24)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/opt/storen2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:446:46)
    at /opt/storen2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:380:25
    at Queue.execute (/opt/storen2mqtt/node_modules/zigbee-herdsman/src/utils/queue.ts:36:26)
    at ZStackAdapter.sendZclFrameToEndpoint (/opt/storen2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:378:27)
    at Request.func (/opt/storen2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:296:36)

What did you expect to happen?

No crash.

How to reproduce it (minimal and precise)

Use my setup and wait long enough... ;)

Zigbee2MQTT version

1.40.1-dev commit: 48d77e4b

Adapter firmware version

20240710

Adapter

Sonoff P

Setup

plain

Debug log

log.zip

Koenkk commented 3 days ago

Does it still happen with the firmwares from https://github.com/Koenkk/zigbee2mqtt/issues/23869#issuecomment-2366942980

okastl commented 3 days ago

Does it still happen with the firmwares from #23869 (comment)

I am trying it right now with SONOFF_DONGLE_P_99240914.hex. As a stress test, I have enabled polling on all Tuya plugs (5 or 6) and reduced polling time to 30 seconds. I'll let you know, how long it works.