What follows is a brief look at an experiment that we did a few years back, the full article of how it was built can be found here. So what is it; it a nut shell it’s a model railway + a Hornby DCC model railway controller + a Rasbperry Pi + a cloud server, web cam and web enabled interface.
What do you get a massively concurrent safe, interactive railway that can be controlled and viewed anywhere in the world.
Here is a video of it working;
And here is how I architected the solution;
The beauty of this, it that the cloud maintains a stack of commands, and the Raspberry Pi orchestrates the activity of the train, by popping off the latest command from the stack, and then sending a set of commands to the train for it to perform a manoeuvre, the Raspberry Pi will not ask for another command / pop another command from the stack until the previous manoeuvre has completed.
What is also quite cool, is that within 1/2 hour of putting this live to the world, a number of people came up with a game, where by you get the train to it’s top top speed, and then send the stop command; timing it to stop by the station as close as possible. Love the internet’s need to gamify everything!