Monday, February 27, 2017

Fun in the Sun: A Weekend Bahamas Cruise

[Composed 2/20/2017]

This past weekend was spent cruising the crystal blue waters of the Caribbean with our friend's 7 year old, J. Shira and I had been both cruising, and on a trip to the Bahamas, but this was our first experience combining the two, and doing so in a weekend no less.

Friday started with, among other quick stops, a run into Walmart to buy a chess set. J is apparently part of the chess club at school, so I figured this would be the perfect opportunity for me to truly learn how to play the game. So with our $10 chess set in hand, we boarded the Royal Caribbean ship that would be our home for the next three days.

This would be our 3rd time cruising, and I have to say, there's just something special about stepping on board. There's so much promise and excitement in the air. Much of cruising is a thin veneer of luxury that doesn't take much to see past, but what a fine veneer it is!

We found our way to our state room where J found he was sleeping on an upper bunk that folded down from the wall. This was a massive highlight of his trip. As for me, I found the room quite satisfactory, and Shira found it too tight for her liking. In my mind, the cramped state room is all part of the quirkiness of cruising.

We then made our way to the ship where we arrived at the pool on the top deck. It was here that we found ourselves comparing this Royal Caribbean cruise to our last experiences on Norwegian, a pastime we found ourselves doing fairly regularly. The water slide was smaller, the pool colder, the free food noticeably absent. J was un-phased. He and one of his Teenage Mutant Ninja Turtle characters found their way to a hot tub and were in heaven.

I sat in the hot tub too, and struck up a conversation with the fellow sitting next to me. Before I knew it, I was 30 minutes into a Trump "discussion" and it was time for us to extract ourselves from the tub. Yeesh, it was like being back in DC, where political talk is basically non-stop.

Saturday we docked in Nassau, Bahamas. This was our second time in Nassau, the first being just about 19 years ago a few days after Shira and I got hitched. Much of that trip is hazy, but I can clearly recall landing in the evening, stepping off the plane, and being hit by a crazy hot and humid wall of air. That's what we got for going in July. For this year's trip, however, the weather was absolutely perfect.

From the ship, we made our way past the crowds to Fort Fincastle, about half a mile away. This tiny structure gave us a chance to learn a little bit about the island and play with the cannons. We can do a beach bum vacation and all, but it's going to be punctuated with history the first chance I got.

After Fort Fincastle, we made our way to the Pirate Museum. But alas, it was closed. We settled instead for hitting an ice cream parlor, and I counted my Guava Cheesecake flavored ice cream as a cultural experience.

From the ice cream parlor we made our way to Junkaroo beach, which has the distinction of being the closest beach to the cruise terminal. There are far more pristine beaches on the island, but for a weary 8 year old, location trumped everything else.

After a few hours of splashing in the chilly water and playing in the sand, we made our way back to the ship. The first order of business, once back on board, was to take a soak in the hot tub. See a theme yet?

After dinner we enjoyed one of the best luxuries offered by the ship: Kids Club. For all the nit picking we could do about our boat, I've got to say, Royal Caribbean nailed the kids activities. J was excited to attend them, and until 10pm (way after all our bed times), they're all free. After 10pm, babysitting is just $7.00/hr, which is a quite the value (considering a bottle of water is $3.50).

Sunday was to be spent on Coco Cay, a private island belonging to Royal Caribbean. One of the best parts: to get there you, you need to take a tender boat. That's sort of a mini-adventure to get to the adventure, and it didn't disappoint.

Once on the island, we grabbed a couple of beach chairs and started exploring the our little chunk of shoreline. J quickly made some new friends, and they found all manner of hermit crab and sea snail.

I'd been looking forward to visiting the island to try my hand at snorkeling. The water, like the day before, was chilly, but not too bad. Shira, J and I made our way out into the main swimming area, and fairly quickly caught site of a variety of different types of fish. Ultimately, I'd go out two or three more times on my own, getting further and further out from the shore and seeing more and more types of fish. I recall snorkeling in Hawaii and being blown away by the sheer quantity of life below water. This wasn't really the case here, but there was still plenty to see and even the smallest amount of effort yielded interesting discoveries.

