
A Raspberry Pi-powered live train station sign - chrisys
https://www.balena.io/blog/build-a-raspberry-pi-powered-train-station-oled-sign-for-your-desk/
======
kevan
Pretty cool. When I took the train to work I made a simple stop-light with
transit data. Trains ran every 10 minutes and it took me a few minutes to walk
to the station. Green meant I could definitely catch the next train. Yellow
meant I'd make it if I walked fast, and red meant I'd miss this train and need
to wait for the next one.

~~~
benj111
Rather than show red, why not show the next train you could actually catch?

A bit more glass half full, and reduces the light count by 33%!

~~~
jrockway
I went that route: [https://jrock.us/mta.html](https://jrock.us/mta.html)

Much better than the MTA's website... though slightly less useful if you're
not me commuting to work.

What I learned from this exercise is that:

1) The estimates are consistently inaccurate; downtown trains at Chambers St.
always arrive when the clock says "2" (minutes until arrival).

2) They use some sort of distributed cache that doesn't remain consistent; as
you bounce between backend instances you get different results, but often the
same two results. (The red/green lines under the station names indicate
freshness.)

3) The clocks in the stations don't work when it's too hot, but the actual
data collection/processing is fine.

~~~
vidarh
That's interesting. Worked on a service based on TFL (London) data, and they
were incredibly picky about ensuring people would not get misled by signage.
Of course sometimes there are tradeoffs, but they had extensive rules to
ensure the tradeoffs minimised negative experiences. E.g we had to take any
buses off the boards if the data was more than x seconds old, never ever allow
enough clock drift or other issues to cause our displays to be off by more
than a certain amount, clear the whole display if we got no api response
within a certain amount of time etc.

It was very annoying to implement, but as a user it is very nice to know how
much thought has gone into it.

------
alexandros
Hey folks, balena.io founder here, just chiming in to mention that Chris is
one of our Hardware Hackers in Residence, and if you think that doing HW
projects with all sorts of cool technologies and writing them up for the world
is your dream job, we're hiring!
[https://balena.workable.com/j/27A101659C](https://balena.workable.com/j/27A101659C)

Happy to answer any balena (or train station sign) related questions, of
course :)

~~~
mainlineman
I haven't used balena but I have worked with other IoT SAAS companies in the
past. All these services seem rather expensive for what you get. Other than
creating an easy way to push OS updates to field devices what would I get from
your service?

~~~
alexandros
You can't ask a founder this and not expect a pitch, so here goes:

Having built a similar bespoke stack in the past, Balena would have been a
steal! It gives you the development, provisioning, build & deployment,
configuration, management, and even remote debugging workflows out of the box.
On top of that, it's built to require web/cloud developer skills, not embedded
skills.

To do that, we have created several companies worth of infrastructure, from a
cross-architecture container build system, to a bespoke OS supporting many
device types, customized docker engine for embedded use cases, container
deltas for bandwidth saving, etc. Even simple things like "how do I make sure
my device gets DNS in an arbitrary home network" are incredibly tricky, and
balenaOS gets it right almost always.

Which brings me to my next point. We are fanatical about support. We take
responsibility for our customers succeeding, which means we constantly find
and improve sources of friction. Using Balena gets you that backup team, but
most importantly gets you hooked up to the flow of improvements we make all
the time. Cloud companies charge $15 per server per month for various devops
type services. We do very similar things but for devices that are smaller,
more diverse, in tougher conditions, with less reliable networking, and ask
for just $1 per device per month.

In other words, when I was in the shoes of our customers, producing even a
fraction of the value and piece of mind that Balena provides in house took a
lot of work, which was money, and that's not accounting for the time and risk
of not getting there in the end. If I found myself in that situation again,
knowing Balena and not using it would essentially be negligent. Our most
fanatical customers are those who have tried to build something like it
themselves, because infrastructure is so easy to underestimate.

------
duxup
That is super cool.

But admittedly when I saw the title i was hoping for a mini version of those
massive flipboard signs. Those things are amazing.

