Monday, October 30, 2017

Paradise ponders: sculpture progress edition...

Paradise ponders: sculpture progress edition...  I mentioned a few weeks ago that we had engaged a sculptress to make a bronze sculpture for our back yard.  I still can scarcely believe we did such a crazy thing!  This sculptress works out of her home in Colorado, and she's been sending us photos of her progress on it (we expect it to be done sometime next spring).  Here's what we've received to date:

It looks like she's being supervised by her dog, doesn't it?  :)

The finished sculpture should have the mom mountain lion and three cubs; the two that aren't there yet will be to the left in the last photo.  It's interesting to see how she puts together the armature with metal, and the (very!) rough shape with what looks like sheets of foam.  It's all very abstract until the clay starts to go on!

Sunday, October 29, 2017

Paradise ponders: happy dogs, musical memories, declining savings, and dark nights edition...

Paradise ponders: happy dogs, musical memories, declining savings, and dark nights edition...  It's so easy to motivate dogs to do anything at all – just figure out a way to let them associate the behavior you want with getting a treat, and they'll do it.  Anything.  If you just give them a treat for no reason, their joy is nearly boundless.  Often, upon noticing this, I reflect on how much more difficult it was to motivate people to do what I needed them to do at any business I owned or managed.  There is no “treat” that works for everybody, though often one could figure out a treat that worked for an individual.  Even then, though, that treat didn't work all the time – and something else might come along that completely negated the effect of a promised treat.

For example, I recall an engineer who worked for me, who (I discovered) really badly wanted to take a couple of months off for an around-the-world trip with his wife.  I promised him that in exchange for solving a particularly tedious problem we were having with one of our products, a problem he was particularly well suited for.  This worked for about four months; he plunged into the work with enthusiasm and was making great progress – until he got offended at a completely unrelated decision we'd made about another part of the product.  In the space of a day or two he went from an energized, nothing-will-stop-me attitude to that of a defeated soldier.  He gave up.  The work didn't get done by him, and he didn't get his reward.

That sort of thing never happens with dogs.  They're so much simpler!  That tasty biscuit works every single time.  Oh, I'd have given a lot for an engineering equivalent of a Milk-Bone!

As I write this, I'm listening to Tommy!, by The Who.  It was released in 1969, and for whatever reason is one of the few dozen pieces of music from my youth that I remember most fondly.  I listened to that album many, many times in my electronics “shack” (a converted chicken coop).  I played it on an ancient Motorola stereo with a tube amplifier and 14" electrodynamic speakers, one that I picked up as not-worth-repairing junk from a TV repair shop.  I still remember the experience of troubleshooting it, as it was a significant learning experience for me.  I had no schematic (or any other documentation) for it, so the first thing I had to do was to reverse-engineer a schematic.  I ended up with about 10 sheets of paper with a pencil schematic.  Then I had to figure out how it all worked, and man, that was hard!  There was so much in that design that I'd never run into before.  Finally, once I understood (or thought I did!) how it was supposed to work, then I went to work troubleshooting it.  I didn't have an oscilloscope, so I came up with a “poor man's” approach.  I started with a little signal injector – a simple oscillator that sent a (roughly) 1KHz tone into the input from the turntable cartridge.  Then I built a little amplifier and a capacitively-coupled probe that let me touch points within the Motorola's amplifier to see if there was a signal there.  I worked my way through several stages of pre-amp to the first stage of the power amplifier, and there I found the problem: a shorted capacitor.  So simple!  I replaced that capacitor and voila! – I had a working stereo.  Every time I hear Tommy! it takes me back to that experience...

An email conversation with a (much younger) friend led me to do a little research this morning, and I found the chart at right (source).  It confirms something I suspected from my own  experience: people these days are saving (for all reasons, including retirement and buffer) at a much lower rate (~3% of disposable income today, versus ~12% in the '60s) than they did when I first entered the workforce (in the late '60s).  I don't know the reasons for this, but clearly some of it is a changing culture, part of the more general trend of people not expecting to have to handle the consequences of their decisions.  Anecdotally young people today seem much more likely to expect government intervention to support them in retirement.  When I've pressed people for details about this belief, I haven't run into anyone who has specific notions.  Everyone seems to dismiss Social Security as adequate for retirement, and many have a vague notion that the government will “do something” to provide for them in their retirement.  I saw figures recently (can't find them now, though) that less than 20% of people aged 50 had any means or even a plan for supporting themselves in retirement.  They had vague notions, like cashing in the equity on their house, but nothing more.

It seems rather obvious that a lower savings rate, combined with increased longevity (and therefore more years in retirement), leads to a bad problem for our society in general.  I don't understand why so few people seem to be concerned about this.  In that respect it reminds me of the under-funded pension problem hanging over so many cities, counties, and states.  Another very obvious problem, with relatively little general concern.  I'm very concerned about both, because I strongly suspect that in order to cover these deficits, the government will be trying to come after anyone who has assets in retirement.  Like us, if we live long enough...

This morning I walked from our house to our barn at around 6 am, and the skies were particularly dark.  Orion was high in the southwest, the Pleiades in the west.  As I was staring up at them, a big meteor, orange fireball, plunged straight down from between them.  I could even make out some smoke trail, so it must have reached a fairly low altitude.  The fireball was extinguished just before it would have disappeared behind the Wellsville Mountains from my perspective.  Beautiful!

Today is bookkeeping day for me.  I've got to catch up from my neglect over the past 10 days or so...

Friday, October 27, 2017

Paradise ponders: beautiful fall morning edition...

Paradise ponders: beautiful fall morning edition...  It's another gorgeous day in Paradise, folks.  I took the photo at right a few minutes ago.  It's looking southwest over our alfalfa field, with the morning's first sun rays lighting up the Wellsville Mountains to our west.  Our valley floor will get sunlight in the nest few minutes...

Debbie's coughing persists, so yesterday morning we ventured off to the urgent care again (if you're counting, that's the fourth time since she first got sick on the 7th).  We were ... less than satisfied with the outcome there.  The doctor on duty listened to us politely.  One of the things we told him is that the cough medicine Debbie had used for years to combat her cough-after-a-cold problem was benzonatate – but it no longer worked for her.  He recommended that we try a different cough medication.  We went to the drug store, picked up the prescription he gave us – and it was benzonatate in brand name form!

