(the -> means estimate based on gps data from the bus, * means scheduled time)
A while a go TriMet opened up several APIs to let people access its Transit Tracker data. Since the bus on our route is rarely on time its always nice to know if you can relax and eat your breakfast or if you have to bolt out the door. It seemed like having access to the arrival times without either a full computer or starring at the phone would be a good thing.
The apis are documented at http://developer.trimet.org/ Its basically a pile of XML that you ask for with a url like this
you could also call the same url like this.
Some where in the resulting pile is the data are a couple of arrival times.
<arrival block="7514" departed="true" dir="1" estimated="1346270336000" fullSign="75 Chavez Blvd to Milwaukie" piece="1" route="75" scheduled="1346270214000"shortSign="75 To Milwaukie" status="estimated" locid="7536" detour="true">
Now thats not exactly a pretty thing but its parse-able. Fortunately for us we don’t have to deal with it yet. Because a fellow portlander Dan Colish has published some python to do exactly what we need to do https://github.com/dcolish/PyMET/blob/master/pymet/pymet.py
So now with a little hacking we put a serial lcd on our maple-bacon and have it forward all serial from the usb port to the display.
Since the lcd requires 5 volts we plug its power into the maple-bacon’s vin and then we connect its serial rx line to tx3. Then we mangle Mr Colish’s code until it works.
Of course this morning when I went to actually use. it.
The next step will be to get the python and the maple bacon onto the pogo plug.
The step after that will be to hook the maple directly to the internet using ethernet.