You are on page 1of 20

RF Signal Tracker

Initial Release: October 2009

Highlights:
 Map and record color coded RSSI as you travel.
 Play back recorded data.
 Sector coverage describing orientation and beamwidth.
new!
 One Cell Tracking to examine coverage of a single cell site.
new!
 Sound and Vibe notification on handover.
 Serving cell located through Google, OpenCellID, or the
users own custom site list.
 Export recorded data to .XML or .CSV files. Import older
recorded data for playback.
 App to SD card
The RF Signal Tracker is an engineering application for doing
impromptu hand-held *drive-test* with your Android phone.
You can drive or walk a particular area and see the RSSI
(received signal strength indication) for the phone as well as
the serving cell location, and save that data to a CSV or XML
file on your SD card. That saved data can be replayed, or you
can import previously saved data for replay as well. A new
feature added in version 2.2.0 is sectorized coverage bubbles.
As you travel a sectorized cone is draw out from the cell
describing the extent of the measured signal from that cell.
This effectively draws the cells orientation, beamwidth and
range. This feature ONLY works if the site location is know.

Some of the phone stats in the app are already displayed on the
phone (go to Settings -> About -> Status to see them). The
advantage with this app is you can then map those stats in a
meaningful way (at least signal strength). My goal in
developing this app was to learn how to interact with the
phones settings as well as notifications and maps. I still have a
good ways to go but I think this has turned out reasonably
well.

The data is saved in a SQLite database on the phone and can


be exported, as mentioned before, to a .CSV or .XML files
(only .CSV files can be imported). In addition to RSSI you also
get your Latitude, Longitude, logdate, and serving cell MCC,
MNC, LAC and CellID, latitude and longitude of the serving
cell and network technology used (EDGE, GPRS, UMTS). I
have found the serving cell location data from Google a little
spotty, at least for UMTS. You can try locking your phone to
EDGE for better results (go to Settings -> Wireless controls ->
Mobile networks, then check 'Use only 2G networks'). The
OpenCellID.org service is not much better, they actually have
a terribly small database of cell sites.

To address this deficiency in serving cell locations I have added


(in version 1.1.0) the ability to load your own cell list into
memory. If you have access to cell location data and can place
this into a .CSV text file, then you can upload the data to the
phone.

The CSV file must be of the form:

mcc,mnc,lac,ci,latitude,longitude
310,260,3601,981,48.9929,-122.7473
310,260,3601,982,48.99287,-122.74726
310,260,3601,983,48.99287,-122.74728
...
310,260,5509,7123,47.684035,-122.647912
310,260,5509,7211,47.550236,-122.583084

where the first line is the header, and each row after that is a
location record. The order of the data in each row must be:

MCC, MNC, LAC, CELL ID, LATITUDE, LONGITUDE

Take out any spaces, and place LAT/LON in decimal format.


Make sure you set "Locate service" to Local in the preferences
screen. All preferences are saved when you exit the preferences
screen.

Note: For CDMA, MCC is the Network Operator, MNC is


the System ID, LAC is the Network ID, and CellID is the
Base Station ID.

My biggest headache while building this app was the GPS and
the maps. Actually just the maps. I thought this would be the
easy part since virtually every app out there has something to
do with location services and mapping, but nooooo. Actually
getting the mapping info *was* easy, figuring out how to paint
a trail on said map was like pulling teeth. My problem was
painting those signal strength dots on the map. You see, I can
place markers on a map by using transparent layers and
painting whatever I want on that. Problem is, it seems like
everything out there is geared toward painting a fixed number
of markers on the overlay layer. I want to paint (potentially) an
infinite amount of marks -- who knows went the users will
stop? I thought I could just take a layer and just keep adding
marks to it and putting it back over the map, but it doesn't
work that way and finding out how it does work is like
searching for the Holy Grail.

This application can be found in the Android Marketplace


under "Tools".

Main Screen

