Blog

Super simple video triggering server & client

simple-server

Student Idea: The aim was to have an Arduino driven tangible interface which allowed the user to make decisions and as a consequence different screens would output different videos(could be more than 10 screens). I advised the student to build this project with processing due to its ease of compatibility with the Arduino.

Solution: A server / client combo lends itself well to this type of application. I found articulating the basic concepts of networking quite difficult, especially as the students are quite new to programming in general. I wrote this simple example to demonstrate how a distributed system could work. The server starts on application start up and waits for clients to connect. It has the capability to store ip addresses of 10 clients. As soon as a client starts up the user must type the IP address of the server into the app and press enter. Every time a client connects to the server, the server stores the clients IP address in an array in the order of which they connect (first to connect = 0, last to connect = 9). The server acts as if it was the tangible user interface but the choices are made by using the numbers on the keyboard. If the user click the number 4 the server gets the IP address from the list of clients at the index of 4 and sends that along with a random number to every client connected ( format example:  10.0.1.3-4  |  ip-number ). It is the clients responsibility to read in the message, check the ip address matchs its own and if it does then change the background colour depending on the random number that was sent in the message.

WARNING: In no way is this a complete system but just a demo for the underlying techniques that would be used to create a distributed video triggering system. 

Server:

Client: