Category Archives: Mobile

Breaking up 3′s mobile broadband scam

3 mobile offer a mobile broadband service. You buy a router which takes a mobile SIM, which has mobile data enabled and which is subscribed to a mobile data plan. The router connects to the mobile network and then shares that connection over a WIFI network in your home.

3 offer a number of plans based on the amount of data you want to download, ranging from 3GB per month up to 100GB per month. For example, 30GB per month costs €29.99.

If you go over your limit, you pay penalty charges. Then penalty rate is 5c per MB. This doesn’t sound like much, but if you go 1GB over your limit (half a Netflix movie), that’s €50. This applies whether you are on the 3GB or the 100GB plan. Once you get to 1GB over your limit, 3 stops the connection and you can’t download any more data until your plan renews at the start of your next billing cycle.

Does this sound like a scam? No, not really, but I haven’t included all the detail.

Given the penal rate that applies if you go over your limit, you would think that 3 had some sure fire mechanism of alerting you that you are approaching your limit or are at your limit, so that you could stop using the service.

Well, they don’t.

All they do is send a warning SMS message to the mobile phone number that is associated with the SIM card in your router. The only way that you’ll ever see this message is if you login to the router and check the messages, which you’re never going to do, because there is no reason to login to the router other than when you first set it up.

It would of course be much more logical for them to send you an email (you supply your email address when you buy the router and/or subscribe to the data plan), but they don’t do this. Nor to they make any functionality available whereby you can set up an email warning yourself.

Nor do they shut off your connection when you reach your limit. Of course, they could argue that they want to give users the capability to burst beyond their limit, in case of some emergency, but why then do they go ahead and shut down your connection when you go over your limit by 1GB, which costs €50? And why don’t they give users the option of having their connection shut off when they breach their limit? And regardless of both these points, you can also buy a data add-on for a couple of euro if you want to go above your limit in a given month.

The only explanation that stacks up here is that 3 are making a small fortune from users breaching their mobile data limits. I use the service, and am technically savvy, but in the first 4 months of using it, I breached my limit twice. I had budgeted paying €29.99 per month for 30GB per month over 4 months (Total: €119.96 for 120GB of data), but ended up paying €219.96 for 122GB of data.

Certain that 3 were playing offside here, I contacted ComReg to make a complaint. Surely, they would recognise how ridiculous it was for service providers to be warning users about breaching data limits by sending SMS messages to SIM cards buried in routers.

But no. To my amazement, I got a response from ComReg saying that mobile providers were not obliged to warn users about limit breaches by email. They were only required to send SMS messages!

Now my blood was really up.

I got to work with some Python and Selenium and wrote a script that logs into my 3 account once per hours and picks up my remaining allowance. This allowance is then posted to a my website, where it is checked by a simple web content checker app running on my phone. Every time the content changes, the app alerts me.

My plan now is to extend this functionality to other users, so that they too can cut off the supply of €50 fines being delivered to 3. If you would like to have your allowance monitored in this way, please let me know and I will send you what you need.

If you’re tech savvy, you can do it yourself. See here:

https://github.com/garrethmcdaid/3allowancecheck/

The Joy of SIP

It’s hard to thing of a technology that has more fundamentally revolutionized the way we do things more than IP telephony, and SIP in particular.

Back in the early 1990s, I was charged with installing a telephone system in an office building that would house 50+ users. I had to buy an Ericsson PABX, which took up an entire corner of the comms room, pull up all the floor panels to route new cables to the desks, buy all sorts of expansion cards to accommodate voicemail and PSTN interfaces, and buy 50 bulky handsets so that users could actually use the thing from their desks. I then had to go off to ESAT and get 8 actual telephone lines, which took 4 weeks to get installed. The whole project cost about €17k, and that was nearly 20 years ago.

Let’s compare that to my most recent installation of a telephone system, earlier this year, again in an office of approximately 50 users.

For the PABX, I bought a tower PC from Amazon which cost €299. I installed the OpenSource software PABX, Asterisk, on this, which took about 20 mins. I then purchased a business package from the VOIP provider, Blueface, which included 8 dedicated Direct Dial extensions, which took about 30 minutes. I then configured Asterisk to use the Blueface SIP trucks, which took another 30 minutes.

Next to handsets. Did I buy 50 handsets?

No, not this time.

This time I purchased 1 handset for the main office number, which cost €99. For everybody else, we installed a SIP Client on their mobile phone, such as CSipSimple, and allocated an internal extension to everybody who wanted one. This client connects to Asterisk over the office’s main WIFI network.

