The original version of the OBD ‘wheres Neil?’ page was created as a Perl script generating HTML/Javascript on the fly, this was made as a proof of concept to get something on the web. It does leave a lot to be desired, though. For a start, in its current form it will only display the journeys from the last day for which there is data. This is adequate for answering the question “Where’s Neil?”, when live data is arriving that will be the latest, but it doesn’t really allow access to the full power of the collected data. There are some interesting things that might be worth trying to display:
- Historic data for a particular piece of road
- Locations of high-revs or high-speeds
- Locations of sudden acceleration and braking
- Maps of engine load/RPM and throttle position
- Locations of good and bad fuel economy
And, I’m sure, there will be others.
To do this I want to bring in an Ajax interface to dynamically get data from the server. Fortunately (and one of the major advantages to this approach) this simplifies the code rather than complicates it. The currently auto-generated HTML/Javascript can be replaced with a static page which requests data using an Ajax request. Then the server need only serve an appropriate JSON object for the required data. This removes the need for the current mishmash of Perl, Javascript and HTML.