Sunday, April 5, 2020

Ongoing Reliability Issues - Water Softener Minder - Pi Zero W

The ongoing story - the little Water Softener Minder that couldn't (at least not for proper lengths of time) ...  

Given the difficulties I was having as per the below Water Softener Minder project, I decided to upgrade the project to Buster with the hope it would improve the reliability. 

It improved the reliability, but not in the way I was expecting.  Buster seems better at dealing with exceptions.  I had decided I would reboot the Pi Zero W if it lost the ability to send out a Telegram message.  Under Stretch, the reboot didn't work as the OS became too degraded due to the problem.  Buster seems better at detecting problems with the system and fails more often.  On the other hand, it seems to fail more gracefully, so the reboot command actually worked.  The net effect is better - when there is a problem, it reboots and sorts itself out.  It does mean a lot more rebooting than should actually happen though.  

After all of that, I realised the problem may be with the Telepot library (version 12.7).  I was using the built in mechanism provided to handle incoming messages.  You define a handling function and tell it to use the function in a thread.  I just had no idea what it was actually doing, particularly with the frequency of checking for new messages for my bot and any retries it would do if things went wrong.  I decided it was better to replicate that function in my own code - I could then better deal with any issues that arose.  

Just waiting for the next failure to gather more insight.  Hopefully it won't be soon...




 

1 comment:

  1. Going better after I stopped relying on Telepot's incoming telegram mechanism - up for almost 6 days at this point.

    ReplyDelete