We rented a floaty mat thing, and J climbed aboard while Shira I snorkeled, pulling him along for the ride. It was quite the sight to see.

After an impressive lunch, we went in search of the nature trail. What we found was a 1/2 mile path that led into the woods and away from civilization. We saw a number of 3+ foot iguanas along the way, and came out at a far more secluded set of coastline. For our purposes (read: entertaining and feeding an 8 year old), being close to where the boats dropped us off and the crowds collected worked well. But I could imagine if I ever came back with Shira alone, it would be fun to hike the nature trail in the morning and set up our own little piece of beach heaven away from the rest of our shipmates. Definitely something to consider if you find yourself on Coco Cay.

After a tender ride back to the ship we hit, you guessed it, the hot tub.

Which brings us to Monday, today. If boarding the ship has that special feeling of excitement and promise, leaving it comes with a corresponding dose of sadness and finality. It's like we're all leaving summer camp or something, yet it's been a mere 3 days of togetherness. Still, we were all sad to wave goodbye to the ship as we departed.

From there, we made our way to J's grandparents home, where they had food and the perfect setting to recount our adventures. They were even able to bust out one of their photo albums and show J the time his Mom, Uncle and Grand Parents went to Nassau. Including photos of Fort Fincastle, the water tower and the Christopher Columbus statue that he'd been standing in front of just 48 hours earlier. It was all so special.

On our drive from the Cruise Ship to his Grandparent's house, I helped J come up with his top ten list for our adventure. Here's what he came up with:

10. Discovering secret compartments in the stateroom
9. Laying out on the floaty mat, while the floaty mat was on dry land.
8. The tender ride to and from the ship and Coco Cay.
7. Collecting shells and searching out sea life with friends on Coco Cay.
6. Floating on the mat while we snorkled.
5. Eating Ice Cream in Nassau.
4. Playing 'frisbee' using my hat in the onboard pool.
3. Sleeping in a folding bunk bed.
2. Playing at Kids Club.
1. Hot Tub Time!



Spring, 22 days Early

Yesterday, Shira and I did some running and hiking on the Potomac Heritage Trail near Riverbend Park.

Everywhere you looked you saw bursts of green drinking in the shower of unobstructed photons. It's only a matter of time before the trees catch up and again reduce the forest floor to a shade only environment. Until then, however, patches of green are thriving. It's quite the sight to see.

Weekly Discoveries: An Epic Breakup Song, A Never Give Up Anthem and a Mighty Fine Waltz

Last week's most clever music video has to be Dearly Departed by Shakey Graves. Sure it's dark, but it's also hilarious and really well done.

