Saturday, August 29, 2015

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

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.


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.

Friday, March 6, 2015

How To Make A Sandwich

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.

Thursday, January 1, 2015

Wifi on the BeagleBone Black with Systemd - An Addendum

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 ( icmp_seq=3 ttl=50 time=71.4 ms
64 bytes from ( icmp_seq=4 ttl=50 time=70.5 ms
64 bytes from ( icmp_seq=4 ttl=50 time=75.6 ms (DUP!)
64 bytes from ( 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:

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, 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
and this starts it up again:
root@beaglebone:~# systemctl start
To avoid starting up a graphical desktop at boot run:
root@beaglebone:~# systemctl set-default
and change back with:
root@beaglebone:~# systemctl set-default
That's enough knowledge bombs for one post. See you next time here at Mad Scientist Labs.

Monday, December 29, 2014

Wifi on the BeagleBone Black with Systemd

EDIT 2015-01-01: What I thought was the last word in getting wifi going on the Beaglebone Black was missing one key piece of information.  Read this addendum, or you're screwed.

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
4: can1: [NOARP,ECHO] mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
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
ping: unknown host
We need to use something called dhclient to get a DHCP address, like so...
root@beaglebone:~# dhclient wlan1
root@beaglebone:~# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=50 time=75.2 ms
--- 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
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 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.


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.

Friday, December 26, 2014

No Pressure - I Got This

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.

Wednesday, June 18, 2014

I Want To See Violet

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. 
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.