Thursday, April 21, 2011

Making gerber files in Eagle in 4 easy steps

CADSoft Eagle is the most popular PCB designing software amongst electronics hobbyist. The user interface is quite predictive and easy to learn. Many tutorials about learning it can be found on the internet. The one on Sparkfun's site http://www.sparkfun.com/tutorials/108 appears most appealing to me. The final files from the software are .sch and .brd files corresponding to the schematic and board layout respectively.
Once the pcb is designed, one would definitely like to send it for fabrication. However, the pcb manufactures generally don't have design softwares like Eagle. They would rather ask you for something called gerber files. These are a set of 7 to 10 files each of which contain data about the pcb holes, text on the pcb, routing etc. Eagle has provision for converting the .brd file into the gerber format. Following tutorial explains how.
1. Open the brd file. From menu go to File->Run and click. A file browser will open, navigate to and select  drillcfg.ulp file. It will ask for units, select inch (NOT mm). A list of tools T01, T02 will show up. Just click OK. A <somename>.drl file will be saved.
2. Go to File->CAM Processor and click. A CAM processor window will open as show in the following picture.

3. From the menu, go to File->Open->Job. From the file explorer that pops up, select excellon.cam and click Process Job at the bottom. Some more files will be saved to the directory.


4. Once again go to File->Open->Job. From the file explorer that pops up, select gerb274x.cam and click Process Job at the bottom. More files will be saved to the directory.

A total of 9 files should be created with extensions : .cmp, .drd, .dri, .drl, .gpi, .plc, .sol, .stc and .sts. In case you are creating a 4 layer pcb, you should select gerb274x-4 layer in the last step. Zip all the nine files created and ship it to the manufacturer.

Tuesday, April 12, 2011

iOS 4.3.1 jailbreak + Unlock for iPhone

Iphone dev team released the iOS 4.3.1 jailbreak for iphone 3GS and iphone 4, besides other devices. More importantly they updated the ultrasnow unlock after 6 months. This means that the wait for iphone owners/unlockers with iOS version 4.1 or earlier is over. I updated to the 4.3.1 and unlocked my iphone 3GS and it works perfectly fine. A few safety precautions before you go ahead: The best jailbreaking is achieved by tweaking the device firmware using pwnagetool developed by iphone dev team

A little about how jailbreaking works - Iphone data disk has two major sections where the firmware is loaded during its operating system (iOS) installation : the Baseband and the Flash section. Baseband is the section which decides which operator your phone is tied to (in case you are tied to, like AT&T in US and Airtel/Vodaphone in India). In the cat and the mice game going on between Apple and iphone hackers, the hackers try to patch the code in the Baseband which detects whether your phone is working with the authorized operator or not. In case the SIM card inserted in the phone is not authorised, Baseband does not allow the main OS (residing in the flash section) to be used. In case the SIM is authorised, it asks for activation. This means that when the actual network (say Airtel) is available, it tries to contact the service provider and gets a code from it. This code when matches (actually a more complex process than simply matching) the code in the Baseband, the phone is activated for use. In this case, all the OS features and apps in the flash section becone accessible to the user.

In reply to the patch by hackers, Apple releases a patch which upgrades and relocks your Baseband to the authorised service provider. Everytime you install (or upgrade) the iOS directly from iTunes by downloading, the Baseband is patched. Interestingly many of the iOS updates have nothing new other than a Baseband patch. This is why for those who want to jailbreak their phone, it is always advised not to install directly by downloading from iTunes. The beauty of Pwnage tool is that it modifies the original iOS and removes the part which upgrades the Baseband. On running it from your computer, it modifies the downloaded iOS firmware (either from itunes or any other mirror), it creates a 'Custom firmware', which can be then installed on the phone using iTunes (By clicking Restore button on itunes with Option key(Mac) or Shift key(Windows) pressed, you browse to the custom firmware created on your computer and restore). 

The latest Baseband firmware version released by Apple is 5.14.05 which can not be unlocked, and the latest iOS version is 4.3.1. However, if you have Baseband version 5.13.04 or earlier, it can be unlocked using some hacks. So, you can use the latest pwnage tool to upgrade to create a custom iOS 4.3.1 which does not upgrade your Baseband. This firmware is also jailbroken, meaning that you can install non official stuffs on it from Cydia store (the unofficial appstore which comes with jailbroken firmware). Once installed, you will need to install ultrasnow from cydia. Ultrasnow basically goes and tells the Baseband to start working with whatever SIM is inserted. This process is called unlocking the iphone.

Thus, to safely jailbreak your phone, use pwnage tool to create a custom firmware using appropriate instructions on iClarified website for your iOS version. Once your phone is restored with the new iOS, go to cydia and install ultrasnow  using instructions on iClarified here. Reboot the device and you are on iOS 4.3.1 with any carrier of your choice.


Having jailbroken your phone, you would definitely like to install those millions of paid apps, for free. Appsync is one cydia software which allows you to do so. Whenever you download an app from Appstore, your itunes account is authenticated with Apple server. However you can download most of these apps from various other sites like apptrackr.org. There is another challenge though. When you try to install it to your phone from itunes, the phone authenticates whether you are signed in using the same account on your phone which you used for downloading the app. Appsync  helps get over this hurdle. It forces the phone not to authenticate the app being installed from iTunes. Thus you can install any app from your iTunes library. Details about using it can be found here.


The new iOS 4.3.1 has some really cool features like :

1. Find my iPhone : This is an amazingly useful service by Apple. This can help you locate, message, lock or even wipe your phone anytime from the website me.com/find. There is also a free app for the same called Find my Iphone.



2. Airprint : This app allows you to print from your iphone over the wifi. However very few printers till date have support for this. Some hp and Canon printers have come up with wifi hardware and airprint features. Hope the number grows fast.



3. Home sharing : This is yet another revolutionary feature. If your iphone, computer or other idevices are on the same wifi network and they are signed in using the same itunes account, your iphone can play the music and even videos shared on itunes library. The best test case I found in my house was that my desktop computer contains all the music but I wanted to play some songs on my music system which was in other room. I shared the itunes library on wifi and opened it on my phone. Then I connected my music system to iphone's headphone jack and enjoyed the live streaming songs from my computer to music system wirelessly.




For more details about jailbreaking and unlocking, definitions and links can be found at http://kshdeo.blogspot.com/2010/12/saving-iphone.html .