Using Cell Phone 'Text Messaging' (SMS) To Get Bus Departure Information

Many current cell phones are able to send and receive text messages via SMS (Short Message Service). If you have such a phone, and if your service provider supports SMS (most do), you may be able to use your cell phone to get up-to-date bus departure predictions from MyBus.

Note: To use this service, you must have access to a bi-directional SMS/email gateway. You will send an SMS message from your phone to a gateway that converts it to an email, addressed to the MyBus server. The MyBus server will respond with an email addressed to your phone number at your phone provider's return gateway, and then an SMS reply will be relayed to your phone. Typically, the required gateway may be available through your phone service provider. You may need to do some research to find out how to send an email from your phone. As an example of how to make this work with a low-end phone, a Cingular prepaid GoPhone, see the details at the bottom of this page. It may also be possible to use a third party gateway.

A Wikipedia list of SMS-email gateways for many wireless providers may be found here. You will need both email-to-SMS and SMS-to-email. As you can see in this list, SMS-to-email is less common, but seems to be available for major phone companies--AT&T, Sprint, T-Mobile.

Since extra charges may be incurred by using SMS messages, and since the MyBus server may generate multiple messages for some locations, you may want to check on SMS costs from your provider before using this MyBus service.

HOW IT WORKS

You will use your phone to send an email message to the MyBus server. In the email, you enter a query for the Metro route and the location that you are interested in. Then you send the message. You will then receive an email reply containing the upcoming bus departure times for your location.

Note: The time it takes to get a reply is dependent on how busy your phone provider's email service is. In our testing, the turn-around time was often just a few seconds. But at other times the response was delayed a minute or so, or in one case about 30 minutes! This is a limitation of SMS, which does not guarantee prompt delivery. Clearly, very long response delays detract from the usefulness of the bus information! Your mileage may vary.

Since the MyBus server responds to standard email messages, you can also try out the system by sending a query from a regular Internet email account, to get an idea of how it works and what the responses look like, before trying it with your cell phone.

DETAILS

  1. You should first determine the 'location ID' for the location in King County that you are interested in. Use the regular MyBus web site (http://mybus.org) to select the location of interest. First use the map to select the general area of interest, and then pick a location from the list that is presented. You may not be able to find your exact bus stop, but try to find the closest location. After selecting a location, you will see the MyBus display for that spot. Toward the top of the page, notice the line that identifies the 'Metro location number'. Remember this number (your 'locationID'). *NEW* It is also possible to request some locationIDs using your SMS phone. For instructions, see the section below "Querying for LocationIDs".

  2. If you have not previously used your phone to send email messages, you may need to consult your phone instruction manual to learn how to do this.
    Set the email address to: sms@mybus.org
    You will most likely find that entering this information using the phone keypad is a tedious task. If possible, you will probably want to store this address in your phone so that you can recall it later without having to re-enter it.
    NOTE: Responses will come from the address "sms-server@mybus.org". Do not do a reply to this address--your query will be discarded. Always send queries to sms@mybus.org.

  3. In either the Subject: line, or in the text body of the message, you will enter your MyBus query. This can take the following forms:

    Type of QueryFormatExample
    single routeroute@locationID31@5903
    multiple routesroute,route,route@locationID31,65,68@5903
    all routes@locationID@5903
    all express busese@locationIDe@5903

    Note that all valid queries include an '@', followed by a valid locationID. Do not combine an 'e' with route numbers; the 'e' can only be used as shown above to retrieve all express buses at a location.
    Make sure that you use one of the above formats.
    If your phone is capable of storing the subject line or message, you may want to do this to avoid having to re-enter a frequently-used query.

  4. Send your message. You should receive a response in a short time, usually in a few seconds. If your phone service gateway is busy, the response may be delayed.

    No response? This may be due to delays in sending mail through your carrier's network. The other possibility is that your query did not match one of the above formats.

INTERPRETING THE RESPONSES

SMS messages are typically limited to only 160 characters. For this reason, the bus information is presented in a condensed form. If you requested information on a single bus route, the response will consist of lines with two parts: an abbreviated destination label, and a departure time for the bus. Below is a sample response:

 UNIVNE45
 UDistrct  3d16
 Downtown  3d16
 UDistrct  3:22
 Downtown  3:25
 UDistrct  3:26
 Downtown  3:35
 UDistrct  3*38
 Downtown  3:45
The first line is an abbreviated form of the location from which buses will be departing. (In this example: University and NE 45th) The times with a ':' separator are predicted departure times for these buses (based on real-time bus location data). In the cases where the ':' has been replaced with a 'd', it means that the bus has already departed from this location. In the case where the ':' has been replaced by an '*', it means that for some reason no real-time data is available for that bus, and the scheduled departure time is presented instead. Express buses will include an 'e' at the beginning of the destination label.

In responses that may include more than one route number (multiple routes, all express buses, all routes), the route number is included in the line. Since this may make the line too long to display on a cell phone, the information may wrap from one display line to another. To make it easier to read, each bus record in enclosed in curly braces { }. For example:

 UW HUB
{75  UDistrct  3:29}
{31  MagnlaVg  3:27}
{372e UDistrct  3:29}
{75  UDistrct  3:33}
The first number is the route number, which will include an 'e' if it is an express bus. The destination label and time are presented as described earlier. In displays of multiple routes, departed buses are not included (this is to make the display a little more compact and readable).

QUERYING FOR LOCATIONIDS

The most complete list of locationIDs is available on the MyBus web site. However, it is also possible to request some of the locationIDs over your phone. This may be helpful if you find yourself in a new location where you do not know the locationID and do not have access to a computer. To query for locationIDs for a particuler bus route, just send an email message to sms@mybus.org, and in either the subject line or the message body put the number of the route you are interested in.

You should then receive one or more email messages with lists of abbreviated location names and associated locationIDs. Below is an example for route 31:

STONN40=1123
FRMTN34=1124
LATONE40=1128
28WBLAN=3510
GILMEMER=3545
33WSMIT=3551
3WNICK=4308
UWHUB=5903
BKLNCME=5918
UNIVCAMP=5942
In this example, the first three locations are: Stoneway and N. 40th St., Fremont and N. 34th St., and Latona and NE 40th St. Note that the very abbreviated names may at times be difficult to interpret if you are not familiar with the bus route. The locations that are listed on a Metro printed schedule should be included in the response that you get, and this may aid in interpreting the names. The name=locationID pairs are NOT listed in any geographical order.

Since SMS messages are limited to a small size, only 10 locationIDs are included in each email response. If your route includes more locationIDs, you will receive multiple email responses to your query. (If your service provider charges you by the number of messages you receive, rather than the number you send, you may want to take this into account. Currently, the route with the most locationIDs fits into 3 email messages.)

OTHER DETAILS AND SOME LIMITATIONS

EXAMPLE--Cingular GoPhone

Some phones are set up to send email messages in a fairly obvious way, with places to enter the email address, subject line, and message. With my cheap prepaid Cingular GoPhone (Motorola C139), it is not so obvious. First, you need to know that you can direct a text message to the Cingular SMS-email gateway by sending it to a phone number of 121. Next, you put the email address to send to (sms@mybus.org) in the first line of the message body. Follow this with your MyBus query. To make things easier, I made a new text template, with the message containing:
sms@mybus.org
@
Then I can just insert the route and location id around the '@', and send the text message to 121. On my plan, this costs $.05 to send the message, and another $.05 to receive a reply.

Comments or questions may be directed to: mybus@its.washington.edu