Basically, that means that everybody’s mobile phone doubles up as their internal office extension. When somebody rings their extension, their mobile phone rings, or when they want to make a call, either internally or externally, they use their mobile phone. Any external calls they make are charged to the company via the Blueface account. In addition, all users are now fully mobile, so if they are in a meeting in another part of the building, they can still be contacted on their internal extension.

This company also has external IPSEC VPN access, so for users who are on the road a lot, I installed a VPN client on their phones, which means they can use their internal office phone extension from anywhere in the world, whether they are on a WIFI/3G/LTE connection.

This company is also multi-site. They have offices in different continents, linked together by a VPN. That means that if a manager is on trip to the office in another continent, they can still be contacted on their internal extension, all over IP, because their mobile SIP client is connected into the main corporate LAN over the WIFI.

Meanwhile, that PABX I bought way back when is probably still rotting in a landfill somewhere.

Cache behavior in mobile browsers

I recently had to deal with a situation in which a web server, which served content primarily to mobile devices, was constantly running out of disk space.

The reason for this was that Apache was generating GBs of logs each day. The site associated with the server was a busy site, but it still seemed strange that the logs would grow to that magnitude.

A cursory examination of the logs showed that there were endless requests for static assets, like images, css files and javascript files, which would normally be cached by the browser. The requests were being responded to with a HTTP 304 response, which was even more strange, as the web server was configured to set an Expires header on all such files of 14 days.

A word about HTTP responses before we continue.

When a browser first requests a file, the web server will fetch that file from the file system and deliver it over the network with a HTTP 200 response. By default, the browser will then store that file in its cache. If the browser needs to  get the same file again, because it considers the copy in its cache to be too old, it will send what is referred to a Conditional GET request to the web server (by including a special HTTP header in the request, which includes the date the browser last accessed the file), which asks the web server to send the file again only if it has not been modified since the last request.

The web server then checks the last modified date on the file, and if it is the same as before, the web server will not send the actual file, but will instead issue a HTTP 304 response. This tells the browser that the file has not been modified since it was last accessed, and that it is safe to load that file from its cache.

Setting the Expires header of 14 days for files means that when those files are stored in cache, the browser will only make a Conditional Get request for any such file if 14 days have elapsed since it was first accessed and stored in the cache. This is a trade off between performance and control: your web server gets fewer requests, but there may be a delay in a user seeing an updated file.

In theory, this means that something like an image file should only be requested from the web server once every 14 days, which meant the behavior I was seeing in the logs was very strange indeed.

To get to the bottom of this I ran some Analog analysis on a week’s worth of logs. I targeted requests for a single-image file, and in the first pass, looked for the number of HTTP 200 responses for that image, and in the second pass, I looked for the number of HTTP 304 responses for the same file. I then did a comparison on the profile of mobile browsers making those requests.

The results are given below:

Status 200 % Status 304 %
Total 206448 100.00% 159266 100.00%
Android 2.1 917 0.44% 1449 0.91%
Android 2.2 3964 1.92% 10750 6.75%
Android 2.3 31692 15.35% 78638 49.38%
Android 3.0 57 0.03% 298 0.19%
Android 3.1 626 0.30% 2096 1.32%
Android 3.2 1938 0.94% 7332 4.60%
Android 4.0 28381 13.75% 468 0.29%
Android 4.1 1693 0.82% 78 0.05%
iOS 2 16 0.01% 0 0.00%
iOS 3 357 0.17% 61 0.04%
iOS 4 16975 8.22% 51845 32.55%
iOS 5 53818 26.07% 1412 0.89%
iOS 6* 57079 27.65% 2343 1.47%
iPod 4 878 0.43% 2181 1.37%
iPod 5 1502 0.73% 24 0.02%
iPod 6 1115 0.54% 30 0.02%
iPad 5 48 0.02% 2 0.00%
iPad 6 72 0.03% 2 0.00%

*iOS6 = iPhone 5, iOS5 = iPhone 4 etc etc…please don’t got out looking for the iPhone 6 in the shops!

The highlighted rows show the source of the problem.

Based on this data, it would appear that Android 2.3 browsers, and iOS 4 browsers (iPhone 3), have very limited caching capability.

Between them, they account for 23.57% of traffic on the site in the period in question, but 81.93% of Conditional GET requests. This would seem to suggest issues with the caching function in these browsers, which is most likely due to the cache space available to them reaching capacity.

