· Aaron Brethorst

Introducing OneBusAway Pocket: Real-Time Arrivals Without a Server

TL;DR: OneBusAway Pocket shows real-time arrivals for your stops with no server, using your agency’s GTFS data. Try the iPhone public beta on TestFlight or the Android public beta on Google Play, or read the source code on GitHub.

OneBusAway has always needed a server. Somebody, usually a transit agency or a group of volunteers, has to set one up, load the schedule, and keep it running year after year. That’s a big part of why OneBusAway runs in a couple dozen places instead of a couple thousand.

Meanwhile, every US transit agency publishes its schedule as an open GTFS feed, and many publish real-time data too. Most of those cities will never get a OneBusAway deployment, and their riders are stuck with whatever app their agency offers.

So I wondered: what if the rider’s own device did the server’s job?

How it works

Pocket downloads your agency’s GTFS schedule, builds its own index, and works out arrival times right on your phone, your computer, or a tiny microcontroller. If the agency has real-time feeds, you also get live predictions, cancellations, and skipped stops. There’s no server, no cloud backend, and no account. Your saved stops never leave your device, and nobody has to host, pay for, or maintain anything.

All of the transit logic lives in one Rust library. I designed it to fit on an ESP32 with 520 KB of RAM, then scaled it up for phones and computers. Each app is a thin native layer around that core. A companion tool compares Pocket’s predictions with the production OneBusAway server in Puget Sound. If the two disagree about when a bus is coming, that’s a bug.

Where things stand

The iPhone app shows a map of your agency’s stops. Tap one to see its next buses, star the ones you use, and put one on your Home Screen with a widget. It’s translated into 24 languages and works well with VoiceOver and the largest text sizes.

OneBusAway Pocket on iPhone: a map of downtown Seattle bus stops, with the next buses at 3rd Ave and Union St in a panel below The OneBusAway Pocket widget on an iPhone Home Screen, showing the next three buses at 3rd Ave and Union St

The Android app has the same map, saved stops, and home screen widget. It’s built with Jetpack Compose on the same Rust core.

OneBusAway Pocket on Android: a map of downtown Seattle bus stops, with the next buses at 3rd Ave and Pike St in a panel below The OneBusAway Pocket widget on an Android home screen, showing the next buses at 3rd Ave and Pike St

My favorite part is a little e-ink display that sits by your front door and shows the next buses at a couple of stops. It runs on an ESP32, pulls the feeds over Wi-Fi, and keeps itself up to date.

A small e-ink display showing upcoming C Line departures at two Seattle stops, labeled OneBusAway Pocket

There’s also a command-line version that prints an arrivals board in your terminal, handy for scripting. A desktop app for Mac, Windows, and Linux will come later.

A taste of OneBusAway

Pocket is small on purpose. It shows arrivals for a handful of stops, and does that well. Trip planning, live vehicle maps, multi-agency regions, and accounts belong in a full OneBusAway deployment, and Pocket will point you there when you want more.

That’s the goal. I’d love for riders in cities without OneBusAway to get a taste of it, and for some of them to start a deployment in their region or bring it up with their transit agency. It’s also a small, self-contained Rust project, which makes it a good place for new contributors to start.

Try it out

The source code is on GitHub at github.com/OneBusAway/pocket, under the same Apache 2.0 license as the rest of OneBusAway. If you have questions or want to help out, email me at aaron@onebusaway.org or join the conversation on our onebusaway-developers mailing list.

Aaron Brethorst Executive Director, Open Transit Software Foundation