Category Archives: Uncategorized

Tour 2015 – Day 11: Bike Santa Fe, or, Lost in the Desert

Cutting through the Rail Yard parking lot to get to the trail
Cutting through the Rail Yard parking lot to get to the trail.
Photo by Judy

Our first day in Santa Fé was warm and sunny, an ideal day for riding the 20km out to our granddaughter’s house south of the freeway. We oiled the chain, essential after 10 days of being battered by road grit, wind, rain, and snow on top of the car, and set out, with a vague mental image of the route. Relying on line of sight to keep the railroad tracks in view, we made our way through downtown Santa Fé, finally solidly on the trackside trail.

DSCF0416
The Arroyo Trail, deceptively downhill, even in the “flat” parts.
Photo by Judy

Before long, we arrived at a fork in the trail, near the high school, and took the right fork down into the arroyo, a path that continued downhill at an alarming rate, as we would have to climb back up in the heat of the day, when we would be tired. But, we enjoyed the speed, zooming over a bridge and continuing down the arroyo, forgetting that the bridge was the junction where we should have turned left (uphill) onto Richards Street. We suspected we were off our route when we arrived at Sam’s Club on Rodeo Drive.

DSCF0423
Looking back up the arroyo from the overpass on Rodeo Drive. We knew we were lost at this point, but at least in the right direction.
Photo by Judy

With an “Oh, well, we’re still headed in the right direction,” we descended back into the arroyo and continued on, until the trail broke up into a series of short, twisty, uphill segments through a housing development and ended on a boulevard. There was a bike lane, so we continued on the street, eventually arriving on Cerrillos Street, NM Highway 14, the main route to Interstate 25. We’re now not lost, but not where we intended to be. Judy’s rule about not riding on the road and not riding steep grades while I’m still on anti-coagulant medication had long since been broken, so we continued on, stopping at the new Starbucks near the intersection with I-25.

DSCF0426
A bonus to being lost–we found the Starbucks on NM 14 near the intersection with I-25.
Photo by Judy

Steeled by a dose of caffeine, we set off once more, dodging cars and trucks on the freeway ramps, finally rejoining our intended route, still on busy Highway 14, but our only choice until we turned off to our granddaughter’s neighborhood at the bottom of a steep hill.  When we stopped, the GPS read a bit over 20km.  Our misdirection turned out to have saved us a few hills and about 2km, at the expense of a little [more] freeway madness, but with a much-needed coffee stop.

20150511_131545
Raymond
20150511_131653
Rocky, Karyssa, Patrick, and Kayla. Paul Jr is in Las Cruces, where he just finished his senior year in high school.

After lunch and a visit with the great-grandchildren, we climbed back on the bike for the long uphill ride back to our lodging downtown, this time intending to take the route we had planned, a quiet road paralleling the freeway to the northeast, then under the freeway to the Arroyo Trail. However, without a detailed map and dodging unexpected heavy traffic, we turned off the highway too early and then missed an alternate left turn that would have put us on our intended route, continuing uphill on a very busy rough road with no shoulder. From time to time, we could see the freeway getting farther and farther away to the north, yet pressed on, arriving in a new housing area at the top of the hill. We flagged down a passing cyclist, Steve, of similar age to our ourselves, to ask directions. Yes, we were lost, with the choice of backtracking 4km to Highway 14 and taking the right route, or pressing on through hills and traffic to Richards Street, which would get us back on track.

By this time, we were hot and exhausted: Steve offered to get his pickup truck and take us to where we needed to be, an offer we couldn’t refuse. So, off we went with Steve and Joan, in increasingly heavy traffic and confusing intersections, which we would not have wanted to cycle through. Finally crossing the arroyo, we, not wishing our kind rescuers further traffic trauma, had them pull over. We descended once more into the arroyo, riding around the south side of the high school complex, then ascending steeply (pushing the bike) to the intersection with the rail trail, a gentler grade, which we followed back to the main rail station and then back out onto the streets for the last leg of our journey.

DSCF0430
This was a lot more fun going the other way earlier in the day. Climbing up out of the arroyo to the rail trail to downtown.
Photo by Judy
DSCF0434
The trail becomes less distinct near the train stations. This is the Rail Runner, commuter service between Santa Fe and Albuquerque.
Photo by Judy

Our total riding today was 33km, in three segments, with lots of hills and road riding, our longest daily total since 2013, and at 2100 meters elevation. When we first arrived in the high country, a couple of days ago, we found ourselves out of breath just walking up stairs, but we seem to be acclimatizing rapidly. Professional cyclists routinely train above 2100 meters as a legal performance enhancement technique, so maybe the pain will produce gain, even at our age.

Links to GPS tracks:

Santa Fé outbound

Lost in the Desert

Santa Fé inbound (on the trail again)

Santa Fe Bike Trails from Larye Parkins on Vimeo.

Practice, Practice, Practice: An Amateur Filmmaker’s Journey

The old saw, “How do you get to Carnegie Hall?”  Answer:  “Practice, practice, practice,” is so true.  All of us are impatient: we just want to “do artistic stuff” and have it turn out like the examples that inspired us in the first place.  However, no matter how refined our tastes, our talents take time to develop.  How long depends on how much help or critique we get along the way, plus a lot of hard work.  What follows is a narrative example of and informal tutorial on making videos on a budget, with inexpensive equipment and open source software.

I’ve always wanted to learn to make video presentations.  I imagined I might want to record test flights in the homebuilt airplane project that has languished, unfinished, in my cluttered and sometimes soggy workshop.  Another  project is documenting our bicycle travels.  One obstacle was gear: quality video equipment is expensive.  However, all modern digital cameras have a video mode.  I started practicing several years ago, strapping my Fuji pocket camera and small tripod to the handlebars of our tandem bicycle, to document rides on the bike trails.  It was pretty terrible, amplifying the bumps and roots on the trail and the clicking of the gear shift, as well as not being very well attached, with the camera flopping around from time to time.

The next year, I got a GoPro Hero 3 (Silver–the mid-range model) point-of-view sports camera, and a handlebar mount made for it, a modest investment.  The  GoPro web site has daily videos sent in by users, showing off amazing feats of surfing, bicycling, motorcycling, scuba diving, parachuting, wing suit plunges, and all manner of dangerous sport, seen from a camera strapped to the forehead, chest, or wrist of the participant.  Some were exciting, some just plain scary, but all very professional-looking.