What seems to be happening is that either new files are not being written to the cache (these phones had limited disk space), causing the browser to constantly refer to an out of date expires date on the files in the cache, of the cache is simply not functioning correctly, causing the browser to issue an unnecessary Conditional GET request.

The implications of this are pretty significant in terms of mobile web performance, which typically relies a much lower bandwidth capacity than the PC web.

Yes, it is true that Android 2.3 and iOS 4.0 are dropping out of the mix as new handsets come on the market, but given the amount of HTTP requests they generate, even a small population of older devices will have an impact on server performance.

Compare the relative data for iOS4 and iOS5 in the table above. There are 4 times as many standard HTTP 200 responses for iOS5 (iPhone 4), indicating that there are 4 times as many iPhone 4s as iPhone 3s  in use on the site, but when you factor in the HTTP 304 responses, the total number of actual HTTP requests issuing from iPhone 3s is greater!

I hope to run this analysis again in 6 months time. The results should make for interesting reading.

X-Servet/Xproxy and mobile web applications

I recently worked on the setup of a mobile web application aimed at customers in Japan.

Unlike in Europe and the US, and indeed in many other parts of Asia, Japanese mobile users have been slow to join the Smart Phone revolution, and many remain wedded to a family of handsets that are built around i-mode technology, which was supposed to be the future of mobile internet, but which became largely redundant when Apple and others started handing out Smart phones that had fully featured browsers and which were capable of WIFI.

The Japanese mobile market is therefore peppered with lots of unusual handsets which have varying degrees of capability in terms of displaying mobile content, which presents a particular challenge in terms of the development of mobile content.

To address this, a Japanese company called FlexFirm has produced a Proxy Server called X-Servlet (sometimes referred to as xproxy) which sits between user handsets and web applications and alters the content delivered to the handset based on what it knows about the handset being used.

The company itself maintains a database of handsets in use in the Japanese market, and allows X-Servlet installations to import this on the fly on regular intervals.

The software itself is supported by documentation that is only available in Japanese, but once you’ve used Google Translate to give you at least some insight into what’s involved, setup and configuration is relatively straightforward. The server is written entirely in Java, so like most Java applications, stopping/starting/running it is simply a matter of managing single process, and combined with something like daemontools to maintain stability, its a pretty robust solution.

More generally, this availability of such software, and the unusual nature of the Japanese mobile market ( as well as several others ) highlights again how elusive standardization is in the mobile internet, and how much of a relief it will be to everyone in  the development community when HTML5 asserts itself as the dominant and pervasive standard.

Stuff you can’t do with an iPhone: the definitive list

This is a list of stuff you can do with an Android phone, but can’t with an iPhone.

View Flash movies in websites

Use Bluetooth to transfer files or control remote devices

Connect to a Samba Network share to save your photos and videos

Take a photograph with a flash

Delete more than one photograph at a time

Mount your phone as an external drive to pull/push files to/from your PC

Buy music from someone other than iTunes

Install an application that hasn’t been approved by Apple

Use an older version of your operating software

Use an SD card to expand your storage capacity

Buy a replacement battery

Use a second, backup battery

Remove the SIM card without a paper clip

Turn on/off WIFI with a single key press

Use a standard mini-USB cable to charge it

Receive a WAP Push SMS message

Update your operating system without having to connect to a computer

Upload a file to a website through your web browser

Choose a different on screen keyboard

Schedule tasks to occur automatically eg turn down volume after 11pm

Customise your home screen

Add widgets to you home screen

Access more than 3 panels on your home screen

Control your phone from your computer

(Not necessarily something you can’t do, but one of the most annoying things about the iPhone is that its earphones don’t come with any sort of foam/rubber mufflers, which means that it you’re sitting beside an iPhone user on a train/plane/bus, you have to listen to whatever it is they are listening to.)

How I solved the iPhone Restore Error 3194 problem

