yashsingh1/xdaforums huggingface dataset:
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
You can only (potentially) get lat / long from a cell id, but not any satellite data. So the information provided by QuickGPS and the information provided by the app (and adding lat/long to it) is very different. What the app could possibly help with is to tell the GPS application (Garmin Mobile XT in my case) approximately where you are, thus (maybe) reducing the TTF because your 'last known location' is very close to where you actually are. I need to research this though - I briefly looked at the Garmin Mobile XT SDK yesterday and didn't find a place to 'set' the current position. Maybe this can be done using the GPS Intermediate Driver.

The cab file creates a shortcut to the service in \\Windows\Startup. I tested this on my device and the service does start up when I soft reset. Remember, the configuration utility does not need to be running for web updates to happen - everything is handled by the service. What happens when you soft reset and then run the configuration utility - does the config utility say that the service is started without you having started it? If so, then it is working correctly.

I had an idea yesterday and already started creating a SQL Server Compact 3.5 database which will store all unique cells that you have visited. Then, I thought we have two options:

Use ADO.NET Synchronization Services for devices (it's currently in CTP1) to sync this database to a desktop application. The desktop application can then be used to call Google's 'hidden' web service for each new cell found and attach lat / longs and then sync back to the device. The lat / longs can be refreshed for all cells since operators can theoretically change cellids or new coordinates for cells could come out. In a java sample that I saw, one had to specify the model of your device, but I don't see that in the code that you posted. If the model is required, maybe we can get a list of supported devices and randomly choose which model is used for each web request so as to not raise suspicion at Google :D

The second option is to not use a desktop application at all, so everything would happen on the phone, but the advantage of the desktop application is to maybe generate a kml file for a cell to view in Google Earth.

What I want to do for myself personally, is (assuming we have a database of cellid to lat / longs), create a Today plugin with a button which says "Show me the map of my approximate location". The plugin would then look up the current cellid in the database, get the approximate coordinates and launch Garmin Mobile XT in map mode focused at that point - no data connection required.
[Tilt, TyTN II, MDA Vario III Themes and Apps] jmat:
I'm not going to quote, since this is a slow thread. ;-)

The 0.2 version is working great for me -- it has been reliably posting cell information to my server for the past two days. The receiving script hits the Google Maps interface when it needs to get lat/long information, but I'm finding 50-70% of the cells don't have that information. I'm not really sure how Google's doing it -- but if I had to guess, they're grabbing neighbor cell information from the phone and querying on those as well.

In order to get my own lat/long in there, I've been carrying around my AMOD AGL3080 GPS logger -- it logs lat/long every second. I then upload that data file to my server on occasion, and run a quick script that syncs the cell data to the GPS data based on the time.

It's accurate enough for my needs. :)

I've already written an interface that lets it post to Twitter/Facebook when my location changes by more than 3 miles (okay, it's a crappy shell script, but it works for me).

The best part is my phone's battery doesn't even notice the program running. Even better is it doesn't pop up randomly like the Comm Manager and that stupid "FindMe" facebook program do.

My concern with adding a backend database and all the other stuff is battery life. I'm lucky to get 12-13 hours as is, and I can't afford to burn anymore battery. That's why I'm not using the GPS receiver itself to do this. If you think you can add that stuff without compromising battery life, then I'm all for it. :D
[Tilt, TyTN II, MDA Vario III Themes and Apps] khaytsus:
Took me a while to figure out just how to use it, but I put together three scripts for my LAMP server, in case anyone is interested.. Probably duplicated some work, but anywho...

cellloc.cgi: Collects data, logs it in a flat text file with the current time

cellloc.php: Takes mmc/mnc/lac/cellid and redirects to Google Maps

myloc.cgi: Reads the log file, gives the stampstamp and a link to cellloc.php

In case it doesn't make sense, the phone uploads to cellloc.cgi. Someone goes to myloc.cgi and it tells them the last data timestamp and gives 'em a link. When they click the link, it passes the data into cellloc.php and immediately then redirects to google.com with the lat/long.

ie: I have no idea how to use the Google API so I hacked stuff together, but for a 45m trial and test period, not bad. It works. :)