motelDSCF0614
The Mean Green Machine on tour in Michigan’s Upper Peninsula, with the GoPro mounted above the handlebars (and the headlight) in its waterproof case. While at an ideal Point of View height, the mount tends to vibrate a lot. I have a helmet mount, but my riding style involves a lot of head movement, which is distracting as well.

 

At first, I strapped the new camera on the handle bars of our Bike Friday Tandem Traveler “Q,” turned it on, and set off on a 35-km ride.  The result was better than the first attempt with the Fuji, but still shaky, vibrating, and endless.  OK, a bit of editing to show some particularly interesting parts, or at least cut out the really boring and really shaky parts.  But, a lot of time sifting through gigabytes of footage.  I eventually pared the hour and a half of “film” (I only recorded one way of the out-and back ride) down to 11 minutes of not-very-exciting or informative view of lake and woods drifting by at 15km/hr bicycle speed, plus a few moments of 30km/hr downhill bouncing and shaking.  The sound track was a muffled one-side conversation between me and my stoker, Judy, on the tandem, plus a lot of road noise transmitted through the frame, and the frequent clicking of the shifters  and hissing of the brake shoes on muddy metal rims.  A really round-about way of saying “We went for a really satisfying bike ride up the south shore of the lake, and came to nice waterfalls about once an hour.  Wait for it.”  Fast forward two years of trial and error…

After watching a lot of other people’s videos, and the progression in skill over the years of some of my favorites, like Dutch cycle tourists and videographers Blanche and Douwe, I have possibly picked up some hints of what makes a good video presentation.  I mostly publish on Vimeo.com, which offers a set of short tutorials on making videos., but I also recently viewed some good tips by Derek Muller, a science educator who makes a living filming short YouTube videos on various topics in science (Veritasium.com), and Ira Glass, host of National Public Radio’s “This American Life,” who published a series of four short talks on storytelling on YouTube.  Both agree that getting good takes practice.  Lots of practice.  Probably not as much as Malcom Gladwell’s tale of 10,000 hours of solid practice (in “Outliers“).  but a lot nevertheless.

The main point of Derek and Ira’s stories is: video is storytelling.  As we found, it is not enough to simply record the world as it goes by on your adventure.  The result has to tell a story: why you did it, where you went, what it was like, and what you learned, in a concise way that holds the interest of the viewer.  I know that most of my efforts failed, because of my viewer numbers on Vimeo.  Sometimes both of my loyal viewers watch a particular video, sometimes neither of them do.  Obviously something needs work.  Submissions to video contests garner a couple hundred views (compared with thousands for the winning entries, and millions for the viral baby, cat, and stupid human tricks videos on YouTube and Facebook), with no idea how many viewers actually watched all the way through.  So, we evolved over time, failure after failure.

First, I got rid of the “native sound,” because what the camera mic picks up isn’t what I focus on or even consciously hear while riding.  Instead, I find a piece of music that I think reflects the sense of motion and emotion in the ride, or one that at least fits the length of the film, or that I can cut the film to fit without making the visual too short or too long.  A fast ride needs a beat reflective of the cadence; beautiful scenery or glorious weather deserves a stirring orchestration or piano number, a matter of taste.  The next step is to trim the video clips to match the phrasing of the music, if possible.

I realized that, though I find looking forward to what is around the next bend exciting while on the bike, watching endless scenery flow by on the small screen isn’t particularly engaging.  Most of other people’s videos I enjoy have clips (scenes) of 7-10 seconds each.  Mine ran generally 20 seconds to several minutes.  Boring.  Furthermore, long takes don’t necessarily advance the story line, just as important to film as to the page, unless there is some interesting progression unfolding in the clip, much as a detailed sex scene in a novel is only necessary to define a key point in the development of the relationship between the characters:  mostly, it is sufficient for the characters to retreat to the privacy of the bedroom behind a line of asterisks, as a transition between scenes.  A video fade on a long stretch of empty road to the next bend suffices just as well.  We’re not promoting “bike porn” here: no matter how much we personally enjoyed the ride.  I’m beginning to appreciate the need for story-telling that doesn’t fall into the “shaggy dog” genre, i.e., drawn-out and pointless–suspense to boredom without a satisfying punch line.

Picking music is another issue.  At first, I shuffled through my library of ripped CDs (no piracy here,  just a convenient way to carry your music library with you, on the hard drive of your computer instead of a case full of plastic in a hot car).  However, even if the audience is small (i.e., myself and others in the same room), such usage violates the copyright on commercial recordings, especially on a public post on the ‘Net.  I’ve recently started re-editing some of the early videos I made this way, substituting from my new library of royalty-free music published under a creative commons license, and downloadable from several sites on the Internet, notably www.freemusicarchive.org, where musicians leave selections of their work as a calling card or audio resume, hoping for commission work or performance gigs, or to sell physical CDs in uncompressed, high-fidelity audio instead of downloading the lower-quality MP3 lossy compression version.

This is the wave of the future in a world where digital copies are easy: whether you buy a copy or get one free, play it, listen to it, use it to enhance your art, just don’t resell it whole.  That’s the idea behind creative commons.  Unfortunately, much of music publishing is still in the “for personal use” only, and if the pressed recording gets scratchy, buy another one, no “backup” copies allowed, and no sharing with friends: if you want them to hear a song, invite them to your house or take your iPod over to theirs: you can’t stream it or email it or share a copy on the cloud.   ASCAP blanket licensing for broadcast or use in video is still on a corporate price scale, intended for production studios and well beyond the reach of a PC user who just wants to add her favorite pop tune to a video of her and her friends having fun.  So it is that Kirby Erickson’s ballad of driving up US93 through the Bitterroot as background to a bike ride up US93 through the Bitterroot is gone, so viewers who aren’t familiar with his work won’t be tempted to buy the album the song came from, because they won’t ever hear of it.   Restrictive licensing actually potentially reduces sales in the Internet age.  By now, you can’t even upload videos if they have copyrighted music audible in them–Facebook, for one, matches audio signatures from video against a sound library and blocks them.

