Monday, July 26, 2010

Repairing an Apple IPhone 2G that wont charge

I received an IPhone the other day that would not charge. My first thought was that the logic board was fried from a dodgy charger, since I had come across a similar problem before.
However, there was something different going on in this situation: Whenever the phone was turned on, the apple "i need to charge" (see pic) came up on the screen. When plugged into a charger, it said that it was charging. However, no matter how long it was left charging for, the battery only ever held a charge for a few seconds.
Two things could cause this. A dodgy battery that cannot hold a charge (unlikely, as that would be a very gradual problem: this iphone suddenly couldnt hold a charge) or two, the white wire that monitors the temperature of the battery to help it charge was broken, making the IPhone refuse to charge the battery. Sure enough, after opening it up, this was the problem. The white wire bad broken off the Comms board. I didnt have my trustly weller soldering iron with me at the time, so I set about soldering the wire back on with a cheap 10 dollar fire-starter iron. Of coarse, I got solder all over the pad and the shielding on the comms board. So, as I was feeling quite lazy, i tried to remove the excess solder from the shielding with a small wire snips.

Good Idea? ->Bad Idea.

The force of the snips had caused the white wire solder pad on the comms board to break off, leaving no where to solder the wire onto.I opened up my own IPhone to try and trace where the pad led to on the board to try and find a new pad that I could solder onto to no avail. After much cursing and swearing, I finally found some information on the net about the pad. As the board is multi-layered, the only place that the pad circuits seems to resurface is at the connecter between the comms board and the logic board. The bad point? The pitch of the connector was very small, and there was no redundancy, i.e normally manufacturers might carry the signal across a few of the connector pins that I could solder to, however, in this situation, there was only one. So I removed some of the shielding with my Dremmel tool, and with a careful hand, soldered some wire-wrap wire onto the pin. I did accidentally short one of the neighbouring pins to it with solder, but with careful use of a sharp Stanley blade, I separated them again. (I had tried solder braid to remove the solder short to no avail). So I powered up the IPhone, tried to charge it for a while, and was delighted to see that it was charging again.

White Pad circuit, secondary point

Apple Rant: Function follows Form?

In not an Apple fanboy per-say, but when I first tried the IPhone when it first came out, I was pretty impressed. Here was the first touch-screen phone that did not feel gimmicky, did not require a stupid stylus, looked....well, class, felt even nicer, and was really really easy to use. So when I spotted a 16Gb broken one on Ebay, I jumped at the chance to buy and repair it.

Unfortunately, as a Hardware Geek, there are one or two issues that I had with the phone. One is that the touchy-feely "real" glass on the screen is notorious at cracking when the phone is dropped. I have repaired about four phones where this happened, and in each situation, it wasnt even dropped from a large height. Secondly, the glass, touch digitiser, and LCD are glued together and cannot easily be seperated. This means that if one element breaks (i.e the glass), the whole expensive assembly has to be replaced. This was lazy hardware design by Steve Jobs and Jonathan Ive IMHO. Any portable device with a touch screen has a tough time at keeping dust from entering between the layers. The IPod touch had a robber bezel around the two layers to do just that. Nokia phones have a foam inlay to do the same. Why couldnt the IPhone be the same?
Thankfully, the later versions of the IPhone separated out the layers similiarly to the IPod Touch. However, Apple went back to old habits with the IPhone 4. This led to the much publicised "yellow spots" appearing on the screen caused by the glue not curing properly before being shipped. From all the hassle and complaints that Apple receive due to their glue addiction, you would assume that they would learn their lesson. Unfortunately, I think not. From the strain-relief gromits on their magsafe chargers that dont do any strain-relieving, to the notorious antenna issues of the IPhone 4, Apple will continue to give preference to design over hardware function. This is an Apple problem that will not go away any time soon.

Tuesday, July 20, 2010

Installing a SD card (MMC) on your Fonera Router

Im a big fan of Linux: the embedded stuff, not the Ubuntu crap you spend 3 months configuring before you can use the interwebs and thats marginally better than Winblows for ease of use. Thus when OpenWRT released "Backfire" i.e version 10.03, I was pretty excited. I had used a few versions before this, from 7.0 onwards, and was pretty happy with the results. Except for one or two points. Version 8 wouldnt boot on my Belkin router due to some RDC processor related bug, and I couldnt get it to support MMC (SD cards) on my Fonera router. Having the additional memory on your router is useful for cracking networks, installing additional packages such as a file server, web server, etc. However, that last problem has been solved with the new release, which I will outline here.