~~~
harpastum
There's a great Github project for building your own Splitflap/Solari displays
from the ground up for $20 each
[https://github.com/scottbez1/splitflap](https://github.com/scottbez1/splitflap)

~~~
duxup
Oh man that is great thank you.

------
odiroot
I'm working on a few projects at home with ESP and RPi Zero. It's so much fun
to do your own "IoT" devices.

There's still a problem I don't know solve well, holistically. When you do
something with UI there's inputs from humans (buttons, knobs, etc), the
network and timers. I'm completely lost how to coordinate that, especially
when I use an LED/OLED display.

How to make sure a single screen is displayed long enough to be readable? But
on the other hand how to react to all inputs? And how to deal with some
inputs/triggers being more and less important (e.g. "modal" screens over
static screens)? Also how to make sure not to get lost in the threading mess
that I just created? The cherry on top is, some inputs require "short term
memory" \-- like patterns of button pressing (double/triple press/long hold)
or rotary encoders.

In the end I give up implementing a lot of features.

~~~
ipoopatwork
You might want to look into a RTOS.

Each task has its own stack, and can communicate with other tasks with
mailboxes or shared memory (with a lock).

You'd have a task for each of the things you mention: debouncing a button,
drive the display from a buffer, and application logic.

The application logic then doesn't have to worry about bounces, how long it'll
take to drive the display, etc.

Modal screens over static screens is orthogonal to this though. You'd need to
build a priority scheme, and only pass down events to the current on-screen
view.

~~~
odiroot
Thanks, ipoopatwork.

I'm using MicroPython and this is what I want to stick with. But I'll research
how RTOS is doing things and make an equivalent.

------
mytailorisrich
I trust that the picture really shows live data because all trains are listed
as running late.

------
VBprogrammer
This is really cool!

One thing that always annoys me with those signs is when they try to put too
much information on them. You have all of the stops, fine. You then have all
of the information about the train splitting which you might well need. But
then they start adding information about short platforms etc. It takes several
minutes for it all to scroll past. Which is super annoying if you're trying to
work out if the train standing there stops at your station.

~~~
jedimastert
I know it's a lot less complex, but on the MBTA all of the signs only show
next two trains and how long they'll take to arrive. The extra information
comes in where each of the displays are.

------
hestipod
Related older pieces from a brilliant Finnish hacker. Her posts are always
interesting:

[https://www.windytan.com/2014/06/headerless-train-
announceme...](https://www.windytan.com/2014/06/headerless-train-
announcements.html)

[https://www.windytan.com/2013/11/decoding-radio-
controlled-b...](https://www.windytan.com/2013/11/decoding-radio-controlled-
bus-stop.html)

------
sschueller
Very cool but I find a pi is overkill for something like this. ESP8266 or
ESP32 would work just as well.

~~~
jrockway
Pi Zero Ws are $10, ESP32 dev boards are $12. Why pick the more expensive one
AND spend more time writing the software?

~~~
mosselman
ESP32 boards are about $4 on aliexpress...

I much prefer using an ESP32 for something like this because I don't have to
deal with installing distro's, updates, etc.

~~~
d21d3q
sd card wearout, power failures (sd card corruption)...

------
inflatableDodo
I like the emergence of these cheap, fun, single function computing devices.
Sure, it is useful to have a smartphone that does everything, but that doesn't
help develop your internal map of reality in the same way as things like this
do.

Ubuiquity can only be stretched so far in a single tool before the benefit you
derive from adding yet another feature is outweighed by it becoming very
slightly worse at everything else it does. Smartphones are great, but as a
backup computing device, in much the same way keyring multitools are. And the
best of them are still measurably worse than the best non-smartphones at
actually being mobile phones.

------
jonahhorowitz
I need one of these, but showing my upcoming meetings. Then I need it to start
blinking when I'm supposed to be somewhere besides my desk.

~~~
AnIdiotOnTheNet
Doesn't, like, all software that has anything to do with a calendar already do
reminders? I know Outlook and Google Calendar do.

~~~
leipert
Well, sometimes you are in Do not Disturb mode, so notifications don't come
through. Also, this thing would always be on, and you simply need to glance
over to see:

Next meeting in X minutes. Also my calendar is kinda full, so seeing conflicts
for the next meetings would be super-cool.

~~~
AnIdiotOnTheNet
...so let me get this straight. You've specifically told your computer not to
remind you about meetings in the straight-forward built-in way it can, and
want to build a separate overengineered reminder system out of an overpowered
toy to do the same thing?

Christ. No wonder everything in our industry sucks.

------
EamonnMR
Ohh, I think I know the right APIs to make the Boston MBTA version of this.
Will post it up if I do it.

~~~
chrisys
PRs welcome - we could remove the 'UK' part of the project and make it work
for more cities/countries.

~~~
EamonnMR
API docs here so I don't forget where they are:
[https://www.mbta.com/developers/v3-api](https://www.mbta.com/developers/v3-api)

------
GordonS
As a total PI noob, it's great to see such clear and simple to follow
instructions for something actually practical. Also liked the specific
recommendations for the case and such - it would be really easy for someone to
replicate.

Been meaning to get a PI and do _something_ with it for years!

~~~
OrgNet
there's a phone right next to it that could do the same thing

~~~
GordonS
If I understand correctly, you're suggesting I _phone_ the rail company to
find the train times instead?

Phone someone? _Phone_ them? Gods man, do you think this is the 1800's?!

------
jypepin
wow, crazy how small Pi has become!

I remember trying to do a similar project for the bus stop at the corner of my
street to know when to leave to catch the bus. It was fun, but I never really
finished when I realised how big just the Pi would be (still powered by usb-a,
etc).

Nice to see this one so well executed!

~~~
prashnts
I’m patiently waiting for a Pi Zero format for new Pi 4B (or something
close...).

Regarding the size of B series, unless I need the ports, I almost always snip
out the ports — don’t bother desoldering it, the ground plane in Pi acts as a
massive heat sink. Instead, I snip slowly and carefully the metal housing of
ports, and then wiggle the plastic bits until the break away. Reduces the
size, and leaves sufficient space to put small modules in place.

I posted a few pictures in my previous comment here:
[https://news.ycombinator.com/item?id=20462711](https://news.ycombinator.com/item?id=20462711)

------
wheresvic1
I'd love to see a writeup of doing something like this but without any of the
balena cloud stuff.

~~~
htch
Hey - I wrote the original code that was forked (exquisitely, I should add!)
by Balena. The original code is just a Python script.

I haven’t written it up into a blog yet, but everything to get you started is
on my GitHub at [https://github.com/chrishutchinson/train-departure-
screen](https://github.com/chrishutchinson/train-departure-screen). Very happy
to help answer any questions too

~~~
chrisys
Thanks for the inspiration!

------
sparso
[https://ukdepartureboards.co.uk/store/](https://ukdepartureboards.co.uk/store/)

~~~
lol768
Given these start at £150, I know which route I'd rather take.

------
jentulman
I'm working on a pi zero version of my own at the moment. The National Rail
Enquires api's (Darwin) are free to use at personal (and surprisingly large)
scale. They may be SOAP but still easy enough to talk to with some simple
python.
[https://www.nationalrail.co.uk/46391.aspx](https://www.nationalrail.co.uk/46391.aspx)

~~~
jsingleton
Yeah, it is a nasty API for the live departures. There are much worse though!

I wrote a proxy to make it easier to use
([https://github.com/jpsingleton/Huxley](https://github.com/jpsingleton/Huxley)).
Been meaning to port it to .NET Core when I find the time. There is also an
old Python client here:
[https://github.com/HackPartners/darwinrest](https://github.com/HackPartners/darwinrest)

You can find many more resources in the community
([https://wiki.openraildata.com/](https://wiki.openraildata.com/)
[https://github.com/openraildata](https://github.com/openraildata)
[https://groups.google.com/forum/#!forum/openraildata-
talk](https://groups.google.com/forum/#!forum/openraildata-talk)). We're
pretty friendly, say hi.

------
virtuallynathan
I'd totally buy one of these pre-made for $50. Love it!

------
guylepage3
It would be cool to use a Split-Flap Display. like this..
[https://www.youtube.com/watch?v=04el3LYiOaI](https://www.youtube.com/watch?v=04el3LYiOaI)

~~~
dividuum
If you can live with a pure software version for the Pi, have a look at
[https://info-beamer.com/pkg/8474](https://info-beamer.com/pkg/8474).

If easy to install using the OS we build and you can update it remotely
through an API or of course on-device.

------
pndy
This is great!

And it made me wonder if bus transport data in my city is available for
everyone - we got few displays around, two services/applications that show the
current position for each line...

~~~
Avamander
Well, technically it's available for everyone if the system has an app then
the app can be reverse-engineered quite easily to get access to the API.

------
McDev
I love it! Now you just need to make a platform announcement addon:
[https://www.youtube.com/watch?v=5Qa7KL1VScw&t=70](https://www.youtube.com/watch?v=5Qa7KL1VScw&t=70)

~~~
jboles
I have done exactly that! (but not for London):
[https://www.youtube.com/watch?v=Fte7w0r8d_k](https://www.youtube.com/watch?v=Fte7w0r8d_k)

(Not my video; someone made it using the program I made)

------
hemantv
Why I can't use my old phones to do this is beyond me. I have one windows
phone lying around and a few android phones. Everything is there in a neat
package but the manufacturer make it so hard to tinker with them.

~~~
ThrowawayR2
Blame the rise of the app store. The old Windows Mobile phones were fully open
and work just fine for what you want; write your app, load it onto the phone,
and just launch it.

~~~
jboles
Once did a project like this that grabbed Seattle's realtime data for some bus
stops around my place. It was an old Windows CE PocketPC thingy, so the tools
were primitive (.NET compact framework 1.0, basically).

Maybe a bit too primitive. It worked pretty well for about a year, until I
found that the CompactFlash WiFi adapter was only 802.11b and there was
nothing newer available that was compatibility with the PocketPC. It ended up
being a choice between keeping the gadget running, or being able to run my
WiFi network at 802.11g speeds with modern (WPA) security, so the latter won
out.

------
seaghost
Consider me a cynical but this is the marketing click bait.

------
wyldfire
That's neat, seems like it would be a cool kit to distribute.

------
southpawgirl
A thing of beauty ️

------
fortran77
I would love a flight information board.

------
krisalty
this is pretty awesome.

