rbaron / b-parasite

🌱💧 An open source DIY soil moisture sensor
1.85k stars 143 forks source link

Zigbee code does not update value #145

Closed AlbanDurrheimer closed 11 months ago

AlbanDurrheimer commented 1 year ago

Hello,

I have some b-parasite boards and several it does not update value (all sensors included) after some hours (almost every 2 days).
To fix the problem, I have to restart the device by removing and reinserting the battery.

Screenshot 2023-06-27 at 14-44-19 History – Home Assistant

Does this happen to other people? And do you have a solution?

Additional information:

B-Parasite Board: 1.2.0 Firmware: latest firmware in main branch (f6b46000448239a9e5288051953c34e94e617c5f) Coordinator: Home Assistant (2023.6.2) with Zigbee2MQTT (1.31.2)

rbaron commented 1 year ago

@AlbanDurrheimer this is unfortunately an open issue with the ZigBee sample. Recent attempts to fix and discussions are in #126, #130 and more recently on #136. We're having a hard time debugging this, as the problem sometimes happen in a few days, a few weeks, and on the other hand some of my sensors are running for multiple months without issues.

Do you have multiple b-parasites running ZigBee? Do they all experience this issue around the same time?

AlbanDurrheimer commented 1 year ago

Thank you @rbaron for your reply. I didn't realize there were already issues...

Yes, I have three cards at the moment (but more are being soldered) with zigbee firmware. And no, they don't produce the problem at the same time, I have one that currently produces the problem every day or so and the others have also already produced the error, but for the moment it's calmed down.

If I can help you find the source of this problem, please don't hesitate to let me know and explain how to proceed.

rbaron commented 1 year ago

Thanks @AlbanDurrheimer. Were the batteries drained from any of the sensors after the problem occurred? Or did just resetting them fix it?

AlbanDurrheimer commented 1 year ago

Thanks @AlbanDurrheimer. Were the batteries drained from any of the sensors after the problem occurred? Or did just resetting them fix it?

@rbaron I haven't had any drained batteries, just one that I noticed was half empty, but I wonder if I'd used it before, so I don't know if it's related... In my case, a simple restart (removing-inserting the battery only once) is enough to get the sensor working again for at least 1 day.

AlbanDurrheimer commented 1 year ago

It's happened again, and this time neither the reboot nor the factory reset was able to update the sensors values. The module just reconnected to the coordinator, but didn't send back any information from the sensors. I had to run a reconfiguration from Zigbee2MQTT to get the sensor to update again.

Regressor commented 1 year ago

It's happened again, and this time neither the reboot nor the factory reset was able to update the sensors values. The module just reconnected to the coordinator, but didn't send back any information from the sensors. I had to run a reconfiguration from Zigbee2MQTT to get the sensor to update again.

I've seen this behaviour with smart plug - it just stops sending measurements and the only way to fix this was a reconfiguration. It looks like this is a zigbee2mqtt problem not b-parasite.

AlbanDurrheimer commented 1 year ago

It's happened again, and this time neither the reboot nor the factory reset was able to update the sensors values. The module just reconnected to the coordinator, but didn't send back any information from the sensors. I had to run a reconfiguration from Zigbee2MQTT to get the sensor to update again.

I've seen this behaviour with smart plug - it just stops sending measurements and the only way to fix this was a reconfiguration. It looks like this is a zigbee2mqtt problem not b-parasite.

Thanks for your feedback, I'll test this the next time it produces the problem.

AlbanDurrheimer commented 12 months ago

I carried out several tests and here are the findings:

1. Send a reconfiguration

I've seen this behaviour with smart plug - it just stops sending measurements and the only way to fix this was a reconfiguration. It looks like this is a zigbee2mqtt problem not b-parasite.

The board does not respond to the command (timeout).

2. Restart Zigbee2MQTT

No new data sent by the board.

3. Restart the b-parasite board

The board joins the Zigbee network again, but no data is sent back.

4. Restart the b-parasite board with Zigbee2MQTT enable joining

The board joins the Zigbee network again, but no data is sent back.

5. Reset the b-parasite board

The board does not join the Zigbee network.

6. Reset the b-parasite board with Zigbee2MQTT enable joining

The board joins the Zigbee network, but no data is sent back.

7. Remove the devices to Zigbee2MQTT network then enable joining

The board joins the Zigbee network, but no data is sent back.

8. Remove the devices to Zigbee2MQTT network and reset the board then enable joining

The board joins the Zigbee network, but no data is sent back.

9. Move the plant to the same room as the coordinator

Once it was working again, I moved the board to the same room as the coordinator (over a weekend). There was no problem until I moved the board back to its old location, where it crashed in less than 12 hours. (I should point out that in both rooms, the signal is greater than 200 lqi).

10. Conclusion

To conclude, I can no longer remove the error from my board. And yet, it still responds to commands such as genBasic/hwVersion.

rbaron commented 12 months ago

Thanks for the detailed testing @AlbanDurrheimer. It's odd that the board doesn't work after a reboot. This I haven't experienced so far. Could it be some hardware issue when reading the sensors? Maybe some debug logging could shed some light into it. Did you experience it with multiple boards?

There's also #146 that fixes a bunch of issues with the zigbee firmware. It's too early to tell if they're gonna help in the long term, but so far I'm running it for 2w with no issues.

AlbanDurrheimer commented 12 months ago

This is the same card with which I'd encountered problems earlier. Every time it crashed, a reboot or reset was enough to get it working again. It also worked all last weekend indoors, then I moved the plant outside for a night, then nothing