This is a saga, but if you’ve been tearing your hair out trying to upgrade to version 5.0 of the Apple iOS on your iPhone, its probably worth reading.
Here’s the background.
Up to Oct 2011, iPhones came installed with iOS 4. iOS 5.0 was then released, and all iPhones sold after this time were sold with iOS 5.0.
To be honest, I don’t know what the difference between iOS 4 and iOS 5 is. I needed an iPhone to test some mobile websites (I wouldn’t buy one for personal use under
any circumstances, because they’re just hand candy) and all I know is that somebody gave me an iPhone 3GS phone that they had finished with, and had it unlocked from
Vodafone so that I could use it on O2. To complete the unlock process I had to do a restore of the iPhone with iTunes, and iTunes would not let me do this unless I
upgraded to iOS 5.
And so the story begins.
When I first attempted to do the upgrade, iPhone happily started downloading the new software. The payload is approx. 700MB, so I knew  it would take a while. However,
it crapped out after approx. 50MB, so I started it again. Same thing, crapped out again, and again, and again.
I did a bit of research on this, and was told by the Apple Support web site that I should ensure I had the latest version of iTunes. My version was about 6 months old,
so I went ahead and downloaded the new version.
Now when I tried, iTunes wouldn’t connect at all to the software update server, and just crapped after waiting 30 seconds to connect.
More research.
I discovered that this was a very common problem, and one that not too many were able to resolve. The most common suggested resolution involves editing the local hosts
file on your Windows system (C:\windows\system32\drivers\etc\hosts). This is in fact a load of crap.
The reason why this is a suggested solution is because lots of people have installed Jailbreak software on their PCs. This software inserts and entry into the hosts
file so that iTunes is directed away from Apple’s software signing server when doing restores. If that hosts file entry remains, you won’t be able to contact Apple’s
signing server when you want to do a genuine restore, for a software upgrade for example, so removing the entry helps. However, for people who have never tried to
Jailbreak, this is just a waste of time. In fact, such users won’t even find the rogue entry in their hosts file.
Digging a bit deeper, I discovered that iTunes lets you load the software upgrade from a local source, by pressing the Shift key at the same time as you click Restore.
Hence, if I could get my hands on the .ipsw file (this is the file type for Apple iOS updates) that needed to be loaded, I could bypass any issues Apple was having in
connecting to the software upgrade server.
I looked around on the web for a source for such files and found this link:
http://appldnld.apple.com/iPhone4/041-8356.20111012.SQRDT/iPhone2,1_5.0_9A334_Restore.ipsw
The server, appldnld.apple.com, is located in the apple.com Top Level Domain, so I figured this was pretty safe. I opened the link in my browswer and the file started
downloading. However, after 50mbs, it crapped out again.
Not wanting to give in on this, I tried a few other things. Suspecting that maybe my local network connection was not roboust enough to deal with whatever crap was
coming out of the Apple network, I logged onto my Linux hosting server in the Amazon EC2 clould and initiated the download from there with wget. This worked a treat,
and I pulled the .ipsw file down onto the server in about 2 minutes.
I then connected to this server using Filezilla and ftp’ed the file down to my local PC. I used Filezila because it can restart failed downloads without having to
restart the download all over again, which is handy for large files like .ipsw files. Witin 30 minutes or so, I had the .ipsw file on my laptap.
Feeling certain that I had now conquered the Apple iOS 5.0 upgrade connundrum, I cranked up iTunes and used the Shift-Restore option to load the locally stored .ipsw
file. It loaded it up and unpacked it, and then told me it was going to verify the software with Apple.
Bang. Game over. An unknown error has occured (Error 3194).
Not to worry, I thought, lets see what Error 3194 means.
http://support.apple.com/kb/TS3694#error3194
Error 3194: Resolve error 3194 by updating to the latest version of iTunes. “This device is not eligible for the requested build” in the updater logs confirms this is
the root of the issue.
Excellent. An obscure meaningless error message that Microsoft would have been proud of. I really shouldn’t have expected anything else.
So back to Google for some more research, and this time I found all sorts of interesting stuff.
Apparently, since the release of the iPhone 3GS, Apple will know longer let you install operating software on your iPhone unless that software is approved by Apple.
That means that whenever you use iTunes to upgrade or restore your iPhone, iTunes will scurry off home to Apple and check that the software you are trying to load is
approved for your model of iPhone. This, it seems, is an attempt to stop people jailbreaking their iPhones, because Apple doesn’t really like people doing things with
their hardware that they don’t approve of.
Anyway, armed with this nugget of information, I contacted Vodafone to ensure that my iPhone was definitely unlocked. If Apple was refusing to allow me upgrade it, I
figured this must be something to do with the status of the handset with the mobile operator to which it was issued.
Not so. Vodafone said that as far as they were concerned the handset was unlocked, and that I would have to copy Apple for technical support.
I did as I was instructed, and was eventually put through to one of their agents to whom I described my problem. He said that Error 3194 meant that I had security
software running on my PC, which I needed to shut down. I assured him I hadn’t, and directed him to the Apple Support website which stated that Error 3194 concerned
the eligibility of phones for upgrade. He then suggested I reboot my PC. I told him I wasn’t going to do this, and that he was wasting my time.
He got a bit flustered at this and put me through to one of this supervisors. This guy seemed to know a little bit more so I explained the actions I had taken thus
far. However, when I told him that I had downloaded the .ipsw file directly from a download server, he sprang to life, and I knew I had made a mistake.
This was not possible to do, he stated, the only way to get the software was through iTunes, and the software that I was now trying to load was obviously a jailbreak
image from a 3rd party and that this was why the upgrade wasn’t working.
I tried to explain to him that the download came from within the apple.com domain, which meant it was legit, and asked why iTunes allowed you to load a locally stored
.ipsw file if it was not possible to get such a file directly from Apple.
No, he said, he worked for Apple and he knew what he was talking about.
I tried to convince him still further. I showed him that the appldnld.apple.com resolved to an IP address that was leased to Akamai Technologies, the company that
manages all of Apple’s media downloads.
No, he said, he worked for Apple and he knew what he was talking about.
At this point, I let him and off and we went through his checklist for solving software upgrade issues.
We cleared the DNS cache. No difference. We created a new user account under Windows and tried the download using that (!!). No difference. We cleared the comments out
of the Windows hosts file and rebooted (!!!!!!). No difference.
I asked him if he knew what server iTunes tried to connect to when doing upgrades, and on what TCP port, so that we could test that he independently. He didn’t know
any of these details, and seemed incredulous that he should be expected to know.
He eventually told me something to the effect that I would have to sign up with a new ISP if I wanted to upgrade my iPhone. At this point, I ended the call.
Some good did come of it, however. Having asked the question about the server iTunes connects to, I set about finding this out for myself.
I installed TCPView on my laptop, cranked up the iTunes upgrade process, and had a look at what it was connected to. I found out that it was connected to ip address
82.52.205.135 on HTTP to do the download. This ip address is leased to an Italian Telecoms company, and obviously forms part of Apple’s new iCloud product.
I also decided to see what Apple was trying to download, and looked in C:\users\garreth\AppData\Roaming\Apple Computer\iTunes\iPhone Software Updates, which is where
iTunes keeps the .ipsw files it downloads from Apple.
Here, I found a file called iPhone2,1_5.0.1_9A405_Restore.ipsw.download, which was obviously the partial download of the full .ipsw file.
Now, notice the difference in this file name the the one I originally downloaded.
iPhone2,1_5.0_9A334_Restore.ipsw
v
iPhone2,1_5.0.1_9A405_Restore.ipsw
Yes, iTunes was trying to download a newer .ipsw file that the one I had downloaded! Of course, iTunes wasn’t letting me use my .ipsw file because a newer one exists,
and Apple doesn’t allow you install older .ipsw files than the current up to date version.
Now, all I had to do was find a copy of the newer .ipsw file that I could download directly and try and load that.
I Google’ed iPhone2,1_5.0.1_9A405_Restore.ipsw and found the following link, which was again on the appldnld.apple.com server, the one that the guy in Apple support
swore blind had nothing to do with Apple and was giving me jailbroken software:
http://appldnld.apple.com/iPhone4/041-3307.20111109.5tGhu/iPhone2,1_5.0.1_9A405_Restore.ipsw
I downloaded this one in the same way as before (via my Linux server) and tried the Shift-Restore option again.
And guess what? It worked! The new iOS was loaded to my iPhone and I now have an unlocked iPhone that I can use on the O2 network.
So what do you need to know from all of this. A few things.
First of all, it is possible to load a locally stored .ipsw file into iTunes. You just need to ensure that it it the most up to date version of the iOS. The Tech
Support guys in Apple are obviously not told this, and it would probably result in them get users to do all sorts of crazy things with their PCs, which could end up in
Apple getting sued (“Woman strangles cat with computer cable while trying to upgrade iPhone” etc)
Secondly, the iCloud service that Apple has started using to distribute media is obviously very flaky. Presumably, I was directed to a server in Italy because I live
in Europe. Users in other parts of the world will no doubt have differing experience, but it certainly seems that the Italian arm of iCould is waaaaay underspec’ed.
Thirdly, you really should give serious consideration to using something other than an iPhone as your smartphone. The saga I have described above if very common in the
iPhone user population, and is unheard for Android users. I myself have an Android. I’ve updated the operating system on it twice. When it needs an upgrade, it tells
me, and I then let it download the upgrade overnight. When I get up in the morning, its done. No hassle.
Also, my hadnset manufacturer, HTC, is quite happy for me to use whatever operating system I want on my phone, which is what I’d expect, given that I paid for it and
own it. The fact that this isn’t the case with Apple should be all you need to know.

