Get cell id & location area code from bluetooth phone

The following will work in OSX will probably work in a similar form in linux.
Go to bluetooth preferences and select your phone and click Edit Serial Ports, add a new RS232 serial port, if there isnt one listed, I called mine Nokia. It can then be found under /dev/cu.Nokia.

Run in one terminal:

echo -e “at+creg=2\r\n” > /dev/cu.Nokia # sends at command to enable retrieval of cell id, fails on a lot of phones I’ve tried, works on the nokia n73 though.

while [[ 0 ]];
do
echo -e “at+creg?\r\n” > /dev/cu.Nokia; # causes the phone to output its cellid & location area code
sleep 1; # you dont want to be sending data all the time 🙂
done

In another terminal do:
dd if=/dev/Nokia bs=1 # this will retrieve the cell ids found
or to log the cell towers to a file,
dd if=/dev/Nokia of= ~/cells bs=1 # this will retrieve the cell ids found
then:
cat ~/cells | uniq > ~/cell-list # gets rid of duplicate entries of cell towers

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: