Wednesday, February 24, 2010

iPhone GSM test mode

I google'd it when I needed to check some GSM radio network values when I'm home. It appeared out that iPhone has a "field test mode", which is enabled with *3001#12345#* code. You just need to type this and hit "Call". I wanted to save the number as a contact to "call" later, but when I call that contact it actually places a real GSM call for that number which is leading me to an announce for the failing call :)

When you do this, you reach to the main "Field Test" screen.

Notice the signal strength indication on top left of the screen. The unit for this number is dB as summarized here.
In the upper left hand corner, the 5 bars are replaced with a decimal indicating the power ratio in decibels (dB) of the measured power referenced to one milliwatt. These are measured on the negative side of zero so of course the closer you are towards a positive number, the stronger the ratio is and likewise a better chance of good service. Anything above a -85 is shows as 5 bars. Anything below -105 is zero bars and loss of connection usually occurs.

Here, I find "MM Info" and "GSM Cell Environment" items interesting.With the first one, I can see the serving network and LAC (Location Area Code).

"GSM Cell Environment" has details about the cells the phone is talking to. I could not find the serving cell ID with a quick check.

And it shows details of 6 possible neighboring cells.

The thing is when you're using 3G, it is not working properly. You can see the signal strength at the top left, but all you see is "Unknown" for all the fields.

I still could not find what I'm looking for, at iPhone's "field test" menu; but sure it looks useful and I'll dig it more :)

BTW, these images are taken on firmware 3.1.3 (7E18)

Sunday, February 21, 2010

Having custom maps with labelled markers

I checked it first when I thought about having a map with some data/markers on that to provide some information. I checked Google Maps and Google Maps API for that and saw that it is really easy to have a map with markers on it but having some text on the markers is not in the standart API.

Here it is talking about having a LabeledMarker, with an extension from Mike Purvis. I took one of his examples and modified to have a basic mechanism to load a datafile and show it on the map. The original example was showing data from Google docs retrieved in JSON format. As I wanted to keep data locally in a format I know, I modified his example a bit to load data from a file provided as a parameter to the webpage.

Below is an example of that, with for the list of spots I might like to see. I just passed SpotsToSee as data file to the page.



Or, here it is shown with another data file showing some operators I've been working with.



Saturday, February 20, 2010

converting Cell ID to coordinates

You know you do not need to have a GPS capable phone in order to enjoy location based capabilities on mobile phones, thanks to Google. Since 2007, Google mobile maps can plot your location without need of GPS with some reasonable precision (sure it is using GPS if it is available). That's how, you can check your location and what is around using your mobile phone. Google is being able to find your location using its internal database of cellular antenna IDs and their locations. Google maps application on the mobile set can query this database as the it knows the ID of the cellular antenna it is talking to.

I'm not aware if that cellular tower to coordinate database is available to developers, but here basics are examplified with a code for Windows mobile platform. There are examples around in C# or PHP around, possibly based on the original reverse engineering work.

These examples are considered to work on the mobile terminal as you have the required data on the terminal. If you have access to the GSM network, you can get this data using MAP messages. Yes, you do not need Google's database if you have access to the GSM network as it means you're possibly the GSM operator's itself :)

Below is a PHP code, a mix of C# and PHP examples; letting you to query coordinates of a LAC/CID pair for any country/network. You can play with it or download the code. Though MCC/MNC is sent as parameters, it looks like the result does not depend on them. This is weird as LAC/CID pair is unique only within a certain GSM operator. I have to be making a mistake which I could not figure out :) Still, I used LAC/CID pairs for two different countries without MCC/MNC, and Google still could point the correct spot.



Related post: Drawing GSM cells on Google Maps