stanvn / zigbee-plant-sensor

GNU General Public License v3.0
111 stars 7 forks source link

Sensor with bad reception goes into unrecoverable state #13

Open bbadaboom opened 1 year ago

bbadaboom commented 1 year ago

I have one sensor in an area with bad ZigBee reception. It has no ZigBee routers nearby but a wifi repeater. After an initial start up it transmits data for about 3-10h, then stops. It even does not continue if I move it to an area with good reception. The attached image shows the effect.

The ZigBee coverage is not terrible (after all, it does transmit without issues for a while), just not very good. I had a ZigBee lamp next to the device and the device worked perfectly for a few weeks. Then I removed the lamp, and the issue started to surface. After a few of these "crashes" I thought the device was defective, so I switched it with another one. But also the second device showed the effect. And the first one, when moved to another room works perfectly.

Screenshot_20230104-073358

stanvn commented 1 year ago

Thanks for your issue, I have seen similar problems by others. I know for a fact that Zigbee is not a self repairing network, or at least it will not look for new connections as long as it still has a connection with its parent. If the connection is lost it will look for a new parent.

What kind of dongle do you use? And do you use Z2M or ZHA?

bbadaboom commented 1 year ago

I am using the zonoff ZigBee usb dongle and zigbee2mqtt.

I used the "map" function of zigbee2mqtt to check and all routers of the network where replying, so I guess they are all online and working. I now placed an Ikea ZigBee repeater close to it and it has been running without issues since.

stanvn commented 1 year ago

Maybe it is a re-connection problem. I'll test it by manually removing links and see if it reconnects properly.

stanvn commented 1 year ago

I found an issue in the know issues from the nRF Connect SDK. I've implemented the proposed workaround in the main. Hopefully the issue is now solved

bbadaboom commented 1 year ago

Hi, sorry for the slow reply, I was a bit busy. Nice to hear you have found a workaround! If you upload a hex I will test it and give you feedback, if that solves my issues...

stanvn commented 1 year ago

No problem, I've been busy too. Here is a link to a hex file so you can test it. https://drive.google.com/file/d/1LK-mcJxXOtrW712IEFpojefQ2F1zVAYD/view?usp=sharing

bbadaboom commented 1 year ago

Hmm, somehow it looks like the device is no longer working properly with the linked hex. The red LED does not light up when I insert the battery and it won't report anything in z2mqtt. Also when removing the device and allowing new devices to join nothing happens. I reflashed the version 2 from the releases page and could add it again.

stanvn commented 1 year ago

That is not how it should work indeed. I'll check the hex file again later. Maybe I added the wrong file.