At that point we decided to make an appointment with our GP, despite the fact that we might have to wait a while to see her.  Debbie  called in, and it turned out that our regular GP was out on maternity leave (she just had a baby boy), and would be until January.  But ... there was a doctor covering for her, and we could get in on that very afternoon.  Awesome!  So off we went again, to see the new doc.  This fellow we both really liked.  In fact, Debbie's first comment upon leaving was that she wanted to switch GPs to him. :)  He listened, was full of questions and comments, and had a cracking good sense of humor.  We were most excellently entertained, and we left with a smile, a prescription for hydrocodone-based cough medication (the only one that's worked for her this year), and an inhaler that he thought might well help.  An hour later her coughing had stopped.  Last night she got her first good night's sleep in over a week.

In between trips to the doctor, I beavered away on my C program again.  Right at the moment I'm writing a replacement for the ancient getopt library.   I've got getopt working, so I really have no need to do this – but I'm offended by the unnecessary complexity of its API.  Further, writing a replacement looks like a tasty practice exercise to me.  So far it's turning out to be simpler and easier than I was anticipating, which really makes me wonder why it wasn't replace aeons ago...

Wednesday, October 25, 2017

Paradise ponders: it was just yesterday edition...

Paradise ponders: it was just yesterday edition...  Only 24 hours ago I mentioned that so far I had ended up writing utility C code myself instead of using third-party libraries.  Well, that ended this morning! :)  I needed to create some JSON-encoded output, and naturally I wondered if someone had a C library for that.  The answer is a resounding “Yes!” – I found dozens of them.  I looked for simple and small, and found this one that I quite liked, right down to the MIT license.  In this case the easy way to use the library was to simply download the two source files (one .c, one.h).  It all compiled and worked on the first try.  I might have to do a little more of that!

Tuesday, October 24, 2017

Paradise ponders: NTP, C, and a nice moment edition...

Paradise ponders: NTP, C, and a nice moment edition...  So a reader wrote and said “I know a bit about NTP, and I’d love to see your ntpq output!”  Well, ok then: here it is, as of a couple minutes ago:

remote           refid      st t when poll reach   delay   offset  jitter
oPPS(0)          .PPS.            0 l   13   16  377    0.000    0.000   0.001
*level1f.cs.unc. .PPS.            1 u    3   64  377   77.729    1.578   1.958 .CDMA.           1 u   60   64  377   32.103    2.562   0.943       2 u   61   64  325   72.172    5.609   1.657    3 u   16   64  377   31.646    1.925   2.052