PHONE
Number: This cell phone's number.
Phone Type: The device phone type (None or GSM)
Device Type: The unique device ID, for example, the IMEI for
GSM and the MEID for CDMA phones.
Sim Serial#: The serial number of the SIM, if applicable.
Software Version: The software version number for the device,
for example, the IMEI/SV for GSM phones.
Sub ID: The unique subscriber ID, for example, the IMSI for a
GSM phone.
Roaming: Returns YES if the device is considered roaming on
the current network, for GSM purposes.
International: Returns YES if the Sim Operator does not
match the Network Operator which will happen if
internationally roaming.
RSSI: Current signal strength the phone is receiving in dBm.
Bit Error Rate: The GSM bit error rate (0-7, 99) (or the CDMA
Ec/Io value in dB*10 depending on the technology).
EVDO (dBm, Ec/Io, SNR): As of this writing these parameter
do not appear to be implemented in the OS yet.

NETWORK
Operator: The alphabetic name of current registered operator.
Network State: Current network connection state
RF Network Type: The radio technology (network type)
currently in use on the device.
MCC/MNC: The mobile country code and mobile network code
used by the carrier.
LAC/Cell ID: Location area code and cell id (note - these are
not the carrier\'s actual ID numbers).
Data Activity: The current state of data traffic (IN, OUT,
NONE, INOUT).
Data State: The current data connection state (cellular).
Reselection Neighbors: The number of neighbors being
considered for selection as well as their individual RSSIs.
LOCATION
Lat: Your current latitude in DMS format.
Long: Your current longitude in DMS format.
Bearing: Returns the direction of travel in degrees East of true
North.
Speed: Returns the speed of the device over ground in
meters/second.
GPS Accuracy: Returns the accuracy of the fix in meters.
Site LAT: Latitude of the serving cell.
Site LONG: Longitude of the serving cell.
Dist to Cell: Distance to the serving cell. Note ~ If a site shows

distance of hundreds or thousands of kilometers (or miles)
away then the open source database you are 
using cannot identify the site. This is beyond the control of the
app. Best accuracy is attained by 
using a custom site location list uploaded to the phone from the
SD card.

WIFI
SSID: Returns the service set identifier (SSID) of the current
802.11 network.
BSSID: The basic service set identifier (BSSID) of the current
access point.
MAC: The phones MAC address.
Supplicant state: Return the detailed state of the supplicant's
negotiation with an access point
RSSI: Returns the received signal strength indicator of the
current 802.11 network.
Link Speed: Link speed in Mbps
Net ID: Each configured network has a unique small integer
ID, used to identify the network when 
performing operations on the supplicant. This method returns
the ID for the currently connected network.

Preferences

Toggle 2G/3G
This button will open the Settings activity allowing the user to
set the phone to use only 
the 2G network. This can save battery life and provide for
more accurate cell location (using the Google 
or OpenCellID location services) since the 2G GSM network is
older and more established.

Vibrate alert: 
The phone will vibrate every time it switches to a new serving
cell.

Sound alert: 
The phone will play the default notification sound every time it
switches to a new serving cell.

Show serving cell:


The application will attempt to identify the serving cell\'s
location. If 
selected, the serving cell will appear as a blue dot with a black
line 
connecting it to your current position.

Sector bubbles:
While in Live or Recorded Data a transparent blue coverage
bubble will be drawn around 
the point of furthest coverage. The coverage bubble will
expand if the phone holds on 
to a given site beyond the previous max coverage point.
Remember this is a rough coverage 
estimate for a site. Remember: coverage in a given direction is
determined by buildings, 
hills, foliage, and other clutter between the cell and mobile
unit.

Show RSSI:
This selection will leave a trail of signal strength dot markers
as you travel. 
The marker color will indicate your signal strength at that
point. Solid red (no signal) 
is about -113 dBm, yellow (moderate signal) about -84 dBm,
and green (strong signal) 
about -59 dBm. Leaving this box unchecked will display a
single dot (with color coding 
based on RSSI as well), but no trail will be left as you move.

Unit of measure:
Choose to display distances using the english or metric
(default) mode.

Screen color:
Choose either white text on a black background (Dark), black
text on a white background (Light), or white 
text on a blue background (Blue).

RSSI dot size:


Set the size of the rssi signal strength dot on the map.

Location service:
Set the location service used to determine your serving cell
location. Note ~ Google\'s location services 
(the default) is increasingly becoming hit-or-miss, and
OpenCellID.org still has a relatively small 
database of cell sites. If either of these options are not working
for you, and you have access 
to site location data, you can place that data in a CSV file and
load those records into 
the application.

To load site data:

1. Using your USB cable, plug the phone into your computer.

2. Slide down the notification bar at the top of the screen.

3. Select 'USB connected' under Ongoing events and mount the


card. The phone will appear as a new  
drive on your computer.

4. From your computer, copy the CSV file to the


"rfsignaldata" directory on the  SD card. Please note, earlier
versions of the app had users place their data in the root
directory. Most of these files were automatically moved after
the v1.2.4 upgrade, but if you have any data still in the root
you will need to move it.

5. Unmount the phone and load the data into memory by


selecting Menu -> dBase in this app.

NOTE: The site data must be saved in a CSV file where the


first line is a header. The 
data must be in the order: MCC, MNC, LAC, CELLID,
LATITUDE, LONGITUDE. Latitude and longitude are in 
decimal format (example: 47.512017,-122.608083) Be aware
that 6,000 records can take 
about 3-minutes to load and take up about 500kb of memory.
Once loaded you should not need to reload 
except to correct data or add another market.
Map mode: 
Choose either the standard Map view or Satellite overlay map
(just like in Google Maps).

GPS refresh: 
This is the time interval the phone\'s GPS will wait before
updating. 
Try to balance this with the update distance to minimize power
consumption. NOTE ~ 
regardless of the refresh-time setting, the update will only
occur if you move 
during that time period (see GPS update distance).

GPS update: 
This is the minimum distance you must travel before the GPS
will send an update. 
Try to balance this with the update time to minimize power
consumption. If you are 
taking measurements while in a car you may want to use the
longer update interval 
or else the GPS may run continuously. Remember, if you do
not move, the GPS will not 
update even after the minimum refresh time has elapsed.

GPS power: 
This sets the power consumption of the GPS while in use.
There is not 
a lot of documentation on what these levels mean beyond the
obvious. 
I leave it to the user to make that choice.

Export file format: 


Data collected through 'Log data points' or while in 'Record'
mode can be saved 
to either an XML or CSV file format. Files are saved to the
root directory of the SD card 
under the name 'export_yyMMDDHHmmss.xml' or
'export_yyMMDDHHmmss.csv', where 'yyMMDDHHmmss' 
is the date and time the file was saved. You can copy to your
computer by following 
these steps:

1. Using your USB cable, plug the phone into your computer.

2. Slide down the notification bar at the top of the screen.

3. Select 'USB connected' under Ongoing events and mount the


card.

4. At this point you should see the phone's SD card appear as a


new drive on your computer. 
Open it and you will see your exported file. Copy to your
computer.

5. Make sure you unmount the card before removing USB


cable.

Current battery level:


When the battery drops below the indicated level the app will
shut down. You will 
not be able to restart it until it is recharged above this level.

Map Neighbors:
If selected, during Live Data display neighbor sites are shown
while the mobile is reselecting. 
Neighbor sites are shown as gray squares with gray lines
running from the mobile's position to 
the site. This preference works best while the phone is in 2G
mode. NOTE ~ If you see a neighbor Cell ID 
of 65535 then this is a non-existent or unknown cell and it will
not be displayed.

Error messages:
Display minor error messages. For administrative use
primarily.

Recorded Data

Recorded data is displayed on a map showing your recorded


position, the serving site location (if 
site display is selected in preferences), and key data points. The
pane at the bottom of the screen 
shows RSSI, the time stamp of the record, the bearing of the
site (degrees east of north), the distance 
to the site in kilometers, and the LAC and Cell ID.

The (+) and (-) buttons control replay speed in .3 seconds


increments. 
The back arrow reverses playback, pause stop or restarts
playback, the forward button does what you think, 
and the status bar shows the record position in the playback.

Click Stats from the Menu options screen to bring up the basic
statistics. These stats  
include distance traveled over the course of the recording,
average, minimum and maximum handover distance, 
as well as the handover sequence. The handover sequence
shows the handover cell ID, the distance from 
that cell, and the timestamp at the point of handover.

To save this data to the SD card press the menu button and
click Save. The file will be named 
rfsignalstats_yyMMDDHHmmss.txt, where
'yyMMDDHHmmss' is the time stamp of the moment the file 
was saved.

Records

Site records
Total number of sites in database. This table contains the CGI
and LAT/LON of sites you load into the phone.

RSSI records
Total number of data points you have collected.

Select and load site records


This is where you load the data containing the site location
info. This data must be in a CSV file located 
in the root directory of the SD card. Data must be in the order:
MCC, MNC, LAC, CI, LATITUDE, LONGITUDE. 
Leave no spaces. LAT/LON must be in decimal format
(example: 47.512017,-122.608083).

Click to delete site records


Clear all site records from database.

Select and load RSSI data


Data that you export (in CSV format) can be reloaded, this is
were you do that. The file must have a header with 
data in the order:
_id,latitude,longitude,rssi,logdate,mcc,mnc,lac,cellid,site_lat,sit
e_lng,tech. Where _id is 
the record index (an integer), latitude and longitude is the user
position and multiplied by 1,000,000 
(example 47576047,-122168140). This is necessary to eliminate
rounding if a float or double is used. These numbers 
are converted after import. 'logdate' can be in any standard
format but try to have it to the second. site_lat
and site_lng are the site latitude and longitude of course. These
numbers must also be multiplied by 1,000,000. 
tech is the technology used and can be any string value.

Click to delete RSSI records


Clear all recorded RSSI tracking data from database.

Click to save recorded RSSI


Save recorded RSSI tracking data to a CSV or XML file
(format is determined in preferences). Data is saved 
with the name export_yyMMddHHmmss.csv where
yyMMddHHmmss is the time stamp of the moment the file 
was saved.

Playback recorded RSSI data


Playback data recorded earlier. Data can be paused, run
forward, or run backwards. Speed can also be increased 
or decreased in .3 second increments.

Menu Options

Record and Stop Rec: 


This will stop/start data recording (this can also be set in the
preferences screen).

Save Rec: 
This will export the data collected to the SD card in the format
you have selected in the preferences screen.

Records:
The datadase maintenance screen is where you will load site
data into the app from the SD card. 
You can also save or delete tracking data. It also provides a
count of the number of records 
in the two database tables used in the app.

Pref: 
This will take you to the preferences screen.

About: 
This will take you here.

One Cell Tracking: 


With 'One Cell Tracking' users can track the coverage of a
single cell site. With single cell tracking RSSI turns red 
if the serving cell is not the tracked cell. Standard colors show
otherwise.

Go to Menu > More > One Cell Tracking, and enter the Cell
ID of the cell you wish to track and press the 
'Start' button. Pressing 'Stop' cancels single cell tracking.

Version History

v2.2.3   Added condition to prevent display of bogus site data


such as Lat=0.0 and Lon=0.0 or a site more than 50 km from
mobile. Improved coverage radius calculation. Removed the
sector coverage offset option under preferences since this is no
longer needed. Also added a feature to break the connection
from a "sticky" cell connection. If the app holes a connection
for more than 2.5km from the initial handover point and the
power has increased by 6dBm then the phoneStateListener is
disconnected and restarted.
v2.2.2   After an extended re-introduction to trigonometry I
was able to develop a slightly better bearing method in my
code which, in turn, improves the sector coverage.

v2.2.1   Included ability to add a sector orientation offset (See


Preferences). This will patch the bug reported showing
sector azimuth being 90 degrees off while I investigate a
solution. The default offset is 0 deg.

v2.2.0   Changed coverage bubbles to sector bubbles. Each


cell\'s coverage is painted as you travel showing sector
orientation and distance. Altered the database to save data
state and data activity. Modified the Recorded Data screen
with a slightly updated interface using a SeekBar and
Stop/Play button. Data plays continuously on a loop. Fixed
map mode bug and other fun things.

v2.1.11  Fixed and tested the map display update (was not
properly refreshing while in Live Data). Added 'One Cell
Tracking' that lets user track coverage of a single cell site.
With single cell tracking RSSI turns red if the serving cell is
not the tracked cell.

v2.1.10  Fixed map update bug.

v2.1.9   Added option to select a location provider. User can


choose to have their location provided through 
GPS or the cellular network. Worked on several other tiny
bugs. I think the Google people tightened up SQLite because
doing things like not closing Cursors is a big no-no now.

v2.1.8   This update effects only Android 2.2 (Froyo) and


higher users. App can now be moved to the sd card.
v2.1.7   Fixed error message checkbox bug. If the app cannot
find a site\'s location it zeros out the LAT/LON.  
Since 0.0N, 0.0W is a point off east Africa, this was causing
much confusion with users, so I made a small 
fix to the display of site location info. Corrected some typos.

v2.1.6   Added check verify that SD card is present.

v2.1.5   Added option to export data to a Keyhole Markup


Language (KML) file format which can be 
imported into Google Earth. Users can now edit output
filenames. Moved the Live Data and Recorded 
Data buttons on the main screen to the bottom of the screen for
easier access.

v2.1.4   If using Local site location data and the site is not in the
user database of sites, 
then app will default to the Google location service. Fixed
Force Close bug caused by a wake lock being 
released incorrectly.

v2.1.3   Added neighbor site display to Live Data map. User


toggles display in preferences. This 
works best in 2G.

v2.1.2   Added check for international roaming. This checks if


the MCC of the Sim operator equals the 
MCC Network operator. A non-match would mean the phone
is roaming internationally. For now, this 
indicator has only been added to the main screen. Roaming
state is now one of the parameters saved to 
the database.

v2.1.1   Application will no longer shut down if it is below the


users minimum battery level setting, 
but on AC power. Also fixed a bug in the minimum battery
level fail-safe routine. Included battery 
level in phone stats on main screen.

v2.1.0   Remodeled preferences screen. Created a service to


allow for data collection in the background. 
This new service includes a minimum power level fail-safe to
keep from depleting the battery.

v2.0.1   Fixed the data import to accept data collected with the
Donut version of this app. Put in a couple 
safety dialogs when deleting site or rssi data. Using
NetworkOperator rather than subscriber id to identify the
MCC.

v2.0.0   This is the first version built for the Android Eclair OS.
It incorporates the new onSignalStrengthsChanged method in
Android v2.1 which includes Bit Error 
Rate (BER) and Ec/Io. Renamed the app to reflect this change
and called it RF Signal Tracker (Eclair). Pre 2.x 
versions will be known as RF Signal Tracker (Donut).
Corrected text sizing issue seen between myTouch and Nexus
One.  
Added user adjustable rssi signal strength dot sizes. Added
complete drive test display feature.

v1.2.9   Incorporating the new onSignalStrengthsChanged


method for Android v2.1 which includes Bit Error Rate (BER)
and Ec/Io. 
Corrected text sizing issue seen between myTouch and Nexus
One. Added user adjustable rssi signal strength dot sizes. This
version does not support CDMA and is intended for the
Android Donut OS.

v1.2.8   Button formatting fix for Droid phones. Sim SN


displays 'n/a' for non-GSM phones.

v1.2.7   Bug in the file delete and rename method fixed.


Corrected wording in Help section.

v1.2.6   Bumped the minimum Android version required to


v1.6 (Donut) after discovering the cdma libraries I was pulling 
do not exist in v1.5, and was crashing the app for those users
still on Donut.

v1.2.5   Added more graceful cdma error handling.

v1.2.4   Improved record count query to eliminate duplicates;


Fixed bug in menu Record button. 
Showing cellID on map. Moved data files to new subdirectory.
Users can delete or rename data files from app by 
'Long Pressing' a listed file. Adding initial parameters for
CDMA phones (experimental).

v1.2.3   WAKE_LOCK added to prevent app from sleeping


during use. Tweaked the Google location service and
discovered 
better results by using the 2G network only.

v1.2.2   Re-ordered selections in the preferences screen and


added english-metric distance display in pref as well. 
App will not exit if RF signal not found, it just won\'t be able to
ID cell towers.

v1.2.1   User can select map centering on current position or a


point between the users position 
and the site; File import verification; MNC fix for T-Mobile
CGIs; Coverage bubble 
around cell sites (see preferences screen); Basic statistics
through the menu on the Recorded Data screen.
v1.2.0   Recorded signal-level data playback.

v1.1.1   Graceful exit if user has no wireless or GPS service.

v1.1.0   Users can load custom site locations from their SD


cards for more accurate tracking.

v1.0.3   Converted displayed CellID from Hex format to


decimal format; User can choose location service 
used to determine the serving cell location; modified data
storage to take complete LAT/LON.

v1.0.2   Included network technology in database export.


Filtering out erroneous serving site data.

v1.0.1   Fixed database delete from menu. Adjusted default


preferences.

v1.0.0   Initial build

You might also like