Although I see some improvement in quality in my amateur videos, I still have a long way to go.  For one, the handlebar mount for the GoPro camera introduces too much vibration, so the picture is hard to watch, and doesn’t reflect the experience of riding.  Some damping is needed.  We did get some better results with the camera mounted on our trailer, but we only use that when touring.  Some sort of counterweight to produce a “steady-cam” effect might work here, as the “real thing” is expensive and a bit bulky.

The story is more interesting when it shows the participants, which, for us, means using the trailer mount or some sort of “selfie stick” to put the camera to the side or front, or, as I did in one clip, turn the camera around briefly.  During my convalescence from heart surgery last summer, we did a lot of hiking, where I devised a selfie-stick approach to give the impression of the viewer being with us instead of sharing our point of view.   I’m a bit happier with some of those, particularly the ones where the camera boom isn’t in the view.  More practice, and experimentation.  I’ve been more satisfied with ones where we’re in the shot only when necessary to tell the story (an essential point, when the story was that I was OK, and getting better), and the scenery out in front when it was the story.

Now, the issue is to trim the scenes to the essential elements (who, what, where, when, why, and how).  To that effect, part of the re-editing process to replace the audio tracks involves cutting the video to synchronize with the sound track phrasing, as well as reducing the length to the minimum necessary.  To paraphrase E.B. White’s dictum on writing, “Omit needless frames.”

fireflyDSCF0730
This still frame says it all: who is reflected in the window, how is the bicycle, where is “Firefly Coffeehouse” in Oregon, Wisconsin. what is “bike tour,” and why is, well, we’re having a good time.

 

One of the issues with being the director, cameraman, and actor all at once is to keep the bicycle safe while planning the shot and operating the camera, as well as keeping the mission (travel) moving along.  We miss some good shots that way, but it is inevitable.  One popular technique is to set up the camera along the route and show the bicycle or hikers approaching or receding across or into the frame, which involves stopping and staging the shoot.  This is less intrusive where there are two or more cyclists, so it is a matter of setting up the shot ahead of or behind the other rider(s), but that isn’t an option with the tandem, and we’ve used it in limited fashion by propping up the monopod/selfie-stick along the trail.  We do have several sizes of tripods, but they aren’t convenient to carry when the photography is incidental to the main purpose of travel.  I’ve long since taken to filming short takes “on the fly” rather than just leaving the camera on to pick up everything, which involves anticipating some scenery reveals or events, and, of course, missing some.  But,  editing “on the fly” to limit scenes does shorten the editing process and save battery life on the camera.  We work with what we have.

Recently, we entered a video contest for a short travel documentary on the Newberry National Volcanic Monument,  in central Oregon, which seemed to demand some dialogue in addition to the usual soundtrack and titles, so we experimented with voice-over to add a short narration where appropriate.  This also wasn’t the best, since our microphone is the headset-attached variety, suitable for making Skype phone calls and video chats, but little else.  Good quality condenser microphones for the computer and lapel microphones compatible with the GoPro are simply not in the budget, along with professional video cameras with microphone jacks or built-in directional microphones.  Drones are all the rage, now, but one suitable for carrying a GoPro as a payload is stretching the budget, also, and presents safety and control issues for use in our primary video subject, i.e., bicycle touring and trail riding.

Besides finding a story in a video clip sequence, getting the story to flow smoothly, and finding an appropriate sound track to evoke the mood of the piece, the skill set also involves learning to use video editing software.  Microsoft Windows comes with a decent simple video editor, but we don’t use Windows.   We do have iPads, which have apps for making videos, but haven’t spent a lot of time on those, which also limit one’s ability to import material from multiple sources (the apps work best with the on-board iPad camera).   There are a number of contenders in the Linux Open Source tool bag, some good, some complex.  We chose Open Shot, a fairly simple but feature-full non-linear video editor, which gives us the ability to load a bunch of clips, select the parts we want, and set up multiple tracks for fades and transitions and overlays of sound and titles.   We also found that the Audacity audio recording and mixing software can help clean up the sound from less-than-adequate equipment.  ImageMagick and the GIMP are still our go-to tools for preparing still photos to add to the video.  Open Shot uses Inkscape to edit titles and Blender for animated titles.

Video is memory and CPU-intensive, so it helps to have a fair amount of RAM and a fast multi-core CPU (or several).  Our main working machine, a Zareason custom Linux laptop, has 8GB of RAM, an Nvidia GeForce Graphics Processor Unit, and a quad-core dual-thread CPU, which looks like an 8-processor array to Linux.  This is barely adequate, and often slows down glacially unless I exit from a lot of other processes.  The more clips and the longer the clips, the more RAM the process uses; often the total exceeds the physical memory, so swap space comes into play.  I’m usually running the Google Chrome browser, too, with 40-50 tabs open, which tends to overload the machine all by itself.

This isn’t something you could do at all on a typical low-end Walmart Windows machine meant for browsing the ‘Net and watching cat videos on Facebook and YouTube, so investing in a professional-quality workstation is a must.  Since we travel a lot and I like to keep our activity reporting current, that means a powerful laptop machine, running Unix, OS/X, or Linux.  Fortunately, our laptop “strata” is in that class, though only in the mid-range, a concession to the budget as well as portability.  We purchased the machine when we were developing software to run on the National Institutes of Health high-performance computing clusters, and is roughly comparable to a single node in one of the handful of refrigerator-sized supercomputers in the laboratories that have several hundred CPU cores and several dedicated GPU chassis each.

In addition to Open Shot, we also sometimes use avidemux, a package that allows us to crop and resize video clips so we can shoot in HD 16:9 wide-screen format and publish in “standard” 4:3 screen format if necessary, or crop 4:3 stills and video automatically to 16:9 format to use with other HD footage.  In addition to the GoPro, we now have a new FujiXP pocket camera that can shoot stills and video in 16:9 HD, and a Raspberry Pi camera unit, that is programmable (in Python), that we use for low-res timelapse and security monitoring.  The programmable part means we write automated scripts that select the appropriate camera settings and frame timing and  assemble a series of still photos into a timelapse movie, using the Linux ffmpeg command-line utility.

So it goes–gradually, the videos we turn out get slimmer and more to the point, if not technically better quality, something we need to work on constantly with prose as well, as an intended 500-word blog post ended up a 3000-word tutorial instead.

