Question

I need to create an information service on trains to deliver live information. I am looking for some ways to go about this.

There are already existing LCD monitors in many of the train wagons. They are powered from the battery. When the train is moving, I would like the screens to display the following information: i) about the route, next stops etc. ii) news items iii) video adverts to be shown when the train is within a GPS 'corridor'.

For this to work, we need to place GPS on board. We also need to be connected to the internet to be able to get live data (for the news items) and to be able to push new video content when it becomes available. I don't want to have to visit each train wagon just to load up new data.

I had originally thought I would need to have an app built in Android that did all this, but I think it would be easier all round if I could get this to work via HTML5 on a browser. So far I have come up with the following 2 hardware possibilities:

1) Buy cheap, 2nd-hand tablets with broken screens (as I should still be able to control it using a mouse). They should have GPS capability either in-built or via a dongle and be internet-enabled (likely a SIM card). Output the display to the LCD screen. 2) Install a laptop with the same capabilities.

With 1) it is possible to buy older tablets or with cracked screens etc. so the cost can be kept lower, although it would be impossible to get a standard type (which would be far easier to maintain). They can be bolted onto the back of the monitor. The disadvantage is that the output from the tablet may not be high enough resolution when blown up onto an LCD

With 2), a laptop, the resolution issue can be more easily overcome. It also may be easier to source working laptops with broken/missing screens.

I imagine that I will need to send information about the GPS location to a server every 10 seconds or so, maybe in a simple GET in a URL, so that I can present the information on a web-page. This might work for information like the next stop, and news feeds, but the videos will likely be longer than 10 seconds. So how do I deliver the content?

Among the things I am wondering is if a browser connected to the internet can do all this. The location needs to be continually updated. Instead of simply playing everything on a loop, things happen when the train is in certain areas e.g. approaching/leaving a station. One way to do it is send the GPS data back every 15 seconds and then refresh the browser web-page to display content based on that GPS location and direction.

Additionally, would video content cache correctly? When a browser needs to show that content, it would be nice if there wasn't a lot of lag as it tries to download a new video (or display an existing one).

And, although using machines with broken screens, which are more cost-effective and less of a target for theft, they become less user-friendly. What happens in the event of a power-outage? It is possible to reboot everything correctly to have the browser displaying everything and connected to the GPS and internet?

Lots for me to solve :)

Was it helpful?

Solution

Content management in this kind of environment can actually be pretty tricky business, depending on what you want... I would try to keep it simple.

You will need an application on the client side that is responsible for loading data. This could be as simple as a script that runs as a cron-job on a little linux box (like raspberry-pi) that runs once a day (at 2am if possible) which would kickoff an RSYNC to a folder stored on your central server. This script would need to be smart enough stop the user visible UI, do the RSYNC, check the data to make sure its not corrupted (by maybe computing an checking a hash code), and then restart the user facing UI. Please note that this component could also be something very sophisticated that runs all the time and establishes a persistent TCP connection with the server where an administrator could push updates to the device(s) on demand. Whatever it is, this component needs to be extremely robust... and able to recover from errors. Use Python ;)

If you are using RSYNC you could keep a separate folder for each train or route in order to keep the volume of transferred data down.

The user facing component could be written as a stand alone app in the preferred language for the platform (java for android) or in HTML5/Javascript or in a mixed application (Maybe java or QT UI with an embedded web browser?). The code/binaries for this component could be shipped to the device via your data distribution mechanism. The app would monitor the GPS coordinates and display content as necessary (assuming all the content is pre-loaded). The content needs to ship with meta-data to let the UI know when/where to display content.

The complexity of the central server will scale with the complexity of the client application and the capabilities you want...You might want to write a web app with a nice REST interface for the clients to use, or not. You probably want implement some way for client applications to inform you of problems (a crashing load). This could be done by exposing a REST interface for clients to use...

Rasberry Pi would be a good choice for client side hardware. Check out the following:

http://www.cooking-hacks.com/3g-gprs-shield-for-raspberry-pi-3g-gps

(Disclaimer: I've never used this so have no idea how well it works.)

Licensed under: CC-BY-SA with attribution
scroll top