Live data from Hacker News

A Raspberry Pi-powered live train station sign

balena.io

81–90 of 146 posts

Re: A Raspberry Pi-powered live train station sign

#81
post #5

Earlier quoted context omitted.

A Solari Split-Flap Display? I love that they're making new ones! Starbucks has been putting them in their Reserve Roasteries. I'm also sort of happy with the 'modern' ones that are actually LCD screens with speakers making the noises. It's cheating, but it's a nice tribute.

There is something to be said for these kinds of vestigial remnants of technologies past. I've always been fascinated by them, and in fact this kind of thing in computer folklore -- for example parts of the docs that explain something exists "for historical reasons" -- are one of the things that got me into programming. For example the "size_t" size has pretty funny origins which I'll leave as an exercise to the read…

One of my favorite examples of this is the HTTP_REFERER. Someone made a typo in the RFC in 1996; software developers a century from now may well still be spelling it "referer" as a result.

Re: A Raspberry Pi-powered live train station sign

#82
post #48

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.

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%!

Re: A Raspberry Pi-powered live train station sign

#83
post #82
post #48

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.

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%!

I was using a physical RGB LED so there wasn't much extra bandwidth for conveying information. I live in a cold climate so green really meant "Leave now and you'll only have to wait in the cold at the stop for 2-3 minutes". Here's the code if anyone's interested[1]. Looks like my memory wasn't quite right, I did blue/green/red with blue=wait, green=leave, red=missed.

[1] https://gist.github.com/kevana/32bfa486d9fb0aa20a19694d1b69d...

Re: A Raspberry Pi-powered live train station sign

#84
post #82
post #48

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.

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%!

I went that route: 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.

Re: A Raspberry Pi-powered live train station sign

#85
post #77

Earlier quoted context omitted.

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

Last year maybe, but I just bought a few for €3.80 each and €0.40 shipping from aliexpress.

Dev boards, or modules to solder onto a circuit board? If you are printing your own board, then yes, the ESP32 is way cheaper. If you are just making a one-off, though, I'm not sure where it wins except in power consumption.

Re: A Raspberry Pi-powered live train station sign

#86
post #82

Earlier quoted context omitted.

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%!

I went that route: 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…

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.

Re: A Raspberry Pi-powered live train station sign

#87
post #14

Earlier quoted context omitted.

They're really cool! The original Solari board modules are mega expensive though. I looked at getting some to make a clock, and it probably would have cost me in the thousands. As an indirect result I now have a project in the works to make them. The concept is simple, but building them to be inexpensive is a challenge. Every extra bracket or fastener gets multiplied by _n_ modules.

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 Right now it's focusing on 40-character flaps (not super convent for clock-making), but it's open-source so I'm sure you could modify it for your purposes with some effort.

That's just for the enclosure. It looks like it comes out to 60-70$ depending on how you build it. I'm targeting sub $50, but it's tough. Good resource though, didn't know about those cheap geared stepper motors.

Re: A Raspberry Pi-powered live train station sign

#88
post #54

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.

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.

Re: A Raspberry Pi-powered live train station sign

#89

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

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). 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

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

Post reply on HN