Looking for Conspiracy in All the Wrong Places

The headlines this week are full of new conspiracy theories regarding former First Lady, Senator, Secretary of State, and current philanthropist and possible presidential candidate Hilary Rodham Clinton.  The conspiracy?  Attempting to hide information from public scrutiny by having her very own personal email address, which she used for correspondence while exercising the duties of the office of Secretary of State.  Well, I am waiting for the Federal Marshals to arrive and haul me away, too, because I did the same thing, while exercising my duties as a federal contractor.   Cutting through the hype and hysteria, one can easily see that the conspiracy falls apart in so many ways as to be classic slapstick comedy, though unfunny in its seriousness, stupidity, and mean-spirited attempt to smear yet another political aspirant for no good reason.

According to a release from the Associated Press, that has been widely re-published by various media, Clinton “suspiciously” ran her own “homebrew email system” to handle her email while Secretary of State, rather than using her official State Department .GOV account.  OK, the latter would work for a person who only uses email for official business, with no personal or outside interests.  But, most of us who don’t need help turning on our computers use the Internet for multiple purposes, many of which are at odds with the government’s computer policies about “For Official Use Only,” to the extent we necessarily use our preferred (and private) systems to comply with those policies.

As an independent contractor, I, of course, like the Clintons, had my own Internet domains, for the purpose of maintaining a web site and email identity for my business, which I used for both government and non-government correspondence, even though I also had a government email account provided with the contract.  The government email account was necessary because government IT policies restrict certain mailing lists to internal email systems only.  Most of those correspondences were in the realm of inter-office memos and “news,” of interest only to persons who work in the building that is the “home office” of the organization.  In my case, this was a compound in Bethesda, Maryland, a city that I have never visited–I worked remotely from my office or at the Montana laboratories.

In Secretary Clinton’s case, by all accounts, she rarely spent time in the Washington, DC State Department offices, having spent much time “on the road,” so no doubt had little interest in notices of parking lot restrictions, “brown bag” lecture schedules in the auditorium, or the like, that make up a large part of the content of official government email boxes.   The “official” mailing lists aside, there is no such internal-address limitation on personal address books for the immediate circle of colleagues that most people deal with 99% of the time.  The other 1% are initial contacts from government employees who had to look up your address in the system’s directory.  After the initial exchange, the correspondent usually will have your outside address.

Mechanics aside, it is a fact that all “official” correspondence within the government will be to or from a government mailbox, and therefore archived within the government email system, whether or not one endpoint is a non-government mailbox.  In the case where correspondence is between two non-government addresses, it is also most certainly copied on CC or BCC to a staffer or colleague, or your own official mailbox, if for no other reason than “FYI” or to comply with record-keeping policies.  Under the new rules, put into place after Secretary Clinton’s tenure, a correspondence that doesn’t include a government address but is pertinent to official business merely has to be forwarded to a government account within 20 days to meet the transparency rule.

It is also a fact that government mobile access to their systems is sometimes outmoded and painful to use, and the hardware provided can legally only be used with the official systems, for official business.  However, personal systems can use the latest or at least preferred hardware and software, while still capable of connecting with government services if necessary.  Carrying multiple hardware systems and accessing multiple accounts on each is not compatible with the kind of rapid-response, on-the-go travel that State Department officials (as well as itinerant consultants) do to accomplish their mission.

The AP release attempts to “spin up” the conspiracy angle by muttering about a “mysterious” individual named on the domain registrations for the Clinton’s businesses, and speculating about the location and security features of the actual physical servers.  Oh, please.  It is normal for the “IT guy” to be named on the domain registration, as it is a technical responsibility, and usually someone who has physical access to the server hardware, i.e., a hosting service.  Whether or not the mystery man is indeed the Clinton house IT guy or simply a “nom de tech” to keep a famous name and contact information out of the public record is immaterial.  The implication that a “homemade” email system is neither reliable nor secure is specious: we are dealing with a multi-million-dollar foundation here, not some preteen wannabe hacker running a web site from his bedroom.

Not that you can’t run a reliable and secure system on a budget–I run a webcam service from a $50 Raspberry Pi that is backed up and secured: the logs show it shrugs off break-in attempts; it gets updated with the latest Linux security patches regularly, and it is available as long as we have power and cable services to the window sill in my office where it sits.  Our main services for web and email are physically located in Montana, where we rent server space for our personal domains.  Those are backed up and/or replicated by the service.  We pay a monthly fee for this service, so expect a certain degree of privacy and security that may not be the case with public free services like gmail or MSN.

This is not rocket science, people.  Anyone as smart as the Clintons or who travels a lot  should and usually does have their own Internet presence outside of Gmail and Facebook, i.e., something that they control and has “brand identification,” and people who have business both within and outside the government need to have a non-government account for non-government business: it’s the law.  The speculation in the article about a “homemade email server” is simply specious.  There is no evidence given that the hardware is in the Clinton’s home.  The IP addresses for the mail servers associated with the domains mentioned in the AP article are not related, so are most likely not colocated on the same hardware.  Domain registrations list the address of the owning entity, not the location of the hardware: it can be assumed that the services are hosted, like those of most small businesses, at a hosting service.  Further analysis might at least reveal the geographic region to which the IP addresses are assigned.  The domains themselves have private registration, so that the AP claims cannot be verified from publicly-available information.  Given the wildly speculative tone of the article, there is no reason to believe any allegations or implications in it are true.

Christmas Vacation At Last

Apologies in advance for the technical detail, but I’ve been trying to get the grandchildren interested in learning to code–if not as a career, just to make the world less magical and more driven by thoughtful application of disciplined skill, like driving a car or cooking a meal.  And, above all, it can be fun.  You know who you are.  The rest of of you, sit down, hang on, and share with the next generation.  The other lesson here is that it is never too late to learn something new, nor too early.

Regular readers may know that I became more or less “full time” retired this fall, with the ending of the latest in a 14-year sequence of contracts supporting the NIH Rocky Mountain Laboratories.  Oh, I have a few commercial web clients left, with the occasional rewrite, addition, or help request when a data entry goes awry, and a few pro bono web sites to manage, but, for the first time in 50 years, I actually have only a few minor updates in this last week of the year.

