Quantcast
Channel: It's science, but it works like magic.
Viewing all 32 articles
Browse latest View live

More Than One Way to Skin a Cat

$
0
0
I know what you're thinking: "DeKay hasn't posted in a while.  Maybe he's dead?"  Fear not.  For while the frequency of my posting has dropped, I remain very much alive.  I've just been a little busy at work.
Thankfully the holiday season rolled around and I was able to take a couple weeks off. I took that time to relax and catch up on all the things normal people like to do: enjoy some good food, visit with friends, and hack on microcontrollers with integrated RF transceivers.
This bad boy is the Moteino from LowPowerLab. It is an Arduino clone with a 3.3V Atmega 328p that integrates a HopeRF RFM69 RF module. And let me tell you, this little module rocks. They are small, cheap, and readily available. Felix from LowPowerLab is getting tons of range out of the high power variant of these little guys.  They are easily programmed over a SPI bus so you don't need special hardware like you do with TI's CC1110, and cheap versions operating in the 900 MHz band are easy to get unlike TI's CC1101.  And recently, interoperability with the RFM12B popularized by the JeeNode has been achieved.

Now the RFM12B deserves a bit of discussion.  Like the RFM69 module, it is small, cheap, and easily programmed.  But it sucks in a number of ways.
A small FIFO means that you better have something real time or close to real time listening to the module. Otherwise its buffer overflows and you lose data. Something like an Arduino works well because it isn't doing other stuff like running an operating system. But worse than this is the hardcoded sync bytes. This pretty much limits the RFM12B to talk to other RFM12B's. And that ain't cool.

The RFM69 fixes all these problems and adds some nice features while it is at it:
  • it has a 66 byte FIFO, a fully programmable sync pattern up to eight bytes in length, and a variable length preamble
  • address checking and CRC validation is optional
  • it supports OOK, FSK, or GFSK
  • it can do AES encryption
  • other stuff
In other words, it looks like it can do what other transceiver modules can do and more.

Intrigued, I picked up a Moteino with integrated RFM69W module and a couple standalone modules while I was at it.  Then I got busy (see above).  Then I got some free time (see above).  Then I started hacking (see below).

Devoted readers of this blog will know that I am strangely compulsed to receive wireless transmissions from my Davis weather station using all kinds of strange hardware platforms.  So why stop now?  I've been looking for a platform like this that is available and easy to use so that more people can take a crack with this stuff (it isn't like you can walk into a Toys-R-Us and pick up an IM-ME anymore).  I also don't want to be glued to the Arduino for everything.  While it is great for running as a remote node, I like the idea of something like my BeagleBone Black connected directly to a transceiver module running some home monitoring and control software (HouseMon?) with Internet connectivity.

But, baby steps.  What I decided to start with was my RFM69 equipped Moteino and the LowPowerLab RFM69 Arduino library.  Because once you've got the wireless protocol figured out, hard hard can it be?  Turns out, harder than I thought.  But after slamming my head against a brick wall a time or two, I got this.
Success!
This is the data from my Davis weather station out in my yard and received on my RFM69-equipped Moteino.  The first field is the channel number, the data is the eight data bytes sent by the ISS on every transmission (see here for what those bytes mean), RSSI is the Received Signal Strength Indication, and the CRC is calculated from the first six bytes in the data packet. Every packet is sent with a CRC in the seventh and eigth bytes, so those two values will agree with the calculated CRC if the packet is good.  I've got some problem somewhere where the first packet I receive is bad, as is any packet on Channel 42.  But those are details.  I'm off to a decent start here and I'm sure I can sort those issues out in time.

Want to check it out?  My DavisRFM69 library is on GitHub and the data above was collected using the ISSRx sketch in the Examples folder.  The approach that I've taken is to subclass my driver from the LowPowerLab one, overwriting just a couple of methods that are specific to this application (namely the initialization and the interrupt handler).  That reduces duplication and lets me automatically pick up any improvements Felix incorporates into his main library.  I have made a couple minor tweaks to his main library for some register definitions that I've issued a pull request for.  Hopefully these will be incorporated into his main library soon.  In the meantime, you'll want to use my fork of the library, so everything will compile cleanly.  This and more is all in the README.

This work can be taken a lot further:
  • do a full emulation of the Davis indoor console for use by weather software like WeeWx and Cumulus
  • hang an RFM69 directly off a BeagleBone Black and write a driver to work under node.js
  • why just receive?
Pull requests gladly accepted  :-)

I'm glad to now have this stuff under my belt.  I could have taken the entire break to just sit in front of the TV eating fruitcake.  That would be easy because My Lovely Wife makes a rocking fruitcake.  But what I really find satisfying is that sense of accomplishment when you set a challenge for yourself and make it happen.  This was a good way to kick off 2014, and the year is just getting started.

And don't get me wrong: I had lots of fruitcake.

For Our Dogster Friends

$
0
0
Update February 11th: Monster Speedup and Experimental Photobucket Rules

One thing that has become quickly apparent is that HTTrack can be ridiculously slow especially on bigger pages.   I have found a way to speed it up.  Way up. It appears that it throttles the download speed without telling you. There is a spot in the user interface that lets you set the maximum speed, but that does nothing unless you know a trick

Here is a shortcut to getting the speedup. Try putting the following in your Scan Rules
--disable-security-limits
--max-rate 1500000
--assume php=text/html
The first one is the secret to taking the brakes off. The second one is the maximum rate in bits per second. We have a two megabit download rate at our house, so I've set the maximum to three quarters of that, or 1.5 megabits per second. If you set this number too big, it just means it will hog your entire network connection. A rough rule of thumb might be that if you are getting internet through your phone company, try 1500000 as we have. If to the cable company, they are usually faster so try 5000000 (five million).

The "assume" bit is recommended in the HTTrack manual to speed up how it parses the files if you can make certain assumptions, and this assumption seems to work great.  Now it is only taking minutes to download smaller pages. The difference is night and day.  These scan rules are now in the main body of the blog post.

Not in the main body of the blog post is some new filters I have been using that seems to work well for downloading from Photobucket.
+*.photobucket.com/*.jpg
+*.photobucket.com/*.gif
+*.photobucket.com/*.png
-blog.photobucket.com/*
-secure.photobucket.com/*
-support.photobucket.com/*
-tutorials.photobucket.com/*
The lower in the list, the higher the priority, so the order above of these filters is important. The rules start by saying you can only load .jpg, .gif, and .png files from Photobucket. That stops it from downloading all the html pages that then takes you down the rabbit hole and downloading the entire site. After that, it specifically blacklists (with the minus signs in front) the blog, secure, support, and tutorial sections of the site. This is just to be on the safe side.  This has worked well for all the sites we have tried, but keep an eye on it if you decide to try it.  I have not put this in the main body of the blog post but give it a shot.

Finally, another problem we've been having is that some pictures weren't showing up after a successful download. I suspect this is because of occasional heavy traffic clobbering the site. Try the following if you are having trouble:
  • From the same window the Scan Rules are entered in, select the "Flow Control" tab
  • In that tab, enter 5 into the Retries field. 
  • Everything else is as per usual. 
Good luck!

Update February 9th: Disable Photobucket Scan Rules

It sounds like some people are running issues where HTTrack wants to download half of Photobucket.  It looks like you will need to figure out more specific scan rules than the ones I have in there now.  I have removed references to Photobucket from the post.

Update February 8th: Fixes and the Addition of Catster!

I have updated the scan rules to fix a few things and have created a set of scan rules for Catster as well.  The new rules are in the main body of the post.  A shout-out to the Dogster (and Catster!) folks that have helped out so much.
  • The gift archive now works.  A new scan filter "+www.dogster.com/subscr/gift_archive.php?pet_id=590841" (or whatever your pet's number is) does the trick.
  • Thumbnails in photo comments now work.  Dogster, for some bizarre reason, has those thumbnails in a URL that looks like "+files.dogster.com./blahblahblah".  Did you catch the weird period between "com" and "/" in that last sentence?  Neither did I at first.  Tweaking the Scan Rule from "+files.dogster.com/*" to "+files.dogster.com*" did the trick.
  • Added a scan rule"+badge.dogster.com/*" to fix missing badges.
  • Added a few new scan rules that should help images from flickr, photobucket, and one other site I'd never heard of come through: "+*mytextgraphics.com""+*.photobucket.com/*",  "+farm*.staticflickr.com/*", and "+farm*.static.flickr.com/*".  You can skip these if you don't have images off the main site, but leaving them in doesn't hurt anything.
  • Added a set of scan rules for Catster.  Did you know that the images on Catster are stored on servers named Dogster?  Neither did I at first.  For this reason, the Catster list will have a "+files.dogster.com*" entry in it on purpose.  It will also have a "+files.catster.com*" on it that I doubt is needed, but better safe than sorry.
  • Added a scan rule that pulls in a specific file used to format the display of the photo pages "+www.dogster.com/photos/photo.css", though I didn't really see a difference when it was added.
  • Reordered the list of scan rules to be a little more sane
Attempts by the Dogster folks and myself to display images in the Pup Pals pages have failed miserably.  I suspect that it has something to do with that being a page generated on the fly with PHP and this is a known issue with HTTrack, but the gift history is also PHP and it works.  Weird.

It doesn't hurt to test the archive out by disconnecting your Internet connection, clearing your browsers cache (Google is your friend here), and then bringing up the web page created by HTTrack for your pet to see if anything is unexpectedly missing.  Note that the page might be slow to load this way because it is trying to reach out to some sites like Facebook, Google, and Twitter that I have intentionally not mirrored.  Your browser will wait for a bit, give up, and then load the archive anyway.  These links don't affect the display of your stuff and they'll be there long after Dogster Doomsday.  Once you connect the Internet back up, it will reach these sites normally anyway

If you are an old hand at this archive process, the only substantial changes to this post are in the "Specify The Options" part.  The rest is the same, so you can save yourself some reading.
Finally, some of you might be wondering why this archive takes so damn long sometimes.  I was mystified by this for a while too until I ran a test on a cat that had 36 pages (!) of diary entries.  I checked out the folder where the diaries are stored and there were a ton more entries than that.

WHY?

Well, there might be 36 pages of diary entries, but there are also five or six diary entries per page.  If you click on a "Comments" link, a whole new page opens up for just that diary entry.  Same thing for photos.  So if you have ten pages of diary entries and ten pages of photos, you don't end up downloading twenty pages.  You download twenty pages where entries are grouped together PLUS over a hundred pages dedicated to each individual diary entry and photo.  Yeah, that is a lot, but that is the only way to see the comments.  It also doesn't help that the download speeds from Dogster and Catster seems to be less than speedy in the first place.

"Beepers" on the Dogster forum posted a suggestion on how to speed up an update if you already have an existing download.
  • On the first option page, you can choose "Existing project name".  Click the arrow to choose the one you want to update.
  • On the next page/screen, in the "Action" block, click the arrow again and choose *Update existing download.
  • Then click on "Set options" and the "Scan Rules" tab as usual.  All your rules for the previous save will be there.  Just add the new rules at the bottom and proceed as usual.
Give it a shot!
          

Update February 5th:

The Bad News

Folks on the Dogster forums groups discovered that the archives would not work when they had no Internet connection.  That implied that the download would stop working once Dogster shut down.  I verified that this is a problem and am very sorry to say that all the downloads that everyone has done to this point will be useless once Dogster shuts down. The web browser was doing some stuff behind the scenes that I wasn't aware of.

The Good News

I have a fix that I would like people to try. I have tested this on a couple of pages now with my browser cache cleared and our internet disconnected and it seems to work perfectly. It still has the same limitations as before (can't click on gifts to get details, etc) but all the important stuff will be there. You will still be able to navigate around the page just like you did before.

The Fix

A new set of Scan Rules is now in the main body of the post.  The rest of the steps should be the same.  Try these new scan rules out and post feedback in the comments.  If you are computer savvy, you can double check by clearing your browser cache, disconnecting your Internet connection, and loading the archived page.  If everything looks good, you are ready for Doomsday when Dogster shuts down.

Please test this out and give feedback in the comments.  Once again, I'm sorry for my error. If I knew what I was doing here, it would help!

P.S.

Some people have been worried about seeing stuff like this in their browser address bar.

file:///C:/My%20Web%20Sites/cocopuffondogster/www.dogster.com/dogs/500107.html

The worry is that www.dogster.com is showing up there still.  That isn't actually a problem as long as the start of the address starts with "file:///C:/blahblahblah".  In this case the "www.dogster.com" part in the middle is actually now a directory on your hard drive.  You can use Windows Explorer or whatever to actually navigate to that directory and below.  There is all kinds of neat stuff tucked away in there!

          

Update Jan 25th:

See near the bottom of the page for instructions on how to save your videos!  A couple limitations of this technique are also discussed.  And after all of this, look who was made Dog of The Day for January 25th, 2014!!!


          

One of the saddest times of my life was when our dear dog Abby passed. She was my best friend and a big part of our lives. That was about a year and a half ago now and it still brings a lump to my throat just thinking about that awful time.

In the days that followed, I was struck by the sympathy and compassion expressed by My Lovely Wife’s friends in the Dogster community. Dogster is a website that dog lovers from all over the world congregate to share photos, stories, and advice on their best friends. While I don't doubt that some of these folks might be a few Milk Bones short of a full bag, My Lovely Wife has developed a true friendship with many people on that site, none of whom she has ever met in person. Our dog now gets more Christmas cards than we do.

Unfortunately, word went out a short time ago that Dogster will be closing down. All of the pet pages with the photos, diaries, and associated comments will disappear. People are understandably upset because they don't know how to save all of those memories. Some are printing the pages off, some are resorting to screenshots.  And some are just at a loss.

But I think I know a better way. And I'll show you how to do it yourself. Step by step.  When you are done, you'll have all of your stuff for your dog.  It won't copy forum discussions and stuff like that.  But it will copy all of your diary entries, all of your photos, and all of the comments on that stuff.  And it will store all that away on your local hard drive.

Ready to go?  Good.  Start with...

Read This Whole Thing Through

Like a recipe, I highly recommend reading this through once or twice to get some idea of what you'll be doing.  It does assume you know your way around your computer a little bit, but you don't need to be a guru or anything like that.  If you are comfortable installing a program on your computer and navigating around the various files on your PC, you should be just fine.

Download HTTRack

HTTrack bills itself as a website copier.  Click on this link, download the appropriate file for your PC, and install it on your computer.  There are a bunch of different versions for the various flavors Windows and whether you are running the 32-bit or 64-bit version, so choose wisely.  You'll be out of luck if you are on a Mac (sorry) unless you know how to compile your own programs.  There looks to be versions for various Linux distributions though for the 0.001% of Dogster users on that operating system.

During the installation process, the program will ask you if you want to put an icon on the Desktop and in the Start Menu.  Let it do so.

Start WinHTTrack

Click the icon the installer put on your Desktop.  The program should start up, displaying one of the ugliest user interfaces in existence.  That's OK.  We aren't using it for its looks.  When you get the screen below, hit the "Next >" button to continue.


Start a New Project

We start out by defining a new project as follows:
  • New project name: This is what the program will name the directory where it stores the files you will download.  I'll be using Abby's Dogster page as an example, so I called my project "AbbyOnDogster".  Use whatever name you like here.
  • Project category: Just leave this blank
  • Base path: If you were going to download multiple Dogster pages, then all of them would go into this directory.  You can use the default "C:\My Web Sites" (it works fine) or specify any other folder you like.

Once you're entered that information, hit the "Next >" button to continue.

Specify the Site To Mirror

So far so good, but now it starts getting a little trickier.  Fill out the next window as follows.
  • Action: Stick with the default of "Download web site(s)"
  • Web Addresses: (URL): The best way to fill this in is to navigate to the Dogster page you want to clone, select the address area, copy it (Control-C), and paste it (Control-V).  Or just type it in from scratch.  The window below shows the address for Abby's page.  It will look something like http://www.dogster.com/dogs/590841.  Click that link to see what I mean.
  • The tricky part is coming up.  Do not hit the "Next >" button yet.  Instead, select the "Set options..." button above it.

Specify the Options

(This Section updated February 5th and then on February 8th to fix the Scan Rules as mentioned at the top of this post).

When you hit the "Set options...." button, there will be a bunch of tabs on top.  Click on the tab that says "Scan Rules".  Don't worry about any of the other tabs.  See the area I have circled in blue?  Click your mouse in that area and delete every single character in there.  You want it to be perfectly empty.  Do not hit the "Exclude link(s)..." button.  Do not hit the "Include link(s)..." button.


Now, copy the fourthirteen all of the lines of text below and paste it into the now empty area that has the blue circle above.  Cut and paste is your friend here.
-*
+www.dogster.com/dogs/590841
+www.dogster.com/dogs/590841/*
+www.dogster.com/subscr/gift_archive.php?pet_id=590841
+www.dogster.com/static/*
+www.dogster.com/files*
+www.dogster.com/images/*
+badge.dogster.com/*
+files.dogster.com*
+www.dogster.com/photos/photo.css
+*.cdnsters.com/*
+tetra.saymedia.com/*
+*amazonaws.com/*
+use.typekit.com/*
+*mytextgraphics.com*
+farm*.staticflickr.com/*
+farm*.static.flickr.com/*
--disable-security-limits
--max-rate 1500000
--assume php=text/html
Note that there is now a * after "+files.dogster.com".  This is a change from my first and second cracks at this.  Don't miss that one.

What if you have a cat?  Other than having to vacuum hairballs off the carpet on a regular basis, you want to use this set of scan rules instead.  Abby was not a cat, but work with me here.  Again, cut and paste is your friend.
-*
+www.catster.com/cats/590841
+www.catster.com/cats/590841/*
+www.catster.com/subscr/gift_archive.php?pet_id=590841
+www.catster.com/static/*
+www.catster.com/files*
+www.dogster.com/files*
+www.catster.com/images/*
+badge.catster.com/*
+files.catster.com*
+files.dogster.com*
+www.catster.com/photos/photo.css
+*.cdnsters.com/*
+tetra.saymedia.com/*
+*amazonaws.com/*
+use.typekit.com/*
+*mytextgraphics.com*
+farm*.staticflickr.com/*
+farm*.static.flickr.com/*
--disable-security-limits
--max-rate 1500000
--assume php=text/html
As explained up top, there are lines for both "+files.catster.com*" and "+files.dogster.com*" because Catster's images are actually stored on Dogster's servers.

This might look like Greek to you, but every single character here is important.  Make sure that these four thirteen lines get copied EXACTLY into the area circled in blue above.  That first line is indeed a minus sign followed by an asterisk.  All the other lines start with a plus.  All of this is important.

Or almost all of it.  The "+*mytextgraphics.com/*" won't be necessary for most people and could be safely left out.  One of our friends had a link to this website for an animated image of her pets name so this had to be included to get that to show up.  Others had images from Flickr (+farm*.staticflickr.com/*) and Photobucket (+*.photobucket.com/*).  Again, you can leave these out if your page doesn't link to these sites, but leaving them in there doesn't hurt anything either.  You would have to do something similar for any other off-Dogster sites that you link to for special images like that.  Just be sure to start the name with a plus and follow the format I've used.

You should end up with something that looks exactly like this when you are done.  Unfortunately the Scan Rules list is kind of long now so stuff is getting cut off on the bottom of the list.  But you get my drift.

Now if we were to proceed on from this point, it would copy Abby's page on Dogster because her Dogster ID number is 590841.  What you need to do now is replace the number 590841 with your own dog's ID number in all three places: the second, third, and fourth lines of the list.  Your dog's ID number is the one that shows up in the address bar of your web browser whenever you go to your dog's pet page.  It is usually six or seven digits long.  Do not add or subtract asterisks, slashes, or plus signs, or anything else unless you really know what you are doing.  Just change the number.  Get this wrong and you could end up downloading half of YouTube.  Ask me how I know...

Once you have changed 590841 to your own dog's ID number, hit the "OK" button at the bottom of the window and pat yourself on the back.  The hard part is done.

After hitting the OK button in the window above, you'll be back to the window that offered you the "Set Options" button in the first place.  You've already done that, so you can hit the "Next" button to Continue.


Breeze Past Connection Parameters

The next screen you'll see is shown below.  This is just getting fancy now.  You shouldn't have to worry about anything on this window, so hit the "Finish" button at the bottom.  And cross your fingers, because once you hit "Finish" the download will begin.


Watch the Download

Here is where it gets exciting.  The program is now going to go out and fetch your Dogster page, with all the associated diary entries, photos, and comments.  It is going to store them on your hard drive and change all the links around so that everything works on your local computer.  What it won't do is create a copy of all the forum discussions or download all of your friends pages.  It gets your stuff for your dog.  And that is the most important thing.


How long this part takes depends on how much stuff you put on Dogster in the first place and the speed of your Internet connection.  Our connection isn't that great but there is a fair bit of stuff on Abby's page, and it still took around five fifteen minutes (the bigger set of Scan Rules from my first crack at this causes a fair bit more stuff to be downloaded).  As it runs, you'll hopefully see some familiar text going by.  The window above has some text that says "...bys_adventures", short for "Abby's Adventures".  This kind of thing told me I was on the right track.

Success!

When your pet's page has been copied, you should see a screen like this. Click "Browse Mirrored Website" and hopefully what you'll be looking at is a copy of your pet's Dogster page.


The actual page will be found where you specified it in that very first screen.  In this example, it would be in a place called "C:\My Web Sites\AbbyOnDogster".  That file will have a directory in it called "index.html".  Just click on that anytime you like and you should see a replica of your dog's pet page.  For our example, the address bar should look something like this.


See how it says "file:///C:/My Web Sites...".  That means that this file is on my local hard drive.  Contrast this with what it says when I access it over the web:

If everything went well, you'll have a copy of your dog's pet page tucked away nice and safe on your hard drive.  Back it up to a USB stick, move the directory around, or do whatever you like.  Have more than one dog on Dogster?  Just repeat the process again as many times as you like.  The ID number is the key.  To be on the safe side,it might be best to use a different project name each time.

Please note that I've put together this method and this writeup in a hurry.  There might be some cases where the process doesn't work.  If you run into trouble, leave me a message in the comments section and I'll try to help you out.  I'll also try to update this page based on people's feedback to clarify any spots where I haven't been clear.

Now I know that not everybody is going to be computer-savvy enough to do this.  But some will be.  All I ask is that those who can figure it out pay it forward and help out those who can't.  Back up their page, zip up the file, and email it to them.  They'll be incredibly grateful, and you'll feel good for helping them out.

Update - January 25th, 2014

First of all, I've been made aware of a couple limitations of this technique:
  • the link to the "Rosette, Star, and Special Gift History" doesn't work
  • clicking on those items from the main page doesn't give the pop-up message from the sender
  • the link to "See all my pup pals" doesn't work
  • the link to the video page doesn't work and the videos aren't downloaded
Now, I am no web guru but it looks like all these things have something in common: the links are not "static" but are dynamically generated when the link is clicked.  That is something that the web mirroring software used in this technique can't handle.  Other web mirroring software is similarly handicapped.

I was asked in one of the comments about videos and, while I can't get that to work as part of this process, I have found a workaround that will let you save each of your videos to your computer as separate files in case you no longer have the original version.

Basically, we are going to set up a "flash downloader".  This is generally an add-on to your web browser that lets you save the videos that you normally don't have an option to save.  The videos on Dogster are in something called "flash video" format, so you'll need a "player" for that too once the file has been downloaded.  I get into that as well.

Other methods besides the one I have tested below are bound to work and you are free to give this a shot with a different browser or technique, but I probably won't be able to help you much if you veer off this beaten path.  And this method should work for everybody on any operating system.

Want to get your videos back?  Here is how.

Step 1: Download Firefox If You Don't Already Have It

Why Firefox?  Because that is what I use, it worked for me, it is awesome, and it is free.  If you already have Firefox, you are awesome and can skip this step.  If you don't, download it from this link and become awesome.  Go ahead.  I'll wait.

Step 2: Open This Post in Firefox

If you are already using Firefox, skip this step as well.  If not, copy the address link for this post from your current browser to Firefox

Step 3: Get the Download Flash and Video Add-On

Like other browsers, Firefox's functionality can be extended with things called Add-Ons.
Install the Download Flash and Video Add-On from this link and clicking the "Add to Firefox" button that shows up in big letters on something like the snapshot below.

Firefox might give you a big scary warning like the one below.  No worries here.  There will be a number that counts down on the greyed out "Install" button on a window...

After a few seconds, the button will change to say "Install now" and it will no longer be greyed out.  Click on "Install Now".  The add-on will install and Firefox will tell you that it will be enabled when you restart Firefox.  Select "Restart Now".  Firefox should restart and bring you back to this page.

Step 4: Show Add-On Bar

Firefox Add-Ons are shown by default on an Add-On bar that is at the bottom of your browser window.  If you don't see a little box with a down arrow in the bottom right hand corner of your browser, hit the "Control" and "/" keys at the same time to make it appear, like so (I've enlarged it to make it easier to see).

Step 5: Get Your Video

So far, so good.  Next thing you want to do is open up your Dogster page and click on the link to open the page showing all of your videos using the "See my Video Book" link on the left side of your pet page.  What you are going to do is...
  • Start the video
  • Pause the video once it starts playing  (it seems to be important that you do this).
When you do this, you'll see the little icon in the bottom right change color.  Click on the icon and you should see something like the window below.  Ignore the "Flash Files to Download" on top.  Click on the video title under "Videos to Download" and the file should download to your computer!

I expect that the name of the downloaded file will look like some random collection of letters and numbers.  You'll certainly want to rename it to something that is understandable.

Step 6: Play the Video

I won't go into too much detail here.  Some computers might already have the software installed to play these videos.  Try opening / double clicking the file to see if it plays for you.  If it does, you are all set and can proceed with downloading all of your other videos.  If not, you'll want to install a piece of software to do so.  I recommend VideoLAN, as it is free, fantastic, and can play just about any kind of video file you throw at it.  It also runs on just about any computer out there.  Get it from this link.

          

Good luck retrieving the memories of your dog and those of your friends.  Mine are incredibly important to me.

Build Your Own Davis Weather Station Console!!!

$
0
0
This Davis weather station hacking stuff is addictive like crack cocaine is addictive.  I always seem to be taking another hit from the pipe.  I've figured out how to get into the Davis console's serial port (after which the two of us had a complete and frank discussion COMPLETELY IN UPPERCASE).  I then built my own Data Logger so I wouldn't have to buy the ridiculously expensive Davis dongle.  Then, after I figured out the wireless transmissions from the outdoor sensor suite, I made my own ISS receiver with a Pretty Pink Pager.  But of course, I can quit any time I want.  Me and Amy Winehouse.
"They tried to make me go to rehab I said No, No, No"  -  Bad Decision

Famous dead drug-addled musicians aside (and how long a list is that?  Don't they know that only Keith Richards is Immortal?), the path I was to go down became clear after Davis pulled a ridiculously stupid stunt in the infamous Firmware 3.0 release they started shipping in new consoles a while back.  The new firmware read 64 bytes from a fab-written, read-only section on the data logger's memory chip.  It took this data, did some algorithmic juggling, and then did a check against another 64 byte write-once block on the data logger put there by Davis.  If the console didn't like what it saw, it declared that the logger was invalid and refused to function further.

This was an obvious and misguided attempt to shut down a few hackers from building and selling third-party data loggers for a fraction of the price Davis charged.  Problem #1 was that people with an older, authentic Davis logger discovered that their pricey little dongle stopped working after a firmware "upgrade".  Problem #2 was it also disabled the serial interface connection I had discovered.  And that pissed me off.

Unfortunately for Davis, the console does not run a 2 GHz Core i7 processor capable of state of the art encryption and decryption algorithms.  It has a little Atmel Atmega processor running at 1 MHz or something like that.  It's abilities are somewhat more... restricted.  Like something that could be cracked by a 256 byte lookup table and a trivial bit of code. Hats off to Watson on WXForum for figuring this out. His most excellent hack is posted below for posterity.  Break out your Arduino and start cutting and pasting if you want to calculate a valid security code for a DIY logger.

u8 const GreenDot_Table[256] =
{
0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C, 0x21, 0x25, 0x29, 0x2D, 0x31, 0x35, 0x39, 0x3D,
0x46, 0x42, 0x4E, 0x4A, 0x56, 0x52, 0x5E, 0x5A, 0x67, 0x63, 0x6F, 0x6B, 0x77, 0x73, 0x7F, 0x7B,
0x8C, 0x88, 0x84, 0x80, 0x9C, 0x98, 0x94, 0x90, 0xAD, 0xA9, 0xA5, 0xA1, 0xBD, 0xB9, 0xB5, 0xB1,
0xCA, 0xCE, 0xC2, 0xC6, 0xDA, 0xDE, 0xD2, 0xD6, 0xEB, 0xEF, 0xE3, 0xE7, 0xFB, 0xFF, 0xF3, 0xF7,
0x18, 0x1C, 0x10, 0x14, 0x08, 0x0C, 0x00, 0x04, 0x39, 0x3D, 0x31, 0x35, 0x29, 0x2D, 0x21, 0x25,
0x5E, 0x5A, 0x56, 0x52, 0x4E, 0x4A, 0x46, 0x42, 0x7F, 0x7B, 0x77, 0x73, 0x6F, 0x6B, 0x67, 0x63,
0x94, 0x90, 0x9C, 0x98, 0x84, 0x80, 0x8C, 0x88, 0xB5, 0xB1, 0xBD, 0xB9, 0xA5, 0xA1, 0xAD, 0xA9,
0xD2, 0xD6, 0xDA, 0xDE, 0xC2, 0xC6, 0xCA, 0xCE, 0xF3, 0xF7, 0xFB, 0xFF, 0xE3, 0xE7, 0xEB, 0xEF,
0x31, 0x35, 0x39, 0x3D, 0x21, 0x25, 0x29, 0x2D, 0x10, 0x14, 0x18, 0x1C, 0x00, 0x04, 0x08, 0x0C,
0x77, 0x73, 0x7F, 0x7B, 0x67, 0x63, 0x6F, 0x6B, 0x56, 0x52, 0x5E, 0x5A, 0x46, 0x42, 0x4E, 0x4A,
0xBD, 0xB9, 0xB5, 0xB1, 0xAD, 0xA9, 0xA5, 0xA1, 0x9C, 0x98, 0x94, 0x90, 0x8C, 0x88, 0x84, 0x80,
0xFB, 0xFF, 0xF3, 0xF7, 0xEB, 0xEF, 0xE3, 0xE7, 0xDA, 0xDE, 0xD2, 0xD6, 0xCA, 0xCE, 0xC2, 0xC6,
0x29, 0x2D, 0x21, 0x25, 0x39, 0x3D, 0x31, 0x35, 0x08, 0x0C, 0x00, 0x04, 0x18, 0x1C, 0x10, 0x14,
0x6F, 0x6B, 0x67, 0x63, 0x7F, 0x7B, 0x77, 0x73, 0x4E, 0x4A, 0x46, 0x42, 0x5E, 0x5A, 0x56, 0x52,
0xA5, 0xA1, 0xAD, 0xA9, 0xB5, 0xB1, 0xBD, 0xB9, 0x84, 0x80, 0x8C, 0x88, 0x94, 0x90, 0x9C, 0x98,
0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF, 0xC2, 0xC6, 0xCA, 0xCE, 0xD2, 0xD6, 0xDA, 0xDE
};

u8 const Adesto_Factory_Programmed[64] =
{
  // put here AT45DB011D Security Register from byte 64 to 127
};

u8 OneTime_User_Programmable[64];

OneTime_User_Programmable[0] = 0x00; // or whatever you want
OneTime_User_Programmable[1] = 0x00; // or whatever you want
OneTime_User_Programmable[2] = 0x00; // or whatever you want

u8 n, value;

for(n=3;n<64 br="" n="">{
value = (u8)(Adesto_Factory_Programmed[n] + n);
OneTime_User_Programmable[n] = GreenDot_Table[value];
}
64>

For more on this whole sad saga, you'll want to read this masterwork by torkelmj, especially if you enjoy reading stuff dripping with spite and vitriol.  Like I do.  Or skip that and just buy a security-coded third party logger from WXForum awesomedude Belfryboy.  Or order up his PCB on oshpark and build your own.  There are options now, and options are good.

Now one might think that everything is just peachy now that DIY loggers are possible once again.  Not me.  I was pretty grumpy that Davis had tried to screw their customers over even if they did release subsequent firmware updates that tried to undo some of the damage.  Once burned, twice shy, so they say.  I started thinking of a Plan B.  I want to build my own console.
Gratuitous Picture of My Dog
My IM-ME thing was a neat hack, but that is about as far as it goes.  IM-ME's aren't actually rolling off the production lines in millions of units per month these days, and their ability to hook up to other little do-dads would not be easily done.  Cheap transceiver boards based off of the popular CC1101 chip that work in the 915 MHz band are hard as hell to come by.  Ask me how I know.  The Seeedstudio RFBee comes tantalizingly close, but others who have tried to go this route run out of RAM and Flash on the limited processor found on this unit before getting too far.

I needed another way and that led me to the Moteino with its awesome little RFM69B transceiver module.  I got it picking up Davis ISS transmissions earlier this year.  Since then I have been coding away in my spare time and have been pulling together the various bits of hardware that I need to get something going.  Something like this.
Beautiful, Isn't It?

Some cool stuff has sprung up from this very breadboard.  My serial connection to the console grew up there on the left side.  The DIY logger design is in the middle.  The stuff on the right half starting from the left is the humidity sensor, the pressure sensor module, the Moteino itself, and finally my USB to Serial Adapter for the project I'm writing about today.

Now I know what you are saying to yourself: "The title of the blog is "Build Your Own Davis Weather Station Console!!!" but that doesn't look like a console at all!  Where is the keyboard?  Where is the display?" Well, I guess I'm not going to get anything past you today.  There isn't a keyboard or a display... unless you want to add one.  The hardware and software here is all open for you to add on what you'd like.  Me, I'm thinking of hooking this bad boy to a serial port on my Beaglebone running Openhab and having all my weather data available from anything in my house that can bring up a web browser.  Very doable, and no display or keyboard necessary for that kind of application.

But why call it a "Console"?  Because I couldn't think of a better name.  And I did indeed try.  It isn't a "Receiver" because it does more than receive given that it has its own sensors hanging off of it.  "Indoor Unit" sounds stupid.  "Thingamahooie" was tempting, I must admit, but didn't quite convey the application well enough.  And hey, the guy that builds the hardware, develops the code, and writes the blog gets to call what he comes up with whatever the hell he wants.  I'm going with "Console", and you'll just have to deal with it.

But I, as I so often do, digress.  Back to business.  On the hardware side of things, here is what I'm working with in more detail:
  • Moteino with an RFM69 module on it.  Pick the 915 MHz RFM69W (standard transmit power) or RFM69HW (high transmit power) at your option.  I have the serial version but it probably would have made sense to pick up the USB variant so I wouldn't need to tie up my USB-Serial converter all the time.  You probably want to add on the male headers option (why even think about it for the one dollar price?) and the flash memory option for four dollars.  I'm not using that yet, but it might come in handy for data logging at some point.  And if you re-dedicate the Moteino to something else later, this memory can be used for wireless remote programming.  Cool.
  • a DHT22 Temperature and Humidity Sensor for less than five bucks.
  • a BMP085 Temperature and Pressure Sensor for less than six bucks.  But it looks like that module is now much cheaper thanks to the compatible BMP180 sensors now out there for under three bucks.  The two are compatible, and I'd probably go with the newer BMP180 myself just because it is smaller.
  • a (yet to arrive and be connected) DS3231 Real Time Clock and Memory Module for less than three bucks (I felt bad for getting something at this price with free shipping so I bought two).  Note that this module also has a 24C32 EEPROM on it that is bound to come in handy.  Don't be dumb and order a DS1307 clock module instead: that one doesn't work well with the 3.3V Moteino and it is horribly inaccurate.  What good is a clock chip that can't keep time?
Arduino is all about little software libraries, and these are the ones I'm working with right now.
  • the LowPowerLab RFM69 library.  Felix has merged the changes I've needed so no need to use my fork of his code any longer.  I don't know if I'll be using this in the long term or come up with my own that is better suited for this application.  Another library that I'm including right now but not really using yet is his SPIFlash library.
  • the JeeLabs DHT22 code.  I have extracted what I need from the JeeLib code and included it into my own library.  JCW's stuff is a leaner and meaner version of some of the other ones floating around on the net.
  • the Adafruit BMP085 library.  I used this as is.  I did look at using the JeeLabs code but it was a little too tied up with JCW's PortsLib for me to bother untangling at the time.
  • the Arduino Serial Command library to parse command input.  This is a really great little library that lets you register callbacks for each separate command and also does command line argument parsing.  I needed to make a few tweaks as noted below, but nothing major.  My changes have been pushed but not merged at this time, so use my fork here.
  • my own DavisRFM69 library, of course.  I've got to be doing something to make all this stuff work together.
Enough chitchat.  Let's cut to the chase, shall we?  Take a look at this thing actually doing something.
Success - I Never Tire of It
This is SandaySoft's Cumulus software talking to my homebrew weather station console.  The outdoor readings are those from my ISS in the front yard.  The indoor readings are from the sensors I have hanging off the Moteino.  On the left you can see the Serial Port Monitor Software recording the RS-232 messages going back and forth.  Cumulus has no idea that it isn't talking to a real Davis console.

Thanks to the Davis Serial Protocol Manual, getting this working wasn't too terribly difficult.   I knew Cumulus used the Davis SDK to talk to the console so the Cumulus author might not be aware of every single command being sent to the station and back.  I also knew that the LOOP command was used to get the data out of the station so I implemented that and some other useful commands on the Moteino.  Then I hooked my real console up and watched some packets go by and found a few more I needed to implement (namely BARDATA, HILOWS, and RXCHECK).  I had a few hiccups of course.  For example, Davis says that a command should always be terminated with '\n' (0x0a) like this...
 except when they don't, like this...
And that is the fun with emulation: you have to emulate not only the functionality, but the bugs as well.  This one caused me to tweak the serial port library to accept multiple command terminators.  Another oddity is that the console itself goes to sleep all the time and is woken by simply sending a lone '\n' that the console is supposed to acknowledge.  The serial library I'm using hadn't actually accounted for that situation.  Now it does.

Want to play along?  Here is what you need to do.   From within your Arduino's libraries directory...
  • Get my version of the SerialCommand library that supports empty commands and a second line terminator.  And of course, you'll want to get a copy of my DavisRFM69 library.  The pared down DHT22 library is tucked away inside the latter.
git clone https://github.com/dekay/Arduino-SerialCommand.git SerialCommand
git clone https://github.com/dekay/DavisRFM69.git
git clone https://github.com/adafruit/Adafruit-BMP085-Library.git Adafruit_BMP085
git clone https://github.com/LowPowerLab/RFM69.git
git clone https://github.com/LowPowerLab/SPIFlash.git
Hardware hookup is like this.

DHT22 Pin 1 -> Moteino 3.3V Out
DHT22 Pin 2 -> Moteino D4 with 10K Pullup resistor to Moteino 3.3V Out
DHT22 Pin 3 -> Not connected
DHT22 Pin 4 -> Moteino GND

BMP085 Module Pin VCC -> Moteino 3.3V Out
BMP085 Module Pin SDA -> Moteino SDA
BMP085 Module Pin SCL -> Moteino SCL
BMP085 Module Pin GND -> Moteino GND
Once you've got all of this hooked up, you'll find a "VP2.ino" sketch in the DavisRFM69 library's Examples directory.  Open that up in the Arduino IDE and select Control-U to compile and download it to the Moteino (be sure to tell the Arduino IDE that you are using an Arduino Uno).  Open up the serial monitor, set the baud rate to 19200 and "Newline" as the line ending.  You should see... absolutely nothing.  Nothing that is, until you type in some (uppercase) commands like "LOOP 1", "TEST", or "STRMON".  The Moteino will respond exactly the same way as a real console would.  Hook it up to Cumulus (with the "Use Data Logger" option unchecked) and revel in a job well done.

I'm off to a decent start here but there is still lots to do.  Here are some things on my list.

  • integrate the real time clock functionality
  • put in the frequencies for consoles in Europe and other regions
  • add some more useful commands like PUTRAIN so you can tell this thing how much rain you've had this year that it can keep a running count of afterward
  • add in some kind of EEPROM functionality so it retains settings like total rainfall between power downs.  Conveniently, there is an EEPROM on my yet to arrive three dollar clock module just begging to be used.
  • make the reception more resilient.  There are some odd things going on here: I get a spurious interrupt on startup (setup issue?) and when I move the board around (need a pulldown on the interrupt line?)  Reception is also poor during the day.  Might be that I just need to adjust the clear channel RSSI value a bit to accommodate more background noise.
  • integrate the real time clock functionality (daily / weekly / monthly / year highs and lows)
  • etc
Anyone that has done much coding on the Arduino gets to know memory limits.  The Moteino has double the RAM and EEPROM than the standard Arduino UNO, so I've got a whopping 2K of RAM and 32K of Flash to play with.  So far I have used roughly half of each, so I've got some headroom.  I haven't done much to try and streamline any of the code besides a few const arrays here and strings stuffed in the F() macro there, so I am sure there is room for improvement if things get really tight.

With this project, I think I've hit the goals I set out to achieve: come up with something functional, inexpensive, and with a low barrier to entry so that other people can dig in.  Have a new feature you'd like to see?  Send me a pull request on Github.  Want to develop a plug in circuit board (kind of like this) with all the dodads attached to lower the barrier to entry even further while making a few bucks on the side?  Be my guest.

I'll wrap this up by saying that the Davis guys make good stuff.  The ISS is very well put together and I love that the thing is solar powered with battery backup.  I've had mine for years and it has been operating trouble free on Battery #1.  The display on the indoor console is nice, big, and easy to read and it also just sips on battery.  I'm guessing that 99.9% of Davis' customers are going to continue buying standard Davis stuff off the shelf despite whatever I come up with here.  Anything I play around with  is ony going to be picked up by that other 0.1% of enthusiasts.  And it is those enthusiasts that are not only going to continue buying Davis products but will recommend them to their friends as long as they are kept happy.  If Davis pulls another stupid Firmware 3.0 thing, they'll do more damage to themselves than I ever did.  I hope they continue documenting their communication protocol and maintaining accessible expansion ports in their current and future products.  That would be a win-win for everybody.

With that in mind, it seems as good a time as any to unveil the new profile picture.
Be Nice


Diablo Bread, The Bread of the Devil

$
0
0
I first blogged about bread around three years ago.  I look back at that post discussing my tips and tricks for Tartine bread and it makes me cringe.  What I thought was a good loaf of bread back then is far below what I'm able to come up with these days.  What has made me a better baker?  The same way you get to Carnegie Hall.  Practice.  I make a loaf of bread pretty much every weekend.
Tartine Bread Try #43
And it isn't just Tartine.  I find I am making that recipe ever month or so, while the other weekly bakes will sometimes be a No Knead bread of some kind or another based on Jim Lahey's technique outlined here.  A post back in May 2012 gave a link to another excerpt from "My Bread" that has more recipes you should check out as well.

Now with familiarity comes the courage to strike out on one's own.  I've been on quite a Sriracha kick lately and I got to thinking, what about a Sriracha No Knead Bread?  Put that term into Google and what do you get?

No results found for "Sriracha No Knead Bread".

Not acceptable.  Time to blaze a trail.

I call this bread Diablo Bread, The Bread of the Devil.  The Sriracha in the recipe is amped up by copious amounts of crushed red pepper flakes.  The orange-red color of the baked result is a warning that this is not a bread to be messed with.

Before starting, watch this video from the man himself to get an idea what you'll be doing.

No-Knead Bread From the Master

My recipe is along these lines, but my method is somewhat different from the second rise onward.  I also use a round Lodge Combo Cooker rather than the oval shaped Dutch Oven Jim uses.  You'll have to tweak my procedure a bit if you are using the latter.  But I'll tell ya, the Lodge is pretty great for baking bread.  And it is an awesome abuse of Amazon's free shipping policy.
Lodge LCC3 Combo Cooker
So without further adieu...
Diablo Bread, The Bread of the Devil
Inspired by Jim Lahey's No Knead Breads 
Ingredients
400 grams unbleached all purpose flour
7 grams table salt
½ teaspoon quick rise instant yeast
1 ½ tablespoons crushed red pepper flakes (Yes.  That is a lot.  Not a typo)
260 grams cool water (55 - 65 °F)
60 grams (4 tablespoons) Sriracha sauce (Don't wimp out!  Not a drop less!)
Wheat bran for dusting
Tools
Cooking spray or oil
Parchment paper
Tin pie plate
Dough scraper
Plastic wrap
Lodge LCC3 Combo Cooker or cast iron Dutch Oven
Serrated knife
Oven mitts
An ice cube
 Procedure
  1.  Mix the flour. salt, yeast, and pepper flakes together in a medium sized bowl.  Add in the water and Sriracha sauce.  Mix using a wooden spoon or your hand until all of the flour is incorporated and the dough is sticky.  This should only take 30 seconds or so.  Add more water if the dough seems too dry.
  2. Transfer the dough to another bowl lightly oiled or sprayed with cooking spray.  This will help prevent the dough from sticking when you dump it out after the first rise, and this in turn helps to prevent the dough from deflating.  The dough will increase in volume probably by a factor of four at least, so be sure to use a big enough bowl.  Use a bowl that is red on the inside to amp up the viciousness that is this dough.
  3. Cover the bowl with plastic wrap so the surface of the dough doesn't dry out during the bulk ferment (a fancy-schmancy baker's term for first rise).  Let it rise at a temperature around 70°F in a spot out of the sun for 18 hours.  Or you could be like me (everybody should be like me) and put the bowl in a water bath maintained by your home-built Sous Vide rig at a rock-solid 21.2°C.  You'll have to shorten the rise or use a little less yeast if rising at temperatures that are a lot warmer, but try not to get into this pickle in the first place.  The long rise time contributes to the flavor of the loaf.
  4. While the dough is rising, cut a circular piece of parchment paper to fit the Combo Cooker using the pan as a template.  Cut it wide enough to stick up above the edges of the cooker.  You'll be putting this paper in the pie plate for the dough's second and final rise.
  5. After the 18 hour bulk ferment (fancy-schmancy!), generously flour your work surface.  The circular piece of parchment paper should be sitting on top of your pie plate.
  6. Gingerly tip the bowl containing the risen dough over the floured surface, taking care not to deflate the dough.  You don't have to have your dog looking out the window when you do this, but it helps.
  7. I usually end up with a round blob of dough that I want to shape into a ball.  To do so, I first use a dough scraper (actually a plastic drywall knife, 'cause that's how I roll) or my hands to gently fold two opposite ends of the blob toward the center to make kind of a rectangle.  Then I use my hands and gently grab one long end of the rectangle and roll it up towards the other to get my ball of dough.  Place the ball of dough seam side down in the center of the parchment paper that is sitting on the pie plate.




  8. Dust the top of the dough with some wheat bran.  Cover the whole thing with a clean tea towel or plastic wrap to keep the top of the dough from drying out.  I use a shower cap stolen from a hotel - the loose elastic does a great job of getting around the pie plate without pulling the plastic too tight.
  9. Place the pie plate containing the dough in a nice warm spot for the second and final rise (around 75 - 80°F).  I put it in the oven with the light on if the house is cool.  I let this rise go for two hours.  It should look something like this when it is done.  Note the little dimples on top.  I was giving this dough the poke test: the idea is that you poke the bread and the dough should hold the indentation when it has properly proofed.  Don't go longer than you need to here, or the dough will be over-proofed and rise poorly in the oven.
  10. Half an hour before the end of the final rise, put the Combo Cooker into your oven with the rack set in the middle.  Set the oven to 475°F.  You want to be using the Combo Cooker with the shallow frypan part as the base and the deep cooker part as the lid.  It is beyond obvious that if you are doing the final rise in the oven with the light bulb on, that you should take the dough out first.
  11. After the half hour preheat at 475°F, take the cover off your risen dough and place it next to your oven.  Have your ice cube and serrated knife standing by.  You are going to work quickly here.  Quickly and extremely carefully.
  12. Put on your oven mitts and take the smoking hot Combo Cooker out of your oven and on to the top of your stove.  Take off your oven mitts, pick up your pie plate and gently set it about halfway into the pan of the Combo Cooker.  Slide the parchment paper with the dough sitting on top out of the pie plate and onto the pan, using your fingers on the parchment paper to maneuver it into place.
  13. Once the dough is centered on the pan, use a serrated knife to cut a slash or two onto the top of the dough.  The dough will rise in the oven and expand where you make these cuts.
  14. Working really fast, put an ice cube between the pan and the parchment paper under the dough.  The idea is to add extra steam inside of your cooking vessel and prevent a crust from prematurely forming on the bread that would inhibit its rise.
  15. Get you oven mitts back on, flip the deep part of the Combo Cooker upside down, and use it to cover the pan.  You'll hear the ice cube sizzling away even with the cover on.  Put the Combo Cooker into your hot oven.  Keep the oven temperature at 475°F.  Let the bread cook covered for 30 minutes.
  16. After 30 minutes, take the cover off the bread and gasp at its beauty.  You'll want it to go back into the oven until the top is a nice dark brown.  This usually takes only an extra five to ten minutes.  Keep a close eye on it so it doesn't burn.  I usually set the lid of the Combo Cooker under the pan to serve as a heat shield for the bottom of the bread to prevent it from getting too dark.  If you have a thermometer, you'll want to see around 205°F in the center of the loaf when it is done.
  17. Once the loaf is a nice dark brown, take it out of the pan and set it on a wire rack to cool for at least an hour.  You'll be rewarded by a lovely crackling sound as the bread cools if everything went well.
Notes
  • If you don't have a kitchen scale to measure out these quantities, go buy one.  I'll wait.  Every  baker should have a scale.
  • The usual No-Knead recipe calls up ¼ teaspoon of yeast instead of the ½ teaspoon I use here.  It seems the spices kick the hell out of the yeast so extra is required.
  • A little less salt is used in this recipe vs. the usual because of the salt in the Sriracha.  The liquid volumes were adjusted accordingly as well.
This bread goes great with pretty much everything.  It is a match made in heaven with chili.  Or pop it into the toaster oven with some sliced cheddar on top.  Me?  I often eat it plain without even butter or jam.  I just close my eyes and savor every bite.  If you are thinking there is something that this bread won't go with, you are wrong.

This bread is a favorite of mine, and not just because I invented it.  The Sriracha and crushed red pepper flakes are great in combination but are not overwhelming - the bread naturally moderates the heat and you are left with some pretty fantastic flavor that can stand up well with anything you dare pair it up against.
Go Make Some.  Now.

I Want To See Violet

$
0
0
One of my earliest memories is standing in front of My Wonderful Mom as a young lad proclaiming how much I loved the purple and white pants I was wearing.  They were so cool.  They were the best.  There was only one problem: they weren't purple.  They were blue.

It probably came as no great surprise to my parents that I was colorblind (the politically correct name for which these days is "color vision deficient", but I have been and always will be colorblind).  My uncle on my mom's side is red-green colorblind (and how he made a successful living as a farmer is beyond me).  Color blindness is genetic and passed along from your mom.  I have her to thank for my colorblindness, my puny musculature, and 50% of the other things I can blame on my DNA.  Thanks Mom.

But I was young and able to bounce back.  I was accepting of the fact that many of the professions I might otherwise aspire to probably would not work out in the end: interior designer ("What have you done to my beautiful house!?!?"), bomb disposal expert ("Cut the green wire."), and last but not least, professional telephone cable splicer.  I was the butt of these jokes and many others through life.
I Have Nightmares Like This
My chosen profession of Engineering is bad enough.  Geology labs back in University were horrible.  I remember having to identify different types of rocks in an exam, and one of the keys in doing so is going by color.  Worse was the infamous resistor color code. Carbon film resistors are marked with a series of colored bands to indicate their value and tolerance.  To make matters worse, my difficulty in resolving colors is compounded when the colored bit I'm looking at is small.  To this day, I have never bothered to memorize this fundamental code: there's no point in me doing so. 
Pointless
When people think of color-blindness, they think of the whole rods and cones thing, but there is more to it than that.  The best explanation I've come across is this one:
Colour vision is based on an opponent process [1]. There are three kinds of colour receptors called L, M and S (for Long, Medium and Short) and they are receptive to colours centred around the red, green, and blue parts of the visible light spectrum respectively.

Here is a good graph showing how sensitive each receptor is to different wavelengths of light: 
But we don't perceive colour directly from these receptors. Instead, our visual systems combine the output of these receptors to form three channels: black vs. white (L+M+S), red vs. green (L-M) and blue vs. yellow (S-(M+L)). This is why there is no such colour as a reddish-green or a bluish-yellow; our visual systems are not able to perceive these (except under exceptional laboratory conditions). As you can see in the graph, the L, M and S receptors aren't just receptive to pure red, green and blue but to a range of wavelengths centred near these colours, and they all overlap to some degree. But the L (green) and M (red) receptors overlap quite a bit.
In red-green colour blindness, either the L or M are shifted so they're even closer. This means that the red vs. green (L-M) channel is no longer able to distinguish between the two, so this channel is always close to zero and the person no longer sees either red or green just something muddy in between. Blue-yellow colour blindness is similar, but in this case it's the S channel that's shifted towards the L and M. In this case it overlaps with both and this means there's no longer any colours that activate the S without also activating L and M (and vice versa), making it impossible to distinguish blue from yellow.

I stumbled on this when skimming through YCombinator on a lazy Sunday afternoon.  The link above pointed to an article on BoingBoing called "Color for the Colorblind".  I read it and was fascinated.  The article describes sunglasses from a company called EnChroma that promises to correct colorblindness while you are wearing them.  Wow.

First you take a test on their website to determine what kind of colorblindness you have and how bad it is.  The test results told me I was a "strong duotan", and I had no idea initially what that meant.  A little research told me that they were telling me what I already knew: I was red-green colorblind, and I had it bad.
Damned If I Can See Anything but a Bunch of Dots
Then I got to this video on the Press section of their site.  At around 45 seconds into it, I started to cry.
...there is always an "aha" moment.  When they'll turn and look at something and say... "Is that flower... violet?" And they've never seen violet before...
Neither had I.

I pulled myself together, went downstairs, and asked My Lovely Wife to bring up first this video called No Such Thing as Color.  It starts with a guy looking at different houses and trying to guess what color they are.  Thing is, I can't tell if he is getting them right or wrong.  I'm guessing he gets a bunch of them wrong, or he wouldn't be colorblind.

 Skip The Last Half - It Gets Pretty Lame

Then I asked My Lovely Wife to watch the EnChroma video.  At around 45 seconds in, I started crying again.  I think she thought I was laughing until she turned around and saw the tears in my eyes.  I desparately wanted to see violet too.

I put in my order to EnChroma later that night for a pair of EnChroma Cx Receptors.  These are designed to fit over top of my prescription glasses, without which I see nothing but a blur.  The three to five business day wait for shipping turned into three weeks.  Seems a lot of other people had read that same BoingBoing article and wanted to see violet as well.  Oh well.  I had been colorblind all my life.  I could wait a few more weeks.

As I waited for my order to arrive, I didn't tell anyone besides My Lovely Wife, My Wonderful Mom, and My Cool Sister.  I had to tell somebody, but I didn't want to spread the news around too much; I wasn't sure if these things were going to work in the first place.  I did drop the odd hint though, like changing my Facebook profile picture.
I kept a close eye on my UPS tracking number as my precious shipment wound it's way up from California to my home in the Great White North.  When the happy day arrived, I went to the courier to pick them up and got a little more than I bargained for, to the tune of...
  • $20.77 in customs fees
  • $21.81 in taxes
  • $64.60 in UPS brokerage fees (!).  No wonder there have been several class action lawsuits filed against UPS for shipments into Canada.  This is exhorbitant.
Now none of these are Enchroma's fault.  Fees and taxes are inescapable, but I do wish they would offer to ship by US Postal Service to minimize shipping costs to non-US residents.

Anyhoo, they say the glasses work best on a bright sunny day.  I got home late on Friday so decided to wait until Saturday to try them out.  The weather on Saturday was crap so I grudgingly pushed the first try to Sunday.  The crappy weather continued, and it wasn't until we got a small break in the crappiness on Tuesday (with the forecast for extreme crappiness in the days following) that I decided to finally give them a shot.

I wanted to try them first in our backyard.  It has a big flowerbed in the back with several different plants in bloom.  Our backyard also faces a river with farmers fields beyond that, making for quite a sight, colorblind or not.  I also had my wife but on her blouse that she tells me is purple.  I wanted to see violet, after all.

I took a long look around before putting on the EnChromas.  I wanted to get a good sense of "before".  My Lovely Wife got the camera out, started recording, and I put the glasses on for the first time.

The partly-cloudy sky transformed itself into something from an alien world.  I didn't really know if what I was looking at now was accurate or just... different.  Whatever I was looking at had far more "pop" than what I had noticed before.  I just stood there and stared for a while, repeating that it "looked different".  I noticed my mouth was hanging open.

I turned around and our pink stucco house exploded into my view with a vibrancy I could not have imagined.  What I thought had been dull and faded was far from it.  Then I looked down and the chickweed in our lawn blazed in front of my eyes like it had been electrified.  I was taken aback.  I tried to describe it to My Lovely Wife as the recording went on but my voice started to crack and I felt the emotion washing over me like that day from weeks ago.  I am probably the first person ever to be overcome by emotion from a weedy lawn.

I looked over at My Lovely Wife and could see that she was getting choked up as well, her violet blouse shining before my eyes.

I had gotten what I was after.  I signaled to her to stop the recording so we could see how it turned out.  I wanted to share the experience I'd just had with others but, alas, there were technical difficulties and these words will just have to do.

I kept the sunglasses on and took a walk around the yard.  The brown stain on our deck was no longer brown, it was brown, with a richness I had not seen before.  I then noticed how browns stood out so much more from greens than they did before.  A small dead pine tree some distance away that would have been almost invisible to me before in the grassy background was easy to spot.  And was our green truck ever green!  A world that had been hidden from me was starting to reveal itself.

I looked down at myself and the burgundy shirt I was wearing lit up before my eyes.  "WOW!", I shouted.  "LOOK AT MY SHIRT!!!"  My Lovely Wife had always liked the shirt more than I did.  To me, it seemed a bit dull.  I was wrong.  I kept staring back at it thinking I had made some kind of mistake.

It was time to go back into the house.  I kept the glasses on but didn't expect much wearing them inside.  As I thought, I didn't see any real improvement, and the folks at EnChroma caution you about this: they work best out in the open with bright natural light.  They came up empty in early evening on a cloudy day.

I am looking forward to the coming days and weeks.  Apparently, they become more effective as your brain adapts to a new way of seeing the world when the sunglasses are on.  The crappy weather might slow that process down, unfortunately.  On the other hand, I'm really hoping for a nice rainbow sometime.  People with this eyewear rave about rainbows (and fortunately for me, the price on these things has come down since that article as well).

I got into this wanting to see violet, but so far it is the greens that are blowing me away.  The new growth on the tips of spruce trees stand out like the lights on a Christmas tree.  I find myself distracted by the rain soaked, green grass growing brightly in the ditches on the drive in to work.  And I will always remember the first time I saw that chickweed and really saw green.  It is only too bad that these sunglasses aren't a cure for colorblindness.  They only do their magic while being worn.  Once I take them off, I return to my muted, drab world.  But to me, something is a hell of a lot better than nothing.

Now my new Facebook profile picture should make sense to everyone.

No Pressure - I Got This

$
0
0
Earlier this year, My Lovely Wife and I enjoyed a visit from My Evil Brother-In-Law, who also just so happens to work for Environment Canada.  Naturally he was interested in my Davis Weather Station and some of the hacking I've done on it.  But he was more interested in its barometric pressure reading of somewhere around mid-800 kPa.  That is a really low number that could mean only one of two things:
  1. My barometer was not working.
  2. We were in the eye of a hurricane.
The weather seemed pretty nice out, but I know from what little TV I watch that the weather can be deceptively nice in the eye of a hurricane, only to worsen when the eye moves on and you're subjected to the hurricane's nastier bits.  So we waited a while and the weather stubbornly continued to be nice.  Broken barometer it was.  Later my suspicions were confirmed when the barometric pressure would just show as a series of dashes.  No need to take cover under the stairs, for sure.
Broken Barometer Badness
Fast forward a little bit and My Evil Brother-In-Law decides to take up the invitation from My Lovely Wife and myself to visit us for Christmas.  My barometer is still broken, but we've offered our invitation a couple months in advance.  I've got time.  I would fix my barometer before the weatherman's arrival.

The first part of the process was figuring out how the hell I was going to do this.  Everything else on the station was working well, so I figured it was just a dead sensor.  But exactly what sensor are we talking about?  I figured this much out a while ago and documented it in this post.
The part is a Measurement Specialties 5534CM.  Applications include "Weather control systems" according to its product page (man, I'd love to be able to control the weather). Here is its product page, here is where you can buy it, and here is some Arduino code to drive it!
The cool thing about this part is that it has a digital interface rather than an analog one I had originally guessed at.  It also is factory calibrated.  Davis was smart and kept things simple: the amount of A/D they have to do in the console is exactly zero.  But there seems to be a price to pay for this simplicity: $27.27 for a single piece, to be exact.  Good thing they are cheaper by the 1,000.
But there was a problem.  This picture was taken in my old console that has since failed me.  I got a new one and U84 above is not populated.  U85 is.
What is U85?
Good question.  What is U85???  I figured after a bit of research that it must be a minified version of the 5534CM: the 5540CM.  Here is where you can buy it.
You can, but...
Note I said you "can buy it" there, but I didn't say you "should buy it" there.  The price of this little bastard is $32 plus shipping that was going to put me out over $40 total.  Looking good in front of My Evil Brother-In-Law was one thing, but $40 is another.  What to do?  Well, Digikey is a well known name in the electronics components biz, but so is Shenzhen Kesun Electronics Co., Ltd.  Actually, no they aren't.  But their price and their shipping was about a third that of Digikey's.  Here is where you should buy it.  Take my money!  All $12 of it.
The Price is Definitely Right
The only price to be paid for not paying much of a price is time: I ordered this on November 12th and got it December 19th.  It was obviously on the slowest of the slow boats from China, but I do feel Canada Post was at least somewhat to blame.  The good folks at Shenzhen Kesun Electronics Co., Ltd. shipped within two days of my order and gave me a tracking number to boot.  However, that tracking number was never updated again by Canada Post.  Even after I received it, the order showed that it was still inbound from China.  I think my little sensor somehow got lost in the Christmas parcel rush.

So I had the What part of the equation covered.  Equally important is the How.  How do you get the old part off and the new one on?  Any time I had ever tried to take a multi-leaded part off a board like this with just a soldering iron and desoldering wick (a fine copper braid that soaks up solder like a sponge), it always ended in heartache.  You never get all of the solder, and you can't get enough heat around all the part at once to keep the solder molten to have the whole thing come off.  In the end, I would end up just wrecking what I was trying to remove.

That's why I got me a hot air rework station.  Which one?  This one.
Dave Jones Has Many Fine Traits.  Brevity is not One of Them 

Actually, mine is a Yihua 858D.  Same difference.  There are a lot of combo units that combine a soldering station with hot air rework, but I already have a decent iron.  This unit is small, it is quiet, the temperature is well regulated, it comes up to temperature very fast, and it has a neat cooldown function.  Best of all it is cheap.  Better of all, it works great.  I'm not sure how I lived without it.  I got it from here for $79.99 with Free Shipping and a spare heater element.  Nice.  This is my new favorite toy: you can take my hot air gun from my cold dead hands.

I got the What.  I got the How.  The Who is me.  The Where is here.  The When is now.  I got a two week Christmas holiday.  Time to get busy.  Open the case.  Set up on something that could take an accidental blast of heat (in this case, my stove), and put some aluminum foil around the surrounding parts to keep the heat off them to prevent their inadvertant removal.
Preparing for Battle
I set my trusty hot air gun to 340°F and held the nozzle just over the part.  The solder melted after maybe ten seconds and the part was off.  No fuss, no muss.  I freaking love this thing.

The next part of the operation did not go smoothly.  At all.  The plan was to use my soldering iron to solder the new part into place.  I took the new sensor out of its package, applied a bit of flux to the circuit board with a flux pen (always use flux when soldering), and placed the part on the board.  The first problem I had was the part did not want to line up well on the board: the part had some solder on each of its eight pads on its underside.  The circuit board also had a bit of solder on the eight copper pads receiving the part.  Placing the part on the board invariably caused the part to slip out of place.  My first attempts to solder the part in place were met with total failure: the part would be misaligned, I'd get a solder bridge, I'd get a missing connection... and all of my attempts had the part seemingly sitting on top of the board rather than being fastened to it.

A good night's sleep made the answer clear.  As so many instruction manuals say, installation is the reverse of removal.  I was using my soldering iron to attach the new part when I should really have been using the hot air station.  I had been leery to try this because I thought the heat might damage the new part.  But thinking about it some more, these boards are usually built using some kind of wave soldering machine that basically heats the whole board with all parts attached in an oven brought to temperatures above that of the solder's melting point.  That is basically what the hot air station does.

So, I laid down the aluminum foil in the area again and hand placed the part as best I could after having put a little liquid flux in the area.  I set the fan speed of the air gun about halfway and again set the temperature to 340°F.  I slowly lowered the nozzle of the gun directly over the part, trying hard not to blow the part off to one side.

What happened next was beautiful.  The solder around the part melted and the resulting surface tension moved the part perfectly into position.  The part also visibly pulled itself toward the circuit board and was no longer just kind of sitting on top of it.  Huzzah!

I let the area cool down a bit and then used a Q-tip and some isopropyl alchohol to clean the residual flux away.  I put it all together and...
Victory Is Mine!!!
The console display is 1020 hPa, or 102.0 kPa, a value that checked out nicely with the value reported from the nearest airport.  Better yet, the repair passes muster with My Evil Brother-In-Law.  Now all I've got to do is keep him on a steady diet of good food and good booze for the rest of his visit.  It's all good.

And by the way, Merry Christmas and a Happy New Year from all of us here at Mad Scientist Labs.

Wifi on the BeagleBone Black with Systemd

$
0
0
Unlike most of my posts on this blog, the title of this post is neither clever nor funny.  I'm feeling serious today.  Why?  I have a Rev B BeagleBone Black (BBB) and I have a love / hate relationship with it.  And I suspect I'm not the only one.
It's Not Me - It's You
I love that it is a hell of a lot more powerful than the Raspberry Pi in all aspects except probably for its graphics: it has a faster processor, more RAM, onboard flash, more I/O, and the incredibly powerful PRUs.  The new Raspberry Pi B+ certainly helps level the field with more I/O than the original B and four sweet USB ports, but for raw power the award still goes to the 'Bone.

On the other hand, I hate that the 'Bone can be such a bastard to get working to its full potential.  One problem is the Imagination Technologies SGX530 graphics core.  This company is open-source hostile, and their closed-source graphics binary blob works only with certain kernels.  All attempts to reverse-engineer an SGX driver have unfortunately failed.  The Raspberry Pi has both more powerful graphics hardware and Broadcom is (amazingly) supporting the development of an open source driver.  Incidentally, the upcoming Beagleboard-X15 will also have an SGX graphics core in it, and they will not be getting my money for this reason alone. Huge win for the Pi here.

The other problem I've had is with getting wifi going.  One dongle was crashing the kernel.  I wasn't the only one having problems, either.  I spent a ridiculous amount of time on this in the fall with no luck.  I thought the best way to fix the problem was to just drive over the 'Bone with my car and get a Pi.

But I'm stubborn.  I've got some time over the Christmas break and I thought I'd give it one more shot.  Amazingly, I seem to have something working using the Jessie snapshot I got from here named BBB-eMMC-flasher-debian-jessie-lxqt-armhf-2014-12-19-2gb.img.xz and running kernel 3.14.26-ti-r42.  I also learned a bit about systemd along the way.  Systemd is fairly new to Debian, and that fact makes a lot of the wireless tutorials out there obsolete.  So how did I get wifi working on the Beaglebone Black with systemd?  Read on, McDuff...

First of all, get the latest Jessie snapshot from the link above and flash it to the eMMC (flash) memory on the 'Bone. I'm not going to go into the details of doing that, because lots of other people have. That is what Google is for.

OK, so you've flashed the 'Bone with the Jessie image and want to get wireless networking going. I'm going under the assumption that you have console access to the 'Bone, either via a USB to Serial connection or SSH over a hard-wired connection. No fancy Graphical User Interface stuff for me.

Next thing to know is that a lot of wifi dongles need some kind of firmware loaded into them.  My TP-Link TL-WN722N already has its firmware on the image linked above (from the ath9k_htc package) so no need to download anything in this case just yet.  Other dongles like those based on the ZD1211 or RaLink chipsets will need you to install a firmware package with the old"apt-get update; apt-get install... " dance.  Here, the dmesg command and good ole' Google are your friend, helping you to figure out what you need.

Now you've got a 'Bone with a dongle plugged in and its firmware loading up.  After that, the thing that trips people up is that recent kernels "soft block" (disable) things like wifi and bluetooth by default. A program called rfkill is necessary to enable them. rfkill is part of the image above (and because I politely asked Robert C. Nelson to put it in) so you should be good to go without having to download something over a hardwired ethernet connection first.

Let's kick things off by checking to see if the wifi is blocked, and enable it if it is.
root@beaglebone:~# rfkill list wifi
0: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
root@beaglebone:~# rfkill unblock wifi
root@beaglebone:~# rfkill list wifi
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
Good start. "Soft blocked" changed from "yes" to "no" after we unblocked it.

Next thing we need to do is bring the wifi interface up using the ip command.  Note a couple things.  First, Blogger hates me.  The square brackets below are supposed to be angle brackets, but the Blogger editor gets confused when you switch back and forth between "Compose" mode and "HTML" mode (and yes, I tried coding in the HTML entities and no, that didn't work).

Before getting into that, how do we know the name of our wireless interface?  Assuming your dongle is plugged in, do...
root@beaglebone:~# ip link
1: lo: [LOOPBACK,UP,LOWER_UP] mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: [NO-CARRIER,BROADCAST,MULTICAST,UP] mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: can0: [NOARP,ECHO] mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
4: can1: [NOARP,ECHO] mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
5: wlan1: [BROADCAST,MULTICAST] mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
There we go.  My dongle is wlan1 and I'll be using that in the examples that follow.  I'll also strip out other interfaces in the output going forward.  Numbers I'd rather you didn't see have been replaced by "xx".

Now let's bring the wlan1 interface up and check its status.
root@beaglebone:~# ip link set wlan1 up
root@beaglebone:~# ip link
5: wlan1: [ NO-CARRIER,BROADCAST,MULTICAST,UP ] mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
See how the status changes from [ BROADCAST,MULTICAST ] to [ NO-CARRIER,BROADCAST, MULTICAST,UP ] once the link is up?

The next thing we'll do is associate the dongle to a wireless router.  This example is for the connection  to my router that is wide open.  If yours is not open or not WEP encrypted, you'll need to do something different like bringing wpa_supplicant to the party (or just skip ahead to the automatic stuff below).  My router connection is named Abby_Slow, so you'll have to substitute the name of your access point below.  The really important thing to note in the following is that older command line tools like iwconfig have been deprecated and will probably not work anymore.  The new tool in town is called iw.  We will first use iw query the status of the link, and then make a connection.
root@beaglebone:~# iw wlan1 link
Not connected.
root@beaglebone:~# iw wlan1 connect Abby_Slow
root@beaglebone:~# iw wlan1 link
Connected to xx:xx:xx:xx:xx:xx (on wlan1)
SSID: Abby_Slow
freq: 2437
RX: 10694 bytes (75 packets)
TX: 2029 bytes (13 packets)
signal: -72 dBm
tx bitrate: 15.0 MBit/s MCS 0 40MHz short GI

bss flags:      short-preamble short-slot-time
dtim period:    0
beacon int:     100
So now we have a link, but that isn't going to get us as far as we need to go...
root@beaglebone:~# ping www.google.com
ping: unknown host www.google.com
We need to use something called dhclient to get a DHCP address, like so...
root@beaglebone:~# dhclient wlan1
root@beaglebone:~# ping www.google.com
PING www.google.com (216.58.216.228) 56(84) bytes of data.
64 bytes from ord31s22-in-f4.1e100.net (216.58.216.228): icmp_seq=1 ttl=50 time=75.2 ms
^C
--- www.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 75.251/75.251/75.251/0.000 ms
root@beaglebone:~#
The sweet, sweet ping of success.  There is just one more thing before we go automatic on this problem.  Some dongles have issues going into power saving mode.  Let's not take our chances and disable this.  Inspired by this post, create a file called /etc/udev/rules.d/wifi_power_save.rules and add this one long line to it (no line breaks no matter what it looks like below, please).
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlan*" RUN+="/usr/sbin/iw dev %k set power_save off"
Here is how to check it the next time you boot the board:
root@beaglebone:~# iwconfig wlan1
wlan1 IEEE 802.11bg ESSID:"Abby_Slow"
Mode:Managed Frequency:2.437 GHz Access Point: xx:xx:xx:xx:xx:xx
Bit Rate=5.5 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=20/100 Signal level=20/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:59 Invalid misc:48 Missed beacon:0
Now obviously you are not going to want to go through this whole process every time you boot the board.  This stuff needs to be automated.  But how?  One thing you could do is trawl the interweb and try to understand how systemd-networkd works.  Then, working from the sparse set of examples on the web, you could manually create some text files against all odds that whatever you come up with is actually going to work.  You could do that, because that is what I tried to do to start with.  I created a 20-dhcp.network file in /etc/systemd/network that should have automatically worked but didn't.  Be smart.  Don't do that.  Do this:
root@beaglebone:~# apt-get update
root@beaglebone:~# apt-get install network-manager
root@beaglebone:~# nmtui
nmtui is the NetworkManager Text User Interface bundled into the NetworkManager package and it is very easy to use.  Ugly, but easy to use.

Ugly, But Works Beautifully
You'll hear a lot more about nmcli, the NetworkManager Command Line Interface.  Don't even try using that unless you are a NetworkManager God.  Stick with nmtui and you'll be good to go in no time.  You can use it to setup connections to open and encrypted access points that will automatically connect up when the board boots.  No fuss, no muss.  It worked perfectly for me.

Until this started to happen...
root@beaglebone:~# [ 2282.574398] INFO: task wpa_supplicant:485 blocked for more than 120 seconds.
[ 2282.581864] Tainted: G O 3.14.26-ti-r42 #1
[ 2282.592586] "echo 0 } /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Then the 'Bone locked up solid.

FML.

I tried once or twice more and the dongle kept locking up hard after a short while, taking the 'Bone along with it.  This is where I started to think that maybe I've got a bad TP-Link dongle.  Fortunately for me, I have another dongle, this one based on a Zydas ZD1211 chipset that is also well supported in Linux.  It needs some firmware that currently isn't in the default image, so I rebooted the 'Bone and did the following before the board decided to crash again.
root@beaglebone:~# apt-get install zd1211-firmware
I plugged in the Zydas dongle and then rebooted the board so the kernel could detect it and load its firmware (might have worked if I hot-plugged it, might not have).  Then I ran nmtui again, set up the dongle, and the network has been working well since then.  But you better believe I'm keeping my fingers crossed.

Incidentally, some people have reported that some dongles work poorly when plugged directly into the 'Bone.  A popular fix seems to be plugging it in via a USB extension cable or powered hub to get a little separation between the two of them.  If you've followed this guide and still can't get things working, try giving that a shot.

This would be a good place to wrap things up with my usual "now go out and do something" line.  But heck, while I'm at this, I might as well throw in some other useful things I picked up along the way to get it all into one place.  If I don't put this stuff here, I'll just be looking for it myself later anyway.
How do you change the name of the dongle's device interface???  See here on the Archlinux wiki.

How do you check out NetworkManager's status?
root@beaglebone:~# systemctl status NetworkManager
How can you see what systemd is putting into its journal for NetworkManager?  (Tip: use the left and right arrow keys to move horizontally a half screen at a time to see long lines of text!)
root@beaglebone:~# journalctl -u NetworkManager
How do I reboot the 'Bone?
root@beaglebone:~# systemctl reboot
How do I power it off?
root@beaglebone:~# systemctl poweroff
Anyhoo, there you have it: a reasonably comprehensive and up-to-date tutorial on how to get wireless networking going on one of the more powerful little ARM boards out there.  Included at no extra charge was a bunch of related systemd stuff that was previously scattered all over the net.  Now get out there and make that 'Bone do something.

Wifi on the BeagleBone Black with Systemd - An Addendum

$
0
0
So I go to all the trouble to write up a nice long blog post on how to get wifi going on the BeagleBone Black and what happens?  The 'Bone bites me in the ass, reinforcing the latter part of our Love / Hate relationship.  Here is the story, and the fix.

I posted my writeup to the BeagleBoard Google Group and one hour later, my wireless connection started acting up again.  I was always getting some DUP packets with my ZD1211 wifi adapter e.g.

64 bytes from ord31s22-in-f4.1e100.net (216.58.216.228): icmp_seq=3 ttl=50 time=71.4 ms
64 bytes from ord31s22-in-f4.1e100.net (216.58.216.228): icmp_seq=4 ttl=50 time=70.5 ms
64 bytes from ord31s22-in-f4.1e100.net (216.58.216.228): icmp_seq=4 ttl=50 time=75.6 ms (DUP!)
64 bytes from ord31s22-in-f4.1e100.net (216.58.216.228): icmp_seq=4 ttl=50 time=76.2 ms (DUP!)

that I couldn't figure out but otherwise things seemed to be working OK.  Then the ZD1211 stick just decided to drop the connection, take its ball, and go home.

I was pissed, but I also have one of those brains where the subconscious continues to crank away on the problem no matter now much you want to drive over your 'Bone with a car.  I was lying awake in bed when I remembered a post about someone else's problem being solved by changing the performance governor the 'Bone uses to set its clock speed.  The 'Bone is set up to go into "ondemand" mode when it isn't that busy, and it drops its clock speed all the way down to 300 MHz from its 1 GHz maximum when it does so.  Could changing this fix the problem?  Only one way to find out, but first I had to figure out how.

The Jessie snapshot I'm using on the 'Bone does not (yet) use the newer cpupower utility that the cool kids like Arch Linux are using these days.  Instead, Jessie still uses the older cpufreq-utils stuff.  So all you need to do to set the 'Bone to 1 GHz (and keep it at 1 GHz, dammit) is:
  1. Edit /etc/default/cpufrequtils (you might need to create it if it doesn’t exist).
  2. Specify the governor with the GOVERNOR variable by putting this line in the file:

    GOVERNOR="performance"
Then reboot the 'Bone with
root@beaglebone:~#  systemctl reboot
Once it has rebooted, check that the change is in effect by using the cpufreq-info command and verifying that the 'Bone is hanging out at 1000 MHz for 100% of the time.
root@beaglebone:~# cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: generic_cpu0
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 300 us.
  hardware limits: 300 MHz - 1000 MHz
  available frequency steps: 300 MHz, 600 MHz, 720 MHz, 800 MHz, 1000 MHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 300 MHz and 1000 MHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 1000 MHz (asserted by call to hardware).
  cpufreq stats: 300 MHz:0.00%, 600 MHz:0.00%, 720 MHz:0.00%, 800 MHz:0.00%, 1000 MHz:100.00%
The wifi on my 'Bone using the TP-Link TL-WN722N dongle has been rock solid since I did this a day or two ago.  No DUPs, no lockups.  I wasn't so lucky with my ZD1211 based dongle (the firmware for which will be appearing in future Jessie snapshots BTW), and I've decided not to pursue this any further.  There are some old bugs on this issue so it is unlikely that this is something I can do much about.  And I don't really care, because at least I have a setup now that works and is solid.

If you are interested, all the details can be found on this post to the BeagleBoard Google Group.  The explanation for using the "ondemand" governor is so that the 'Bone can be powered by USB.  But this doesn't make sense to me.  Nothing prevents the 'Bone in "ondemand" to clock up to 1 GHz for an extended period of time, and if USB won't cut this, you're screwed anyway.  And is it better to have mysterious failures like this happening to people and getting them so frustrated that they just want to run over their 'Bone with a car?  After all, there are other people besides me that burned off a bunch of hours thanks to this issue.

Want some take-aways to wifi on the Beaglebone Black?  Here are some take-aways.
  • Use an Atheros-based wifi dongle like the TP-Link TL-WN722N
  • Set up your wireless connection using NetworkManager and, if you are working from the command line, its nmtui interface
  • Set your CPU governor to "performance" or live to regret it
  • Don't power your 'Bone from USB.  Get yourself an external supply rated for 5 Volts at 2 Amps.  I use this one from the good folks at Adafruit.
Now, just like my last post, I'll toss in a few other tidbits that I've learned along the way.
Compiling your own kernel or wanting to use the SGX libraries?  Make sure that you have lzop installed.  I did not, and couldn't figure out why the kernel build wasn't producing a zImage and putting it into the deploy directory as noted in these instructions.  And if you are going to be doing that, might as well have ccache installed as well.  On Arch Linux:
root@beaglebone:~#  pacman -Sy lzop ccache
Want to turn off screen blanking not only for X-Windows, but for serial / SSH terminal sessions and the raw framebuffer (so that your OGLES2ChameleonMan demo doesn't blank after ten minutes)?  Edit /boot/uEnv.txt and add consoleblank to your cmdline, like so:
cmdline=quiet consoleblank=0
Did you flash your 'Bone with something containing the LXQT desktop or something similar?  What if you don't want LXQT to start on boot?  This awesome post shows to turn off LXQT in a running system:
root@beaglebone:~# systemctl isolate multi-user.target
and this starts it up again:
root@beaglebone:~# systemctl start graphical.target
To avoid starting up a graphical desktop at boot run:
root@beaglebone:~# systemctl set-default multi-user.target
and change back with:
root@beaglebone:~# systemctl set-default graphical.target
That's enough knowledge bombs for one post. See you next time here at Mad Scientist Labs.

How To Make A Sandwich

$
0
0
The Lowly Sandwich. For too long, the Sandwich did not get the respect nor the attention it deserved. Then two things happened. First, "Sandwich" (and the closely related "Sammich") became a meme.  I really like this one, just because I think Steve Balmer is a doofus...
A Filthy Rich Doofus, But Still a Doofus
... but you gotta like this one too.  Because Nigella.
Everything In This Picture Is Good
The second thing that happened was my writing of this blog post.  Srsly.

If your first thought of a Sammich is a slice of bologna with store-bought white sandwich bread, you’re doing it wrong. Very wrong.  I'm here to fix that.   It is time to dress The Lowly Sandwich up a bit and give it a chance to strut its stuff.
Nothing In This Picture Is Good
Now I’ll admit, I’ve long had pretty low Sammich expectations. I basically grew up on something much like the unadorned beast pictured above, taking a lunch to school for the majority of my school years in Grades 1 through 12. And in those days, lunch meant Sammiches.  Let’s just say I ate a lot of Sammiches over that time, and going back down that road didn’t initially hold a ton of appeal.

But appreciating and, even better, making your own good food means you’ve sometimes got to open your eyes and see a challenge in a whole new light. Sometimes, you’ve got to do that in territory that you might think has been well trodden. Can we turn the pedestrian Sammich into something that you dream about? Can a Sammich blow your mind?

The best way to answer this question is, of course, by example. I’m going to show you my take on a popular Sammich available in these parts: the Chicken, Brie, and Fig Sandwich from Earl’s Restaurant. Earl’s is a restaurant chain here in the Great White North that pairs a pretty decent menu with a pretty decent beer selection brewed on premises. What is not to like? Very little as it turns out.
The menu states that the Chicken, Brie, and Fig Sammich includes  "roasted apples, spinach, garlic aioli, fresh ciabatta".  Hmmmm... Bread. Brie. Chicken Breast. These are not exotic ingredients. You might have these ingredients or reasonable facsimiles thereof sitting in your fridge right now. That was the case in my refrigerator when this idea came to me anyway. What I ended up doing was making the best with what I had on hand at the time to put together an Earl’s-like Sammich.  I subsequently devouring said result. How did I go about it? Let me show you.  Let me show you exactly - to the gram.  Because that's how I roll.

First off, you need some decent bread. Bread is the foundation of a good Sammich, and a crappy bread is a crappy foundation. I recommend something like my No Knead Blue Cheese and Toasted Sesame Seed Bread (Jim Lahey's No Knead Bread with 40g each of crumbled blue cheese and toasted sesame seeds) described by a friend as “The best bread I’ve ever had”. And his mom was a baker. If you think you don’t like blue cheese, you are wrong. Blue cheese is amazing. The amount of blue cheese in this recipe is just enough to haunt the bread with its flavour, not beat you over the head with it.

Cut yourself a couple slices but don’t go too thick here. The bread is the foundation of the Sammich, but there is little worse than a Sammich that just tastes like all bread. That isn’t a Sammich. That’s just bread with some stuff on it. The slices in the picture below could probably be a little thinner.
This Bread Tastes Like More
Next up, you’ll want to lay a little mayo down. This serves a couple purposes. First and foremost, it adds a nice tang to the sandwich. Second of all, it serves as a kind of waterproofing layer so that the next ingredient up won’t make the bread soggy. I’m using a low fat mayo hear and can hear the boos from the audience even in advance of posting this. Haters gotta hate. I went this route because a) it is what I had in the fridge and b) low fat for a non-critical element like this lets me eat more of other stuff. Life is full of decisions. Make yours. Put on what you like.
Don't Hate Me
How about an option even at this early stage? Once in making this sandwich I made the “mistake” of putting on this ridiculously awesome concoction.
Best.  Mistake.  Ever.
If you see this stuff in your grocery store, buy it on the spot. It. Is. Spectacular. And by Spectacular (capital S), I mean it will clear your sinuses in one hell of a hurry. This stuff lays the heat down far better than any “hot” horseradish I’ve ever bought in a grocery store. Store-bought horseradish is an abomination that should stay in the store. I am convinced that if you want good horseradish, you need to make it yourself. But that is a post for another time. Go easy on this stuff if you got it.  You have been warned.

Next up we add a bit of sweetness with a little applesauce. Again, I’ve had bad luck with store-bought. I have been disappointed time and again with anything out of a can. Want good applesauce? Buy a pressure-cooker and make your own. We make ours from crabapples given to us by our friends in the fall, after they have picked multiple five-gallon pails for themselves and can’t bear to look at a single apple more. The tang you get from these apples makes a delicious applesauce, so don’t go ruining it by adding sugar. Oh, and make pie. Not too heavy here. The applesauce, I mean. If you’re making pie, make it as heavy as you like.
Mmmmmm.... Pie
The Earl’s menu says they use fig jam. Fig jam? I didn’t have no fig jam. What I did have was dates, to which My Lovely Wife has a habit nastier than anything cocaine or heroin could pull someone in to. I sliced a few dates as thin as I could and laid them down on top of the applesauce. This is easier said than done because dates are kinda mushy and very sticky, but I persevered Because Of Sammich.
Jam Would Have Spread Better
Next up: chicken breast. Cut up chicken breast and put it on the Sammich. This part isn’t complicated. Just use small pieces or thin slices and everything will be fine, just fine. It wouldn’t hurt here to pop it into the microwave for a bit just to take the chill off.
[Insert Breast Joke Here]
Next up would be the Brie in the Chicken and Brie sandwich. But again, your options are open here. I think you want to stick to a softer cheese that will make the effort to get your attention, rather than a rather flavourless cheese that everybody goes with because they know it (mozzarella, I’m looking at you). I went with a garlic-flavoured Boursin cheese based on a tip from a buddy of mine. He was not wrong. But don’t get me wrong, Brie would have been good here too. I guess what I’m trying to say here is: get a damn tasty soft cheese and lay it down on the other piece of bread.  You probably want to use more than I did here.
That done, bring the two slices of bread together. You are so close now, you should be able to taste it. Patience. There is one more step to go.

What I’ve been doing up to now is tossing the entire sandwich into the microwave for a very short period of time. How short? I can’t remember to be honest, but I seem to remember it was in the twenty second ballpark. That is just long enough to take the cold out of the chicken breast and apple sauce, but not so long that the applesauce is steaming hot. The microwave also does a pretty great job of making bread that might not be at its freshest taste a lot better. I also like how the warming of the bread brings out the flavour of the Blue Cheese in my Blue Cheese and Toasted Sesame Seed Bread even more.

I present for your inspection below the end result, cut in half and ready to be devoured in no time flat. It is good. Damn good. Is it a dead-ringer for the Earl’s version? Not exactly, but I did take several liberties along the way.
How Good?  Damn Good, I Said.
As good as that sandwich was, one always needs to think ahead to Next Time.  Next time, I want to try something a little different. Something like this.
And What Is This I See Before Me???
This is my waffle maker. There are many like it. This one is mine. Inspired by The Waffleizer’s book “Will It Waffle” (the answer is yes), I made up this Sammich over Christmas with my now famous Diablo Bread, some leftover turkey breast cooked sous vide (with these seasonings but this cooking method), mozzarella cheese, and thin slices of dill pickle. Were you to have actually tasted this yourself, you would have wept uncontrollably with joy. I can say without fear of exaggeration that this is the best Sammich that has ever been made or ever will be made.

It didn’t hurt that I brought a nice new technique to the party.  I was finding the lid of the waffle iron didn’t put enough weight on the Sammich to transfer the heat to it like I wanted. So I put my water bottle (about half full) onto the handle of the waffle iron, and I jammed a chopstick in there to prevent the bottle from rolling off. The beauty of this technique is that you can adjust the amount of “press” this ghetto Panini press puts on your Sammich by tweaking the amount of water in the bottle.
Patent Pending
And why, you might ask, am I using a waffle iron instead of a Panini press to make this Sammich??? Jeez Louise. Really??? Can you make King Arthur Sourdough Waffles in a Panini press???  No. Can I make paninis in a waffle iron???  Yes. Are we done here???  Yes.

Based on the spectacularity of this Diablo Bread / Turkey Breast / Mozzarella Cheese / Dill Pickle Sammich, I can only imagine how mind blowing a waffled Blue Cheese and Toasted Sesame Seed No Knead Bread / Horseradish Mayo / Applesauce / Date / Chicken Breast Sammich would taste. But I have a pretty damn good guess. It would be definitive proof that there is a God and He loves me. I don’t know about the rest of you, but me for sure at least.

Good food is good food.  Go make some.

Teardown and Repair of a Panasonic DMC-ZS40 / TZ60 Digital Camera

$
0
0
UPDATE 2015-08-30: I have found out that many of my pictures have been blurry ever since I tore this thing apart.  I don't know why yet, but it probably is a result of my spinning the lug down a bit on the focus motor.  I don't yet know how to enter the camera's service mode in the hopes of getting more information.  Not sure what to do next.  Please consider yourself warned.

------------------

The Panasonic DMC-ZS40 (TZ60 in Europe) is a pretty awesome camera: compact, user friendly, long zoom, great image stabilization, and excellent image quality.  I've been really impressed with it since My Lovely Wife and I bought it back in the spring of 2014.

That is until a couple of days ago when we turned it on and got this:

System Error (Focus)

That's not good.  Not good at all. Especially since it went off warranty around four months ago.
Looking around the Net, this seems to be a pretty common problem with Panasonic.  Fortunately, a few people have had the gumption to tear these things down.  This blog post is great.  Here is a fantastic YouTube video on disassembling the camera, and here is another on cleaning the lens assembly.  All great information.  All for cameras much older than the ZS40.

OK, I thought.  There must be a service manual out for the ZS40.  The closest I could find was this one for the earlier model, the ZS30.  Unfortunately, I could not find anything for the ZS40 that I wouldn't have to shell out for.  And I wasn't in the mood for shelling out.  I know my way around inside a computer.  How hard could tearing apart a compact digital camera be?

As it turns out, pretty damn hard.  Digital cameras are at a completely different level of complexity and integration compared to a PC. The five hours I spent in the guts of this thing trying to restore it back to life were kinda terrifying.  But I went into it pretty blind, and I made a few mistakes along the way.  It would have been a lot better had I had a guide to follow like the one I am writing for you now.  Take on the following procedure at your own risk.  If you do take it on, read it through not once but twice, to get an idea of what you are getting yourself in to.  Also read the blog and watch the videos I've linked above.

What you'll need:
  • a computer nearby to read this blog and the others I link to
  • a clean work area free of dust
  • a very small Japanese Industrial Standard (JIS) screwdriver.  I didn't have one so I had to use a Philips 00 screwdriver instead.  Read this to see how they are different, and beware that the risk of this repair goes up if you are like me and don't have the right screwdriver.
  • a very small flat-bladed screwdriver
  • a piece of paper, scotch tape, and a pen for keeping track of which screw went where
  • a Tupperware container for covering the disassembled bits of lens to keep the dust off
  • a flashlight for shedding some extra light on the subject, especially if your eyes are as crappy as mine.  A magnifier wouldn't hurt either.
  • maybe an air bulb to blow dust and lint off things

This was my setup.

What I didn't use but you might want to have handy
  • a bible, prayer book, or something like that.

OK.  Let's get down to business.

Remove the lanyard, battery, and memory card from the camera.  This is the easy part.  Enjoy it while it lasts.

Next, remove the seven screws holding the back on.  There are four on the bottom, one on the left (when looking from the back), and two on the right.  Panasonic uses a bit of Loctite to help keep the screws from coming out so be prepared for them not coming out easily.  I wasn't, and I screwed up (ha ha) one of the screws on the bottom, probably because I didn't have a JIS screwdriver.  I was fortunate though that it came out halfway.  I was able grab the screw head with some pliers and turn it the rest of the way out.  I was probably pretty lucky that this was the only one I messed up.  As a friend of mine likes to say, I'd rather be lucky than good.

Here is maybe a good time to say that there are a pile of screws holding this thing together, many of them different sizes.  I suggest doing what I did.  Get a piece of paper and draw a little picture of what it is you are about to take apart.  Wrap some scotch tape in a loop so the sticky side faces out and stick that on the paper.  As you remove each screw, place it on your picture so you know exactly where it goes.  I'll warn you ahead of time that some assemblies will have two screws right next to each other of a different thread and / or length.  If you think you'll just be able to remember, you're probably wrong.  And this is an expensive camera to gamble on.  How many screws hold this thing together?  This many.

Once the screws are out, the back cover will stay in place thanks to a set of plastic clips all around it.  Unlike previous versions of the camera, nothing is attached to this cover.  Carefully tug at the back cover and the clips should let go.  Set the cover aside. 

Next, the circuit board with the control dial needs to be freed up.  Push it down gently from the top to free it from the two plastic clips.  It will slide down a bit and come loose.  Fold it up and out of the way.

Now the display has to come loose.  Put gentle pressure with your finger on the left edge of the display and push it to the right while you gently pull up on the right edge of the display.  There is a thin piece of metal sticking out on that left edge.  Pushing to the right will get that metal piece past two heavier metal clips holding the display down.  The display will then fold over to the right.

Remove the four screws holding the gold-colored frame plate down.  BEWARE.  These screws are different sizes, so keep track of which one went where.  The screw at top right has a finer thread than the other three.   Once you've removed the frame plate, you should see something like this.

Removing that frame plate is a little tricky.  There is a long metal tab on the bottom left corner of this plate that extends deep into the body of the camera.  Use a small bladed screwdriver in this corner and lift up from there.  The right side of the frame is going to try and stay in place as you do so.  This is because the frame plate acts as a heat sink for the camera's image processor. There is a sticky thermal pad under the black tape on the right side of the frame.  As you pull up from the left, the sticky pad should pull away from the processor on the right.  Set the frame aside once it comes free.  Don't let the sticky pad touch anything because you'll want it to stick on to the processor again when you replace the frame.  I covered the frame up with a small piece of Tupperware to prevent any dust in the room from landing on it.  This picture is the frame plate after removal.  The sticky heat sink stuff is that beige rectangle on the left.  You can also see that long metal tab I was talking about on the right.

Now the control board and the display can be removed.  Use a small flat-bladed screwdriver to lift up on the black tab on the rear of the connectors, opposite to where the ribbon cable enters the connector.  The black tab will flip up.  This black tab is the clamp that holds the ribbon cable in place.  Gently pull the ribbon cable out of its socket.  Note just how far that ribbon cable goes in there.  It will be important when re-assembling the camera to make sure these ribbon cables are pushed all the way back in, and that they are nice and straight with respect to the connector.  If the cable goes in crooked, it won't push in far enough and there will be the chance of a short-circuit.  This is what you'll see once the control board and display are removed.

There is a black plastic thingamahooie between the lens assembly and the main circuit board.  Wiggle it around a bit and it should come loose.  Set the thingamahooie aside.

There are three ribbon cables crossing over the lens assembly and another two on the assembly itself.  Remove them from the connectors on the circuit board at the right of the camera by lifting up on the connector tabs as before with a small flat-bladed screwdriver.    Note that there is some tape on the fat cable going to the middle of the lens assembly.  You'll have to loosen this off before this cable can be removed.  Once all of these cables have been removed, there is nothing else holding the lens assembly in place.  Gently pull up on the assembly to remove it from the main body of the camera, and set the body aside.


Now things get really tricky.  Take a deep breath and keep going.  Above all, stay sober.  Alcohol at this point won't make things go any smoother.  Patience is a virtue.  Wait for it.

Face the front of the lens towards you and remove the small screw near the top of the zoom motor close to the lens.  There is another one at the bottom right holding down the focus motor (said screw is not visible in the picture below).  Remove it too.  This second one will be much longer than the first.

If you look at the bottom of the zoom motor, you'll see that the ribbon cable is soldered in place.  I was really worried for a while that I'd have to unsolder the thing to proceed with the disassembly.  Fear not.  You don't need to.  You'll have a lot of other things to be fearful of in a minute, though.

Turn the lens to face down.  Remove the seven screws around the outside edge of the lens assembly.  Keep track of which one went where!  The screw holding down the ribbon cable is smaller than the rest.  DON'T remove the CCD which is attached on the other side of the silver disk in the middle of the rear of the lens assembly with three weird screws.  The CCD (or image sensor as it is otherwise known) isn't necessary to get at the focus or zoom motors.  I would recommend NOT removing the CCD unless you absolutely have to.  I get the feeling that taking it off could throw things out of alignment and result in crappy pictures later.  That is more a theory than a fact, but don't risk it if you don't have to.

Turn the lens so the bottom faces toward you.  There are two screws to remove here at the top left.

Pry the ribbon cable off all of the little black posts on the rear of the assembly with a small flat-bladed screwdriver.  The cable will pop free from the post with a bit of pressure.  Be REALLY careful here - you really don't want to damage these cables.

Next you will see a connected piece of cable that is folded over and deviously connected to a black plastic tab helping to keep the bottom of the back cover of the lens assembly from coming free (I got stuck here for the longest time before I figured this out).  You also have to pop the ribbon cable off the little black post on the very left side of the bottom of the lens.  The picture below shows the devious little tab popped out and laying over top of the back of the silver disk.  There is another one like it to its left that has to come out too.

Once that is off, the back of the lens assembly should pull away cleanly.  Put this someplace clean where dust can't get at it.  I again covered it with a piece of Tupperware.

Here is another look at the rear of the lens assembly, this time from the side.   If you look carefully, you can kind of see the hole where that devious little clip fits into.

Now we can take a look at the motors.  This is the zoom motor on the left.

If you were getting a "System Error (Zoom)" message, you want to be looking here.  It seems that grit can work its way into the lens and cause this part to lock up.  Mine still looks pretty good here.  Pay particular attention to the screw holding the zoom motor in place that is only accessible AFTER the rear of the lens assembly has been removed.  Other teardowns of older cameras have you pulling the zoom motor fairly early on in the disassembly process.  That screw makes doing so impossible on this camera.

This is the focus motor.

The lug at the end of the thread pushes a little lens assembly up and down.  Take this little assembly off and put it under a chunk of Tupperware.  Nothing is holding this assembly in place, and it is bound to fall out as you look around the lens to figure out what is wrong with the damn thing.

Now I was getting a "System Error (Focus)" message so I figured my problem was somewhere around this focus motor..  But the real problem was I couldn't see anything wrong with it.  The drive was clean, greased, and the lug on it moved easily on the thread.  This was kind of depressing.  I had gone this far and found nothing.  I thought maybe that the lug was a little too far near the end of its travel so I spun it back down the thread a bit.  But really, I thought the motor was probably fried and there wasn't much I could do.  So, I just started putting the thing back together.

Assembly is the reverse of disassembly (just read this post backwards and you should be good).  I was really worried that reassembly would be the hardest part of it, but it went back together easily.  I was glad I had taken a lot of pictures along the way and that I had been pretty meticulous in keeping track of which screw went where.

With everything back together, I put the battery back in and powered on the camera.  I hadn't fixed anything, so I wasn't expecting anything.

It asked me to enter the time and date.

That's weird.  I can see how it could have lost this information with how I'd taken everything apart, but it wasn't giving me an error message.  So I entered the time and date.  And it worked.

IT WORKED!

So I used the now working camera to take a picture.

And the thing is, I have no good idea why it works now.  Maybe threading that lug on the focus motor a little further down did the trick.  Maybe one of the ribbon cables had worked loose a bit, and the reassembly straightened things out.  Don't know, don't care.  Because it worked.  Time to celebrate with a little something a kind relative dropped off the other day on her way through town.  And I took a picture of it too.  Because I have a camera that works.

See you next time, here at Mad Scientist Labs.

The Making of the Perfect Puffed Wheat Square

$
0
0
Ask me.  Go ahead.  Ask me.
"DeKay, you say you know how to make the Perfect Puffed Wheat Square, but just what is a Puffed Wheat Square anyway?"
Glad you asked.  Webster's Dictionary defines "Puffed Wheat Square" as... well, actually it doesn't define it at all.  The Wikipedia entry for "Puffed Wheat Square" describes it as...  
The page "Puffed Wheat Square" does not exist.
Why is life so hard?  Why do I have to do everything myself?

Here is how I would define a Puffed Wheat Square:
Puffed Wheat Square is proof that there is a God and that he loves us.
Apt, but it leaves a lot to interpretation.  Let's try again.
Puffed Wheat Square is a dessert made from puffed wheat (duh) coated in some kind of syrup and cut into squares (really???)
Or maybe I should just show you a picture.
The Embodiment of Deliciousness
Like Nanaimo Bars and Insulin Medication (both of which have Wikipedia entries), Puffed Wheat Square is a Canadian invention.  Puffed Wheat Square is lesser known than both, I'll grant you that.  But like Nanaimo Bars, they seem better known in the Western portion of This Great Land.  I am sure there are many people like myself that grew up on them.

My Wonderful Mother made a mean Puffed Wheat Square, and those are not words to be taken lightly.  Puffed Wheat Squares are hard to get right, and the problem is the syrup: one day you'll get a syrup that is too soft that makes for a crumbly square that doesn't hold together.  The next day you'll get a syrup that is too crisp and makes the square hard and dried out.  In fact, Puffed Wheat Square is hard enough to get right that My Lovely Wife, a force to be reckoned with in the kitchen for sure, had given up on them entirely.  But I wanted Puffed Wheat Square, and I wanted the Puffed Wheat Square of my youth.  That could mean only one thing: I would yet again have to do this myself.  Because life is hard.

I am an Engineer, and before I go to make something, I need to define a set of requirements.  That rigor has served me well in my career, so let's apply that process to a Puffed Wheat Square.  What make a good Puffed Wheat Square?
  • The syrup has to be the proper consistency.  This is the big one.  Once it has cooled, you should be able to eat the Puffed Wheat Square by pulling away one puffed wheat at a time (this is, in fact, how I eat savor mine and it proves that I am a unique human being).  The syrup has to have enough give that each little puffed wheat does not split apart or crumble as you pull it away from the square itself.  But, the syrup has to be hard enough that the individual puffed wheats hold together with the rest of the square.  A crumbly Puffed Wheat Square is a sad thing.
  • The syrup can't taste grainy.  'Nuf said.
  • The puffed wheat can't taste soggy.
  • The square must not be overly sweet.  Some squares go overboard on the syrup.  If you and your dentist are into that, then make more syrup if you must and leave me out of it.
  • The square has to have chocolate in it.
  • The recipe has to be reproducible.
Now that we have our requirements nailed down, it is time to find a recipe.  And here is where the troubles began: there is no definitive recipe for Puffed Wheat Squares.  A basic Puffed Wheat Square breaks down to:
  • Puffed Wheat
  • "Golden Syrup" (more on this later)
  • Butter
  • Brown Sugar
  • Cocoa Powder
Some recipes add a bit of vanilla extract or a dash of salt.  The puffed wheat is put into a mixing bowl and the rest of the ingredients are heated in a pot on the stove until a syrup is formed.  Somewhere around when the syrup starts to boil, the pot is removed from the heat, the vanilla is stirred in, and the mixture is dumped over top of the puffed wheat.  Quickly mix while the syrup is still hot, and then press the mixture into a greased baking dish to cool.

In search of a recipe, I found that:
  • all the ratios of all the ingredients in all of the recipes are different
  • all of the ingredients are always specified by volume instead of by weight.  Not such a big deal for puffed wheat or butter, but brown sugar is a notoriously variable beast since it packs like crazy.  I also didn't want to be arsed to dirty a measuring cup with the ridiculously sticky syrup and then dirty a spatula scraping the syrup into the pot.
  • every recipe online is inevitably followed by comments that the syrup didn't come out right, even though the author of the recipe swears that it is foolproof
I decided to go back to first principles.  First, "Golden Syrup" seems to be the syrup of choice.  What is Golden Syrup?  Well, this time, Wikipedia has my back.  Golden Syrup is made in the process of refining sugar cane or beet juice into sugar.  It is thick like molasses but tastes nothing like it.  And it is golden in color.  You are surprised, I can tell.

There are two kinds of Golden Syrup popular in my neck of the woods: Lyle's Golden Syrup and Roger's Golden Syrup.  It turns out that you can also make your own Golden Syrup, but I decided to go with a known product because there were enough damn variables in this project already.  That and it wasn't like buying some syrup was going to change my retirement date.

My Lovely Wife made the bold move of buying both of them so we could see which one tasted better.  In Lyle's favor, they have a tradition going back to the 1800's. In Roger's favor, they make the stuff in Western Canada which is the birthplace of Puffed Wheat Squares (I think).  So taste them, we did, and despite Lyle's being three or four times more expensive than Roger's, we could not taste a difference between the two of them.  So disregard comments like #107 in Smitten Kitchen's Pecan Pie Recipe where posters claim that Lyle's is so much better "since Aussies know about Golden Syrup" (the stuff is in fact made in the UK).

BTW, that Smitten Kitchen recipe has a fascinating treatise on Golden vs. Corn Syrup in pecan pie that is well worth reading.  So go read that now.  I'll wait. 

Just to be on the safe side, I checked out each of the syrups with my handheld refractometer (doesn't everyone have a handheld refractometer?), and the Brix (sugar content) are almost identical between the two syrups.  If there is a difference, it is minute and you sure as hell aren't going to tell the difference in a blind Puffed Wheat Square taste test.
Everybody Needs A Refractometer
This is my refractometer. You need one too.  A little over twenty bucks with free shipping gets you something that will accurately measure the sugar concentration in various liquids from 0 - 90 Brix (where 1 degree Brix = 1 gram of sucrose in 100 grams of water).  That lets you measure pretty much anything sweet, including and beyond honey.  Not only can you use it to dispute the purported differences between two essentially identical syrups, but you can also use it to nail the sweetness of jams and jellies, get the right sugar content in your homemade ice cream so it doesn't ice up, and even use it for tracking the fermentation progress of homemade beer and wine.

Now, neither Golden Syrup manufacturer has a recipe for Puffed Wheat Squares on their website.  Let me stress: on their website.  But, I just so happen to have a copy of Round The Year With Rogers. It was printed even before it was deemed necessary to put a date on things like this.
My Mom Loves Me!  The Sticky Note Says So!
This was a recipe booklet that Rogers used to attach to the monstrous metal tins that they used to sell syrup in.  Now why I have this booklet in the first place is a long story in and of itself.  How can you get a copy for your own?
I checked out my little recipe book and what did I find?  The jackpot.

This was my starting point.  A manufacturer of Golden Syrup publishing an old-time recipe from the birthplace of Puffed Wheat Square aka "Chocolate Puffs".  And the recipe claimed they were good for me.  Sweet deal!  (Get it?  Sweet?  Syrup?  Never mind, I'll see myself out).

But before I made this, I wanted to understand the problem of why the syrup consistency seemed so hit and miss.  All the recipes I read focused on how long to boil the syrup for.  Some said as soon as it came to a boil.  Some said to boil it for at least a minute.  Why did the recommendations vary?  Why was it inconsistent?  Time to do a little research.

What I came upon in short order was the expertise of the candy makers out there.  The time you let the syrup boil for is a red herring.  What is important is the temperature that the syrup gets to, and how long it takes to get to that temperature will depend on the size of your pot, the heat your stove is putting out, and a bunch of other things.  No wonder this inconsistency exists.

This link explains everything you need to know about the relationship between temperature and how hard the syrup will get.  A temperature of 230 - 235°F is the "Thread Stage" and sounded too thin to be a proper Puffed Wheat Square syrup.  This would explain all of those squares that would fall apart.  A temperature of 245 - 250°F is the "Firm Ball Stage" and is a caramel-like consistency.  That explains all those hard, dried out Puffed Wheat Squares.  A temperature of 235 - 240°F is the "Soft Ball Stage" and is a consistency like that of fudge.  That sounded to me like the Goldilock's bed of Puffed Wheat Square syrup consistency: not too hard, not too soft, but just right.

Now you might ask "DeKay, how do I know when my syrup is 235 - 240°F?"  And I might respond "Just use your Thermopen."  And you might say "DeKay, but I don't have a Thermopen."  And I be like
Srsly?
Buy a Thermopen.  Yes they are expensive.   Ask for one for Christmas or for your birthday.  Sell your car.  Wait for a sale.  Just get yourself a damn Thermopen and stop overcooking every meat you barbecue.  And while you are at it, verify that your fridge temperature is too warm so you can stop your milk from going sour all the time.  Or cheap out, buy a lesser thermometer, and lead a sad life.

Now I've got a recipe and I know how to get the right consistency of syrup.  But remember that I had a requirement that the recipe be reproducible, and that means none of this "cups" stuff when it comes to stuff like brown sugar measurements.  I scoured the Internet to come up with reasonable conversions so that you don't have to, and here is what I came up with.

Chocolate Puffed Wheat Square  
Ingredients
  • 68 grams (4.5 cups) puffed wheat
  • 72 grams (a half a cup) brown sugar
  • 72 grams (a quarter cup) golden syrup
  • 28 grams (2 tablespoons) butter
  • 1 tablespoon unsweetened cocoa powder
  • ¼ teaspoon vanilla

Method:
  • Butter a baking dish about 8" square and set aside.
  • Put the puffed wheat into a large mixing bowl and set aside.
  • Put the brown sugar, golden syrup, butter, and cocoa powder into a small pot over medium heat.
  • Stir constantly until the temperature hits 235°F, the "soft ball stage".
  • Immediately remove from heat and then quickly mix in the vanilla.
  • Pour the mixture over the puffed wheat and stir to combine until puffs are well coated.  Work quickly as the syrup will get thicker as it cools.
  • Spoon the mixture into the buttered dish.  Smooth out with a spatula or wooden spoon.  Better yet, use a piece of wax paper cut roughly to the shape of your pan and press it down flat and evenly using your hands.  Credit for this brilliant technique goes out to Nana's Best Recipes.
  • Let cool and cut into squares with a sharp knife.
So what do you get?
Something pretty damn good, that is what you get.
My very first attempt at this hit all of my requirements.  Chocolatey, not too sweet, and most importantly, a pretty much perfect consistency to the syrup that kept the puffed wheat together without it being too hard and sticky.  My world was perfect, but only for a short time.

My Hippie Cousin posted a recipe for a Peanut Butter Puffed Wheat Square and All Hell Broke Loose.
I'd argue that this square Is not, in fact, a cake.  But she's family so I let it go.
Intrigued, I whipped up a batch.  What did I get?
Pseudo-Puffed Wheat Square
I got something resembling, but not quite like, the Puffed Wheat Square that I knew and loved.  What did I notice?
  • The stick-togetheredness of the puffed wheat turned out a bit loose for me.
  • The puffed wheat didn't quite have the crispness that my version did.
  • It was too sweet for my tastes.
But it was My Lovely Wife who pointed out the biggest flaw:
"A Puffed Wheat Square has to have chocolate in it."
 She was right, of course.  This rule is right up there with Star Trek's Prime Directive.

So that is when I conceived of my cunning plan: I would make a Chocolate Peanut Butter Puffed Wheat Square.  Genius!  I mean, who doesn't like Reese's Peanut Butter Cups?  But an idea is nothing unless you have a plan to make it happen.  My plan was to start with the recipe I had come up with since it was closer to my ideal.  I would simply swap out the butter in my recipe with an amount of peanut butter that gave me the equivalent fat content.  Easy!  A little bit of Internet told me:
  • Butter is 81.1% fat by weight
  • Peanut butter is 50.4% by weight
So it would take more peanut butter than butter to get the same amount of fat.  I thought I'd ease into it, so instead of my original recipe of 28 grams butter, I went with 10 grams of butter and 30 grams of peanut butter.  That gave me 23.23 grams of fat in this version vs. 22.7 grams in the original.  Close enough!  And yes, in fact, I did create a spreadsheet to calculate all of this.  You would have too if you were me.

So the big day came.  I whipped up a batch of Puffed Wheat Square with these tweaks and cooked my syrup to 235°F (the "soft ball stage") as I had done before.  I fully expected Puffed Wheat Square Nirvana, but I was sadly mistaken.  First problem was that the syrup was too hard, so the square was too dry and crispy.  But it was My Lovely Wife that once again pointed out the biggest flaw:
"Needs MOAR peanut butter."
She was right again.

I was undeterred.  I figured I had mistakenly overcooked the syrup somehow.  The syrup isn't very deep in the pan I was using so maybe I wasn't getting a good temperature reading.  It was time to double down.  Version 2 would be all peanut butter, all the time, and I would cook the syrup to only 230°F in case there was something in the peanut butter that was screwing up my "soft ball" stage.  My spreadsheet told me that for the same amount of fat I would get from 28 grams of butter, I would need about 45 grams of peanut butter.  No problem.  I got this.  I whipped up another batch.

And Version 2 was a terrible failure.  Despite cooking the syrup to only 230°F, this version was at least as dried out if not more than Version 1.  And leave it again to My Lovely Wife to point out the biggest flaw:
"You can't taste the peanut butter."
Dammit.  This woman is never wrong.  Inexplicably, despite being 100% peanut butter and 0% actual butter, you couldn't taste the peanut butter.

Why?

I despaired.  Perhaps a Chocolate Peanut Butter Puffed Wheat Square was just not meant to be?  I double checked my calculations.  I blamed the new bag of puffed wheat that we had bought as being too dry and brittle compared to the old bag we had run out of.  Clearly, I was in denial.

I lied awake at night puzzling over the problem (not joking).  I was ready to give up.  There was no point in trying to perfect a Chocolate Peanut Butter Puffed Wheat Square that didn't taste like peanut butter.

Time passed.

Then one evening I was working out while nibbling on a piece of dry, crusty, Puffed Wheat Square between sets.  I had abandoned my usual savoring of the square by eating it one puffed wheat at a time because the stuff was so brittle as to make that nigh impossible.  But it was then I started to notice that the Puffed Wheat Square had softened in the area from where I had previously taken a bite.  Must just be getting soggy?  Later in the workout, my subconscious got busy and percolated something up from the Rogers Cookbook that I had read:
Rogers Golden Syrup has another quality besides sweetness that makes it a valuable cooking syrup.  It attracts moisture from the air."
It hit me like a ton of bricks.  Golden syrup is hygroscopic: it sucks up moisture.  Butter has at least a little water in it.  If there isn't much water in peanut butter, then the syrup isn't getting the water it needs as it cooks and it cools to be much harder than you would expect.  And you don't taste the peanut butter because the flavor is locked up in the hard candy syrup.  Suddenly, everything made sense.  Everything added up.  It was like when the Theory of Relativity was discovered.
Get it?  Squared away?  Puffed Wheat Square?  Sigh.  Tough crowd.
I finished my workout and hit the Canadian Food and Nutrition Database and discovered this:
  • Butter is 17.94% moisture by weight
  • Peanut butter is 1.55% moisture by weight
Based on this, the full butter version of my recipe had 5 grams of water in it vs. 0.7 grams in the recipe that was all peanut butter.  Could this be it?  I mean, this was saying the delta was a little over 4 grams of water.  Consider that there are only five grams of water in a teaspoon.  Was I making crappy Puffed Wheat Squares because I was missing a lousy teaspoon of water?  I decided to find out.

I made a half batch of the all- peanut butter version but added a full teaspoon of water.  That was about twice as much as I should have needed, but I wanted to make sure I was going in the right direction.  I also decided to cook the syrup up to the "soft ball" stage of 235°F.  I cooked up the syrup in a glass ramekin on our gas stove instead of using a pot, since the small amount of syrup would have been too shallow in the pot to get an accurate reading with the Thermopen.  I noticed immediately as the syrup's temperature climbed that it was a lot less thick than previous failed attempts.  Was I on the right track?

I hit 235°F and immediately removed the syrup from the heat, poured in the vanilla, and then poured that over the puffed wheat.  Everything mixed together easily.  I dumped the mix into a greased loaf pan (again, I was making a half batch here) and I was easily able to flatten it out.  I let it cool and then My Lovely Wife and I cut ourselves a slice.  The square sliced easily without the puffed wheat shattering apart.  My Lovely Wife then said:
"You can taste the peanut butter."
You can!!!  You can taste the peanut butter!!!  And then she had another piece to prove the point.
Version 3, only a short time later.
The taste of the peanut butter was no longer locked away in the syrup.  The individual puffed wheats pulled away easily from the square, perhaps a bit too easily.  The puffed wheat was generally good but some of them tasted almost a bit soggy.

And I was ecstatic.

I had purposefully put in too much water just too see if this was the culprit and the results were as you'd expect if I was right.  Now the road ahead was clear: add enough water to match that from the butter in the original recipe as well as enough peanut butter to match the fat content.  Crunch the numbers and here is what you get.  The...
Perfect Chocolate Peanut Butter Puffed Wheat Square
Ingredients
  • 68 grams (4.5 cups) puffed wheat
  • 72 grams (a half a cup) brown sugar
  • 72 grams (a quarter cup) golden syrup
  • 45 grams (3 tablespoons) natural peanut butter
  • 8 grams (1.5 teaspoons) water
  • 1 tablespoon unsweetened cocoa powder
  • ¼ teaspoon vanilla
Method:
  • Butter a baking dish about 8" square and set aside.
  • Put the puffed wheat into a large mixing bowl and set aside.
  • Put the brown sugar, golden syrup, peanut butter, water, and cocoa powder into a small pot over medium heat.
  • Stir constantly until the temperature hits 235°F, the "soft ball stage".
  • Immediately remove from heat and then quickly mix in the vanilla.
  • Pour the mixture over the puffed wheat and stir to combine until puffs are well coated.  Work quickly as the syrup will get thicker as it cools.
  • Spoon the mixture into the buttered dish.  Smooth out with a spatula or wooden spoon.  Better yet, use a piece of wax paper cut roughly to the shape of your pan and press it down flat and evenly using your hands.  Credit for this brilliant technique goes out to Nana's Best Recipes.
  • Let cool and cut into squares.
I actually added a little bit extra water to get a syrup that wouldn't get to crunchy if the square wasn't all eaten up after a day or so.  But fat chance of that happening.  Feel free to adjust the amount of water yourself either way.  Just know that anything less than a teaspoon in the recipe above will run you the risk of baking a puffed wheat brick.

The first thing you might want to change with this recipe is doubling it.  I may or may not have grown up on Puffed Wheat Square that was double this thickness.  I got a little hesitant at making big batches myself here for fear of a failed experiment that I've have to eat all of.  That fear has now been erased.

The second thing you might want to change with this recipe is adding more cocoa for an extra chocolate hit.  I haven't tried this myself, but I wouldn't expect more cocoa to throw off the fat / water ratio enough to affect the end result.  I'd start with maybe an extra half tablespoon and go from there.

It has also occurred to me that you might be able to use something like those terra cotta disks used to keep brown sugar from turning hard as another way to prevent leftover square from drying out.  Same principle, right?  Have a few pieces of square to make room in the pan and then drop one of these bad boys in there.  Haven't tried this myself either, but if you do, let me know how it worked out in the comments.
The Cure For Dried Out Puffed Wheat Square?
My Wonderful Mom is here visiting this weekend so I whipped up a test half-batch for her.  Remember I said above how she made a mean Puffed Wheat Square?  Here is her verdict on mine:
Victory, Hard Won
Achievement Unlocked: The Perfect Puffed Wheat Square.  Go make some.  Now.

Time To Make The Doughnuts

$
0
0
Growing up, My Wonderful Mom would make doughnuts.  I don't mean doughnuts.  I mean doughnuts.  These deep fried delicacies were the stuff of legend amongst friends and family.  Quoting from a recent exchange on the Social Media site that everybody loves to hate:
  • I said auntie used to make the best doughnuts and mom agreed.
  • I loved those donuts!
  • I brag about how good they were!
Efforts by said family to get her to come out of retirement were not successful:
  • Would it work if I told you what I told my darling daughter.  Go to Tim's, that is what I do!  Can't believe those donuts are coming back to haunt me, there were pretty darn good.
But I am one not easily dissuaded.  She was coming to visit for a weekend, and I would not be denied.  Through a clever combination of begging and pleading, I was successful in getting her to agree that Doughnuts. Would. Be. Made.  It was like a dream come true.
What follows is part recipe, part adventure.  You see, My Wonderful Mom isn't too hung up on that whole recipe thing.  Her original recipe called for "flour", but with no indication as to how much.
This Is A Recipe?
Maybe if you've made them a couple hundred times before, "flour" is sufficient.  But if you are a doughnut newbie like me, you're screwed.  So she basically went by a few scribbles for a recipe and followed her nose while I frantically made notes, weighed bags of flour before and after, etc.  My Lovely Wife served as Official Photographer.

In the thousands of words that follow, you are going to see strange things like "199 grams of Apple Sauce", but I'm just recording what it was.  I haven't made any effort here to round things up or down to make even numbers anywhere, but you should feel free to do so.  You're also going to see a lot of steps, but I've broken this down into excruciating detail so you aren't left guessing.  And the work of the Official Photographer makes things that much easier.

This recipe makes a hell of a lot of stuff.  And by a hell of a lot of stuff, I mean:
  • Twenty-five Doughnuts
  • Twenty-two Doughnut Holes
  • A dozen Bismarks
  • Eighteen Cinnamon Buns
  • Two pizza-sized Kolache
We used almost a full five pound bag of flour that afternoon.  You might want to consider cutting the recipe in half or something like that if you want to make some of one thing but not another.  Or don't and make the whole damn batch.  Live large, and have fun.

Now if we're going to make some doughnuts, we're going to knead a dough (Get it?  "knead" ... "dough".  Ahem, that's OK.  I'll see myself out).  Making this dough is a three part process: getting the yeast going, mixing some eggs and sugar together, and then getting all of that into the main dough mixture.  Ready?  Set!  Go!!!

Make the Yeast Mixture

Ingredients
  • 16 grams Active Dry Yeast (16 grams = 2 pouches)
  • 237 grams Lukewarm Water (110ºF) (237 grams water = 1 cup)
  • 8 grams Sugar (8 grams = 2 tsp)
Method
  • Warm water in a small bowl. Dissolve sugar into water. Sprinkle yeast on top of the water (no need to stir it in). Leave sit for 10 minutes so yeast can activate. While waiting, proceed with the steps below.

Make the Egg / Sugar Mixture

Ingredients
  • 4 Extra Large Eggs
  • 142 grams Sugar (142 grams = 3/4 cup minus 2 tsp in the yeast mixture)
Method
  • In a medium sized bowl, lightly beat the eggs. Add in sugar and stir to combine. You are probably still waiting for the yeast at this point so get started on the dough in the steps below.

Make The Dough

Ingredients
  • 948 grams Barely Warm Water (80ºF) (948 grams = 4 cups)
  • 11 grams Salt (11 grams = scant 3/4 tablespoon)
  • 2101 grams All Purpose Flour (Divided into batches) (1 cup flour = 120 - 140 grams).  I used Roger's All Purpose Unbleached Flour and used the batch sizes below (actually, my mom just dumped in flour and I weighed it as she went).  You don't need to be exact here per batch but the final flour total is going to be pretty close.
    • Batch 1: 900 grams
    • Batch 2: 750 grams
    • Batch 3: 200 grams
    • Batch 4: 160 grams
    • Batch 5: 50 grams
    • Batch 6: 41 grams
  • 226 grams Unsalted, Softened Butter (226 grams butter = 2 sticks)
  • All Yeast Mixture From Above
  • All Egg/Sugar Mixture From Above
Method
  • Pour the 80ºF water into a very large bowl (we use a big ceramic dough bowl). A full batch of this dough will take almost five pounds of flour, so plan accordingly! Add the salt and Batch 1 of the flour and mix the flour into the water just a bit.
  • Cut the softened butter (not melted, softened) into small chunks. Add the butter, the egg / sugar mixture, and the (by now) frothy yeast mixture into the large bowl with the flour and water. Stir everything together to make a loose batter.
  • Add Batch 2 of the flour and keep stirring together. Batter will thicken.
  • Add Batch 3 of the flour. At around this point, a sticky dough begins to form. Start using your hand at this point to mix the dough by slipping your hand to the bottom of the bowl, grabbing a handful of dough, and pulling it up and over the top of the mixture. Give the bowl a quarter turn and repeat again and again.
  • After each batch of flour is incorporated and worked in a bit, add in the next one. The consistency is correct when the dough is pulling away from the bowl and not sticking to your fingers. Use this as the guide for the final amount of flour to add. Note also that it is this slow incorporation of the flour that kneads the dough along the way. The dough is worked entirely within the bowl and never placed on the counter for further kneading.
My Wonderful Mom Mixing The Dough - LIKE A BOSS
  • Once the dough has been mixed, shape into a ball. Sprinkle flour all around its surface and place into a VERY LARGE mixing bowl (we used our monster steel mixing bowl that we keep downstairs). A full batch of dough took 12g of flour for the dusting. This flour is to help prevent the dough from sticking to the bowl. DON'T USE OIL for this, as most recipes will advise. I don't know why for sure, but Mom just says DON'T and I listen. Good enough for me.
  • Cover the dough bowl with Saran Wrap to prevent the dough from drying out. Then place a dish towel over the dough bowl to help keep it warm. Place the bowl into a warm spot to rise until doubled. We had it in the spring day sun with the house around 22ºC and it took 2h 15m to double, and we rotated the bowl every now and then to help warm it evenly. The dough pressed right up against the Saran Wrap stretched across the top of our monster metal bowl.
Before
After (!)
  • While the rise is underway, prepare your work area. You need two spaces: one being a good sized chunk of counter space that can be dusted with flour and the dough rolled out on. The second space is for laying down a large, cotton tea towel on which the doughnuts will sit for their second rise. This will take up a lot of space if you are making a bunch of doughnuts, so plan accordingly once again.
  • While the rise is underway, make sure you have your other ingredients ready. For the doughnuts, get together any sugar, sprinkles, icing, or what have you (I do not sully my doughnuts with such things). For the Bismarks, figure out what jams or jellies you are going to want as filling and have it ready. For the cinnamon buns, you'll need softened butter, cinnamon, brown sugar, and anything else you might like in the filling (Bits of chopped apple are great. Raisins are OK in a pinch). For the Kolache, you'll need a filling of some kind: I love homemade applesauce topped with a crumble of butter, flour, and sugar. My Grandma would also use cottage cheese with raisins sprinkled on top. Some cooked up poppy seeds are another classic.
  • While the rise is underway, get your tools together. You are going to need a rolling pin, and a couple of very large, non-fuzzy cotton tea towels to place the doughnuts on for their second rise.  More importantly, you are going to need something to cut the doughnuts and something to make the doughnut holes. Our doughnut maker was a jar lid used with canning jars that is 3.25" in diameter and 3/4" high. Our doughnut holer was an old cap from a container of baby oil with its little lid cut off. It was 1 1/8" in diameter. What made this holer work so well was that the little hole from which the baby oil would come out from also worked well to let air out as the doughnut holes were being cut.
Donut Cutter
Donut Holer
  • While the rise is underway, strategize! Are you going to make all doughnuts? What are you going to do with the bits cut away during the doughnut making process? We found that 1500 grams of dough makes around 20 doughnuts with about 350 grams of cut away dough bits left over. A full batch of dough is around 3840 grams, so that is a lot of doughnuts! What we did with our full batch was to make two batches of doughnuts using about 72% of the dough and two pans of cinnamon buns with the remainder. The scrap bits from making the doughnuts went to making two Kolaches. This was a good use for Kolaches because they don't need to rise up as puffy as doughnuts or cinnamon buns.
  • And while the rise is underway, get the stuff together that you'll need for cooking. For cooking the doughnuts, we used a KitchenAid Dutch Oven, around 1 liter of oil for cooking (we used a Becel canola / sunflower mix, but any neutral tasting vegetable oil would do), a thermometer to ensure the oil is at the right temperature, chopsticks / tongs / forks to flip and remove the doughnuts from the oil, paper towels and a plate to get excess oil off the doughnuts, and lots of cooling racks to place the doughnuts on after cooking. For the Kolache, we used one pizza pan and one cookie sheet that were greased with butter. For the cinnamon buns, we use two 9"x13" Pyrex baking pans greased with butter.

Make The Doughnuts

  • When rise is complete, take somewhere between a 1200g - 1500g chunk of the dough and place it on the counter dusted with flour. Punch the dough down and roll it out into a circle until it is a little more than 1/4" thick. Throw a little skiff of flour underneath the dough as it is being rolled out so the dough doesn't stick to the counter. First time we made this, Batch 1 was 1491 grams of dough.
  • Use the jar ring to cut the doughnut shapes, shifting the rolled out dough a bit this way and that to minimize the amount of "scrap" dough.
  • Next, use the doughnut holer to cut the hole in the center of each doughnut. The hole will usually get stuck in the cutter, so use either your finger or a toothpick to work them out.
  • Place the holes onto a non-fuzzy cotton tea towel in a little group of their own. Alternatively, skip cutting a hole into some of the doughnuts and make Bismarks instead. After the Bismark is cooked and cooled, you can cut a hole in the Bismark to make a home for your favorite jam or jelly.
  • The doughnuts and Bismarks are pulled off of the floured counter and placed onto the tea towel to rise as they are cut. Floured side goes down. Give them a bit of space to rise.  Do not put any extra flour on to the tea towel: the dough shouldn't be so sticky that you'll need to do this.
  • Once a batch of doughnuts has been cut, gather all of the dough scraps together and form them into a ball. Place them back in the bowl under Saran Wrap in a warm spot for a second rise to make something else like Kolache.
  • As doughnuts are placed onto the tea towel, cover them with a second towel to keep them warm and prevent them from drying out. Let them rise a second time for about 45 minutes to an hour, or until puffy looking. NOTE: About 15 minutes before the doughnuts finish their rise, heat about 1 liter of a neutral flavored oil to 375ºF in a deep fryer or Dutch Oven. Again, we used our KitchenAid Dutch oven and a thermometer to verify the temperature. Too cold and the doughnuts will be greasy. Too hot and the doughnuts won't cook properly on the inside.
  • By the way, here is how things broke down between the doughnuts, the cinnamon buns, and the Kolache.
    • Doughnut Batch 1: Started with 1491g of dough. Made 20 doughnuts, 18 holes, and had 349 grams dough left over for Kolache.
    • Doughnut Batch 2: Started with 1277g of dough. Made 5 doughnuts, 5 holes, 12 Bismarks, 2 odd shapes, and had 296 grams dough left over for Kolache.
    • Kolache: Made two with 645 grams of "scrap" dough from the doughnuts one on a pizza pan and another on a cookie sheet.
    • Cinnamon Buns: Made two 9x13 pans with the leftover 1071 grams of "virgin" dough.
The end result of the two doughnut batches we cut up looked a little something like this.
Actually, It Looked Exactly Like This
While the doughnuts rose, we got the cinnamon buns and the Kolache ready.

Make The Cinnamon Buns

Everybody knows what cinnamon buns are, and everybody has their cinnamon bun ideal.  To many, this ideal is a cinnamon bun dripping in brown sugar and topped with a heavy layer of cream cheese icing.  These people are wrong.  More is not always better.  More is sometimes just more.

This is a cinnamon bun that harkens back to a simpler time.  It is not horrifically sweet, and you won't need an insulin shot immediately after consumption.  It is a simple recipe where each element gets a chance to shine.  Try it.  You'll like it.

Ingredients
  • 1071 grams Virgin Dough not used in doughnut making
  • 17 grams Melted Butter + more for brushing on top of shaped buns
  • 119 grams Brown Sugar
  • Cinnamon To Taste
  • Raisins / Diced Apple / Etc To Taste
Method
  • Roll out the dough for the cinnamon buns similar to how the dough for the doughnuts was rolled out. Place the dough on the counter dusted with flour. Punch the dough down and roll it out into a roughly square shape until it is a little more than 1/4" thick. Throw a little skiff of flour underneath the dough as it is being rolled out to minimize the dough sticking to the counter.
  • Brush the melted butter evenly across the top surface of the dough using a pastry brush. Here we used softened butter and a knife to spread it.  Same difference.
  • Sprinkle a healthy dose of cinnamon across the surface of the dough.
  • Then sprinkle the brown sugar evenly across the top.
  • Roll up the dough loosely but evenly along the long edge.
  • Use a knife to cut the roll into even slices to the desired thickness (we got 18 buns for the full batch above using a thickness of around 3/4", but thicker probably would have been better). As each slice is cut, lay it into a greased 9x13" pan. Don't crowd the buns so that they have room to grow outward a bit. Brush top of each cinnamon bun with melted butter.
  • Let the cinnamon buns rise for about 45 minutes to an hour, or until puffy looking (this in a relatively warm kitchen). About 20 minutes before the first batch is due for the oven, preheat the oven to 350ºF with the oven rack in the middle position.
  • Bake the cinnamon buns one pan at a time at 350ºF, rotating the pan 180º halfway through the bake. When we made these the first time, they were done after 26 minutes and a turn halfway through at 13 minutes. When done, the buns were a light brown on the top and a fairly deep brown on the bottom. Be careful not to bake them off to hard or the brown sugar will burn on the bottom of the pan.
  • Take the buns out of the oven when done and get the next batch baking. After each pan is cooked, leave the buns to cool in the pan for just a minute or two. Then flip the buns out onto a cooling rack. Otherwise they'll get soggy sitting in the pan. The syrupy bottom will also harden up and you'll never get them out if you wait too long.

Make The Kolache

Everybody has heard of Doughnuts.  Everybody has heard of Cinnamon Buns.  Almost nobody has ever heard of Kolache unless you had an awesome Czech Grandmother like I did.  My Grandma always had Kolache at her house.  Always.  And they were fantastic.  And you never ate just one, no matter how much lunch you'd had.  Never.  Because if all you ate was one, her face would grow sad and she'd say...
What?  You don't like Grandma's Cooking?

And I guaran-damned-tee that you'd find room for another.
My Lovely Wife's First Attempt - A Bit Puffy, But Absolutely Delicious
As I noted above and as shown in the picture, these are going to be made with applesauce and a crumb mixture made from butter, flour, and sugar.  Cottage cheese and raisins were another of Grandma's go-to's, as were some cooked up poppy seeds.  Me?  I always had this version.  Always.

Kolache can be made two ways: as a single serving size or kinda pizza size.  We're going pizza size here, because we've got a lot of other irons in the fire.  I'll have to go into Kolache more at some point, but that'll have to be another blog post.  In the meantime, do a little research if you're interested.

Ingredients
  • 645 grams Scrap Dough left over from making doughnuts
  • 199 grams Apple Sauce (Homemade, if at all possible)
  • 24 grams Softened Butter
  • 63 grams All Purpose Flour
  • 55 grams Sugar
Method
  • While you were frantically making doughnuts and cinnamon buns, the scrap dough from the doughnuts should have been balled up and left to rise in a nice warm spot. Get going on these once the cinnamon buns are done.
  • Place dough onto a pizza pan or cookie sheet greased with a bit of butter. The 645g of dough we had here was enough to make two Kolache, and the dough was split more or less evenly between the two. Flatten the dough out into the shape of the pan. Again, the dough should be about 1/4" thick or so, about the thickness it was for the doughnuts and the cinnamon buns.
  • Combine the flour and sugar into a small bowl. Cut the butter into chunks and work it into this mixture with a fork, spoon, or pastry cutter. You're looking to make small and medium sized chunks of goodness here. Set the mixture aside.
  • Spread the apple sauce over the Kolache as if you were spreading sauce on a pizza. Leave a bit of bare crust at the very edge. Homemade apple sauce is amazingly superior to the store bought stuff, BTW, and it makes a huge difference to the final result.
  • Sprinkle the crumble mixture over the Kolache as if you were sprinkling cheese on top of a pizza.
Note Crumb Mixture on Kolache At Left
  • Set the Kolache aside to rise for about 45 minutes to an hour, or until puffy looking.  The Kolache were made from scrap dough during the doughnut making, so they might need a little more rise time than the doughnuts and the cinnamon buns.  Like the cinnamon buns, they are cooked at 350ºF with the oven rack in the middle position. If you aren't making the buns, remember to preheat the oven about 20 minutes before the Kolache finish their rise.
  • Once the Kolache are finished their rise, place the pans in the oven to bake at 350ºF for 20 minutes. We were able to fit both pans into the oven at the same time. Rotate the pans 180º after about 10 minutes to help them bake evenly. The Kolache are done when they are a medium brown on the bottom. Don't let them get too brown and crispy.
  • Remove Kolache from oven when done and slide them out onto a cooling rack to cool.

Cooking The Doughnuts

  • At this point, the doughnuts should have risen for about an hour and at least one liter of some neutral flavored oil like vegetable oil should be pre-heated in a Dutch Oven or deep fryer to 375ºF. Obviously, if your cooking vessel is larger, you'll need more oil to get sufficient depth. I'll stress that if the oil is too cold, the doughnuts will take too long to cook and be greasy. Too hot and the inside won't be cooked by the time the outside is done. Monitor the temperature of the oil closely while the doughnuts are cooking as the temperature tends to drop as you put in the colder dough.
  • Start by cooking one or two of the holes as a test run. Take a few off the tea towel and drop them in the hot oil. They only take a minute or so to brown on one side, and they will grow in size as they are cooked. Try to flip them around in the oil using tongs, chopsticks, or a fork (my Wonderful Mom's weapon of choice) so they brown evenly on all sides. The holes are tricky because they have a mind of their own. Don't stress it if the holes don't brown evenly on all sides. They are small and will still cook through OK.
  • Remove the holes from the oil once they are a rich brown and put them on a plate lined with a few paper towels. Immediately cover with another paper towel and lightly press / roll them around to sop up any excess oil. Transfer the holes to a cooking rack after a few seconds.
Or To A Plate For Immediate Consumption
  • Cook the rest of the holes, in batches if necessary so the holes aren't too crowded in the oil while cooking. They will poof up and take more space as they cook.
  • Now start cooking the doughnuts, starting with the first ones that were cut. Pull the doughnuts gently from the tea towel by hand and gently drop into the hot oil top side down. Again, don't crowd the doughnuts because they will puff up. We were able to cook four at a time in the KitchenAid Dutch Oven.
  • Once the underside has a rich brown side (after a minute or so), use a couple forks or whatever to gently flip the doughnuts over to the other side.
  • Remove from the oil once they are browned on both sides to the paper-towel lined plate, dab the excess oil off of them as you did with the holes, and transfer to a cooling rack after a few seconds. Use fresh paper towels as required if the old ones start getting greasy. It helps a lot to have two people doing this: one person cooking and the other dabbing the oil off.
  • Repeat until all the doughnuts are cooked, and keep an eye on the oil temperature all the way along. Don't let it stray too far one way or the other from 375ºF.
On the subject of topping the doughnuts...  Me, I like 'em just plain, so you are on your own if you want to add toppings to these deep-fried treasures. I'd think that sugar or sprinkles should go on while the doughnuts are still very hot. Bismarks should be filled with jelly or jam after they have cooled so the jam doesn't melt in and make the center of the Bismark all soggy. Topping with some kind of icing is probably best done once they have cooled as well.

Right after this baking extravaganza, it was time for supper.  We whipped up a delicious supper for My Wonderful Mom featuring Ricotta Gnocchi and Chicken Breast With Tomatoes and Capers.  Dessert was, of course, doughnuts.  I grabbed one off the counter and took a bite walking back to the table.  BOOM.  I was instantly transported back to my teenage years.  The doughnuts tasted exactly as I remembered them.  And in that second, all of that effort was worth it.

But you, dear reader, let's not forget about you.  All you have seen to this point are isolated pictures of this and that.  But I'm a big picture guy, so let's look at the big picture.  What came out of that afternoon?
Like Looking Into The Face Of God
One hell of a lot of awesomeness, that is what came out of that afternoon.  But there is more that is not shown here.  I had a great day with Mom.  And I mean, a great day.  She hadn't made these doughnuts for decades!  We had a lot of laughs and relived a lot of memories while recreating a classic memory from my youth.  If something terrible were to happen tomorrow, I'd look back fondly to this day and think that I made the most of it.  Even if I hadn't gotten to taste a single bite of any of what we'd made, it would have been worth every second spending that time with her.

I don't want to be that person that says "I only wish I had learned to make X from my Granda / Mom / Aunt.  It was so good, but I never got the recipe."  To Hell with that.  Don't be that person either.  Go see your Grandma / Mom / Aunt and tell them how much you enjoyed that whatever when you were a kid.  Then spend the day making it together, and have a blast while doing it.

Days after My Wonderful Mom left, I opened the cutlery drawer.
The Donut Holer
She'd deliberately left her Donut Holer behind, her way of passing the baton.  And here I sit with a freezer full of baked goods, and a lump in my throat.

Go cook something, go do it now, and go do it with someone you love.  And tell 'em the guy from Mad Scientist Labs sent you.
    Viewing all 32 articles
    Browse latest View live