This is a saga, but if you’ve been tearing your hair out trying to upgrade to version 5.0 of the Apple iOS on your iPhone, its probably worth reading.

Here’s the background.

Up to Oct 2011, iPhones came installed with iOS 4. Thereafter,  iOS 5.0 was released, and all iPhones sold after this time were sold with iOS 5.0.

To be honest, I don’t know what the difference between iOS 4 and iOS 5 is. I needed an iPhone to test some mobile websites (I wouldn’t buy one for personal use under any circumstances, because they’re just hand candy) and all I know is that somebody gave me an iPhone 3GS phone that they had finished with, and had it unlocked from Vodafone so that I could use it on O2. To complete the unlock process I had to do a restore of the iPhone with iTunes, and iTunes would not let me do this unless I upgraded to iOS 5.

And so the story begins.

When I first attempted to do the upgrade, iTunes happily started downloading the new software. The payload is approx. 700MB, so I knew  it would take a while. However, it crapped out after approx. 50MB, so I started it again. Same thing, crapped out again, and again, and again.

I did a bit of research on this, and was told by the Apple Support web site that I should ensure I had the latest version of iTunes. My version was about 6 months old, so I went ahead and downloaded the new version.

Now when I tried, iTunes wouldn’t connect at all to the software update server, and just crapped after waiting 30 seconds to connect.