Typically, the systems support folk perform maintenance on systems when the majority of the staff has time off, which, in the United States, tends to occur only between Christmas and New Years Day.  In the pre-Unix days, this often meant traveling from coast to coast to work on U.S. Navy ships in port for the holiday.  In the past 20 years, it meant working late on days when the rest of the staff got early dismissal, or telecommuting on holidays.

So, having a bit of free time, I’ve decided to “play,” which, for the thoroughly addicted Unix Curmudgeon, means writing programs for fun and wiring up systems just to learn something new (or practice rusty skills).  The geek toy of the year, or maybe decade, is the Raspberry Pi computer, the $35 Linux board (more like $50-$100, depending on what accessories are needed to set up and run it–and, once they are set up, you can run them “headless,” without keyboard, monitor, or mouse, and access them from your PC, Mac, iPad, or phone, with the proper app).  Normally fairly frugal, I have somehow managed to acquire five of these little beasties, the last one because I thought one died, but it was the SD card (like the one in your camera) that serves as the primary “disk drive,” so I bought an extra SD card and have an extra box.  I also bought one to get my hands on the new B+ model, the one with a 40-pin I/O jack and four USB ports instead of the old-style with 34-pins and two USB jacks.  I did refrain from buying another protective case, instead choosing to bolt the “replacement” board to a piece of scrap hardwood so it won’t short out.

naked_pi20141230_160313
A “crustless” Pi, mounted on a scrap of lumber. This one is a database server, running PostgreSQL.

 

The purpose of the Raspberry Pi, as conceived by its British designers, is to promote learning and experimenting.  Thus, the I/O port, with a number of digital and analog inputs and outputs, and a special port for a miniature CCD camera board the size of a postage stamp.  Of course, I had to have one of those, too, along with a “daughterboard” for another that provides convenient digital input/output lines with screw terminals and a couple of tiny relays.

piface20141230_160324
This Raspberry Pi has a PiFace module plugged into the I/O jack, providing input/output terminals that can be connected to lights, other circuits, and switches. two relays are provided for switching incompatible voltage devices. When not wired to sensors, this unit is the head node of a compute cluster and a file server for a 1TB external disk drive.

 

The Raspberry Pi is, though small, a “real” Linux server, and can run almost any software.  Having been a Unix/Linux system administrator for the past 25 years, I find them  fun to play with and use to recreate small versions of big networks.  I have one that provides network information and internet name service to the local network, another that is a router and cluster head node, connecting two networks together and managing one of them, including disk sharing, one that is a gateway to the Internet (providing secure access into our network) and also a web server, one that is a print server, and another that is a database server.  And, of course, one that is a camera platform.  (In case you are counting, some do several things at once–that’s what Linux and Unix are good at, even in a small machine.)

Lacking interesting ideas, I merely pointed the camera out my office window, to provide a “window on the world,” for which I have started to experiment with different programming.  First, I simply put up a web site (using the Pi as the web server) that allows the user to take a picture of what the camera is looking at “right now.”  The Raspberry Pi promotes the use of the Python programming language (named by its author, Guido van Rossum, after the British comedy team, “Monte Python”), a language that I have heretofore avoided, since it uses “white space” as a block delimiter, and white space has been the bane of Unix shell programmers (of which I am one) since the beginning of the epoch (1/1/1970).  Nevertheless, it is a solid, well-constructed language, which is growing rapidly, in both academia as a beginning programming language and in industry and research as a powerful tool for rapid prototyping and robust permanent systems.  Python is, unlike most scripting languages, strongly typed (meaning variables are distinctly numbers, text, or other structures) and naturally object-oriented, which means data can inherit processing methods and structure, and details of structure can be hidden from other parts of the program, making programs easier to extend and debug, and making objects easily imported into other programs.

picam20141230_160209
The PiCam, pointed out at the driveway, mounted in a case and held by a “third hand” workbench tool. The ribbon cable attaches the camera to the web server, below.

 

So, with Python as a de facto system programming language, the libraries that operate the external ports and the camera are, of course, written in Python.  Using the devices requires Python programming skills, incentive enough to finally learn the language.

The web camera project quickly evolved into a combined weather station and surveillance system, and, not surprisingly, expanded my Javascript programming skills as well.  Javascript is at the core of most interactive web applications, as it mostly runs in the user’s browser, providing dynamic interaction with the server without the need to reload the current web page, and capable of performing automatic functions.  Since part of the project involves sewing a sequence of still images into a timelapse video, it also involved building a command-line video editor from source code and learning to manipulate video with it.


The web page:  All this code does is display a photo, then update the time and the photo every 15 seconds (the rate at which the camera takes pictures).  The python code runs on the server, the Javascript code runs in the user’s browser.  The image acquisition happens in another program, which follows.

 #!/usr/bin/env python

import cgi
import time
import os
import sys
import urllib2
import json

os.environ['TZ'] = "PST8PDT"

print "Content-type: text/html"
print

Now = time.localtime(time.time())
DST = time.tzname[Now.tm_isdst]
Date = time.asctime(Now)

print """
<html>
<head><title>Raspberry PiCam</title>
<body>
<h1>The view from Chaos Central <span id="nowTime">%s</span></h1>
""" % Date

f = urllib2.urlopen('http://api.wunderground.com/api/79be9651d0e9e9fc/geolookup/conditions/q/WA/Shelton.json')
json_string = f.read()
parsed_json = json.loads(json_string)
location = parsed_json['location']['city']
title = parsed_json['current_observation']['image']['title']
link = parsed_json['current_observation']['image']['link']
weather = parsed_json['current_observation']['weather']
temp_f = parsed_json['current_observation']['temp_f']
temp_c = parsed_json['current_observation']['temp_c']
wind = parsed_json['current_observation']['wind_string']
updated = parsed_json['current_observation']['observation_time']