Now I know that only the geekiest amongst you will have any clue at all what you're seeing there.   If you're curious, everything you need to understand it is available here.  That output was generated with “ntpq -p”; it's a peers report.  The important bits to me are where I've highlighted it in orange: that's the offset and jitter, in milliseconds, for my little NTP server.  A zero in those measurements would be perfect; I'm pretty darned close! :)  My GPS-based timing unit is currently reporting (separately) a maximum error of 8 nanoseconds in it's pulse-per-second output, and that's what my NTP server is using for a reference (that's what the “oPPS(0)” refers to).  The other interesting piece of information I see is highlighted in red.  That's telling me that the NTP server I'm using as a possible reference has not responded to 3 of the last 8 queries my NTP server sent to it.  The “-” at the far left of that line tells me that my NTP server is ignoring it, most likely because of these errors.

I spent a good part of the day working on my GPS configuration and monitoring program, written in C.  I'm really enjoying this “close to the metal” experience again – it's a bit like being back in the '70s and early '80s, when this sort of development was the only kind I did.  On the other hand, it's also driving home for me just what a rich development environment I've been using with Java and JavaScript.  In C I find myself writing code for lots of different things that I haven't had to think about for years.  For example, today I wrote a set of C functions that implement some of the features of Java's standard ByteBuffer class.  That's a really handy thing for encoding or decoding binary data, which is exactly what I have to do for this GPS.  There's nothing even remotely like it in the standard C library!  I did find lots of libraries on the web, but ... knowing nothing about them, if it's something easy, I'll just do it myself.  And ByteBuffers are, in fact, almost trivially easy, so I rolled my own.  So far, if it's not in the Gnu Standard C library, I'm doing it myself.  I'm sure I'll run into something eventually that I'll want to borrow – but not yet.

Yesterday Debbie and I went to Aggie's Creamery for an ice cream cone.  Of course, as always, they were outrageously delicious.  When I first walked in, there were only two other customers there; they had just finished getting their ice cream.  One was a young woman, perhaps 25 years old.  The other was a much older man, maybe 85 or 90, very frail, a little confused, barely able to walk.  The young woman was, I suspect, his granddaughter.  I watched them, unseen, for a minute or so, just delighted by the scene.  The young woman was very solicitous of the old man, watching out and helping in many little ways.  She was clearly happy about his reaction to the ice cream: he was enjoying his little cup of chocolate wonderfulness at the same time she was trying to guide him into the safety of a seat at a little table.  He was distracted by everything: the shop, the bustling employees, the task of getting a spoonful of ice cream into his mouth, and the difficulty of walking in his condition.  Nevertheless, there was a huge grin on his face and he was making utterly unrestrained happy noises.  The young woman finally got him safely down, and as she sat down she turned toward me – and I could see her happy satisfaction with the moment.  She glanced at me and she saw my smile and thumbs up, and responded with a big grin of her own.  Just a sweet, happy moment: a younger person taking pleasure in making someone she cares about happy.  And in that she certainly succeeded...

Monday, October 23, 2017

Paradise ponders: dogs and C edition...

Paradise ponders: dogs and C edition...  There's a morning ritual at our house that is by now burned into the brains of our five (!) dogs.  The ritual has several parts, all of which the dogs have firmly associated with canine bliss.  The first part is the morning excursion to the back yard.  We generally let them out first thing after we get up, even before we do our morning ablutions.  The dogs all know that nothing else happens until they've gone outside and done their business.  They do that quickly, and then as soon as they see activity in our kitchen (as when we've finally really gotten up), then they clamor at the door to be let in – they know what's coming next: bananas!

With five dogs I changed from one banana to two, so they each get roughly 40% of a banana.  And they go bananas!  I peel the two bananas in the kitchen sink, which causes great excitement – especially for Ipo and Mako, both of whom are able to stick their noses over the edge of the counter and slightly into the sink.  There is much leaping and wagging and doggie excitement!  Then I take the two peeled bananas and a knife, and with my back to a kitchen wall wait for the dogs to form a semi-circle around me.  Ipo always performs one little ceremony: she darts into her crate, and then back out to the semi-circle.  Once they've all settled into place, I start slicing the banana and tossing them to a particular dog, saying their name just before I do it.  This is aimed at helping them associate their name to themselves and something good.  It works. :)

Once the bananas are gone, I (and usually Debbie) settle into our morning tea, coffee, and toast or pastry routine.  We're generally talking, reading news or email, etc. during this time.  The dogs are all watching us carefully, waiting for signs that we're finished.  They are incredibly good at detecting these signs, and you can see them winding up as the end approaches – because they know that once we're done, I'm going to feed them.  And that, of course, is the best moment of the day!

We have a small laundry room adjacent to our kitchen.  In there is a cabinet with a rollout drawer that we keep our dog food container in, with a low granite counter top above it.  In the left photo below, you can see that arrangement, caught in the middle of my filling of the bowls.  The three stainless steel bowls that are full of food are for our three youngest (Mako, Cabo, and Ipo), all of whom we feed in their crate.  So the first step for the feeding ritual is always the same: pull out the food drawer, unscrew the lid of the food container, and fill the three stainless steel bowls.  The dogs watch me on every step of this stage, making sure I'm doing it right.  The second photo shows the view behind me as I'm working: dogly inspectors hard at work.  After I fill the first three bowls, I take them (stacked up as in the photo) into the kitchen.  There I fill each bowl with warm water sufficient to cover the food (this brings out the smells in the food).  Then I take them over to the crates, stacked up again – and the three who are about to be fed dart at maximum possible speed straight into their crate.  Often there's a big crashing noise as they hit then end before turning around to await the delivery of their bowl.  Then the crunching and slurping begins. :)

After the young ones are chomping on their kibble, I return to the laundry room to fill the two big blue plastic bowls, for Miki and Race.  These two, being (much) older dogs, get less food, lest they turn into fat old men.  If anything, this makes them even more eager for their morning chow.  Miki's only demonstrations of physicality come during these moments that I'm walking toward the laundry room to fill their bowls.  He knows it's his turn, and he's very excited.  Race is just as excited, but seems to know he doesn't have to work to get his food – he just has to be patient.  So he hovers nearby, emitting little whimpers occasionally, as I fill their bowls with kibble and warm water.  Finally the big moment comes for them: the bowls are put into their stands in the laundry room, and they go to work with great enthusiasm.  Those bowls, you might note, are not smooth on the inside.  As Michelle's boy A.J. likes to say, they've got obstacle courses in them.  These bowls cured Miki and Race of a bad habit: gobbling their food down so quickly that they'd often puke it right back up.  They can't do that with these bowls, as the only way they can get most of the kibble down their gullets is to worm out the individual pieces with their tongues.  They take about twice as long to eat as the younger dogs, but the problems we used to have with their gulping eating style are all gone...

After all five dogs have finished, things are much calmer in the house.  I let them all back outside again, and then they start the serious business of doggie play.  This is their way of waiting out the clock for the morrow's morning, when the doggie ritual of joy starts all over again...

I spent a lot of the day yesterday debugging my C program, and I expect to be doing a bit more this morning.  From a very high level, debugging in C is no different than debugging in any other programming language.  At a lower level, though, it's very different than debugging in Java (where most of my recent experience is) – mainly because most of the problems I encounter are things like uninitialized variables, memory allocation goofs, and pointer errors of one sort or another.  In that respect, it's much more akin to debugging in assembly language, right on the (computer) metal.  Here's one example I debugged yesterday.  The broken code:

*count = 0;

while( TC && (*count < max) ) {
    int c = readSerialChar( fdPort, charWaitNs );
    if( c > 0 ) {
        buffer[*count] = (byte) c;
return *count >= max;

See the problem?  I didn't see it until I stepped through it with a debugger!  Here's the corrected code (highlighted in orange):

*count = 0;

while( TC && (*count < max) ) {
    int c = readSerialChar( fdPort, charWaitNs );
    if( c > 0 ) {
        buffer[*count] = (byte) c;
return *count >= max;

This sort of error (referencing a pointer variable directly, instead of the object it was pointing too) just doesn't happen in Java.  There are no pointers, or so the language proponents like to claim (really, all the object instances are pointers internally, but the language does a great job of hiding that from you).

This difference in debugging is neither good nor bad, just different.  Especially, I think, for someone like me who hasn't done any “low level” debugging for a zillion years or so... :)

Sunday, October 22, 2017

I really am...

I really am ... still here.  Just heads-down on C code. :)

Wednesday, October 18, 2017

Paradise ponders: geekly gloating success!

Paradise ponders: geekly gloating success!  It took me damn near all day to do it, but I finally got remote debugging working with the toolchain I'm using.  All the difficulties turned out to be silly little things (as usual).  It's in the nature of things like this that you have total, epic failure until you nail the last problem ... and then suddenly everything works!  The main reason this was so challenging for me is that darn near everything I was working with (the parts of the toolchain) are brand new to me – so I wasn't just fighting actual problems, I was also fighting my ignorance.  I'm ever-so-slightly less ignorant now.  Here's what I had to do to make all this work:
  • I had to find the sources for a particular older version of the GNU debugger (gdb).  That turned out to be far more challenging than I expected, and led me down a blind alley learning how to clone git repositories.  Turns out GNU has a tarball of exactly the version I needed up on their anonymous FTP server.
  • I had to configure and compile that special version of gdb.  The configuration would allow gdb to execute on my Mac, but debug programs compiled for the Version 7 ARM computer that powers the Raspberry Pi 3.  This was way harder than I expected, but only because I had so much trouble locating the magic word (“armv7-unknown-linux-gnueabihf-gdb”) to use as the argument for the “—target” parameter to ./configure.  I read approximately 17 billion web pages to find that magic word.
  • I had to figure out what “symbol file” meant in the CLion run configuration screen.  I ran with the assumption that I had to tell the compiler to produce a symbol file ('cause that's how things worked in the dark ages when I last did things like this).  Turns out that's wrong.  What I had to do was to compile my source code on the target machine, then copy that object file back to my Mac – and point to that as the symbol file.  That took another 12 billion web pages skimmed to figure that one out.  I also found a way to produce a separate symbol file, though I'm not sure I actually care – the first method is easy and fast.
  • The easiest challenge turned out to be configuring CLion to automate all of the above things.  I only had to read about 5 web pages to get that! :)
The most important thing, though, is: Hooray!  I've got it working!

Paradise ponders: missing blogger edition...

Paradise ponders: missing blogger edition...  No, I haven't disappeared from the face of the earth!  I've just been heads-down on several projects, including installing a microwave, trying to figure out CLion (the C/C++ IDE from JetBrains), and generally learning the C toolchain for remote development on a Raspberry Pi.  So much stuff to learn!

Monday, October 16, 2017

Paradise ponders: C programming and compressed air edition...

Paradise ponders: C programming and compressed air edition...  Debbie and I took a beautiful drive yesterday morning up Blacksmith Fork Canyon.  We saw a dozen or so deer – all fat and healthy looking, ready for the privations of winter – and the tail end of the fall color.  It's elk season, and there were hunters all over the place.  Some of them (a minority, thankfully) park along the side of the road and set up what is basically an ambush at the side of a field where an elk might come to forage.  On one stretch of such an ambush, about 50' wide, I counted eleven hunters.  Each had their binoculars up, searching for some elk to poke its head out.  There were four other such ambushes along the edges of the same field, though the others weren't quite so large.  Still, if an elk was dumb enough to stride out onto that field, probably over a dozen rifles would be shooting at it.  I wonder how they decide whose “kill” it is in a situation like that?  We also saw some beautiful effects of the cold weather (it was 15°F where the photos below were taken), around waterfalls and rapids.  The combination of low temperatures and high humidity meant that the fine spray thrown up by the tumbling water stayed in the air as a liquid (or ice crystal) for much longer than usual.  This produced wonderful “steam” effects, and also ice-coated twigs and grasses.  A few photos of some of the better ones:

We also ran a few chores, but for much of the remaining day, and also today, I've been programming in C again.  I greatly expanded the simple little program I wrote about in my previous post, to give me all the functions I could imagine needing for my NTP server.  I've also modularized it in a way that will make it relatively easy to add new features, should I need to.  I'm finding that I quite enjoy the process of programming in C.  It's a far simpler, smaller language that the Java and JavaScript world I've spent the last twenty years in; in that sense it's easier and cleaner.  On the other hand, some things that are easy to do in Java/JavaScript (mainly because of the ubiquitous high quality, well documented libraries) are much harder to do in C.  Then there's the fact that C is fairly close to the hardware and the operating system – not quite as close as assembly, but not too darned far from it.  I like that; it plays to my hardware background and my desire to tinker with little embedded systems (like the NTP server and my irrigation supervisor).  One thing I've come to realize: it's pretty easy to meld the two languages for everything (or nearly so) that I might want to do: I can handle the low-level, close-to-the-hardware stuff in C (where Java either couldn't do it, or would have trouble doing so), and I can run those C “helpers” as a child process under Java.  That's both easy and clean.  I'm doing a test project of that general architecture right now: to let a Java program interpret the NMEA protocol output of the GPS on my NTP server.  A little C program will echo that NMEA data to stdout, and my Java program will run that as a child process and consume its output.  Simple!  But Java couldn't do it on its own...

Our sprinkler contractor showed up this morning, towing a huge air compressor behind his pickup.  He used this compressor to blow all the water out of our underground sprinkler lines, so that when they freeze this winter (as they surely shall), it won't damage any of the system.  The photo at right shows what it looked like as he blew out one zone in our back yard.  The noise as he did this was quite impressive, and full of bass notes that I wouldn't have expected from rapidly moving air...

Saturday, October 14, 2017

Paradise ponders: NTP adventures and old friends edition...

Paradise ponders: NTP adventures and old friends edition...  Debbie and I are both feeling a bit better today, but wimpy as heck.  Debbie's fever seems to have broken last night, and her voice is back.  I can tell she's feeling much better because she did the cat chores today, much to the delight of our feline contingent!

Last night our forecast called for snow, but we didn't get any.  We did get just a bit of a kind of fine-grained hail (photo at right), along with (I'm guessing) about a tenth inch of rain before the temperature dipped below freezing.

I got a real surprise yesterday: a colleague and friend, Ron N., from over ten years ago contacted me out of the blue.  I'm not quite sure how he located me, but he left a comment on my blog and then the two of us got together on email.  It's been interesting to catch up with him, though obviously we've got a lot more to do of that!  He tells me he'd like to come up here to visit sometime next year, which would be really fun...

Most of yesterday and this morning I've been consumed with trying to fix a problem with my NTP project: configuring the GPS to be in stationary mode, wherein it assumes the antenna is not moving.  This translates into more accurate time measurement (more on that below).  The problem I started out with was that the directions I was following for setting up my NTP server included a link to a program that just plain didn't work.  The specific problem was that the program hung when it tried to open the serial port for reading and writing.  I troubleshot it for several hours, but finally gave up because I didn't understand how it could ever work in the first place.

So I decided to write my own program instead.  That meant that I had to understand the rather complex communications protocol that the GPS chip manufacturer uses for the functions I needed, as they're implemented in a proprietary “UBX” protocol.  Then I had to dust off my (extremely) rusty C programming skills – the last time I wrote a complete C program was around 1983 (seriously!).  I've done lots of work since then in C++ and Java, but not in C – and if you're a C programmer, you know it's changed a lot since the '80s!  Finally, I had to learn something completely new to me: serial port programming on Linux. I did the development work on a Raspberry Pi, where the only development tools I had was gcc (the Gnu compiler) and nano (a text editor).  Somehow I managed to get my little program working, which, I have to tell you, was a very satisfying thing indeed – validation, of a sort, that I might have more than two or three little grey cells still working.  If you're geekly enough to be interested, here's my satisfying little program.

A couple of my readers wanted to know what the heck a GPS receiver has to do with keeping good time on my network.  If you don't know anything about how GPS actually works, I can imagine this is really quite puzzling!  The first thing you need to know is that each GPS satellite has an incredibly accurate atomic clock in it.  There are over 50 of these satellites in four separate systems (the US, Russia, China, and Europe each have their own independent system), so there are a lot of these awesomely precise clocks flying around.  The GPS receiver I'm using can listen to all four systems, and at any given moment it likely has 10 or 12 satellites “in view” (meaning that it can hear their signals). Once my receiver can “hear” at least four satellites, it can tell the time very precisely indeed.  In fact, its accuracy is very nearly that of an atomic clock, as if I owned one of these (very expensive!) things.  All that with a $39 GPS receiver and a $29 antenna!

With the success of my little program, I've now got my stratum 1 NTP server up and running.  It's working great, passing all the tests I can throw at it.  Now the only things left to do are to mount the antenna on my barn's roof (that might be a challenge!) and to make a case for the Raspberry Pi.  I've already got it in use on my network, though – even with the antenna just pointed out of a window in my office, it's much more accurate than any NTP server I can access over the Internet...

Thursday, October 12, 2017

Paradise ponders: finishing touches and beginnings...

Paradise ponders: finishing touches and beginnings...  I woke up this morning feeling pretty lousy – mainly because I was running a fever – but by the end of the day my temperature was nearly normal, and I was feeling ok.  Debbie is continuing to get better as well.

Today the special battery arrived for the alarm panel (part of the much-bigger-than-expected gate sensor project).  This was the last piece I needed to complete the whole project.  I installed it, expecting instant gratification, but I still was getting a low battery alarm.  Dang!  On the off chance that the battery wasn't shipped fully charged, I decided to wait a few hours before troubleshooting.  Glad I did!  About two hours after I installed the battery, my low battery alarm went away.  Yay!  Everything is now working properly – quite a relief after all the trials and tribulations it took to get the right parts.  Now I have a new skill: programming Ademco/Honeywell alarm panels.  For a geek, that's roughly the equivalent of an auto mechanic understanding how to rebuild a 1927 Ford's engine – interesting, possibly even cool, but pretty much worthless in the real world.

I also got started on my stratum 1 NTP server project, mentioned in an earlier post.  I configured a new Raspberry Pi 3b to run as a standalone server, then followed these directions to get a GPS receiver working and configured as an NTP server referencing the PPS signal put out by the GPS board.  That's all working, more or less on the first try, much to my amazement.  I'm having some trouble at the moment with a little detail: configuring the GPS board as a stationary GPS device, rather than a portable one.  In the stationary mode, the timing output is even more accurate, and it will collect a long-term average of its position that's more accurate than the usual GPS mode.  That little detail, plus mounting the antenna on the roof, is all I have left to get my stratum 1 NTP server into a usable state.  I'm going to make a wooden case for it as well, but obviously that doesn't affect its function...

Wednesday, October 11, 2017

Paradise ponders: urgent care edition...

Paradise ponders: urgent care edition...  Well, this morning it was back to the urgent care again.  Debbie's existing symptoms got even worse – especially her coughing and sore throat.  On top of that, she's developed an eye infection, and when she woke up this morning she could hardly open her eyes for all the gunk that had showed up.  We saw a different doctor this time, just as competent and nice as the last one.  This time, though, the treatment was more aggressive, mainly because the symptoms had worsened.  She got a chest X-ray (that ruled out pneumonia), a treatment on the nebulizer machine (to clear up her lungs), a steroid injection (to quickly clear up her lungs), and a whole shopping bag full of meds to attack the eye infection, the cough, and the clogged up lungs.  I'm writing this a few hours after we got home, and she's already feeling better.  Let's hope this trajectory continues!

Yesterday I installed the last major bit of my wireless gate sensor project: an RF repeater to extend the range enough to allow the furthest gate from the house to work.  I put it in my cedar shed pump house, and it all worked right away.  Imagine that!  Now all that's left is to mount the two gate sensors onto the gates that have yet to be repaired, and then that project is completely finished.

A few minutes ago, one of our neighbors brought over a big container of homemade chicken soup, a repeat from a couple days ago.  This stuff tastes really good to Debbie, and it's one of the few things she can reliably hold down, so this gesture is much appreciated.  What a great community to live in!

Monday, October 9, 2017

Paradise ponders: creeping crud and remote gate sensing edition...

Paradise ponders: creeping crud and remote gate sensing edition...  Poor Debbie is laid pretty low with some virus she most likely caught on her travels.   I took her to our local Urgent Care facility yesterday just to make sure it wasn't something truly awful.  The doc said it's just your usual virus, gave her a prescription for some codeine-based cough suppressant (seems to be working ok), and a backup prescription for antibiotics in case it was something more than a virus.  The doc practically begged us not to use the antibiotics, but to save us a possible second trip he gave us the prescription anyway, once he was sure that we understood his pleas.  From the manner of his delivery, I'm guessing that many people don't realize that (a) antibiotics are completely ineffective against viruses, and (b) that taking antibiotics when they're not needed has some undesirable effects.  You'd think by now, almost 100 years into a good understanding of viruses versus bacteria, that these things would be more generally known.  Apparently not...

In between caring for Debbie and the animals I've been working away on the remote gate sensing project.  Today I got the Tuxedo panel, the RF receiver, and the alarm panel all installed and working.  Furthermore, I got three of the five gate sensor installed and also working.  Woo hoo!  The remaining two gate sensors have to wait until my contractor has fixed the two gates they're going onto.  The only thing I have left to do is some caulking and painting of the cables running along the outside wall, which, weather permitting, I will do tomorrow.

Meanwhile, here's what the visible components of the system look like.  The first photo is the Tuxedo panel, which is installed in our kitchen, right alongside the door we use to let the dogs into the back yard.  It looks a bit like an iPad mounted on the wall.  The screen turns off after a few minutes of disuse, leaving a bland plastic slab visible – not exactly beautiful, but at least not obnoxious.  A touch to the screen lights it up again, at which point that green bar across the top means “All gates are closed!”   If that bar turns orange, one or more gates is open.  In that case, a couple of click on the touch screen will show the open gates, by name.  The second photo is the RF receiver, which I've mounted in the kitchen just above the aforementioned door.  It's particularly unobtrusive – you'd have to have an unusually observant person to even notice it was there.

An inquiring reader wants to know...

An inquiring reader wants to know: what's it like for one who drinks alcohol to live in one of the states most restrictive about selling alcoholic beverages?  For those who don't know: in Utah one can only purchase packaged alcoholic beverages at a State Liquor Store.  There's one twelve miles from our home, in Logan.  An alcoholic beverage is apparently defined as anything containing more than 3.2% alcohol, because “3.2 beer” is sold in every grocery store.  You can also buy alcohol at bars (which we never go to) or in restaurants who have obtained a liquor license and who obey the rather arcane rules surrounding serving food and alcohol together in Utah.  It is illegal to ship alcoholic beverages into Utah, so we can't use online vendors like this.

Between the two of us, Debbie and I drink wine, beer, and scotch, all in small quantities.  We like to get “the good stuff”; it's one of the perks of retiring with enough money to afford it.  So how has living in such a restrictive state affected us?  Bottom line: hardly at all, and certainly not to the degree we expected it to.  Mainly this is because the State Liquor Stores actually carry a rather nice selection of the beverages we enjoy – better, in fact, than most of the retail outlets we knew best in San Diego.  There's one particular location (in Salt Lake City, of course) with an especially good wine selection.  Our local store's wine selection is decent, too.  All the locations seem to carry a broad selection of top-drawer single malt Scotch.  And all the locations also carry a wide variety of the craft beers that Debbie loves – including some from local craft breweries (mainly in Salt Lake City).

About the main effect we've actually been impacted by is being sawed off from the online vendors.  That we really do miss.  There's a fairly easy workaround we haven't yet employed: we could obtain a PO box from a place like Mail Boxes, Etc. in a nearby Idaho town, and have it shipped there.  It would be about an hour's round trip to go retrieve it.  We haven't been so motivated yet, though that's still a distinct possibility...

Paradise ponders: missions to space...

Paradise ponders: missions to space...  I'm sitting here this morning watching the live webcast of the latest SpaceX Falcon 9 launch, on my laptop in my kitchen (screenshot at right).  Watching this got me to remembering the first such launch I followed: the launch of Vanguard 1, on March 17, 1958.  I didn't see this on television; I listened to it on my crystal radio, the one my dad helped me build.  After that, every chance I got I listened to (on radio), watched (on television), and read (in science related magazines) everything I could, up through the Apollo moon missions.  Much of the detailed information about those missions came from books and magazines published long after the actual launch.

Now fast-forward nearly 60 years, and here I am in my kitchen.  I'm watching a high-fidelity, realtime presentation on the SpaceX launch, on my laptop computer.  It's connected by WiFi to the Internet, which is how the video is being sent to me.  It's in hi-fidelity, full-color, with great audio.  There is realtime video from the launch pad, from the first stage, from the second stage, and from the drone ship where the first stage will attempt to land.

It's a few minutes since I wrote the above paragraph, and now the first stage has successfully landed on the drone ship.  The second stage is in parking orbit, preparing to transition to a higher orbit where the Iridium satellites (ten of them) will be deployed. 

SpaceX is really starting to make satellite launching routine, in a way that NASA was never able to do.  So far this year they've launched 15 rockets to orbit, and recovered the first stage successfully on 8 of those flights (something NASA once declared “impossible”).  For me, the excitement I'm feeling today about SpaceX's efforts is that they provide a promise that commercial exploitation of space might just be possible.  Elon Musk has far grander visions than that, but personally I'd be satisfied with nothing more than igniting commercial exploitation – because then I know for sure that mankind's ventures into space will be better-managed, sustained, and successful...

Saturday, October 7, 2017


Attention!  Debbie is home, safe and sound...

Paradise ponders: discombobulation edition...

Paradise ponders: discombobulation edition...  Well, of course everything went wrong with Debbie's flights home yesterday.  It's a long and uninteresting story, but the end result is that she's booked onto new flights today.  In fact, as I write this, she's in the air from Cincinnati to Chicago – and amazingly enough, that flight is looking like it will arrive early.  The poor lass ended up staying in a hotel last night, right next to the Cincinnati Airport.  Assuming her connection in Chicago works out all right, she should be on a flight to Salt Lake City in about 90 minutes, and arriving here at 11:15 am.  Yay!  In my last texts with her, though, I discovered that she's feeling like she's got a cold coming on.  Dang it!

With Debbie's change of schedule, our plans for yesterday got blown up.  I did get a coat of paint on the new trim work and siding where the new deck was attached to the house.  It already looks a lot better, though it needs at least one more coat of paint for completely coverage (I'm painting white over a dark primer).  I was also able to make progress on what has been an unexpectedly complicated undertaking.

We created a beautiful fenced back yard for our dogs about a year ago.  This back yard has five gates, three of which are not visible from the back door or deck.  On multiple occasions we've had people leave a gate open, including a couple of times after I put the nice little signs up asking people to keep the gates closed.  This is worrisome for us, as we're afraid that someday a gate will be open, we won't know it, and we let our dogs out.  They'd discover that open gate within seconds, and then they'd likely scatter to the winds – we have, unfortunately, seen this action before.

So I got to wondering if there was a way to put sensors on the gates and have an indicator of some kind in the house to let us know if they were open.  Wireless (radio) sensors of some kind would be the easiest to install, by far – running wires to all those gates would be a serious pain in the patoot.  So I started researching that, and quickly ran into wireless gate sensors (made by Honeywell) that were designed to be part of an alarm system.  I started checking that out, and I found online discussions about using a product called “Tuxedo” with them.  Some of those discussions mentioned how easy this was.  I liked that!  So I ordered five gate sensors and that Tuxedo.

When I received them, I unboxed the Tuxedo and a sensor with the intent of testing things out to see if they worked ok.  I quickly ran into a mystery: the Tuxedo had no power supply, or any obvious place to connect one.  WTF?  The only electrical connection to it was a 4 position terminal block.  I was forced to go read the manual – and in doing so, I discovered that the Tuxedo was actually just a peripheral unit (“keypad” in alarm-speak) for an alarm panel.  Said alarm panel was required in order to operate the Tuxedo.  Sheesh!  So after some research I located a relatively inexpensive alarm panel, the Vista 21IP.  I ordered it, all the while thinking to myself that I was being sucked into some kind of money pit.  I just want to know if my gates are all closed!

When the panel arrived, I sat down to do that testing again.  This time, the Tuxedo had power (after I wired it to the panel), and it booted up and started working.  The reviews rave about how easy the Tuxedo is to use, as a method of programming the alarm panel.  Something I failed to understand until I actually used it is that those reviews are rating it's usability in relative terms.  By any modern user interface standards, the Tuxedo's user interface is somewhere between horrible and criminal.  However, compared with the alternative – using the “standard” arcane and tortuous numeric code programming – it is wonderful.  The standard scheme looks like something out of the '50s, or transcribed from a medieval torture manual.  So I suffered through enough stuff (Googling often for help) to prove that the Tuxedo was actually working.

So at that point I broke out one of the gate sensors to see if they were working.  Here a misunderstanding on my part came up and slapped me in the face.  The discussions I'd read online about the Tuxedo raved about its “Z-Wave” (a wireless standard) capabilities, in particular how simple it was to make them work.  That's the part I really liked reading.  Those same mentioned how easy it was to make the Tuxedo work with wireless sensors, and mentioned the gate sensors.  So I assumed that the gate sensors were Z-Wave sensors.  They are not.  They use a completely different wireless standard, not even on the same frequencies as Z-Wave.  That means the Z-Wave receiver built into the Tuxedo can't receive the radio transmissions from the gate sensors I bought.  After a lot of research, surprisingly difficult in the Google era, I finally figured it out.  I needed another RF receiver, one that is a peripheral to the alarm panel.  The money pit vortex strikes again.  I ordered one of these.

Meanwhile, I tracked down two annoying “faults” that kept popping up on the Tuxedo.  Both of them, it turns out, were actually faults within the alarm panel being reported on the Tuxedo.  One of them was a “103 LNGRNG RADIO” error, and I figured out that this was related to the cell phone interface built into the alarm panel.  That interface is intended for reporting back to some central monitoring company (like ADT).  Of course I had no interest in that, since I'm not using this as a burglar alarm.  With some additional research, I discovered that if I entered a magic series of digits (“411280056**00*”  - I kid you not) on the emulated keypad, I could disable the cell phone completely.  I tried it, and (it's magic!) it worked.  One problem down.  The other error was the panel complaining about a low battery voltage – but there was no battery.  WTF?  Turns out that the panel requires a rechargeable battery for power backup.  So far as I could tell, there was no way to disable this requirement.  Naturally, the battery in question is a non-standard one, so I had to order one of those as well.

Yesterday the RF receiver arrived.  I connected it with some trepidation, wondering what new part was going to be required in order for this to work.  Once I had it connected, I researched how to “enroll” a gate sensor (all that means is to pair the gate sensor with the panel).  I expected this to be something like Bluetooth pairing, but oh, no, it's nothing at all like that.  Pairing on of these involves manually entering the gate sensor's serial number.  That involves strings of numbers that makes the disabling of the cell phone look like child's play.  It took me a half hour of frustrating interaction with what is surely a candidate for the worst user interface ever invented to get the first gate sensor enrolled.  But then, the good news: it actually works!  In under a second, any change of state on the gate sensor (open-to-closed or closed-to-open) gets reported back to the alarm panel and then to the Tuxedo.  Holy crap, this is actually going to work!

Now that my test is done, I have to wire all this stuff in.  The Tuxedo will go on the wall next to our back door, so it's convenient to check before we let the doggers out.  The RF receiver (quite small) will likely go on the wall above it.  Those two things can easily be wired together.  The giant, utilitarian-ugly alarm panel will go in our mechanical room, in the basement.  That means I get to run a four-conductor cable between the basement and our kitchen, while keeping the wiring completely inside the walls in the house.  That's gonna be a bit tricky, and I'm still working out how exactly to accomplish that.  The battery should arrive with a couple weeks, and by then I should have it all hooked up...