Fonera 2100 Router
Serial Pin-out for Fonera
First off, you will need to install OpenWRT on your fonera router. There are countless guides for doing this on the net, so here is another. You will need to build a serial cable. The easiest way to do this is to go onto ebay and buy yourself a Nokia DKU-5 data cable. This cable was used back in the day of tear-aways to hook a nokia phone up to a PC. To this, it needs to shift the serial Tx and Rx lines of the pc (anything from 3v to 15v), to 3.3v ttl for the phone. Thankfully, this is levels that we need to communicate with the router. A modifying the cable for our use is available here. You will just need 3 wires: Gnd, Tx, and Rx. Connect them up to the fonera as shown here. Fire up your terminal program (hyperterminal on the PC, ZTerm on the mac, or minicom or putty on Ubuntu) with the settings: 9600 baud, 8N1, no flow control. When you power cycle the fonera, you should be greeted with a load of text output from the fonera starting up. If not, try swapping the Tx and Rx lines. I have also experienced some problems with the fonera not booting up properly when there is a serial cable connected up: try leaving the serial cable disconnected for a second or two after you power cycle, and then connect it up again.



Once you have serial working, use the OpenWrt flashing guide available here: http://wiki.openwrt.org/toh/fon/fonera (scroll down to near the end). Note, for the "fis create" step, I had to use:

fis create -l 0x006D0000 rootfs

...due to the size left for the Backfire filesystem.
Larsens MMC Hardware setup (given in link)
Now, you have OpenWrt installed on your router. You will need to wire up a MMC card to the general input/output pins (GPIO) on the router. A guide is available here. Just follow the harware steps: I left the resistors, I just removed the capacitors
When you have that done, go to the web interface at 192.168.1.1, and enable wireless. Select client mode, save and apply settings, then scan for wireless networks, and connect to your local wireless internet. Then go to network-interfaces-wan and add "wifi0" as your wan connection, and DHCP as your protocol. If you reboot the router, it should connect to your local wireless network. Go back to your terminal, and see if you have successfully connected the device to the internet by pinging google:

ping www.google.com

You should get a response. Now, go to the software tab under administration, and click on update packages. Then install the luci-app-mmc-over-gpio package. This should install all the required dependencies. Reboot the router (type "reboot" in the terminal window or power cycle) and go to the newly available "MMC" tab under administration. Click on "enable", leave the other values alone, save and reboot the router again. In your terminal, OpenWRT should boot normally. Leave it for an additional minute or two. At the end, you should see something like:

gpio-mmc: Failed to request mmc_spi module.
mmc_spi spi32766.0: ASSUMING 3.2-3.4 V slot power
mmc_spi spi32766.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
gpio-mmc: MMC-Card "default" attached to GPIO pins di=1, do=3, clk=4, cs=7
mmc_spi spi32766.0: can't change chip-select polarity
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SD card on SPI
mmcblk0: mmc0:0000 SU128 120 MiB
 mmcblk0: p1

If you go to the /dev folder, you should see a new  mmcblk0 and a mmcblk0p1. The latter is the first partition found on the MMC card (assuming that you formatted the card correctly: i stuck it in a windows machine and formatted it fat32). From the guide available here, you will need to install the some packages in the terminal:


opkg update
opkg install kmod-fs-vfat kmod-nls-cp437 kmod-nls-cp850 kmod-nls-iso8859-15
 
Now, create a folder to mount the MMC card in your /mnt folder:  

mkdir /mnt/mmc

Now, mount the MMC card and hopefully you will get no errors:

mount /dev/mmcblk0p1 /mnt/mmc

Congrats! You now have plenty of additional (albeit a bit slow) external storage (I did get an unknown char error when i first tried to mount, but after I installed kmod-nls-iso8859-1 I think it was, it worked fine). This extra space will be handy for running Aircrack-ng to hack wireless networks and for other uses.
Handy post: https://forum.openwrt.org/viewtopic.php?id=21590&p=1