2008-08-08

Cellular Internet Access on iPhone 2.0 in Israel

To configure your iPhone 2.0 to access the Internet over the cellular network, there are two options:
  1. Directly through the cellular provider
  2. Use a WAP proxy
Option 2 is usually much cheaper per megabyte -- often unlimited. The downside is that only port 80 (HTTP) works, you cannot access email directly over IMAP/SMTP. As a workaround, Web mail can be used.

To configure your iPhone for the Orange network in Israel, do the following:
  1. Copy /private/var/preferences/SystemConfiguration/preferences.plist from your iPhone to your desktop (using sftp or WinSCP).
  2. Edit the file on your desktop to read as below.
  3. Copy it back to the iPhone.
  4. Reboot your iPhone.
The contents of the preferences.plist:

Search for the text "ip1", and edit the text after that to look like this:


<dict>
<key>Interface</key>
<dict>
<key>DeviceName</key>
<string>ip1</string>
<key>Hardware</key>
<string>com.apple.CommCenter</string>
<key>Type</key>
<string>com.apple.CommCenter</string>
</dict>
<key>Proxies</key>
<dict>
<key>HTTPEnable</key>
<integer>1</integer>
<key>HTTPPort</key>
<integer>8080</integer>
<key>HTTPProxy</key>
<string>192.118.11.55</string>
<key>HTTPSEnable</key>
<integer>1</integer>
<key>HTTPSPort</key>
<integer>8080</integer>
<key>HTTPSProxy</key>
<string>192.118.11.55</string>
</dict>
<key>com.apple.CommCenter</key>
<dict>
<key>AllowNetworkAccess</key>
<integer>1</integer>
<key>Available</key>
<integer>0</integer>
<key>Setup</key>
<dict>
<key>apn</key>
<string>wap.orange.co.il</string>
<key>password</key>
<string>mobile54</string>
<key>username</key>
<string>orange</string>
</dict>
<key>Version</key>
<integer>1</integer>
</dict>
</dict>


Sources:

2005-06-24

Editing the PocketPC's timezone for Daylight Saving time

I'm using a PocketPC -- an HP iPAQ 4150 running Windows Mobile 2003. One of the things that frustrated me is that there is no way to edit the timezone settings -- you can choose a preset timezone from a list, but what if your timezone is not on that list or the rules for it have changed? For instance, in Israel the Daylight Saving Time definitions change every few years due to various political and religious reasons.

I went to search for a solution that would let me edit the rules for a timezone, including the start and end dates for DST.
After searching for a while, I found this post by Peter Foot where he mentions that the timezone information is stored in the Registry under the key HKEY_LOCAL_MACHINE\Time\TimeZoneInformation, and that this value is a TIME_ZONE_INFORMATION structure. Looking it up in the Windows SDK on MSDN gave the necessary information on this structure.

Armed with this information, I went to look for a simple way to actually modify this Registry entry. Being a Linux guy myself, I wasn't looking forward to write a Windows-specific (Mobile or otherwise) program to do this, even though it seemed to be the obvious solution.

Instead, I wrote a Python program to create the necessary data structures. This turned out to be quite simple using Python's built-in struct module.

The script takes the DST start and end dates, and produces a hex string of the required format that can then be entered into the PocketPC registry using a Registry editor such as PHM Registry Editor.

The script is not very user friendly -- it was meant more as a quick hack, but feel free to contact me if you want it.

One other issue related to timezones on Windows that boggles my mind is that the Microsoft people seemingly have never heard about timezones that change from year to year. On Unix, the timezone can be specified for specific ranges of years. This means that if I know the rules for the next ten years (even though they're slightly different from year to year, as in Israel), I can create a timezone file with all the information that the OS will automatically use. Since Windows timezones can be defined only for one year, this means that the registry editing trick has to be repeated every year!
I'd love to hear someone correct me on this...