This yearly hackathon (stay tuned for the next one – advertised soon) is always focusing on a challenge that involves real world objects and their connectivity not only to the the Internet but also to the Web. In short it is always about having things talking to each other and humans based on Web protocols and tools.
The 2013 editions’ theme was all about football: enhancing a Fussball Table with a number of sensors and actuators to make it a lot smarter.
First we wanted the goals to be automatically counted. We also wanted to display the score in real-time and have the ability to automatically share the score on social networks.
Rather than building monolithic applications the WoT Hackathons are usually about building different pieces with different IoT technologies and then making sure they all speak Web protocols to assemble the puzzle themselves in an almost spontaneous manner.
So the project comprised of four independent parts.
The first step was to instrument the goals. In the first goal we placed an Arduino Uno with a simple motion sensor, we then wrote a simple bit of code that could detect whether there was an object (i.e. a ball) nearby. This Arduino was then setup to communicate with the EVRYTHNG API where it was storing a goal counter using EVRYTHNG’s RESTful dynamic properties API.
Another team worked on the second goal which was equipped with an OpenPicus Flyport and a Grove Motion sensor. This embedded device was then connected to the COMPOSE platform where counter increments were sent over HTTP.
Basically we could have used any combination of embedded device + motion sensor + cloud platform to achieve this goal. The only requirement was for the device to support HTTP for notifying the cloud service. (FYI – a spare kit was was also developed using an ElectricImp and the EVRYTHNG API).
Here is what the code looks like for the EVRYTHNG API:
Link to the Code.
The Social Bit:
Last but not least, we wanted players to be able to “check into” the Fussball Table before starting a game with their Facebook account, so that we could share the score at the end of the game.
For this we used the EVRYTHNG API’s Facebook connector. With just a bit of code and the EVRYTHNG.js (beta) SDK you can create an app that allows a Facebook user (here the player) to check into an EVRYTHNG managed thng (here the Fussball Table).
The steps are pretty straight forward:
Create a Thng corresponding to the Fussball Table and generate its QR code, redirecting to where you’ll put your final app.
Use the EVRYTHNG.js SDK to allow Facebook users scanning the QR code checking into the Fussball Table.
Here is what the code for this last step would look like:
Link to the Code.
It’s all about spontaneity…
Here comes the beautiful part. As I said before Web of Things Hackathons are all about unplanned interactions between people and things. Well this Fussball Table is a neat example of spontaneity:
- The embedded devices in the goals do not know of each other, furthermore they do not know they are goals. All they know is that if they detect an object (i.e., the ball) they have to update a property stored on the EVRYTHNG (respectively COMPOSE) API.
- Moreover, the scoreboard doesn’t know much about fussball or about the ongoing game, all it knows is a URL to get one counter from the EVRYTHNG API and one from the COMPOSE platform.
- Similarly, all the sharing page needs to know is the address of the Thng on the EVRYTHNG API corresponding to the object from which to extract the properties to push to Facebook.
Besides the fact that it was real fun building and testing it in a day I really like this prototype because it illustrates two important concepts for connecting things.
Secondly, it also shows how IoT and WoT cloud platforms can be the mediators of relatively complex, sometimes unplanned, real-world workflows. Indeed, all the actors of the Smart Fussball Table use-case rely on the fact that the data is pushed to a universally accessible API in the cloud where it can reliably and easily retrieved by all interested parties without firewall, connectivity, availability or protocols incompatibilities issues.