I'm loving the sound of The Avett Brothers, but I'm so confused. The imagery from their videos is 1970's, yet they've only been around since the 2000's. Why would anyone aspire to look like My Dad's generation? (No offense Dad; you looked great back in the 70's).

Also included in this most recent set of discoveries: a Waltz. Not sure I've ever found myself rocking out (OK, probably more chilling out) to a Waltz, but there you go.

Listen to them all here.

Friday, February 24, 2017

Chess in a Hurry | Cheat Sheets for Playing Chess Now

On past trips to Boston, our nieces and nephew have seen the over-sized chess set that's situated in the hotel where we often stay. They've expressed interest in playing, but we've never done so. While I had some hazy sense of how to play, I always thought of chess as a complex game and one that would be too hard to explain to them. This past weekend, however, I had a chance to play chess with a 7 year old and it finally clicked for me: this is fun stuff! I finally had a chance to see past the minutia, and started enjoying the actual game.

While all this was fresh in my head, I wanted to collect up some simple resources I could be armed with next time I had the chance to play chess. Here's what I came up with:

Just yesterday, as David and I finished up a run I noticed an over-sized chess board just crying out for us to play. With the above resources at hand, there's no excuse for not diving in and playing.

Wednesday, February 22, 2017

30 Seconds to More Identifiable Luggage

What follows isn't a life hack, clever trick or road warrior tip. What follows is common sense.

All things being equal, I'm glad to check my bag when traveling. The last few times I've flown, I've considered ways to optimize identifying my bag . In my mind's eye, I could imagine 3D printed, Raspberry Pi luggage tags, with a QR code or NFC tag embedded. Instead of all this nonsense, for our last trip, I hastily tied a strip of orange fabric to each handle of the bag. Here's an action shot:

It was ugly, and perhaps a candidate for /r/RedneckEngineering, but boy did the technique work. When I our bag was pulled aside and tucked into a corner at baggage claim, I still had no problem identifying it from a distance. And had I needed to ask a baggage handler to look for the bag, it would have been straight forward to send them after the one with bright orange flagging tape on it.

Simplicity for the win. Why didn't I do this years ago?

In hindsight, I recall that years ago my grandparents (Z"L) had a yellow ribbon tied around their car's radio antenna to help them find it in a parking lot. At the time I thought, oh how cute. Now I realize (a) they were smart, and (b) I'm old.

Tuesday, February 21, 2017

Weekly Discoveries: Some Sad Songs, Some Rocking Songs and One Classic Piece of Poetry

I found Aquilo's Silhouette to be a remarkably touching song, with a powerful video to match. I'd never heard of the group Aquilo, and was hooked by half-way through this first song.

And no doubt about it, this is how you sell perfume. I won't claim to 'get it,' but it's an impressive performance regardless.

And speaking of not getting it, I have no idea what's going on in this Korean music video. But I'm really impressed that they made a video that's optimized for portrait viewing on a cell phone. That's some clever work, right there. It reminds me of the Facebook Live ads that take the defect of people shooting video in the wrong orientation, and embrace it as part of the product's brand.

I know it's hardly a 'discovery' for anyone (what with 20 million views and all), but I really do get a kick out of Sia's Move Your Body video. She's created quite the playful little story arc, all while paying tribute to the 80's.

Watch all the discoveries here:

Thursday, February 16, 2017

Tiny but Surprisingly Hot - A Tea Light Powered Stove

Whether it's for back-country use, power outage preparedness or just to indulge the Pyromaniac Boy-Scout within, I've experimented with a number of portable stove designs. While doing some research I got curious: could you power a stove on tea lights alone?

Obviously, one tea light won't do much. But what if you had a whole bunch?

Step 1. Check YouTube. And what do you know, here's proof that you can cook with tea lights.

Step 2. Buy and eat 4 cans of tuna. The simplest 'stove' I could think of was a sheet of aluminum foil, a few empty tuna cans, the tea lights and a pot on top.

Step 3. Try to cook an egg! I organized 5 tea lights and 4 tuna cans and lit it all up:

I pre-heated a frying pan for 5 minutes and then cracked an egg into the pan:

I covered the pan and checked in a few minutes later:

And to my surprise, the egg was partially cooked.

Ultimately, I let the experiment run for about 18 minutes. And when I was done, I had an overcooked egg:

So the process was slow, but definitely effective.

Step 4: Improvise a crock pot. Cooking eggs is fun and all, but I wanted to step things up a bit. I filled a casserole dish with about 3 cups of water, lit the same 5 candles, covered it, and let it 'cook.'

At nearly 4 hours, 3 out of the 5 candles had burned out. The water was almost 160°F. From a quick Google search I see that a crock pot on low cooks at around 190°F. So I wasn't quite there, but I was too in the neighborhood.

I have to say, I'm really impressed by these results. With almost no effort, and about 70 cents worth of fuel, I was able to nearly approximate a slow cooker. If I added a few more candles, and swapped them out at 3 hours and 45 minutes, I could probably have a functional slow cooker.

The final test is to actually make a more complex dish using this setup. Alas, I don't have time for this experiment today, but I will keep my eyes out for the right recipe to give this a shot with. And then we can find out just how bad an idea this is.

Wednesday, February 15, 2017

Junk In My Trunk: The Car Kit v1.0

This past weekend a friend mentioned that she was equipping her car with an emergency kit, and knowing my love of all things preparedness, was curious what was in mine. I rattled off some items, but it's been too since I've really considered the question. Not checking in on this sort of thing regularly leads to driving around assuming you don't have something, but do, or worse, assuming you have something but don't.

Besides, we have a relatively new car, so it makes sense to do an inventory and make sure it passes muster.

Before I dive into a tour of the goodies, here's a few points of philosophy to consider. First, you'll see that for all my chatter about preparedness, I actually try to keep things fairly lean. You could easily fill up your car's trunk with items based on What-If scenarios. I try to pick specific scenarios I want to be ready for, and leave the rest to improvisation.

Second, I'm not a fan of redundency. If I can carry something in my man-bag, I'll choose that over carrying it in my car. And I can find a way to carry it on my key-ring, I'll choose that over my man-bag.

Finally, I hate storing batteries and other perishable items in my car kit. Inevitably, they go bad due to heat, cold or time.

OK, let's get to it.

First up, the driver and passenger side Oh $#!? Handles have Res-Q-Me's zip-tied into place. The Res-Q-Me is a vehicle escape device, and according to YouTube they work. Given how cheap, small, effective and valuable they are, I'm fine putting them in the car even if they never get any use.

Next up, there are a few essentials in the glove box. Mainly, a Swiss Army Knife, tissues, a tire pressure gauge and some heavy duty produce bags. The produce bags are used as puke bags. I speak from experience when I say they work, and work well.

And finally to the trunk:

Items include: a backpack with emergency gear (more on that below), jumper cables, sun screen, bug spray, and a picnic blanket. The sun screen, bug spray and picnic blanket are for when we arrive at a hike or other outdoor activity and realize we've forgotten some essential. The jumper cables are self explanatory. And here's the contents of the emergency bag:

Items include: a large plastic drop cloth, which among dozens of other uses, is handy for dealing with messy passengers or cargo. A neutral colored sweatshirt, which actually gets quite a bit of use when we show up to restaurant that has the AC cranked way up. There's a bunch of glow sticks, which provide a battery free form of light. There's one of my Version 2.0 Hiking Kits, which provides first aid essentials, among other things. The cord, duct tape, towel and garbage bags are multipurpose items.

There's a 15' piece of 1 inch tubular webbing, which is rated to 4,000lbs of force. I imagine this could be useful for an improvised/temporary tow-rope if need be.

There's a zip lock baggy with toilet paper, an extra Bic lighter and a compass. Without a compass, how are you going to possibly flee the zombies?

Finally, there's an AMK emergency bivvy. Every once in a while we get a nasty enough storm that people are forced to shelter in place in their cars. It's unlikely, but at times like that, the bivvy could be pretty dang essential.

Not shown are 6 tea light candles rolled up in a large square of heavy duty aluminum foil. The candles are a battery free source for heat and light.

Finally, this was useful exercise for me if only to familiarize myself with the latest Acura flat tire solution: a tire repair kit:

Gone are the days of discovering that along with a flat tire, you also have a flat spare. Whoo!

So, let's review: tool to help extricate yourself in a catastrophic car accident? Check. Vomit bag for a car sick kid? Check. Jumper cables to deal with a dead battery? Check. Tire repair kit to deal with a flat? Check. Supplies to make it through a miserable night on GW Parkway awaiting rescue? Check. Duct tape and a pocket knife to conquer all other challenges? Check and check.

Safe travels!

Tuesday, February 14, 2017

The Surprisingly Simple Way To Control Your Home From an Acura ILX

Like any self respecting 40 year old geek, I've got a heap of defunct hardware that I've collected over the years. I keep said pile around because I have dreams of finding just the right bit of ancient tech to perfectly solve a problem. Usually, this doesn't happen, but I like to keep the dream alive.

Last week I was fiddling around with detecting radio signals of in-home devices. It occurred to me that our Acura's have always come equipped with HomeLink buttons, designed to remotely operate a garage door. We don't have a garage, much less a garage door opener, so we've never used this feature. Yet, what if I hijacked these signals and instead of opening a garage door, I detected them using an SDR dongle connected to a Raspberry Pi. I could then use the Pi to control other devices in our home.

Sure, it would be a significant effort to hack this together, but when I was done, I'd have my home and car connected.

I started Googling around, and to my amazement came across discussion of X10 and HomeLink integration. X10 is an ancient (at least since I was in college, in 1998) standard for remotely controlling lights and appliances. Back around 2000, I was on a total X10 kick, and tried various configurations to automate our apartment at the time. Eventually, we settled on remotely controlling a single light in the bedroom, which we use to this day. Every night before bed, we hit the X10 controller to turn off the last light in our bedroom.

Suddenly, this was all starting to make sense: the X10 probably broadcasts on a similar frequency to a garage door opener. That's probably a required standard. And HomeLink doesn't know anything about the signal it's setting, it just allows you to record a given signal and it will re-broadcast it. I didn't need to hand craft a Raspberry Pi solution. I needed to connect up an X10 lamp module, remote and transceiver. That's about $75 worth of hardware. But fortunately for me, I already owned all of these components. To the Defunct Hardware Pile!

It took some digging, but I found all three components and plugged them in. In our front room, I plugged the transceiver into one outlet, a lamp module into another outlet, and a lamp into the lamp module. I put fresh batteries in the remote and to my surprise, the light turned on and off in response to the remote. Whoo!

I then headed out to my car and followed the instructions here to train the HomeLink buttons in my car to send X10 signals. My guess is that the procedure is no different than training a garage door opener, or any other device. The only moment of confusion came when the HomeLink button I trained only turned the lamp on. But that actually made sense, because the X10 remote has one button for turning things on, and one button for turning things off. I simply trained another HomeLink button to be the 'off' switch for the lamp, and that worked as expected.

Who would have thought that 17 year old tech would pair perfectly with the latest Acura ILX?

The project that I thought would take weeks of effort to organize was implemented in about 15 minutes. All that's left to do is purchase a reasonably nice looking lamp we can put in our front hall, and to program Shira's Acura RDX. Then when she pulls into the driveway on a dark winter night, she can turn on a light in the house with a simple button press.

(Hey look, I accidentally made my wife a geeky Valentine's Day gift. Oh defunct hardware pile, what would I do without you?!)

Monday, February 13, 2017

Weekly Discoveries: Tin Whistles, Hang Drums and a Home Made Cup-of-Soup Ramen

I don't get it: how can this hang drum video have 22 million views? I mean it was good, but 22 million views good?

And here's a novel take on Barbecue: Food of the Enslaved: Barbecue. Think of it as better food through understanding history.

And finally, unexpected music video of the week goes to I Love You More Than You Love Yourself, which portrays the Lisa Nowak story. The artist behind the song explains:

The video is based on NASA astronaut Lisa Nowak. What drew you to her story?

Austra: I was kind of upset with the way her story has been portrayed. There’s a photo of her in her NASA spacesuit, looking very wholesome and happy. I found it so insensitive that there was no regard for the fact that she was a NASA scientist who went to space before the age of 30. She’s a total genius! Lisa had a breakdown, and I don’t think there was any compassion for mental health at all in her story and in the (media) narrative (surrounding it), so we wanted to try, in some ways, to give her a bit of justice.

Check out all the videos:

Thursday, February 09, 2017

The Signal Beacon In Your Pocket

Yesterday's experiment listening to nearby gas and water meters got me thinking about tapping into other devices that emit radio signals. One such tiny device is the clicker on my car's key fob. This is more technically known as a Remote Keyless System, and operates on the well known frequency of 315Mhz.

Visualizing these signals is almost trivial. I kicked off SDR Touch, tuned it to 315Mhz and pressed the clicker. Here's a screencast showing the result:

As you can see, clicking the key fob causes a noticeable burst of activity.

So now what?

Capturing this data is easy enough, and analyzing it shouldn't be too difficult either. Here's someone who did just this. And once you've analyzed it, it seems like it would be simple to write some code to detect this signal and take action. I can imagine a Raspberry Pi + SDR Dongle sitting around waiting for my key fob clicks.

It also doesn't take much imagination to see nefarious uses of both capturing and re-sending these key less entry signals. But I'll leave those exploits to others.

I can imagine a more MacGyver'y type hack where your key fob is turned into a signal beacon. It plays the role transmitter, while SDR Touch is the receiver. Let's say you wanted to signal someone in the next room. If your accomplice has SDR Touch open, then a simple press of your car's remote is all it would take to send them a message. Just agree ahead of time on what the pattern of bursts mean, and you're all set. Think 007 on the very cheap.

Finally, it's worth noting that these short range, 315Mhz transceivers are actually dirt cheap. Consider this one on sale on Amazon for $5.00. I could imagine swapping out the foot pedal in my last project with one of these transceivers. Then I could have a key fob clicker that controlled emacs. How cool would that be?!

Wednesday, February 08, 2017

The Very Chatty Gas Meter

I tend to think of Software Defined Radio as a dirt cheap, and extremely portable way to listen to radio chatter. However, it's far more generic than that: it can pick up a whole range of radio signals, and with the right decoding software, pull useful data out pf thin air. For example, you can pull down real time flight info or weather satellite imagery. And my latest discovery: you can discover your home's power usage.

There's a catch to this, though. You need the right type of power meter, specifically one that broadcasts your usage data to anyone who's listening. While this sounds like an esoteric requirement, it's actually quite sensible. Power companies use this style of meter to replace walking house-to-house to collect data, with a driving through your neighborhood instead. This strategy of using low power transmitters as a way to streamline data collection is a brilliant hack in its own right. It's far cheaper than hooking up every meter to the Internet (though, I assume we'll get there), and far less labor intensive than going door to door.

If you have such a meter, you just need the right software to tune your SDR dongle and interpret the data being sent over the air. Here's just such a tool. I spent about 20 minutes trying to get this setup on Windows and then gave up. I then grabbed my Linux box and had it running in a few minutes.

You kick off rtl_tcp in one terminal, rtlamr in another, and then you wait.

After a minute or two, it spat out a Standard Consumption Message (SCM) to the screen. Whoo! Over about an hour, it issued all of these lines:

$ ./util/go/bin/rtlamr | tee ~/tmp/x.out
11:14:47.876424 decode.go:82: CenterFreq: 912600155
11:14:47.876562 decode.go:83: SampleRate: 2359296
11:14:47.876576 decode.go:84: DataRate: 32768
11:14:47.876587 decode.go:85: ChipLength: 72
11:14:47.876600 decode.go:86: PreambleSymbols: 21
11:14:47.876611 decode.go:87: PreambleLength: 3024
11:14:47.876621 decode.go:88: PacketSymbols: 96
11:14:47.876630 decode.go:89: PacketLength: 13824
11:14:47.876640 decode.go:90: Preamble: 111110010101001100000
11:14:47.876649 main.go:93: GainCount: 29
{Time:2017-02-08T11:18:17.611 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:18:32.111 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:19:18.164 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:19:47.163 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:21:02.161 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:21:35.106 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:21:47.161 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:22:47.106 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:23:32.659 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:25:48.156 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:26:50.601 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:26:59.101 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:29:05.098 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:30:47.650 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:31:02.150 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:32:17.149 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:33:32.147 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:34:17.146 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:36:02.644 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:36:02.644 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:37:19.588 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:38:18.142 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:41:50.583 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:43:17.636 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:43:32.136 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:44:47.135 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:46:02.135 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:46:47.132 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:48:32.630 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:50:48.127 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:52:47.126 SCM:{ID:XXXX6390 Type:11 Tamper:{Phy:00 Enc:00} Consumption:   47785 CRC:0xFA19}}
{Time:2017-02-08T11:55:47.621 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:56:02.121 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:56:32.120 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:57:17.119 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:58:32.118 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T11:59:17.117 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:01:02.615 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:03:18.112 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:08:17.606 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:09:47.104 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:11:02.103 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:11:47.102 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:13:32.600 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:15:48.098 SCM:{ID:XXXX2860 Type:12 Tamper:{Phy:01 Enc:00} Consumption:    5068 CRC:0x0C70}}
{Time:2017-02-08T12:16:53.985 SCM:{ID:XXXX3239 Type:11 Tamper:{Phy:00 Enc:03} Consumption:    3082 CRC:0xCFC1}}
{Time:2017-02-08T12:16:55.151 SCM:{ID:XXXX3808 Type:11 Tamper:{Phy:02 Enc:03} Consumption:   17074 CRC:0x8213}}
{Time:2017-02-08T12:16:58.039 SCM:{ID:XXXX1202 Type:13 Tamper:{Phy:02 Enc:00} Consumption:   20251 CRC:0x315C}}
{Time:2017-02-08T12:16:58.652 SCM:{ID:XXXX0624 Type:11 Tamper:{Phy:00 Enc:03} Consumption:   23587 CRC:0x1B9F}}
{Time:2017-02-08T12:17:01.540 SCM:{ID:XXXX8036 Type:11 Tamper:{Phy:00 Enc:03} Consumption:   26157 CRC:0xA931}}
{Time:2017-02-08T12:17:02.818 SCM:{ID:XXXX6800 Type:11 Tamper:{Phy:00 Enc:03} Consumption:    7179 CRC:0xE748}}
{Time:2017-02-08T12:17:03.984 SCM:{ID:XXXX3239 Type:11 Tamper:{Phy:00 Enc:03} Consumption:    3082 CRC:0xCFC1}}

Using the protocol and meter docs I see that I'm picking up Gas and Water meters.

The meters bolted to the side of my home have various identifier looking values, none of which appear to match up those I've discovered. That may mean I'm looking at the wrong identifier on the side of the house, or more likely, it means I'm hearing my neighbor's smart meters.

Perhaps if I let this run long enough, I'll pick up some data associated with my home. And then it's only a quick shell script away from tracking and graphing this data.

I have to say, this is a truly eye opening experience. Your utility usage data is just floating out there, waiting to be grabbed and analyzed. All you need is a $20 USB dongle and some basic hacking skills. That's both cool and terrifying, no?

Monday, February 06, 2017

Weekly Discoveries: Chillstep, Reason #1 To Avoid Prison and a Monster 200 Mile Race

This last week I went in search of some new country music, and found aural gold in Stripes by Brandy Clark. It's clever and catchy, what more can you ask for? From there, I found a whole slew of scored woman songs that I adopted as my own power ballads for the week.

Apparently, we're doing this fishing thing all wrong in DC. Check out these guys as they pull monster fish out of the Potomac. Oh, and they're not at some exotic distant location, but are steps from DC Memorials.

And here's Somewhere Over the Rainbow played on an old saw using a violin bow. You've got to hear it to believe it.

I watched (well, mostly listened to) Kerry Ward complete the Bigfoot 200, and I still can't comprehend his accomplishment. That's over 200 miles of near continuous running through crazy terrain. At the end of the video talks about meeting up with his buddy Sammy Hassan who casually remarks that at mile 42 his "left IT band went." Basically, he ran over 150 miles on an injured leg. That is essentially super human. What an amazing testament to human accomplishment.

Finally, I tripped over this Blackmill album, and fell in love. I'm not even sure what this genre would be called. I've seen it referred to as both Chillstep and Drumb and Bass. Doesn't matter what you call it, it's remarkable stuff. So chill, yet so interesting. Next time you've got a multi-hour task needing to get done, press play on this video and get to work.

View the entire playlist

Friday, February 03, 2017

3shrink'ing on a Mobile Device

3shrink is working well in a desktop context, so it was time to spread the love to mobile. Specifically, I wanted to be able to take a resource on my mobile phone and quickly generate a 3shrink code for it. This turned out to be straightforward to do in Tasker.

Much of the heavy lifting is done by AutoShare, a Tasker plugin that links Tasker profiles to your phone's share menu. I used geek mode to allow 3shrink to play nicely with Tasker's HTTP Get action. Finally, I created a Tasker Scene which displays the code, domain and content encoded as a window overlay.

Here's an example of 3shrink'ing a YouTube video:

And here's an example of 3shrink'ing arbitrary text:

You can see these codes work by visiting the relevant URLs: http://projx.3shrink.com/ALN and http://projx.3shrink.com/DN3.

By naming the AutoShrink command intelligently, I can programmatically derive the correct domain from %ascommand. This allows me to have a single 3shrink Tasker Profile which handles any number of domains.

The trickiest part of this project was dealing with the inherent messiness behind Android sharing. AutoShare exposes 3 different variables: %assubject, %astext and %asfiles, which correspond to the subject, text and files being shared. There's no set standard for what will appear in each of these variables. YouTube, for example, stores the video name %assubject and the video URL in %astext. Taptalk, seems like it does the same thing, storing post titles in %assubject. However, it chooses to set %astext to the URL to the post followed by a space, followed by the post title again.

My solution was to examine %assubject %astext as one large string, and if a URL is detected, extract it, otherwise fall back on returning the whole mess. Here's the JavaScriplet that implements this logic:

var text = 
  (local('par1') === 'undefined' ? '' : local('par1')) + " " +
  (local('par2') === 'undefined' ? '' : local('par2'));

var text = text.replace(/[\n\r ]+/g, " ").trim();

var matches = text.match(/(http[^ \n\r]+)/);
if(matches) {
  setLocal('result', matches[1]);
} else {
  setLocal('result', text);
}

I can't tell you how helpful it was to be able to write this code as a JavaScript rather than implementing this using clunky Tasker commands. Of course this solution isn't perfect, as it's biased towards URLs. But generally, if there's a URL in the sharing context that's what I want to capture within 3shrink.

For now I'm completely ignoring %asfiles, though eventually, I'll want to account for this variable as well. For example, I can imagine having a collection of photos I want to share with someone, and 3shrink would reduce all these files to a simple 3 character code.

Up next is to reverse the process: that is, adding support for typing in a 3shrink code and expanding that to the URL or content.

However, for now, this is certainly a step in the right direction. There's just something awesome about being able to share a video, album or article on a Post-It note containing 3 characters:

Wednesday, February 01, 2017

Foot Powered macOS Monitor Hopping

We interrupt this emacs hack for an OS X hack.

Yesterday, after making progress with the Trinket Pro, I grabbed the foot pedal, wire strippers and athletic tape of all things, and connected everything together:

Yes, this is a pathetic build. No, I don't care. I loaded the Trinket with this small program:

#include <cmdline_defs.h>
#include <ProTrinketKeyboard.h>
#include <ProTrinketKeyboardC.h>
#include <usbconfig.h>


const int PIN_SWITCH = 0;    // Trinket pin to connect to switch 
const int LED        = 13;
int   pressed        = 0;
void setup()
{
  pinMode(PIN_SWITCH, INPUT_PULLUP);
  TrinketKeyboard.begin();  // initialize keyboard library
}

void loop()
{
  TrinketKeyboard.poll();
  if (digitalRead(PIN_SWITCH) == LOW)  // If the foot switch grounds the pin
  {
    if(pressed == 0) {
      TrinketKeyboard.pressKey(0, KEYCODE_F8);
      TrinketKeyboard.pressKey(0, 0);  // release key
      pressed = 1;
    }
  } else {
    pressed = 0;
  }
}

Note the use of pressed variable. It's needed to keep the board from sending a stream of key presses when its held down.

With the program above in place, pressing the foot pedal is equivalent to pressing F8 on the keyboard.

My plan was (and is) to wire this into emacs in an intelligent way. Also, I need to find a way to have the pedal respect the current modifier keys. That is, if I'm holding down shift, then it should send Shift + F8. But all that aside, once I had working pedal, I knew which annoyance I wanted to fix first.

OS X's support for multiple desktops is quite solid. If a screen has focus, it's trivial to use key combinations to navigate among desktops. What doesn't have an obvious solution is jumping the focus between screens. This is the sort of thing I found requests for, but not an obvious solution. Here's one I rigged up.

First off, I grabbed Keyboard Maestro, a piece of software mentioned in my search for a solution. Keyboard Maestro looks quite sophisticated and getting my bearings was non trivial. From poking around I learned two important pieces of information. First, the variable %CurrentMouse% contains the coordinates of where the mouse is. Second, when I'm on the 'left' screen, the x-coordinate is negative. Using these facts, I was able to rig up this rule:

By detecting the presence of the minus sign, I can tell which screen I'm on and warp the mouse to the other monitor. Finally, this is all connected to F8, which is sent by the foot pedal.

I can't tell you how gratifying this solution is. Now, when I'm on the right screen, I no longer need to remove my hands from the home row, but can just tap my foot to warp myself to the left screen. And I'm only a foot press away from being back to the right screen. It's so cool.