Friday, October 6, 2017

Paradise ponders: porches, homecomings, and sunrise edition...

Paradise ponders: porches, homecomings, and sunrise edition...  Our masons (Randy and Jeffrey) were here yesterday to finish putting the rock on our two porches.  They brought three dogs with them, all of them lovable beasts – but most especially Carl, the border collie in the second photo.

Debbie comes home tonight!  I'm driving down to the Salt Lake City airport to meet her at 10:30 pm – very late for me.  There will be a happy household here, round about midnight.  Yay!

Yesterday morning I was up at my brother's cabin south of Newton, hoping to install a new microwave for him.  That didn't work out so well (the new microwave was damaged in shipment), but I did get to see a beautiful sunrise!

Tuesday, October 3, 2017

Paradise ponders: more fall color, crispy morning, and electronic pursuits edition...

Paradise ponders: more fall color, crispy morning, and electronic pursuits edition...  Yesterday around noon I finished all my bookkeeping and set off on a short trip to Porcupine Reservoir to see the fall color (photos below).  That was one beautiful drive.  Near Avon I passed the home of our friends Bruce and June N., so I stopped in to say hi.  Ended up talking to Bruce for an hour, catching up on all sorts of things.  June was away in California, so I didn't get to see her.  From their home, on a knoll, you're surrounded by some of the best fall color I've seen.  What a perch they have for this season!

