Monday, June 29, 2009

Google phone saves the day?


View Larger Map
I have made the journey from Boston, MA to Cincinnati, OH with a heavily loaded 1990 Pontiac Bonneville many times. My car has achieved an all-time high score of 30mpg on the Cincinnati to Boston trip once. So I knew it would take about 14 hours and I should leave at about 6am to avoid hitting big cities during rush hour. On Friday, June 26th I actually got started a little late at 7:30am after checking the inflation on my tires (this helps the car get a better score). Two days earlier, I popped the hood to take a "let's make sure everything is in its place" look. I noticed the serpentine belt was a bit worn, so I decided to pick one up from AutoZone before leaving Boston.
Since 630 of the 900 mile drive is on I-90 and 95% of the NY and MA sections are limited access toll roads, fuel and food are limited and over-priced. There is about 20 miles of I-90 around Albany, NY where the turnpike follows I-87. I usually stay on I-90 there so I can make a fuel stop.
Since I had not actually replaced the serpentine belt before leaving Boston, I decided to take a look to see how it was doing when I stopped for fuel. I noticed that the belt was not actually sitting in the grooves on the crankshaft pulley but I didn't have the 18mm socket to turn the belt tensioner out of the way and replace the belt. I figured that it has probably been like that for a while, and that was causing the wear in the belt I noticed two days earlier. I looked at my fancy phone's Google maps for more gas stations. Rt 9 in Greenbush (east of Albany) has plenty to choose from, so I started driving toward that road. After only driving about 3 blocks on Rt 9, my power steering went out. I immediately thought, "There goes the belt!" Since the serpentine belt transmits power from the crankshaft to the A/C compressor, water pump, alternator, and power steering pump, I thought this was a pretty good conclusion. I drove another couple blocks to a Sunoco station before opening the hood to replace the belt.
Unfortunately, the belt came out intact; it had just fallen off the pulleys. I reached in and grabbed the water pump pulley because it looked a little crooked. I guess the rebuilt water pump that I put on the car about 6 years earlier was not very high quality because as I touched it, all of the coolant from my engine leaked out onto the ground.
I again turned to my Google phone to find auto parts stores in the area. I could get the parts (rebuilt quality again) for about $50 from the store 1 mile up the road. Then all I needed was a couple tools and somewhere to work on it. The tools I could buy, rent or borrow from the auto parts store, but as I hung up the phone, thunder clapped and the sky tore open. Without a dry place to work, I resolved that it might be OK to pay a service station for the work. In 10 minutes (with the aid of the Google phone) I had three quotes for the parts and labor for a water pump replacement. I went with Palmer's Auto Service because the rate was good and the mechanic wouldn't use the inferior rebuilt parts from cheap auto parts stores.
The replacement procedure took about two hours. I was back on the road by about 12:45pm. The whole stop set me back about 3 hours, so I hit Buffalo, NY during 5:30 Friday traffic. I finally made it to Cincinnati at about 1am without any other trouble. I have to get another tank of fuel to be sure, but I think my conservative driving and tractor-trailer drafting may have gotten me a new high score of 31mpg!

Thursday, June 25, 2009

G1 cradle hack

I purchased a suction cup mount cradle for my T-Mobile G1from ppc4you.com for about $40. It was the only cradle I found that looked decent for use in my car. The description and pictures didn't show exactly what connections were available on the cradle. I wanted to be able to plug a regular USB cable into the cradle and have it pass through to the phone as well as the ability to connect some other audio amplifier (my car stereo) with a 3.5 mm plug. Unfortunately, neither of these options existed on the unit as purchased. It did have a mini USB connector for connecting the combination speaker and power supply unit to the actual cradle, but the USB data pair was not passed through. In fact, the analog audio was present on those pins.

This schematic shows the original connections inside the cradle. Notice the non-standard pinout on the miniUSB connector at left.



In order to fix the cradle so I could plug a regular miniUSB cable into the femaile USB connector, I had to open the cradle and rewire the connectors inside. The cradle actually has a lot of empty space in the base, so I was able to add a button and a 3.5mm stereo jack (mouser.com p/n = 806-STX-3100-5NB). The following schematic shows my modifications to the cradle.
I added the 3.5mm connector on the lower left and the momentary pushbutton on the lower right. This photo was taken before I added the audio wires, but the USB wires can be seen going from the miniUSB connector on the left to the underside of the extUSB connector carrier board.

I like the fancy green button that says "RUN" because it has a perfect tactile feeling like a Dell QuietKey keyboard.
Since the miniUSB connector no longer has the audio output from the phone, I had to modify the speaker power supply unit to have a 3.5mm plug for the audio. I did this by cutting the cable about 3 inches from the connector and splicing in an old iPod headphone cable.



Now I can mount the cradle in the car and pass the audio directly to the auxilary input on the car stereo. It is also now possible to connect my laptop to the phone in the cradle via USB.

Thursday, June 4, 2009

QR codes

Last week I needed to add the 128 bit WEP key to my phone for my sister's wireless. I looked it up in the repository (where I store a file of wireless keys) and decided that I am too lazy to actually type in all of those characters on my phone's tiny keyboard. Fortunately, there is an application called "Barcode Scanner" on Android that uses the phone's camera to scan barcodes. Appropriate name, eh? It can scan UPC type barcodes and perform a product search as well as 2D QR codes. The QR code can contain a URL, vCard or MECARD contact information, URI for the android market or geographical location, plain text, and many other psudo-standardized formats.

Check out http://en.wikipedia.org/wiki/QR_Code for more information on QR codes.
Check out http://code.google.com/p/zxing/ for more information on the android application.

Since Barcode Scanner can transfer captured data directly to my phone's clipboard, all I need is a way to produce the QR code containing the WEP key. After a little searching, I found and installed a program on my Ubuntu based laptop called qrencode that takes a file or stdin and generates as a png a 2D barcode.

$ sudo apt-get install qrencode


Example 128 bit WEP key as 13 hex pairs:
00112233445566778899aabbcc

$ qrencode -o qrcode.png 00112233445566778899aabbcc


Then I used gqview (sudo apt-get install gqview) to display the png on my laptop's LCD. I fired up Barcode Scanner on my phone and captured the image, decoded it, and copied it to the clipboard just by pointing the phone at the image. It actually captured it at a funny angle, so I consider the QR codes to be very robust. (I think it also does just fine if the image is 30 feet tall and you capture it with a lot of keystoning.) Next I just opened the wireless settings and pasted the key in the appropriate field. Everything worked wonderfully. I was happy even though I reallized I probably did much more work than I had to just to type in a WEP key.

Today I was upgrading Firefox on my sister's computer to version 3. When the incompatible add-ons screen popped up, I remembered the fun experiment with the QR codes and wondered if there was an add-on for Firefox to generate them. I found "Mobile Barcoder" and installed it.

Here is a link to the Mozilla Add-on site: https://addons.mozilla.org/en-US/firefox/addon/2780

Now, I can highlight a block of text, right click and generate a QR code immediately. It is rather convenient. There is also a small mouse over icon in the status bar that provides a QR code with the link to the current page.