More research.

I discovered that this was a very common problem, and one that not too many were able to resolve. The most common suggested resolution involves editing the local hosts file on your Windows system (C:\windows\system32\drivers\etc\hosts). This is in fact a load of crap.

The reason why this is a suggested solution is because lots of people have installed Jailbreak software on their PCs. This software inserts an entry into the hosts file so that iTunes is directed away from Apple’s software signing server when doing restores. If that hosts file entry remains, you won’t be able to contact Apple’s signing server when you want to do a genuine restore, for a software upgrade for example, so removing the entry helps. However, for people who have never tried to Jailbreak, this is just a waste of time. In fact, such users won’t even find the rogue entry in their hosts file.

Digging a bit deeper, I discovered that iTunes lets you load the software upgrade from a local source, by pressing the Shift key at the same time as you click Restore.

Hence, if I could get my hands on the .ipsw file (this is the file type for Apple iOS updates) that needed to be loaded, I could bypass any issues Apple was having in connecting to the software upgrade server.

I looked around on the web for a source for such files and found this link:

http://appldnld.apple.com/iPhone4/041-8356.20111012.SQRDT/iPhone2,1_5.0_9A334_Restore.ipsw

The server, appldnld.apple.com, is located in the apple.com Top Level Domain, so I figured this was pretty safe. I opened the link in my browswer and the file started downloading. However, after 50mbs, it crapped out again.

Not wanting to give in on this, I tried a few other things. Suspecting that maybe my local network connection was not robust enough to deal with whatever bumpf was coming out of the Apple network, I logged onto my Linux hosting server in the Amazon EC2 cloud and initiated the download from there with wget. This worked a treat, and I pulled the .ipsw file down onto the server in about 2 minutes.

I then connected to this server using Filezilla and ftp’ed the file down to my local PC. I used Filezila because it can restart failed downloads without having to restart the download all over again, which is handy for large files like .ipsw files. Witin 30 minutes or so, I had the .ipsw file on my laptap.

(Note: hopefully you won’t have to do the step above, and have a good enough network connection to get the  .ipsw with your browser)

Feeling certain that I had now conquered the Apple iOS 5.0 upgrade connundrum, I cranked up iTunes and used the Shift-Restore option to load the locally stored .ipsw file. It loaded it up and unpacked it, and then told me it was going to verify the software with Apple.

Bang. Game over. An unknown error has occured (Error 3194).

Not to worry, I thought, lets see what Error 3194 means.

http://support.apple.com/kb/TS3694#error3194

Error 3194: Resolve error 3194 by updating to the latest version of iTunes. “This device is not eligible for the requested build” in the updater logs confirms this is the root of the issue.

Excellent. An obscure meaningless error message that Microsoft would have been proud of. I really shouldn’t have expected anything else.

So back to Google for some more research, and this time I found all sorts of interesting stuff.