This morning I was outside working at the crack of dawn, cleaning up the deck in preparation for caulking and painting.  It's cold – just 26°F when I first got outside.  Once the sun came up it (slowly) started to warm up.  The views were very nice, too.  The first photo below is looking to the southwest from our front yard.  If you click to embiggen it, you'll see the beautiful fall color on the sunlit hillside, and clouds amongst the peaks toward the left (due south).  The second photo is looking east at our (newly sodded!) back yard, covered with frost.  I had intended to catch the dogs playing in the sunlight there, but naturally when I brought up my phone to take a photo they all ran away and hid.  Communists!

Yesterday I read about the new iMac Pro, with lots more detail than I've seen before.  My basic reaction is: I gotta get me one of these!  They're due for release in December, so I think I know what my Christmas present will be this year!  A shipment I've been anticipating arrived yesterday, too: a GPS extension board for the Raspberry Pi 3b, along with a matching roof mount antenna with a low noise amplifier (LNA).  The parts to mount it are due tomorrow.  This particular GPS board has a pulse-per-second (PPS) output and uses all the extant GPS satellite networks, plus it has a stationary (base station) mode.  All of this combined makes it the perfect time reference for a stratum 1 network time protocol (NTP) server.  I have no actual reason to own a stratum 1 NTP server, but it's something I've always wanted (and actually, briefly, had a few years ago).  Having this server on my local network should give me computer time accurate to sub-millisecond levels on all the computers I own (about a dozen at this point).  What's that good for?  Not much.  But if you're a geekly sort, it's way cool!

