Fleet tracking with AT&T location API

Hacks PHP Web Design

When I got approached by a client to deliver GPS tracking solution for an upcoming “Cloudy 2 With A Chance of Meatballs” foodimobile tour, I must admit I wasn’t sure where to begin. Building a website with map showing current location of the tour truck was something I haven’t done before and with due date looming I had to carefully think before making any decisions.

One of the first things I’ve thought of was a GPS device itself. What should it be, and how will I communicate with it?

Cloudy With a Chance of Meatballs 2

Cloudy With a Chance of Meatballs 2 tour website screenshot

Thinking about GPS you first think of big guys – TomTom, Garmin and such.

Garmin Telematics Platform

Garmin Telematics Platform

Garmin’s Telematics Platform promises a lot, especially when your eye meets “so-developer-friendly” word API, but in reality does not go any further sending you to the network of their partners with websites not featuring any mention of API access to the raw location of the device.

Garmin Telematics Platform Partners

Garmin Telematics Platform Partners page

Not to mention pricing structure, which in my case was probably the biggest concern, since my project would last only 2 months while trucks are on the US tour. I realized that just like it is with big companies not caring about small clients, my chances setting up something reliable here are pretty bleak.

Looking at numerous websites offering fleet tracking solutions from the reseller level, I was primarily interested in obtaining access to the API in order to poll device and receive most current location information.

Not so many companies were looking to open it up and those who did requested device installation procedure, which I did not have time for looking for something quite portable to deal with.

In hopes of finding something portable and maybe not-so-white-market I turned my search to Amazon and ebay, discovering a ton of China made GPS portable trackers, none of which have worked.

Amazon Real Time Portable Mini GMS/GPS/GPRS Tracker

Amazon Real Time Portable Mini GMS/GPS/GPRS Tracker

All of these use GPS satellite signal to locate themselves and bearing a GSM/GPRS modem inside using the SIM card with active cellular service on it responding back to a certain set of commands you can send via text messages. In reality, I bought 4 units from two different merchants on Amazon, returning all of them because I was not able to make any work. The closest I have come the making one work was actually getting a response back from the device with a text “GPS:NO”. No matter where and how I was placing these receivers they were not able to locate themselves.

To make these work I had to purchase AT&T’s prepaid SIM cards along with the cheapest GSM phones. This fact helped tremendously in finding the best solution.

Searching for possible solutions on how AT&T can help me in location reporting I stumbled upon their Developers Portal with examples of the code for TL (terminal location) functionality. This was exactly what I was looking for in my project.

Accurate down to a few blocks, based on the network triangulation, location was returned via REST HTTP request with oAuth 2.0 authentication. Having spend a few days playing with the sample code, I created a simple php script which polls phones located on the trucks on the days they make stops in the cities along the route. Other helpful scripts help re-draw the map on the main page and re-write the HTML page with Google Map snippet showing exact vehicle location in the city.

Exact location of the vehicle

Exact location of the vehicle screen on the website

Sadly though, I’ve recently learned that AT&T had shut down the service, and no longer offers location tracking feature via API.

2 Comments

Leave a Reply to Wasi Abbas Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.