Tuesday, June 08, 2010

Yamaha V6 Outdrive stuck shifter repair

Here are some pictures and directions for repairing a stuck shifter on a Yamaha outdrive that I created about two years ago for my Yamaha Sterndrive owner's group. This is a common problem with this unit.

Wednesday, May 19, 2010

80's / Zombie party

So we had this 80's Zombie party at our place last weekend. I was going to be Zombie Mario, but I gave up on the Zombie makeup after screwing it up several times. So I was just Mario the Zombie slayer.

Anyways... I had one of my friends film me playing Mario Brothers on the Wii. It cracks me up every time I watch it. Check it out:

I should also mention that my wife made an awesome brain cake for all the zombies to munch on:

Twittering doorbell

All I wanted was a doorbell that would send me a text message when somebody rang it, and I wanted it NOW. There are a number of ways I could have done this. Ideally I would have used an opto isoloator, but Radioshack didn't have those. They did have a full wave bridge rectifier, and a 5V relay. I already had some random capacitors, and a 5V regulator, so that would have to do. I connected the AC inputs on the rectifier inline with the doorbell using the connections behind the doorbell transformer in my garage. The relay switch is connected to the digital input and ground connections on my IOBridge. I've configured the iobridge to send an email to both my magic account at ping.fm that updates twitter, as well as an email distribution list that sends text messages to both my wife and myself, as well as to our email inboxes.

You can find the twitter updates from my doorbell on my twitter account here: http://twitter.com/jgarland79

Here is the schematic and a photo:

Sunday, May 09, 2010

Busting the myth: Unbalanced Breaker panel = Larger electric bill

There is a myth that if your breaker panel is "unbalanced" then you will be billed for the higher leg on the meter.

Let's find out...

I didn't film the third part because it was dark outside, but I went outdoors and monitored the meter before and after I shut off the breakers on one of the phases making the load unbalanced. The meter DID spin half as fast, so this proves that the meter IS accurate and this myth is BUSTED!

DHCP Notify Parsing with Polycom phones

Syslog sample:

Jul  8 18:25:12 babelfish dhcpd: {"vendor-class-identifier": {"substrings": [ {"company": "Polycom"}, {"part": "SoundPointIP-SPIP_430"}, {"part_number": "2345-11402-001,1"}, {"app_version": "SIP/ 10:17"}, {"bootrom_version": "BR/ 13:08"} ] }}

create polycom.conf and include it in your dhcpd.conf file.