Monday, October 2, 2017

Paradise ponders: electrical phenomena and gorgeous fall color edition...

Paradise ponders: electrical phenomena and gorgeous fall color edition...  Saturday evening, my brother Scott contacted me to let me know that there had been a lightning strike near his cabin (just outside Newton, Utah) and that he'd lost power.  By 8:30 pm, power was restored, so I wasn't worried.  Then on Sunday morning he contacted me again: he had no water and his refrigerator had died.  Yikes!  I grabbed my trusty DVM and headed his way...

The 30 minute drive to his place was spectacular: a mix of blue sky and rain squalls turning into rain near his place, views of the red and orange fall color that blankets our mountains.  As I drove, I listened to an NPR reporter trying her level best to get a Puerto Rican citizen to condemn the US (and by inference, Trump) response to the hurricane.  The citizen kept insisting that the response was good, much to the frustration of the NPR reporter.  It was a pretty clear example of media bias, though I doubt most listeners would even realize that.  It was a strange juxtaposition to the beauty around me...

Once I got to Scott's place, I did a little diagnostic work.  The refrigerator's circuit board was easily accessible (thank you, LG), and I spotted a soldered-in fuse on there.  A quick test showed the fuse was blown.  Then I started checking out the well pump (a fancy variable speed pump and controller).  The controller had no LEDs, not a good sign.  The cutoff switch was open, cover missing, and some quick testing there showed 240 VAC on the line side, and 0 VAC on the load side.  At first I couldn't figure out what the heck could be wrong with the switch – not much to go wrong on them.  Later I figured out what had happened: that switch was fused, but the fuses had quite literally exploded.  The explosion damaged some of the internal switch components and blew the door off the switch box (door and box made of sturdy steel).  Scott wasn't home when this happened, or that noise would most certainly have scared him! 

