This is a small Python web application (using the Tornado framework) that receives trace messages from an OpenXC-enabled and network-connected device and them out to disk, split by hour. It supports visualizing a single vehicle's data in real-time using HighCharts and Google Maps.
This application is intended as a proof-of-concept and is lacking in quite a few areas - please do take this as a starting point for a web-enabled OpenXC application, but don't expect this to be production-ready out of the box!
First, I recommend installing pip
, the Python package manager (if you don't
have it already):
$ [sudo] easy_install pip
Next, clone this repository and install the Python requirements:
$ git clone https://github.com/openxc/web-logging-example.git
$ cd web-logging-example
$ pip install -r pip-requirements.txt
While not required, I also recommend installing Fabric - it's a command-line tool that I use to create shortcuts for some common tasks (running the development server, resetting the database, etc.).
$ pip install fabric
Without Fabric:
$ python recorder.py
Using Fabric:
$ fab runserver
You can send test data with a Fabric command:
$ fab send_test_data:path_to_trace.json
All API calls accept JSON. There is no authentication (seriously, don't try and run this example app in production!).
The format of the individual log messages should match the output format from an OpenXC vehicle interface.
POST /records
{'records': [
{'timestamp': 1332975697.078000, 'name': 'steering_wheel_angle',
'value': 42.0},
{'timestamp': 1332975698.078000, 'name': 'steering_wheel_angle',
'value': 38.0}
]}
Please see our Contribution Documents.
Copyright (c) 2013 Ford Motor Company Licensed under the BSD license.