print """
<img src="/images/current.png" id="currentImage"/>
<script language="Javascript">
setInterval(function() {
 var currentImageElement = document.getElementById('currentImage');
 currentImageElement.src = '/images/current.png?rand=' + Math.random();
 var now = new Date();
 var h = now.getHours();
 var m = now.getMinutes();
 var s = now.getSeconds();
 formatnum = function( num ) {
 if ( num < 10 ) { return '0' + num; }
 else { return '' + num; }
 }
 var time = formatnum(h) + ':' + formatnum(m) + ':' + formatnum(s);
 var nowTimeElement = document.getElementById("nowTime");
 nowTimeElement.innerHTML = time;
}, 15000);
</script>
"""
print "<p>The temperature in %s is: %s F / %s C<br />" % (location, temp_f, temp_c)
print "and the weather is %s<br />" % weather
print "Wind: %s<br /><br />" % wind
print "Weather Data %s<br />" % updated
print "Reload page to update weather: image updates automatically every 15 seconds<br />"
print "Weather data provided by <a href=\"%s\">%s</a><br />" % (link, title)
print "Image realized on a <a href=\"http://www.raspberrypi.org\">Raspberry Pi</a></p>"
f.close()

print """
</body>
</html>
"""

So, confused yet? Below is the code that actually runs the camera. It takes a picture every 15 seconds, numbering the pictures so that a third program can sew them together into a timelapse video.  The timezone hack in the shebang line (the first line of the script) powers the timing of the script.  This script is started each day by the system before the earliest sunrise, then waits until sunrise (obtained from the weather programming interface), and runs until sunset.  We start 30 minutes early and stop 30 minutes later to start/stop in twilight.

#!/usr/bin/env TZ=PST8PDT python

import time
import picamera
import os
import urllib2
import json

riset = urllib2.urlopen('http://api.wunderground.com/api/...(api key here).../astronomy/q/WA/Shelton.json')
json_string = riset.read()

parsed_json = json.loads(json_string)
sunriseh = int(parsed_json['sun_phase']['sunrise']['hour'])
sunrisem = int(parsed_json['sun_phase']['sunrise']['minute'])
if ( sunrisem <= 30 ):
 sunrisem += 30
 sunriseh = sunriseh - 1
else:
 sunrisem = sunrisem - 30

while (time.localtime().tm_hour < sunriseh):
 if ( time.localtime().tm_min < 30 ):
 time.sleep(1800)
 else:
 time.sleep((sunrisem * 60) + 1 )
 while (time.localtime().tm_min < sunrisem):
 time.sleep(60 * (sunrisem - time.localtime().tm_min + 1))

sunseth = int(parsed_json['sun_phase']['sunset']['hour'])
sunsetm = int(parsed_json['sun_phase']['sunset']['minute'])
if ( sunsetm >= 30 ):
 sunsetm = sunsetm - 30
 sunseth += 1
else:
 sunsetm += 30

print 'Sunrise: ' + str(sunriseh) + ':' + str(sunrisem) + ', Sunset: ' + str(sunseth) + ':' + str(sunsetm)

wday=time.localtime().tm_wday

logdir = '/mnt/TIMELAPSE/' + str(wday)

# remove last week's files.
import shutil
shutil.rmtree(logdir)
os.mkdir(logdir)

# grab camera and start recording
with picamera.PiCamera() as camera:
 camera.resolution = (320,240)
 camera.start_preview()
 time.sleep(2)
# loop: capture method grabs camera device for duration.
 for filename in camera.capture_continuous(logdir + '/img{counter:04d}.png'):
 shutil.copyfile(filename, '/var/www/images/current.png')
 print('Captured %s' % filename)
 time.sleep(interval)
 if ( time.localtime().tm_hour >= sunseth and time.localtime().tm_min <= sunsetm ):
 shutil.copyfile('/var/www/images/NoImage.png', '/var/www/images/current.png')
 exit()

So, there it is, a program that finds the hours of daylight, day after day, and records four photos a minute, which should catch at least of glimpse of anyone entering the property. Each picture is copied to the web site as “current.png” so that the Javascript in the web page can update it to anyone currently watching (or at least who has a tab open to the site).

The next evolution is to make a timelapse movie, which, at 8 frames per second, displays an hour of observation every 30 seconds. At faster display would make the movie shorter, but moving objects won’t appear long enough for the eye to recognise them, and slower internet connections/browsers may drop frames, missing data altogether.

big_iron20141230_160612
The Dell PowerEdge 110, configured as a virtual machine host. This currently looks like about nine different machines to the network. This provides our business with all of the various system configurations we support, including customer systems that may run on older software versions as well as the latest releases. One of the virtual machines assembles the timelapse videos for the PiCam system. Because it is very fast, and videos are hard work.

This code runs in a virtual server on our main virtual host, which contains system images for the various versions and releases of Linux, Windows, and FreeBSD that we support. This happens to run on CentOS7, the latest free Red Hat clone.  It could run on the Raspberry Pi, but requires a lot of time and processing power, so we chose to distribute parts of the process on a faster machine with more memory: the Pi has a 32-bit 700Mhz Atom processor and 512 MB of memory; the virtual host has a quad-core 64-bit 2.4Ghz  (3 times faster) Intel Xeon processor and 8GB  (16 times as much) memory.

#!/bin/bash

cd ~/TIMELAPSE
~/bin/ffmpeg -framerate 8 -i ./images/${1}/img%04d.png -r 30 -pix_fmt yuv420p surveil${1}.mp4

Short, eh? A simple, essentially one-line shell script running the ffmpeg command with a lot of options set. But, there’s more to this. For one, the files are on an external hard drive attached to the Raspberry Pi. It takes much less processing power and time to copy files, and we can copy them incrementally through the day, so we have a driver script on the Raspberry Pi to send the files to the main server, run the remote video processing script, and retrieve the resulting video file.  In this case,  the included ‘my_agent’ script sets the environment needed to login to the remote machine using a security agent’s pre-authorized key .

#!/bin/bash

. my_agent
rsync -av /mnt/TIMELAPSE/* centos7:TIMELAPSE/images/
ssh centos7 ./TIMELAPSE/makevideo.sh $1
rsync -av centos7:TIMELAPSE/surveil*.mp4 /mnt/TIMELAPSE/videos/

Lastly, a web interface is needed to display the video on the user’s browser: This is still under development as an integrated part of the webcam application, but relies on a snippet of HTML version 5 code, the latest version of the HyperText Markup Language that Tim Berners-Lee spun off as a subset/variant of the 1986 Standard Generalized Markup Language (SGML) to invent the World Wide Web 25 years ago, in 1989 (it didn’t get built until 1990). HTML 5 provides powerful tags to define multi-media constructs like video and audio that previously required specialized streaming server software and browser plugins to implement.  The code snippet below contains the Javascript hack needed to signal the browser to reload a new version of the file, rather than replay the cached version.  The final version will offer the option of displaying a timelapse video for the current day to current time (within the hour) or for any day in the past week (hence the use of an external disk drive on the Raspberry Pi, in order to store a week’s worth of surveillance video and the still pictures from which it is built).

<video width="320" height="240" controls>
<source src="/TIMELAPSE/videos/surveil0.mp4" type="video/mp4" id="vidFile">
</video>
<script language="Javascript">
 var currentVidFile = document.getElementById('vidFile');
 currentVidFile.src = '/TIMELAPSE/videos/surveil0.mp4?rand=' + Math.random();
</script>

And, so, that’s what old programmers do for fun during Christmas break. Meanwhile, I’ve developed some familiarity and skill with Python programming, honed Javascript skills, and refreshed my skills building software from source packages, and kept up to date on the latest system software from Red Hat. Jobs are out there… On the Internet, no one knows you’re a geezer, or simply doesn’t care, if you have the code skills they need.

If you want to see what’s outside our window, check on http://www.parkins.org/webcam during the day ( the camera is off at night).    The picture will update every 15 seconds until you close the browser window or tab (or go to another site from this window). Of course, it is a work in progress, and we have recently made changes to our router, so it might not work at any given time.

The Parkins Report: Events of 2014

Note: this is an expanded version of the one-page PDF we circulate.

DSCF1134banner
“Entering Utah,” on Road Trip 2014, a January venture to visit relatives in New Mexico,Texas, and California.

This year was characterized by extreme medical adventures, interspersed with the usual auto tours and some slightly different activities. The year started fairly normally, with an auto tour to New Mexico and California, and a business trip to Montana, but then took a different tack.

The Southwest Loop tour began with the Bike Friday perched on top of the Jeep, with the intent of getting in some winter riding early, while visiting with kids, grandkids, and great-grandkids in Santa Fe, Las Cruces, and El Paso. In keeping with our advancing age and reluctance to let scenery pass by in the dark, we took several days enroute, stopping in eastern Oregon and Durango, Colorado, arriving in sunny Santa Fe to -11C temps, much too cold for riding.

Las Cruces was a bit more hospitable, weatherwise, and we did get in a few rides, one in the middle of a half-marathon, where we shared the trail with many runners for 2 km. The back and chest pain Larye had experienced on early-season rides for the past several years returned, but overall the ride was pleasant.

desert_shadowDSCF1220
Crossing the Sonoran Desert, headed from Las Cruces to Anaheim.

Moving west, we visited relatives in Anaheim and Thousand Oaks. After a few days, we headed north, overnighting in Carmel-by-the-Sea before settling in for a few days vacation and riding at Clear Lake. The weather was a bit cold and Larye’s discomfort was more pronounced, through we did manage a 30-km ride on a mild day. Despite the drought, we drove US 101 the rest of the way north to Oregon in sometimes heavy rain, taking time to tour the scenic drives through the redwoods. In Oregon, our way was blocked by a large tree blown down across US101, with high winds when we finally reached our evening’s destination. Our tour culminated with a stop at the chilly air museum in the blimp hanger at Tillamook, then directly home after encountering snow at the 45th parallel.

judy_cabin20140302_095613
A quick inspection of the exterior of our cabin: the snow was piled deep against the front door, so we didn’t go in.

In early March, we traveled to Montana, staying with nephew Rick rather than shoveling out our cabin, which was buried in several feet of snow. A business trip to Rocky Mountain Laboratory yielded a task to flesh out a web application Larye had written years before and package it for general distribution to other users of the instrumentation with which it was designed to work.

bdfacs_login
The login screen on Larye’s web app, a custom user interface to create plate definition files for the BD Biosciences FACS cell-counting instrument, originally designed for the Research Technology Section of the Research Technology Branch of the National Institute for Allergy and Infectious Disease, and soon to be released to Open Source as a Linux software package and virtual appliance, for all users of the instrument model.

 

old_mill20140414_154350
At Lake Chelan, as the fruit trees were starting to bloom.

We visited with friends Gary and Char at a resort near Mt. Hood in the spring, and they stayed with us in May at McCall, Idaho. It’s always fun to share vacations.  Gary was the first to note that Larye’s exercise-related pain might be something other than reflux, having been through similar symptoms himself the year before.

A few local bike rides were cut short because of Larye’s recurrent pain when starting out. We spent a week at Lake Chelan in late April, with some riding around Manson, with minor starting-out pains. Memorial Day weekend, we rode the 30km around Payette Lake, from McCall, Idaho, with frequent stops for pain to subside and pushing through the loose sand and gravel on about a quarter of the route.

readytorideDSCF1743
Ready to begin our circumnavigation of Payette Lake, at McCall, Idaho. The 30-km loop was fraught with frequent stops to let the angina pain subside. Judy grounds Larye for the duration of the week: three weeks later, he was in ICU recovering from cardiac bypass.

On returning home, Larye saw his physician and insisted on a cardiac stress test, “just to rule out any problems.” Well, the stress test lasted almost three minutes before blood pressure and pulse spiked over 200, and Larye was feeling pain down to his fingertips. This was on a Friday, and he was sent home with nitro pills and beta blockers, with a Monday cardiology appointment, which yielded an early Tuesday catheterization: the blockage was severe, and a full cardiac artery bypass graft was scheduled for the afternoon, as soon as the surgical team finished the morning surgery.

Waiting for lunch in the ICU, the morning after surgery.
Waiting for lunch in the ICU, the morning after surgery.

So, suddenly, the summer plan turned from training for a bicycle tour in Wisconsin to slowly regaining strength by walking back and forth on the porch, gradually extending to downtown sidewalks, then city and county parks, then regional trails, and an excursion into the Olympics and salt marshes, hiking trails we hadn’t visited in 20 years or more. By the time the Portland Knit,Quilt, and Stitch came around in August, Larye was ambulatory enough to drive to the Lacey Amtrak station and we attended the conference via public transit, after getting a clean bill of health from his cardiac surgeon, and later, a release from the cardiologist: no rehab program needed, since we were hiking up to 6km on the trails by then.

mid_span20140811_102742
Rehab: a walk across the Tacoma Narrows Bridge, 6km round trip, before going in for 8-week checkup with the heart surgeon.

Labor Day weekend found us “on the road again,” with the weekend in Silverton, Oregon, touring the Oregon Gardens, with a brief tour of Silver Falls before heading east to the dry side for a week in the Bend area. The original plan had been for a bicycling holiday, but we continued to hike, visiting the Newberry Volcanic National Monument and hiking the trails around the resort, including an hour’s spin on a side-by-side one-speed tricycle just to prove we could still ride, albeit cautiously. Since then, Larye has set up his old Fuji touring bike on a wind trainer in the basement to get in some interval training without danger of crashing, something we don’t want to do: read on.

Workout from Larye Parkins on Vimeo.

Recovery was not without setbacks, however. A couple weeks after surgery, on July 4, Larye experienced a pulmonary embolism, which prompted another hospital stay, so he is on blood thinner for a year, which involved several weeks of daily painful injections into the stomach while building up the poison levels… Then, a few days before a planned long fall vacation trip to Montana, Idaho, eastern Washington, and British Columbia, the warfarin mistook Larye for a rat and he turned up with bleeding kidneys, for a few frightening days until the warfarin level was brought down and the flow stopped, plus some unpleasant tests to rule out bladder cancer: found a kidney stone, to be addressed later. We were able to join our vacation route “in progress,” with a trip to visit Judy’s brother and sister-in-law in eastern Washington before heading for Canada’s Okanagan Lake and a visit with Larye’s cousin, Becky.

kelowna20141025_124316
Kelowna, BC, Canada. Where we stayed was exactly 75km each direction from cousin Becky’s house, on the opposite side of the lake. The lake is 135km long, with Kelowna and its floating bridge about halfway.

We had one more trip planned this year, at least, to spend another week at Lake Chelan, finishing out this year’s timeshare obligations, sans bicycle, but with hiking shoes. It is quiet time at the resort, with only three of the 24 units in our section occupied, including ourselves.

This was the year that Larye became more or less retired for real, after electing not to renew his contract for support of the NIH, which expired in September. He has hinted to his remaining clients that nothing is forever, so they should have a Plan B.

Being an official “retired person,” Larye didn’t have any excuses to put off completing the inside storm window project this fall, spurred on by an early cold snap in mid-November.

Our fourth year as Warm Showers hosts saw an early influx of bicycle tourists, with a trio of hardy souls in January on a Seattle-to-Los Angeles trip, and a scattering of early season tourists in between our own travels in the spring. The medical issues forced us to close for the summer as well as cancel a few reservations, but we had a flurry of guests between our Bend and Kelowna trips, and a late-November tourist who needed rescued from storms and steep hills that left him cold and wet, far short of his goal by dark, 60km from us and far from other hosts. We had to turn down yet another potential guest in early December, due to our schedules.  The guest count is close to 100, plus a number of cancellations and just requests for advice or assistance.

lacey_art_20140606_180515
“Twilight in the Garden,” a quilted, discharged, appliqued, and bead-embellished piece from 2008, which now hangs in a classroom at the Lacey Senior Center

Judy continued as program director for the Olympia Weavers Guild, which is more or less a full-time job, if not a lifetime position, as few are willing to undertake the task. She also is now primarily a weaver, having sold her quilt fabric stash last year and, on the weekend before Larye’s surgery, her long-arm quilting machine. Fortunately, her health has been good this year.  Judy also sold an art piece this year, to the Lacey Senior Center, as a result of a call for entries for art to hang in the new center at Woodland Park.

Peace — Larye and Judy (and Delia)
For more photos and videos, find us on Facebook,Vimeo, or our personal blogs.  (Links to some of our videos below.)

IMG_0003_w
18-year-old Delia runs the house, insisting on a lap near the fire, and her favorite quilt.

Appendix: Travels with Judy and Larye, a video notebook

Las Cruces – NMSU from Larye Parkins on Vimeo

Once past the half-marathon (2000 runners) with whom we shared the bike path, we continued on to the New Mexico State University campus, then back to our B&B on the normally busy El Paseo commercial strip, where there was no bike lane.

LakePort from Larye Parkins on Vimeo.

A ride around the north end of Clear Lake to Lakeport and back saw much heavy traffic, despite being “off season.”

Wapato Lake from Larye Parkins on Vimeo

On our spring trip to Lake Chelan, we rode up into the hills and around the lakes and apple and wine country north of Manson.

Payette Lake from Larye Parkins on Vimeo.

The Payette Lake ride was the ultimate wakeup call that no amount of diet and training was going to fix what turned out to be advanced heart disease. The lack of film footage on this ride around the beautiful high mountain lake was telling–Larye was too busy dealing with getting back to town alive to operate the camera.

Capital Lake from Larye Parkins on Vimeo.

One of our first long walks.  We also walked around the north basin of Capital Lake later, and made a number of walks on the 3-km Huff ‘n Puff trail park in Shelton, as well as other city trails and county park trails.

Staircase remix from Larye Parkins on Vimeo

Staircase is the southwest gateway to the interior of the Olympic National Park.  We last hiked this in 1985 on a weekend backpacking trip with Matt, Mark, and Jason.

Theler Wetland Nature Preserve Trail from Larye Parkins on Vimeo.

Another nostalgic visit: we hiked this tidal marsh trail when it first opened in 1994.

Amtrak Cascades – Olympia to Portland from Larye Parkins on Vimeo.

A train trip to the Quilt, Knit, and Stitch expo in Portland.  We did a lot of walking around the Lloyd Center area, where our Montana friends
were staying, as well as downtown Portland, taking the light rail and buses around the city, along with more walking.

Newberry caldera from Larye Parkins on Vimeo.

A trip to Bend, Oregon, led us to a hike around the east shore of West Paulina Lake, in the crater of the Newberry volcano south of Bend, in search of the hot springs at the north side of the crater.

ClineFalls from Larye Parkins on Vimeo.

We had intended to cycle the paths around Eagle Crest Resort and the roads and trails near Bend, but ended up hiking the trails instead, one of which led us down into the Deschutes River trail upstream from Cline Falls.

Trike from Larye Parkins on Vimeo.

Our first pedal outing, on a rented side-by-side trike at Eagle Crest Resort, near Bend.