Thanks for the program and the links to the PHP code folks. And I'll probably improve on the stuff, but let me know if anyone is interested.
[Tilt, TyTN II, MDA Vario III Themes and Apps] seelion:
which url i must type in?
[Tilt, TyTN II, MDA Vario III Themes and Apps] gai-jin:
It looks like you're well on your way, but I thought I'd point out another option. I run Navizon for the points collection/rewards, but I was playing with their website a couple of nights ago and found, in the buddies section of the page, that it gives you a way to publish your location out to a url at any given time. It has links to google maps and such, but also offers a very simple xml file with your longitude and latitude in it. Perhaps grabbing the lat/long from that file would be sufficient?
[Tilt, TyTN II, MDA Vario III Themes and Apps] khaytsus:
Sounds interesting, but the cool thing about this program is that it pushes the data out every time your CID changes, not just when prompted, and it does it completely in the background, and as far as I can tell, uses very little battery and creates zero disruption.

I haven't tried Navizon, so not claiming it uses lots of battery, disruptive, etc.

I've worked on my scripts a little more, I can limit the shown occurrences, days shown, as well as limit to a date range of data shown. Has basic use of the Google API to draw a fairly clean map right on the page of the most current location or any of the shown occurrences if someone clicks the links, etc, with some basic html forms using a mix of php and perl.

I've *considered* making it able to use anonymous registration and get a unique ID which anyone can use to send and view their data, assuming they maintain their unique ID. If anyone is interested in that let me know and I could probably do it pretty easy.
[Tilt, TyTN II, MDA Vario III Themes and Apps] gai-jin:
I only use navizon with the GPS and Wifi on, so as to collect points, so I'm not sure how battery life is when used only the cell phone. Obviously, with all the radios running, the battery runs out pretty quickly.
[Tilt, TyTN II, MDA Vario III Themes and Apps] khaytsus:
I imagine it does.. I've measured the GPS alone at 50-100mAh, not sure why it varies so much. So when I'm outdoors with GPS I have it running, screen at high, and probably running some intensive program (PathAway, etc), which results in 300-350mA draw. Yikes.

I was doing this in the back yard one day with online email, IM, GPS, PathAway, on HSDPA and it was dropping 2-3% a minute and was VERY warm.
[Tilt, TyTN II, MDA Vario III Themes and Apps] Termiter:
Thanks to newb5000 for this aplication!

I did small Locate Server based on PHP and MySQL for my friends. We are posting cellid to SQL and we can see where are we (and where are was) on our personal page via Google Maps API.

Very small data traffic, none battery drain... :c)
[Tilt, TyTN II, MDA Vario III Themes and Apps] freekquency:
Yea your going to get lots of redudent tower ids, lots of time your call is going on on two cell towers at once. (if everything is working correctly)

Then when your signal is stronger on one it switches you <

I have access to overlays for new england. With about every cell location on them. ( you cant see the map thru the tags- theres that many).

Anything anyone could use?
[Tilt, TyTN II, MDA Vario III Themes and Apps] acedish:
Windows Mobile 6 Compatible?

I installed the Cab file with no errors on WM6 but when I run the program from the start menu I receive an error in the cidconfig.exe? should it work on WM6?
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
Yes, it should work on Windows Mobile 5 or 6 as long as you have the .NET Compact Framework 2.0 or later installed. What is the error message that you are getting?
[Tilt, TyTN II, MDA Vario III Themes and Apps] acedish:
Hmm I think I have Compact Framework 2.0 installed, Is there a way I can verify? i did uninstall and reinstall wit the same errors.

I receive the error message:

An unexpected error has occurred in cidconfig.exe. Select Quit and then restart blah blah blah...

If I select details

NotSupportedException

at Microsoft.AGL.Common,MISC.HandleAr() at System.Windows.Forms.InitInstance()

and it goes on......
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
Well the .NET Compact Framework 2.0 should come preinstalled with all WM6 ROMs and even custom ROMs (the chefs should bake in either 2.0 or 3.5).

You can maybe check if it is installed if you examine the following registry keys, but I do not think that you need to go through this process since the exception being thrown is a framework exception.