So off we went to get parts.  At home Depot, we bought a replacement fuse for the fridge, and a soldering iron to install it.  At Lowe's, we bought a replacement cutoff switch, fused.  Then we went to Herm's and had a great breakfast: carnitas skillets all around.  Man, those are great!  With properly fortified tummies, we headed back to his place to do the actual repairs.

First up: the fridge.   I soldered some brass wire to both ends of the replacement fuse, then soldered it piggy-back on the blown one.  We plugged the fridge back in and it worked.  Yay, fuse!

Then down into the basement, and I replaced the blown-up cutoff switch.  That was a straightforward exercise, and afterwards we turned on the power ... and the pump controller still had no lights.  Dang.  So I opened up the controller and looked for an internal fuse – no joy.  On closer inspection I saw char on the board, near the switching power supply transformer.  Looks like the controller blew up, too – the cutoff switch fuses must not have blown quickly enough.  Scott will be calling the pump folks this morning, and hopefully they've got a replacement controller in stock.  If not, Amazon has them.  For the moment, he's without running water.  At least he has food. :)

After that I headed back home, again treated to a glorious drive.  I drove all the way down to Wellsville on State 23, paralleling the eastern side of the Wellsville Mountains.  The entire length of that trip I had spectacular views of fall color up the slopes...

The last one...

The last one...  The last full portrait of Saturn taken by Cassini before it crashed into Saturn.  It sure is a beautiful planet...   Via APOD, of course...

Sunday, October 1, 2017

Paradise ponders: catch-up edition...

Paradise ponders: catch-up edition...  Just after dawn on the morning we learned that Debbie's mom had died, I walked out to our barn ... and saw what you see in the photo at right.  The sight of that flag makes me think of my mom and her love of all things crafty every time I see it.  I have no equivalent piece of memorabilia for Kate (Debbie's mom)...

Debbie arrived safely in Ohio yesterday afternoon.  Her sister Judy picked her up at the Cincinnati airport, then took her back to Judy's home near Oxford.  Debbie used gate-checking for the first time on her trip yesterday, and was very happy with the results: her luggage arrived in Cincinnati along with her. :)

As I mentioned yesterday, I've been working steadily on the deck project in between bad weather and all the other things happening in our life.  In the first photo below, you can see my clamping arrangement for one of the dowel-pinned butt joints I made in the rails (one in each of the four rails).  In the second photo you see one of the butt joints after gluing and sanding – they came out very well indeed, with an almost invisible joint.  Despite the good results, if I ever do this again I'm going to use a half lap joint instead – they're much stronger, though a bit more challenge to get perfect.  The third photo is of the cedar ceiling again, and the fourth is the finished redwood rails, after their last (of six!) coats of polyacrylic finish.  I used satin polyacrylic, lightly sanded with 600 grit paper between coats, and I'm very happy with the results.  Now I just hope it stands up to the weather as promised!  The fifth photo shows the (much less messy!) deck with the rails in place, and the last photo is a closeup of a rail and stanchion.  The color for the stanchion's finish was chosen by Abigail at Lazy K Wrought Iron – it sure looks good with that redwood!  Speaking of Lazy K, they're going to be making the metal framework for our deck stairs as the next project they do for us...

Yesterday when the sun broke out in the afternoon, I took a ride up Blacksmith Fork Canyon to Hardware Ranch.  It felt quite odd to do this by myself!  I didn't see a single animal, and only a couple of birds – but the fall color was just spectacular.  I had spotted the orange and red hillsides through the rain earlier in the day, but when the sun came out ... well, see for yourself:

I had about two hours of intermittent sunshine, and I made the most of it with the beautiful drive and several short walks.  I sure wish Debbie was here to see this – it's far better color than in the previous years we've seen.  Hopefully we'll see it again another year.  One thing I noted yesterday is that several species have yet to turn color – most particularly the quaking aspen, who have just barely begun to lose their green.  In another few days they should reach their peak – maybe Debbie will get to see them!