Wednesday, March 23, 2016

Moved to Medium

Did you enjoy my posts? Good, come see what I posted on Medium next

Wednesday, August 19, 2015

Drill press metal drilling a sailboat binnacle

We have all been there, a stuck and stripped bolt. Especially if you have a boat this can be particularly painful as decades of salt and metal galvanic corrosion really work together to ruin you day. In my case we had four through screws stuck inside the power control of the binnacle.
The hope came when I found this (Irwin reference for metal drilling) in that rpm and feeding speed are crucial to success vs. psychotic episodes! I definitely recommend it, good read.

the after picture...

Wednesday, March 5, 2014

How to use the Arduino watchdog to build a reliable IOT WiFi prototype


Arduino is a convenient but unstable prototyping/DIY platform. When building applications that are supposed to run indefinitely (for example, monitoring), you will need a fault tolerance approach that virtually guarantees that your mote can self-heal.

Solution (ok, it's a hack!)

Use the a call to the set the hardware watchdog. Usually this is used to handle short processes (milliseconds). Locally the Arduino exposes a few time intervals including a gargantuan 5sec timeout. As it turns out, this is extremely useful if you do not quite your Wi-Fi shield like, oh I do not know, the CC3000.

So how does it work? Well you can find out more here (no point in reinventing the wheel) but basically you wanto import the library and then use a pattern like:

critical section here

The first call tells the watchdog to bump the board (hardware reset) after the specified interval, in this case 2 seconds. The second call after the critical section put the watchdog back to sleep so you can continue your logic and avoid the draconian and unnecessary reboot since your critical section returned succesfully.

I used this on the CC3000 since this board can occasionally take a very long time to return from DHCP and/or DNS resolution. At times, it won't actually return at all thus the need to hack the Arduino code to self heal. Obviously the solution would be to dig into the CC3000 open source code and find out what is causing the application to hang indefinitely but who has that much time while prototyping? ;-)

Restoring Ms Elly

Ms Elly is a 1972 vintage Moto Guzzi. A 850 Eldorado to be precise, thus the name Ms Elly!
I decided to give her her own blog so look for it here.

Thursday, November 21, 2013

Linode NodeBalancer and SSL/HTTPS, nodes are DOWN

This is a short post that might help others since the Linode documentation is unclear on this one.


Load balance SSL APIs (HTTPS web servers) running on several Linodes using NodeBalancer. You followed the directions from here and added your Linodes to the NodeBalancer but they wont go UP.


The NodeBalancer needs to talk to your nodes over HTTP. So once you create your configuration for HTTPS, add the nodes and use port 80. That is, if you want to add node (yes, you should only use internal IPs), you want to add it as


If your experience problems and one of the node does not want to go UP, delete it and start over. I had this problem after changing which port to use etc. and I could not figure out why it would not work. So I deleted it and created a new entry for the NodeBalancer. Also, give it a minute (literally).

Thursday, September 26, 2013

iOS7 and the status bar overlay problem

If you are porting an iOS app to iOS7 you have run into this problem. Not to give away the ending but the solution is provided to you by Apple in the Interface Builder. Yep, it is that easy.


in iOS7 the status bar overlays with your views at all times. This is a new behavior, in previous releases the status bar had its own real estate and it was not sharing it. An example of the problem from our app dog stories, in stores soon ;-)
our app in iOS6

our app in iOS7 prior to fixing it


  1. in IB, select the File inspector
  2. go to view as and switch to iOS6
  3. select all elements in the view that you want to move when the app is run on iOS7, that is, select all UI object like buttons, tables etc. that you need to adapt. In our case above, we wanted the camera button, the pull down, the search button and the table to all move down 20 points if the app is running on iOS7
  4. switch to the Layout inspector
  5. under iOS6/7 delta, put 20 in the deltaY 
    1. if needed, like in our case for the table, we also subtracted -20 from the delta height
  6.  go back to (1) and switch back to iOS7 and rejoice, you are done
Update: iOS7 will by default try to slide UITableViews from under the header/footers by adding about 30pts, so your first cell will look like it is starting lower than it should. Read this post to learn how to remove that annoying blank header on top of you table!

our app in iOS7 with the element shifted down by 20 pts and the table height re-sized to -20pts

Monday, July 15, 2013

Before picture

Repacking a stuffing box (packing gland)

Vessel: 1979 Newport 30MKII
Engine: Universal Diesel 18hp (5216?)
Gearbox: 2:1 ration
Propeller shaft: 7/8"


This is just to share some interesting lessons learned that might apply to similar set ups or sister boats. For general instructions on how to do this please see.

Disclosure: what follow is for information purpose only. What you do with your boat is your responsibility. Some have reported significant amount of water flowing in once the stuffing nut is removed so it is your responsibility to make the right decisions before attempting any project.

Tips and tricks

After picture (wet due to cleaning)
  • In my case the stuffing box body was tight enough around the shaft that the leak was minimal after I removed the packing nut.  So I did my job with the boat in the water. The water flow increased over several minutes but it was still well within what a bilge pump or manual pump can handle.
  • I used narrow pipe wrenches. In my case the two nuts measured 45mm and 50mm. Big, crude plumber wrenches might not work well. Look for something sturdy but narrow that can properly grab the nuts.. I used RIDGID E-110 Hex Wrench. Just FYI.
  • The packing material for my stuffing box was 1/4" Flex. 
  • The packing gland in my case is so close to the gearbox that you can barely unscrew the stuffing nut and move it away from the rest of the packing gland so you can work on it. Be prepared and check yours before you start
  • to remove the old packing, that is hard as a rock initially, I used a long wood screw. I carefully thread it into the stuffing for about 5 full rotations and then gently wiggled it back out. Do make sure to stay away from the shaft, you do not want to scratch it! Same for the stuffing nut albeit it is less critical. It worked like a charm and cut my time in half once I realized I could do that. I pulled the first of three stuffing sections using a picker and it took for ever since the only way to really get it out is to carefully find the splicing point and use that as leverage. Using the screw method above it is straightforward and considerably faster, just align the screw with the shaft so not to touch it and go.
  • Once I put it all back together with new packing, I hand tight it and left it soaking overnight. There were no leaks already. The next day I unscrewed it until I saw water dripping, then slowing tighten it until the leak stopped. Secured the counter nut, started the engine and tested that it drips every 30 sec or so. Ditto, done.