If you click on details, the error message can be quite large (it's the stack trace that is large, which is the sum of all of the lines beginning with 'at '). It will be useful to see the full stack trace if you're willing to type it out here. I'm interested in what is not supported (indicated by NotSupportedException).

I thought that it has something to do with the RIL layer, but cidconfig.exe does not make any RIL calls.

Only thing I can suggest at the moment is to try to soft reset, but I might be able to help if you can show the full error message.

Have you tried to run the app on the first page? That was just a test app to read the current cellid, so it is not useful, but I'm interested if you get a similar error.
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
Another question: Are you using Windows Mobile 6 Professional? If you are using Windows Mobile 6 Standard, that may very well be the cause of this error, from the research that I just conducted.

Without the stack trace, this is a shot in the dark, but it appears that Windows Mobile 6 Standard, which is installed on SmartPhones does not support buttons, which the app uses. Windows Mobile 6 Professional is installed on Pocket PCs. I'm assuming that you're not using a TyTN II / Tilt. Does your phone come with a touch screen / stylus?
[Tilt, TyTN II, MDA Vario III Themes and Apps] acedish:
I tried the first app and received the same error, I am using a Samsung BlackJack 2, no touchscreen or stylus.
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
Right, so you are running Windows Mobile 6 Standard.

I'm going to have to see what can be done to make this work on Standard. I'm thinking two different versions of the configuration utility - one for Standard and one for Professional. The service has no user interface, so that should work on both as is. It's not much work - the configuration utility is small, but the user interface will need to be different.

I'll be testing out the app on a Windows Mobile 6 Standard emulator and will get back to you.
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
It was more work than I thought, but I got there, eventually :)

This version is functionally identical to the version on the 3rd page (cellidupdater_0.2.cab), except that the user interface is designed to work on Windows Mobile Standard (i.e. Smart Phones).

It will work on Windows Mobile Professional (i.e. Pocket PCs) as well, but there is no need to download this version if you are already using the one on the 3rd page.

There are two issues with this cab (acedish or any other Smart Phone users, please will you provide feedback).

Firstly, it is not digitally signed. Edit: I actually typed out a lengthy post on why this can be a problem, depending on device configuration, but decided to omit this since it may not be a major problem after all. This article provides a lot of detail - very good read, I must say.

Edit: Second issue Fixed. Pressing the 1 dialpad character continuously will now cycle through the appropriate characters. Additionally, I found out that if you press and hold the # key, you are offered a choice of even more symbols (which doesn't seem to work on the emulator). So typing in the url on a Smart Phone should be no problem at all.

I decided to include some screenshots this time round, so here they are (the Smart Phone / Windows Mobile Standard version):
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
THANKS A LOT

Could you also share the source code?
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
Problems with RIL

Hi everybody,

Just a quick question.. I was trying to make my own application based on RIL to get CellID and LAC..

What happens is that I keep getting 10-digits number value for dwLocationAreaCode, which does not seem to be true..

Any idead why that could be happening?
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
Well, I have tried the application and seems that I've finally run into some problems..

I cannot explain that, but my mobile is returning a different CellID every second.. I mean, it never repeats.. I can't probably beliebe that it is switching from one tower to another every second.

Besides, I am getting the same LAC as in the application i tried to do myself.. (10 digits, while it supposed to be up to 7 digits)

In addiition I am getting wrong MCC and MNC...

Anybody experienced something similar?

I am using Samsung-i320.

Do you think it might be a phone or Mobile operator problem?
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
Dale Lane's posted source code. That's pretty much all you need to use the RIL layer, which is what I'm using.

That's interesting. My lac is 5 digits, cellid is 5 digits, mnc is 2 digits and mcc is 3 digits.

It could be a phone / operator problem, but I would look elsewhere first:

Since you've got it running, what is your value of dwParams that you get back? (It's the second member of the RILCELLTOWERINFO structure).

dwParams, according to the documentation, should be one of or a combination of RILCELLTOWERINFO parameter constants. It could be that you're getting an invalid LAC back.
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
dwParams = 28
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
I think you just hit the nail on the head. This could explain why jmat (and possibly others) have been receiving "extra" cellids.

for dwParams == 28

(dwParams & RIL_PARAM_CTI_CELLID) != 0	[B]true[/B]
(dwParams & RIL_PARAM_CTI_LOCATIONAREACODE) != 0	[B]true[/B]
(dwParams & RIL_PARAM_CTI_MOBILECOUNTRYCODE) != 0	[B]false[/B]
(dwParams & RIL_PARAM_CTI_MOBILENETWORKCODE) != 0	[B]false[/B]

which means that your CELLID and LAC are valid, whereas your MCC & MNC are invalid. This is only a very initial guess though. I need to investigate this further.

The values seem to be:

const uint RIL_PARAM_CTI_MOBILECOUNTRYCODE = 0x00000001;
const uint RIL_PARAM_CTI_MOBILENETWORKCODE = 0x00000002;
const uint RIL_PARAM_CTI_LOCATIONAREACODE = 0x00000004;
const uint RIL_PARAM_CTI_CELLID = 0x00000008;
const uint RIL_PARAM_CTI_BASESTATIONID = 0x00000010;
const uint RIL_PARAM_CTI_BROADCASTCONTROLCHANNEL = 0x00000020;
const uint RIL_PARAM_CTI_RXLEVEL = 0x00000040;
const uint RIL_PARAM_CTI_RXLEVELFULL = 0x00000080;
const uint RIL_PARAM_CTI_RXLEVELSUB = 0x00000100;
const uint RIL_PARAM_CTI_RXQUALITY = 0x00000200;
const uint RIL_PARAM_CTI_RXQUALITYFULL = 0x00000400;
const uint RIL_PARAM_CTI_RXQUALITYSUB = 0x00000800;
const uint RIL_PARAM_CTI_IDLETIMESLOT = 0x00001000;
const uint RIL_PARAM_CTI_TIMINGADVANCE = 0x00002000;
const uint RIL_PARAM_CTI_GPRSCELLID = 0x00004000;
const uint RIL_PARAM_CTI_GPRSBASESTATIONID = 0x00008000;
const uint RIL_PARAM_CTI_NUMBCCH = 0x00010000;
const uint RIL_PARAM_CTI_NMR = 0x00020000;
const uint RIL_PARAM_CTI_BCCH = 0x00040000;
const uint RIL_PARAM_CTI_ALL = 0x0007ffff;

This is going to complicate things...

Edit:

I just tested this on my phone by modifying the tester app on the first page (it now works on Smart Phones as well, plus it will indicate whether each parameter is valid - the device is polled every 5 seconds). As before, this one is a .zip, not a .cab, since this is just a test app.

All four of the parameters which I receive are valid, but I presume yours won't be.

The question is, whether your MCC & MNC are always invalid, or just some times. And what causes them to be invalid?

This will affect the main app in that the web request should only be made if all four parameters are valid.
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
Just tried it and the results are still the same.

My LAC is constant and valid

My CellID is constantly changing (even if I move my phone just 5 cms hehehe)

MCC & MNC are constant and invalid...

I assume that my provider could change something as I was using a Navizon application previosly and it was working perfect at my current location, while today it stopped locating with my phone as well..

I am heading home from the office and will try to see if RIL works ok at other locations on my way and a bit later with check it with other operator sim card. Hope, we'll get it work!

Thanks
[Tilt, TyTN II, MDA Vario III Themes and Apps] jmat:
What I'm doing with this

cell id program uploads cell tower/etc data to web server

webserver looks it up in mysql database, if i already have this one recorded, it just adds an entry to a tracking table and exits; if not.. continues.

using the mnc, mcc, lac, and cid, it queries google to get the latitude/longitude of the tower; if google comes back with valid data... continue.

using the free API at www.ibegin.com (free for less than 100 queries a day) server sends latitude/longitude into the reverse geodecoder, getting the closest intersection; saves all of this data into the database lookup table

ibegin.com's geocoder is rather accurate. In fact, it found the cell tower near my home to the EXACT address posted on the sign out front. :)

Another script runs every few minutes and looks at the location, if it's changed (zipcode), it updates my Twitter location automatically using the Twitter API (update_location attribute). Mostly pointless, but it's just a geek toy.

I have a lot of other things I use it for, but I'm not posting 'em here. :)
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
Ok, looks totally insane.. but the problem keeps to be the same..

dwSize = 2147500037
dwParams = 28
dwMobileCountryCode = 29
dwMobileNetworkCode = 41
dwLocationAreaCode = 4026596920
dwCellID = 739638680
dwBaseStationID = 2496201084
dwBroadcastControlChannel = 23
dwRxLevelFull = 277728
dwRxLevelSub = 67877472
dwRxQuality = 4294953108
dwRxQualityFull = 1
dwRxQualitySub = 2496202248
dwIdleTimeSlot = 33524352
dwTimingAdvance = 277728
dwGPRSCellID = 67877472
dwGPRSBaseStationID = 1
dwNumBCCH = 33524352

you can see that it is total rubish...

if you look attentively some of the variables turn out to have the same value (dwRxLevelFull & dwTimingAdvance; dwRxLevelSub & dwGPRSCellID ; dwRxQualityFull & dwGPRSBaseStationID; dwIdleTimeSlot & dwNumBCCH ) which makes me think there's something totally wrong with RILCELLTOWERINFO structure in my version of ril.dll...

