Teensy Code for GSM Geolocation with SIM900 module

Status
Not open for further replies.
Hi all,

Well, I've been working on the Halifax Bike Trailer Sharing Project, which is a public/private partnership to deploy 3 prototype "smart" bicycle trailers throughout the city of Halifax this summer. The trailers are going to be equipped with a Teensy 3.1 controlling a locking mechanism, membrane key pad, and (the subject of this post), a SIM 900 GSM module from iTead Studios.

Anyways, part of the original concept for this project was to forego using a GPS unit by utilizing GSM triangulation to track the location of the trailers in the fleet.

After reading several guides on roughly how to do this, and spending about 20 hours programming, I have come up with a solution that I think will be viable.

It works in the following steps:
  1. SIM900 Modem Powered on and Connected to GSM network
  2. SIM900 gathers signal information of nearby cell towers
  3. URL string is created out of all the GSM cell signal variables gathered
  4. HTTP $GET request is sent to my server, with URL containing the variables
  5. php script runs on server, page loads and is read by SIM900

right now, the php script simply reads the variables and echos them to the html, but in the end I will make the script write to and query a mySQL database (on the same server) to log the cell network info, and to see if the user PIN entered to unlock the bike trailer is valid.

Here's an sample of the html that my SIM900 is downloading from the website right now (notice all the cell tower variables in the URL):
http://bikewrights.com/testPHP.php?...0&mcCo3=302&mnCo3=720&sigStren3=-65&rxLev3=24

The Geolocalization part can then be accomplished using any number of cell geolocalization APIs including:

http://www.opencellid.org/
https://developers.google.com/maps/documentation/business/geolocation/

Anyways, the .ino file and code is attached! If you have a SIM900 and a Teensy 3.1, just flash it to the Teensy and you'll be sending my website the cell tower data off your module within minutes (assuming you hook up the wire like I did!) Tested and verified!

View attachment Friggin_with_GSM_20140402.ino

View attachment testPHP.txt

PS: Here are some pictures of the first prototype trailer:

IMG_0873.jpgIMG_0874.jpg
 
Last edited:
Status
Not open for further replies.
Back
Top