Apparently, since the release of the iPhone 3GS, Apple will no longer let you install operating software on your iPhone unless that software is approved (signed) by Apple. This basically applies to everything other than the most up to date version of the iOS. Apple doesn’t want you loading older versions, because some of these let you do things that Apple doesn’t want you to do.

That means that whenever you use iTunes to upgrade or restore your iPhone, iTunes will scurry off home to Apple and check that the software you are trying to load is approved for your model of iPhone. This, it seems, is an attempt to stop people jailbreaking their iPhones, because Apple doesn’t really like people doing things with their hardware that they don’t approve of. As noted above, this is why jailbreaking software directs you away from Apple’s signing server, gs.apple.com.

Anyway, armed with this nugget of information, I contacted Vodafone to ensure that my iPhone was definitely unlocked. If Apple was refusing to allow me upgrade it, I figured this must be something to do with the status of the handset with the mobile operator to which it was issued.

Not so. Vodafone said that as far as they were concerned the handset was unlocked, and that I would have to copy Apple for technical support.

I did as I was instructed, and was eventually put through to one of their agents to whom I described my problem. He said that Error 3194 meant that I had security software running on my PC, which I needed to shut down. I assured him I hadn’t, and directed him to the Apple Support website which stated that Error 3194 concerned the eligibility of phones for upgrade. He then suggested I reboot my PC. I told him I wasn’t going to do this, and that he was wasting my time.

He got a bit flustered at this and put me through to one of this supervisors. This guy seemed to know a little bit more so I explained the actions I had taken thus far. However, when I told him that I had downloaded the .ipsw file directly from a download server, he sprang to life, and I knew I had made a mistake.

This was not possible to do, he stated, the only way to get the software was through iTunes, and the software that I was now trying to load was obviously a jailbreak image from a 3rd party and that this was why the upgrade wasn’t working.

I tried to explain to him that the download came from within the apple.com domain, which meant it was legit, and asked why iTunes allowed you to load a locally stored .ipsw file if it was not possible to get such a file directly from Apple.

No, he said, he worked for Apple and he knew what he was talking about.

I tried to convince him still further. I showed him that the appldnld.apple.com resolved to an IP address that was leased to Akamai Technologies, the Edge Caching company that facilitates all of Apple’s media downloads.

No, he said, he worked for Apple and he knew what he was talking about.

At this point, I let him and off and we went through his checklist for solving software upgrade issues.

We cleared the DNS cache. No difference. We created a new user account under Windows and tried the download using that (!!). No difference. We cleared the comments out of the Windows hosts file and rebooted (!!!!!!). No difference.

I asked him if he knew what server iTunes tried to connect to when doing upgrades, and on what TCP port, so that we could test that independently. He didn’t know any of these details, and seemed incredulous that he should be expected to know.

He eventually told me something to the effect that I would have to sign up with a new ISP if I wanted to upgrade my iPhone. At this point, I ended the call.

Some good did come of it, however. Having asked the question about the server iTunes connects to, I set about finding this out for myself.

I installed TCPView on my laptop, cranked up the iTunes upgrade process, and had a look at what it was connected to. I found out that it was connected to ip address 82.52.205.135 on HTTP to do the download. This ip address is leased to an Italian Telecoms company, and obviously forms part of Apple’s new iCloud product, or maybe one of Akamai’s Edge servers.

I also decided to see what Apple was trying to download, and looked in C:\users\garreth\AppData\Roaming\Apple Computer\iTunes\iPhone Software Updates, which is where iTunes keeps the .ipsw files it downloads from Apple.

Here, I found a file called iPhone2,1_5.0.1_9A405_Restore.ipsw.download, which was obviously the partial download of the full .ipsw file.

Now, notice the difference in this file name the the one I originally downloaded.

iPhone2,1_5.0_9A334_Restore.ipsw

v

iPhone2,1_5.0.1_9A405_Restore.ipsw

Yes, iTunes was trying to download a newer .ipsw file that the one I had downloaded! Of course, iTunes wasn’t letting me use my .ipsw file because a newer one exists, and Apple doesn’t allow you install older .ipsw files than the current up to date version.

Now, all I had to do was find a copy of the newer .ipsw file that I could download directly and try and load that.

I Google’ed iPhone2,1_5.0.1_9A405_Restore.ipsw and found the following link, which was again on the appldnld.apple.com server, the one that the guy in Apple support swore blind had nothing to do with Apple and was giving me jailbroken software:

http://appldnld.apple.com/iPhone4/041-3307.20111109.5tGhu/iPhone2,1_5.0.1_9A405_Restore.ipsw

UPDATE Sep 2012: Latest image is:

http://appldnld.apple.com/iOS5.1.1/041-6051.2012.0525.Cvby7/iPhone3,1_5.1.1_9B208_Restore.ipsw

I downloaded this one in the same way as before (via my Linux server) and tried the Shift-Restore option again.

And guess what? It worked! The new iOS was loaded to my iPhone and I now have an unlocked iPhone that I can use on the O2 network.

So what do you need to know from all of this. A few things.

First of all, it is possible to load a locally stored .ipsw file into iTunes. You just need to ensure that it it the most up to date version of the iOS. The Tech Support guys in Apple are obviously not told this, and it would probably result in them get users to do all sorts of crazy things with their PCs, which could end up in Apple getting sued (“Woman strangles cat with computer cable while trying to upgrade iPhone” etc)

Secondly, you really should give serious consideration to using something other than an iPhone as your smartphone. The saga I have described above if very common in the iPhone user population, and is unheard of for Android users. I myself have an Android. I’ve updated the operating system on it twice. When it needs an upgrade, it tells me, and I then let it download the upgrade overnight, directly to the handset using WIFI. When I get up in the morning, its done. No hassle.

Also, my handset manufacturer, HTC, is quite happy for me to use whatever operating system I want on my phone, which is what I’d expect, given that I paid for it and own it. The fact that this isn’t the case with Apple, explained here, should be all you need to know.

The Metamorphosis of Apple

In 1984, Apple first aired their Big Brother commercial at half-time in the SuperBowl. Remember it?

The voiceover recites the following monologue:

Today we celebrate the first glorious anniversary of the Information Purification Directives. We have created, for the first time in all history, a garden of pure ideology: where each worker may bloom, secure from the pests of any contradictory... thoughts.
Our Unification of Thoughts is more powerful a weapon than any fleet or army on Earth. We are one people: with one will, one resolve, one cause. Our enemies shall talk themselves to death and we will bury them with their own confusion. We shall prevail!

Apple’s message in this commercial was that they were the antidote to this tyranny of thought purification, that they were the guardians of  free expression, that they could empower the individual.

And, for several years, that was true. Apple did bring the PC to the masses, and served to undermine the dominance of the computing megaliths like IBM.

The problem was that as Apple become more of a corporation, with shareholders and sales forecasts, and not least, competitors, it became increasingly difficult to maintain this ideal, and no where was this more true that with the iPhone.

In the beginning, the iPhone was a technological, and commercial, miracle. It was beautiful to look at and use, and Apple sold millions of things, propelling Apple 2.0 into the stratosphere of corporate IT giants.

While the handsets were flying off the shelves, and no one else was making them, Apple weren’t too concerned with what users did with their phones. Provided they used iTunes to buy music, they could use their hardware, that they owned, to do as they wished. The spirit of 1984 was alive, or at least not dead.

But then, inevitably, the competition arrived, and lots of people started developing software for iPhones, and suddenly Apple released that their users might start using their right to “free expression” to do things that weren’t in sync with the commercial interests of the Apple Corporation.

Apple now faced a choice. They could get on board with the likes of Google, Mozilla, HP, Sun etc and participate freely and enthusiastically in the development of standards based technology, or they could do a Microsoft, and put all their efforts into holding their ground, and hope that clever marketing would make up for the inevitable deficiencies that would result from maintaining a Closed Shop approach to product development.

The crunch came with the release of the Apple iPhone 3GS, the first major revision of the Apple’s flagship product.

Prior to the 3GS, iPhone users were free to load any sort of operating system onto their iPhone they so wished. There were numerous variations out there, which could be loaded via a shortcut in iTunes. This allowed users to do things on their iPhone (that they had bought and paid for) that were not possible with the software loaded by Apple.

This changed with the 3GS. From that point on, it was only possible to load an operating system to your iPhone if that software was signed by Apple. A new version of iTunes was released, which checked the software you were trying to load, and if that was not approved by Apple, iTunes would not complete the installation to your phone.

The significance of this is probably lost on most iPhone users, but it is significant none the less.

For millions of users worldwide, Apple now has complete control of what software they use on their hardware.

Imagine if this were the case with a PC that you bought from PC World. Imagine if you were not allowed to install any software on that PC unless it was approved by a private company like Microsoft?

Now, go back and watch the SuperBowl commercial again.

Which protagonist reminds you more of the Apple Corporation in 2012? The girl with the sledgehammer, or the face on the screen?