Strangely after severl reboots I made Navizon application work on my mobile and it gives proper coordinates in the result.. Unfortunately, they give no way to see the CellID and LAC information (as it is being encrypted before 'querying the navizon API). But at least that means there's a way to overcome this problem...

any ideas on that?
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
jmat: Glad you're finding the app useful. I've got the logging to local DB complete (no synchronization yet, though). I'm just testing it out myself before I release. Shouldn't sacrifice any battery life since the cells are logged at the interval as your web updates, and it's just an extra disk read / write.

dzalbo: Are you using Dale Lane's code or your own?

The first thing that worries me about the structure you posted is the dwSize - it's actually supposed to be cbSize. There is no way that the structure size is 2147500037. My cbSize is 140. An incorrect structure would definitely mess up all the other information.

According to the docs the structure looks like this in Windows Mobile 6 (in C++):

typedef struct {
DWORD cbSize;
DWORD dwParams;
DWORD dwMobileCountryCode;
DWORD dwMobileNetworkCode;
DWORD dwLocationAreaCode;
DWORD dwCellID;
DWORD dwBaseStationID;
DWORD dwBroadcastControlChannel;
DWORD dwRxLevel;
DWORD dwRxLevelFull;
DWORD dwRxLevelSub;
DWORD dwRxQuality;
DWORD dwRxQualityFull;
DWORD dwRxQualitySub;
DWORD dwIdleTimeSlot;
DWORD dwTimingAdvance;
DWORD dwGPRSCellID;
DWORD dwGPRSBaseStationID;
DWORD dwNumBCCH;
BYTE rgbBCCH[MAXLENGTH_BCCH];
BYTE rgbNMR[MAXLENGTH_NMR];
} RILCELLTOWERINFO;

However, the one that I'm using for the app is (in C#):

public class RILCELLTOWERINFO
{
public uint cbSize;
public uint dwParams;
public uint dwMobileCountryCode;
public uint dwMobileNetworkCode;
public uint dwLocationAreaCode;
public uint dwCellID;
public uint dwBaseStationID;
public uint dwBroadcastControlChannel;
public uint dwRxLevel;
public uint dwRxLevelFull;
public uint dwRxLevelSub;
public uint dwRxQuality;
public uint dwRxQualityFull;
public uint dwRxQualitySub;
public uint dwIdleTimeSlot;
public uint dwTimingAdvance;
public uint dwGPRSCellID;
public uint dwGPRSBaseStationID;
public uint dwNumBCCH;
}

rgbBCCH and rgbNMR are missing, but it still works just fine. The RIL layer probably detects the structure size that you send in and populates the relevant information into your structure. This is a long shot, but maybe you should try add rgbBCCH and rgbNMR, and see what happens? Edit: Removed another suggestion because it wouldn't have helped.

My result looks like this (with valid numbers instead of xxxxx :) ):

cbSize	140
dwBaseStationID	0
dwBroadcastControlChannel	0
dwCellID	xxxxx
dwGPRSBaseStationID	0
dwGPRSCellID	0
dwIdleTimeSlot	0
dwLocationAreaCode	xxxxx
dwMobileCountryCode	xxx
dwMobileNetworkCode	xx
dwNumBCCH	0
dwParams	15
dwRxLevel	0
dwRxLevelFull	0
dwRxLevelSub	0
dwRxQuality	0
dwRxQualityFull	0
dwRxQualitySub	0
dwTimingAdvance	0

One last thing you can maybe post is the values of the RILRESULTCALLBACK parameters.

Mine are:

dwCode 1
hrCmdID will always be different since it's a pointer
lpData will always be different since it's a pointer
cbData 140
dwParam 0
[Tilt, TyTN II, MDA Vario III Themes and Apps] dzalbo:
dwCode 3
hrCmdID will always be different since it's a pointer
lpData will always be different since it's a pointer
cbData 4
dwParam 0

and yeah, I am using Dale Lane's code
[Tilt, TyTN II, MDA Vario III Themes and Apps] newb5000:
We've almost solved this.

dwCode == 3 means that an error is occurring during the API call.

cbData == 4 means that the size of lpData is 4 bytes, i.e. an int. So trying to marshal 4 byte data into RILCELLTOWERINFO would obviously produce incorrect results.

lpData should contain the error code.

I need to figure out how to map the error codes, but while that's happening,

what is the value of:

Marshal.ReadIntPtr(lpData).ToInt32()

If I had to guess, it might have something to do with the app not being signed and it not having permissions to get the cell tower info.

I cannot reproduce this on my device - even if I put my phone in flight mode, I get dwCode == 1 (success), with the cell data prior to the flight mode switch, which is why I need your input.

Edit:

This might help as well:

Marshal.ThrowExceptionForHR(Marshal.ReadIntPtr(lpData).ToInt32())