allow booting;
option option-150 code 150 = text;
option option-155 code 155 = text;
option option-160 code 160 = text;
option sip-server code 151 = text;
option voice-vlan code 128 = text;
class "polycom" {
            match if(
            (substring (option vendor-class-identifier, 0, 4) = 00:00:36:3d) and
            (substring (hardware, 1, 12) = 00:04:f2:11:f3:b9)
            set vendor_class_identifier = (substring (option vendor-class-identifier,5,(extract-int ((substring (option vendor-class-identifier, 4, 1)),8))));
            set vendor_class_identifier_1_len = (extract-int ((substring (vendor_class_identifier,1,1)),8));
            set vendor_class_identifier_1 = (substring (vendor_class_identifier,2,vendor_class_identifier_1_len));
            set vendor_class_identifier_2_len = (extract-int ((substring (vendor_class_identifier,(3 + vendor_class_identifier_1_len),1)),8));
            set vendor_class_identifier_2 = (substring (vendor_class_identifier,(4 + vendor_class_identifier_1_len),vendor_class_identifier_2_len));
            set vendor_class_identifier_3_len = (extract-int ((substring (vendor_class_identifier,(5 + vendor_class_identifier_1_len + vendor_class_identifier_2_len),1)),8));
            set vendor_class_identifier_3 = (substring (vendor_class_identifier,(6 + vendor_class_identifier_1_len +  vendor_class_identifier_2_len),vendor_class_identifier_3_len));
            set vendor_class_identifier_4_len = (extract-int ((substring (vendor_class_identifier,(7 + vendor_class_identifier_1_len + vendor_class_identifier_2_len + vendor_class_identifier_3_len),1)),8));
            set vendor_class_identifier_4 = (substring (vendor_class_identifier,(8 + vendor_class_identifier_1_len +  vendor_class_identifier_2_len + vendor_class_identifier_3_len),vendor_class_identifier_4_len));
            set vendor_class_identifier_5_len = (extract-int ((substring (vendor_class_identifier,(9 + vendor_class_identifier_1_len + vendor_class_identifier_2_len + vendor_class_identifier_3_len + vendor_class_identifier_4_len),1)),8));
            set vendor_class_identifier_5 = (substring (vendor_class_identifier,(10 + vendor_class_identifier_1_len +  vendor_class_identifier_2_len + vendor_class_identifier_3_len + vendor_class_identifier_4_len),vendor_class_identifier_5_len));
            log(info, (concat ("{\"vendor-class-identifier\": {\"substrings\": [ {\"company\": \"", vendor_class_identifier_1,"\"}, {\"part\": \"", vendor_class_identifier_2,"\"}, {\"part_number\": \"", vendor_class_identifier_3,"\"}, {\"app_version\": \"", vendor_class_identifier_4,"\"}, {\"bootrom_version\": \"", vendor_class_identifier_5,"\"} ] }}")));
            if (option dhcp-message-type = 8)
                        option dhcp-parameter-request-list 2,3,4,6,15,17,42,43,60,66,128,150,151,155,160;
                        option option-150 "http://PlcmSpIp:PlcmSpIp@";
                        option option-155 "http://PlcmSpIp:PlcmSpIp@";
                        option option-160 "http://PlcmSpIp:PlcmSpIp@";
                        option tftp-server-name "http://PlcmSpIpFOO:PlcmSpIp@";
                        option sip-server "sip.voip.local";
                        option domain-name-servers,,,;
                        option domain-name "voip.local";
                        option ntp-servers;
                        option time-servers;
                        option time-offset -18000;
                        #option voice-vlan "VLAN-A=10;";
subnet netmask {

Thursday, January 14, 2010

Twitter update your energy usage using a TED 5000

The Energy Detective 5000 has an API that can be polled for data using this simple perl script that I wrote.

You can find my Twitter feed here: http://twitter.com/jgarland79power

Order your own TED 5000 here.

If you are running Debian Linux you will need to install a few dependencies:
sudo apt-get install libxml-simple-perl libwww-curl-perl

And you can automate the execution of this script with an hourly cron job:
Run: crontab -e
and then add this line (assuming you put my script in ~/bin/:
0 * * * * ~/bin/twitterpower.pl


# Written by Jason Garland @ http://blog.jasongarland.com/

my $twitter_user="jgarland79power";
my $twitter_password="super_secret_password";

my $ted_ip="";

# use module
use XML::Simple;
#use Data::Dumper;
use WWW::Curl::Easy;

sub write_callback {
 my ($chunk,$variable)=@_;
 # store each chunk/line separately
 # This should be faster than using $$varable .= $chunk;
 push @{$variable}, $chunk;
 return length($chunk);

my $curl = WWW::Curl::Easy->new();

my @body;
$curl->setopt(CURLOPT_WRITEFUNCTION, \&write_callback);
$curl->setopt(CURLOPT_FILE, \@body);
$curl->setopt(CURLOPT_URL, "http://$ted_ip/api/LiveData.xml");
my $body=join("",@body);

# create object
$xml = new XML::Simple;

# parse XML
$data = $xml->XMLin($body);

my $PowerTDY=$data->{Power}->{Total}->{PowerTDY};

$status="used $PowerTDY watt hours of #electricity since midnight today. Find out more here: http://a1.ly/7";

print $status,"\n";
$curl->setopt(CURLOPT_URL, "http://twitter.com/statuses/update.json" );
$curl->setopt(CURLOPT_POST, 1 );
$curl->setopt(CURLOPT_POSTFIELDS, "status=$status" );
$curl->setopt(CURLOPT_USERPWD, "$twitter_user:$twitter_password" );