Wednesday, August 9, 2017

Paradise ponders: embedded web servers and lucky cat edition...

Paradise ponders: embedded web servers and lucky cat edition...  For most of my day yesterday I was hard at work programming.  First I completed a round of testing and troubleshooting the core part of the irrigation supervisory program, the state machine that controls whether the 5 horsepower pump is enabled.  That's more challenging that you might think – all the following possibilities need to be handled:
  • The water supply (from the Paradise Irrigation cooperative that I belong to) pressure may be high enough that no boost from the pump is required.  In this case we don't want to turn on the pump at all.
  • The water supply may be turned off, or nearly so – in which case running the pump would destroy it, so we want to turn it off.
  • The pump cannot maintain sufficient output pressure.  This might happen if there was a break in the line, or if there was a problem with the variable frequency drive (VFD).  In this case, running the pump won't hurt it, but the irrigation system won't work properly – so we want to suspend the irrigation schedule and turn off the pump.
  • The pump produces too high an output pressure.  This condition runs the risk of destroying the sprinkler system, and indicates that there's something wrong with the constant pressure pump system.  In this case we want to turn off the pump and alert a human to come help.
  • Either or both of the filters could be excessively clogged, causing a pressure drop across the filter(s) and therefore a lower than desirable pressure to the sprinklers.  In this case, we want to to alert a human to come help.
  • A human may have disabled the system (for instance, to clean the filters).  In this case we want to turn off the pump and suspend the irrigation schedule.
  • If any of the above conditions caused the pump to shut down, when the conditions have cleared (or enough time has gone by that we want to try again), then we need to turn the pump back on and resume the irrigation schedule if it was suspended.
All of the above is now working in my irrigation supervisory program, with the single exception of irrigation schedule suspension and resumption.  I'll be working on that bit today.

Later in the day yesterday I took a break from the state machine and got an embedded web server (using Jetty) running.  This was not exactly a difficult task, and therefore well-suited as a half-brain-dead afternoon job. :)  I've used Jetty before, so a lot of what I did was to remember things I'd already done in the past.  The Jetty developers did a really nice job of making an easily embedded, yet very capable web server.  Anyway, in under an hour I had the canonical “Hello, world!” web server up and running.

In the evening Debbie and I made a wildlife-viewing run up Blacksmith Fork canyon, and out to Miller's Ranch.  We saw lots of things, but most especially does with fawns.  Just north of Miller's Ranch we saw the flock of Cedar Waxwings we've been observing all year.  Right at Miller's Ranch we saw a pair of birds we don't know: they resemble grosbeaks (though their beak wasn't quite as thick), or perhaps meadowlarks.  They had black feet and were feeding from the tops of blooming Dyer's Woad.  Their most distinctive feature, though, was a bright red flash on their wing close to their bodies (or perhaps on their shoulder).  Our plan was to identify them in our Sibley's book when we returned, but that plan got sidetracked by an unexpected encounter.

As we were returning, roughly two miles from Hyrum I spotted a dark house cat sitting in a pullout on the south side of Blacksmith Fork Canyon Road.  I drove past it before I could stop, but then reversed and pulled into the pullout.  The cat didn't move at first, but then started trotting toward our car.  That's very much not the behavior of a feral cat.  Then Debbie opened her door and got out, and the cat ran right up to her.  She could pick her up without any trouble, and while holding her we could do a quick assessment of her condition.  She was skinny but not emaciated, had been nursing kittens not too long ago (no milk, but also no hair around her teats), her coat was full of burrs, she'd been sprayed some time ago by a skunk, and some fur was missing (making us worry about mange).  Otherwise she seemed okay, with no obvious injuries.  The fact that she'd had kittens recently worried us – were her kittens in the area, and was she still taking care of them?  Her behavior suggested otherwise; she showed no inclination to either lead us to or keep us away from any kittens.  We let her down and then just followed her to see if she'd move toward kittens, but instead she kept returning to either us or our car.  This was obviously a cat used to being around people.  Then we tried putting her in the car with us, to see if she'd act concerned about leaving the area.  Quite the opposite; she seemed overjoyed to be out of there.  I drove, Debbie held her, and she was purring loudly and kneading biscuits with great enthusiasm.  After that, we decided that a rescue was in order, as there most likely were no kittens to be concerned about.

So off to home we went, where we set up our new cat in isolation until we can get her checked out by a vet, vaccinated, etc.  We put down some food for her, and she immediately went to work on it (photos below) – obviously very hungry.  She ate an entire can of wet food, and about a cup of dry food along with it.  We put up a waterer and a little box, and made sure she had some comfortable places to lay down, and called it a night.  This morning we came up with a name for her: Laki, which is the Hawai'ian word for “lucky” – and she's certainly one lucky kitty to have run into us out there.  Debbie will be lavishing attention on Laki this morning, and (assuming she's free of any awful disease) I have no doubt that within a week or two Laki will be integrated with the rest of our kitties...