-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This is project is OneBusAway software modified for HART's Tampa, FL deployment.
If you're looking for the main OneBusAway (OBA) project, please see the OneBusAway Application Suite wiki.
The below instructions discuss the specific deployment of the OBA software to the OBA Tampa server infrastructure. For more general instructions on how to compile the web applications using Eclipse, please see the OBA Developer Installation Guide.
You can find the active OneBusAway instance for Tampa, FL at http://tampa.onebusaway.org.
The OneBusAway software is current running on HART's virtualized servers.
https://docs.google.com/drawings/d/1k9ReYVW2h82eEZfrFS8cyUagrUTl3Mt3Ps4C0lTVF_k/edit?usp=sharing.
The OBA Tampa deployment consists of the following components:
- OneBusAway (onebusaway-application-modules - this Github project)
- GTFS-realtime feed software - retrieves real-time transit data from HART's AVL system and formats it into GTFS-realtime format
- MySQL Database Server- holds user account information, as well as a cache of transit data
- XWiki Server - contains the text and images used in the OneBusAway desktop web interface
The following sections discuss the specific technical details and instructions for deploying and maintaining the above components of the OBA Tampa software system. At the bottom of the page, we include details for available third-party application programming interfaces (APIs), and well as details on available third-party apps.
As shown by the above architecture figure, data is exchanged between the different components of the system. This section contains information on the size and frequency of data exchange. Note that data exchange that happens within the same virtualized server doesn't have an impact on the net data input/output for that server. Also note that the frequency of data updates for the GTFS-realtime Generator application and OneBusAway server can be adjusted.
The GTFS-realtime Generator issues a JDBC query to the HART OrbCAD SQL Server to retrieve the current AVL data, and formats it according to the GTFS-realtime spec.
-
Frequency - SQL query is currently executed every 5 seconds.
-
Data Size - Request = Unknown, Response = Unknown
The OneBusAway Tomcat Server issues a HTTP request to the HART OrbCAD SQL Server to retrieve the GTFS-realtime Trip Updates and Vehicle Positions Protobuf files.
-
Frequency - OneBusAway currently retrieves updated GTFS-realtime data every 15 seconds.
-
Data Size - Request = Unknown, Response = (tripUpdate.pb at 8kB + vehiclePositions.pb at 9kB) = 17kB total
OneBusAway Tomcat Server -> OneBusAway clients (e.g., Android app, OBA Desktop browser, OBA smartphone browser, OBA text-only browser)
The many different OBA clients can all request information about static or real-time transit data from the OneBusAway Tomcat Server via HTTP, and receive a response.
-
Frequency - Based on rate that clients decide to query OBA
-
Data Size - Request = Unknown, Response = Unknown
Note: if you're testing new OBA webapps on your local PC using the CUTR-at-USF OBA code (i.e., this Github project), you must use the full machine name of your USF computer (e.g., USF111111.cutr.usf.edu), and not localhost, when testing from a browser. This is because the Google Maps API used in OBA is restricted to servers running in the *.usf.edu domain. To change the valid domains for the Google Maps API key, have someone with credentials change this in the Google API console.
To deploy new WAR files to OBA Tampa server, use the code in this Github repository and the data-sources.xml files here (note that you'll need to replace the text <usernameGoesHere>
and <passwordGoesHere>
with the actual username/password credentials for MySQL in all 3 files). You'll need to rename each of the XML files to just data-sources.xml
and put in the respective project /src/main/resources folders
.
Then, build the projects using the instructions at the primary OBA Developer Installation page (be sure to follow the instructions for building the Google Web Toolkit components).
For the onebusaway-transit-data-federation webapp, onebusaway-api-webapp, and the onebusaway-webapp projects, you'll need to right-click on each and do "Export->WAR file". Select a place to save the WAR file on your local computer, and select the option to "Optimize for Tomcat v6". Rename the file onebusaway-api-webapp.war
to api.war
.
Remote desktop into onebusaway.forest.usf.edu
.
Stop the Tomcat server by right-clicking on the OneBusAway - Tomcat port 80
icon in the lower-right hand corner of the screen and then clicking Stop service
. Wait for the service to stop.
Delete the current WAR files and folders for onebusaway-transit-data-federation webapp, onebusaway-api-webapp, and the onebusaway-webapp from the server directory C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps
. Place the 3 new WAR files in this directory, and then re-start Tomcat by right-clicking on the OneBusAway - Tomcat port 80
icon in the lower-right hand corner of the screen and then clicking Start service
. This may take several minutes for the server to initialize and the website to come back up. If 10 minutes or more have passed without a response, please check the Tomcat error log at C:\Program Files\Apache Software Foundation\Tomcat 6.0\logs
.
We're using our HART-GTFS-realtime-Generator software to make HART's AVL data available to OBA via a GTFS-realtime feed. This software also runs on the same server onebusaway.forest.usf.edu
, but uses an embedded Jetty web server running on port 8088.
To deploy a new version of the HART-GTFS-realtime-Generator software, the following two updated files should be placed in the C:\OneBusAway\GTFS-realtimeGenerator\application
folder on the server:
- cutr-gtfs-realtime-hart-1.0.1.jar - Java file that contains the HART-GTFS-realtime-Generator software (file name and link to file on Github will depend on version number)
-
cutr-gtfs-realtime-hart-autorun.bat - batch file that configures and starts the HART-GTFS-realtime-Generator software (The .bat file executes the cutr-gtfs-realtime-hart-1.0.1.jar file) (note that when a version number changes, you need to update this bat file to point to the new JAR file name). Note that you can change how often the GTFS-realtime feed refreshes the transit info from HART's system by changing the
--refreshInterval=5
value (units is seconds) in this file.
Currently, cutr-gtfs-realtime-hart-autorun.bat
is executed on server startup via a Windows Task "GTFS-realtime".
You should be able to see the GTFS-realtime feed in plain text format by visiting the below two links:
- http://onebusaway.forest.usf.edu:8088/trip-updates?debug - For estimate arrival time updates
- http://onebusaway.forest.usf.edu:8088/vehicle-positions?debug - For vehicle positions
To change how often the OneBusAway software refreshes its real-time info from the GTFS-realtime feed, you need to change the data-sources.xml
file in the onebusaway-transit-data-federation-webapp - for example:
<bean class="org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeSource">
<property name="tripUpdatesUrl" value="http://localhost:8088/trip-updates" />
<property name="vehiclePositionsUrl" value="http://localhost:8088/vehicle-positions" />
<!-- Optionally set the refresh interval - how often we query the URLs, in seconds (default=30) -->
<property name="refreshInterval" value="15" />
</bean>
...would refresh the real-time data in OBA every 15 seconds.
Note that the current data-sources.xml
file in the onebusaway-transit-data-federation-webapp assumes that the GTFS-realtime feed is running on the same server as OBA, hence the localhost
entry. If the GTFS-realtime feed is moved to another server, this same config file will need to be updated with the new servername. You may be able to modify this file within an existing compiled onebusaway-transit-data-federation-webapp WAR archive and redeploy the WAR to the Tomcat server. If this approach doesn't work, you'll need to recompile the onebusaway-transit-data-federation-webapp application using the approach documented on the main OBA app modules developer installation guide wiki, and then redeploy the newly compiled application to the Tomcat server.
If the HART OrbCAD database server moves to a new servername (or database server credentials change), you can stop the existing GTFS-realtime feed, and then edit the file C:\OneBusAway\GTFS-realtimeGenerator\config.properties
and change the host
field to a new value. When you restart the GTFS-realtime application, it should pick up these new values.
All OBA Tampa desktop browser website content (e.g., text, images, etc.) is managed through an XWiki instance (XWiki Enterprise 4.2) running on onebusaway.forest.usf.edu on port 8081. It is installed to the location C:\OneBusAway\XWiki\XWiki_Enterprise_4.2
, and can be started by double-clicking on the file start_xwiki.bat
, and can be stopped by double-clicking on the file stop_xwiki.bat
. start_xwiki.bat
can be edited to change the port number if needed.
Currently, start_xwiki.bat
is executed on server startup via a Windows Task "XWiki".
NOTE: if the XWiki port number or IP/servername is changed, the onebusaway-webapp data-sources.xml file will also need to be changed and redeployed to point to the new port number and server. Since a remote call is made to the XWiki servername from the user's web browser, the XWiki servername in the onebusaway-webapp data-sources.xml file CANNOT be localhost
. Therefore, even if the image is moved as a whole to a new server, the XWiki servername will still need to be updated to the new public facing XWiki servername. After modifying the file you'll need to recompile the onebusaway-webapp using the approach documented on the main OBA app modules developer installation guide wiki, and then redeploy the newly compiled application to the Tomcat server.
We are currently using MySQL Community Server (installed via the MySQL Installer for Windows)) as a database server for all user account info and the transit data cache, running on the onebusaway.forest.usf.edu machine on port 3306. This database server is only accessible locally from software running on onebusaway.forest.usf.edu, as port 3306 is not currently open in the firewall. The MySQL server is set up to start via a Windows Service MySQL-OneBusAway
that starts at Windows startup.
For the OBA mobile apps to work with OneBusAway, the following keys must exist in the data-sources.xml file for the opentripplanner-api-webapp:
-
Android:
v1_BktoDJ2gJlu6nLM6LsT9H8IUbWc=cGF1bGN3YXR0c0BnbWFpbC5jb20=
-
iPhone:
org.onebusaway.iphone
-
Windows Phone 7:
v1_C5+aiesgg8DxpmG1yS2F/pj2zHk=c3BoZW5yeUBnbWFpbC5jb20=
These keys have been added to the OBA Tampa server instance.
Note that we are still working on a permanent solution to provide the Android app to Tampa OBA users (see the entry at the bottom of this page). iPhone and Windows Phone 7 mobile apps currently aren't available for Tampa OBA users. See this page for more general mobile app configuration info.
Every time HART updates their GTFS data, we need to follow the following steps:
-
Delete any current files in the directory
C:\OneBusAway\bundle
on the computer where you're building the bundle. -
Build the OBA graph with the new HART data on your computer
- Put new HART GTFS data in the directory
C:\OneBusAway\HART_GTFS\HART_GTFS_fixed.zip
. - Execute
org.onebusaway.transit_data_federation.bundle.FederatedTransitDataBundleCreatorMain
in the OBA project onebusaway-transit-data-federation-builder with the Program Arguments ofC:\OneBusAway\HART_GTFS\HART_GTFS_fixed.zip C:\OneBusAway\bundle
and VM arguments of-Xmx4000m
. This will produce new bundle files in the directoryC:\OneBusAway\bundle
.
- Put new HART GTFS data in the directory
-
Remote Desktop into the server onebusaway.forest.usf.edu
-
Right-click on the "OneBusAway - Tomcat 6 Port 80" icon in the status bar in the lower-right hand corner of the screen, and select "Stop Service." This will stop the OBA service and the http://www.usf.edu/onebusaway website will not be available until the service is restarted. You must wait for the service to completely stop, so Tomcat releases the lock on the old transit data files.
-
Delete any files in the directory
C:\OneBusAway\bundle
on the server. Copy all files from the directoryC:\OneBusAway\bundle
on your computer and paste them using Remote Desktop into the directoryC:\OneBusAway\bundle
on the server onebusaway.forest.usf.edu (NOTE - you cannot just overwrite the files on the server, as not all OBA information will be updated. You must delete all old files and copy the new files into a clean directory). -
In Remote Desktop on onebusaway.forest.usf.edu, right-click on the "OneBusAway - Tomcat 6 Port 80" icon in the status bar again, and select "Start Service." This will start the OBA service and the http://www.usf.edu/onebusaway website should become available again with the newly loaded bundle data.
As of Nov. 13, 2012, there are errors with HART's public GTFS data (see Issue #9) which requires HART to send a special post-processed GTFS data file to the USF team before OBA can be updated, so the public GTFS data cannot be used to update OBA. Therefore, Step #1 currently requires that a GTFS zip file be received from HART and manually placed in a directory so a bundle can be built.
Please see the wiki page Tampa - Creating Service Alerts for detailed instructions on creating service alerts that will be seen by OneBusAway users in Tampa.
There are two interfaces provided by the software deployed on the server onebusaway.forest.usf.edu that can be used by 3rd party apps to retrieve real-time transit information:
- GTFS-realtime feed
- OneBusAway REST API
Please see the Tampa - Third Party App Interfaces page for details.
Information about third-party mobile apps for OneBusAway Tampa is available on the Tampa Third Party Mobile Apps page.