Some progress. I made the code changes as suggested. The simple program with the modifications runs solid, that is, after an hour of run time, the flow rate measured is steady and at a value (~90 L/hr) that is expected.
Making the same change to the original script, with temperatures, a dynamic plot, thermostat control, etc., had 2 effects. First, the flow rate measured was way higher than expected. (~160 L/hr, I suppose I could recalibrate the count to L/hr factor, eg. 2.1) Second, as the attached plot shows, the flowrate is much more volatile and seems to be cycling in some range.
I'm stuck. Would it be worthwhile to try to break apart the flow measuring into a separate thread or process or daemon that the main program would reference/call/query? Would developing my application in something other than python work better? Maybe much more drastic and use an arduino nano for the interrupt counting and connect to an RPi GPIO?
I'm getting more and more frustrated, but I do greatly appreciate your help.
- TestVdivide20200228Callback.png (36.18 KiB) Viewed 384 times