‘How I connected FIWARE to a TupperBot’ by Angel Hernandez

Dec 5, 2013Agrifood

Most people don't get it, but let's be honest, some of us love those endless sessions of programming and idea development. This is exactly what the FI-WARE Smart City event in Santander was about: three intense days in which dozens of developers got together to unleash their imagination using the FI-WARE platform.

My teammate Jesús Domínguez and I aren't experts in web programming, but we both love robots. We can spend hundreds of hours adding wheels and engines to our ideas. Our hobby is building small robots that help us improve our technical abilities and force us to learn how to handle the latest technologies; that’s why we didn´t hesitate to take the opportunity of integrating FI-WARE with some of our robots.

ANGEL HERNANDEZ and JESUS DOMINGUEZ right after presenting their robot connected to FI-LAB to the Jury in Santander

For 72 hours we had a single minded and simple obsession: to control one of our robots via the Internet using the full potential of FI-WARE. To do this, we first had to learn about the Context Broker, Widgets, the Mashup … and thanks to an array of documents available to the public and the help of the development team at FI-WARE, we managed to connect our latest “Tupperware on wheels” (TupperBot) through the Cloud, allowing us to control it from anywhere in the world.


The brain of the robot is a Raspberry Pi for which we developed a small "operating system" that is capable of recognizing the devices connected to it: distance sensors, thermometers, motors, servos, telephones…

Once all devices are detected, the robot is able to interact with the world and it can be moved using a joystick normally used for video games and a control panel that provides full access to the "innards" of the robot. But of course, all developers always want to go further, so we decided not to use our control panel and to connect the robot’s small brain directly to the Cloud instead.


FIWARE offers developers an array of interesting tools, such as the virtual machines on which you can launch images of complete operating systems, with all the functionality from the platform. In our case, we use a virtual machine with the image of Orion, because it allows us to have our own private Context Broker. 

The Context Broker is the "home" of the robot in the Cloud. Here we published the values ​​of all the sensors and the actions it can undertake, like movements, taking measurements, raising its arm with the phone to make video calls…


Once the robot is virtualized in the FIWARE Context Broker, it´s possible to interact with it through the command line to make a videoconference for example or to move it freely around your home from anywhere in the world. But since it´s very inconvenient to have to type the commands in the console just to make the robot move, we created the Control Widget. This simple widget reads the keys pressed and informs the Context Broker of the action that the user wants to perform. Once the Context Broker has been informed, the robot is in charge of carrying out whatever it has been commanded to do. Although the polling method that we developed is not ideal for a mobile platform like ours, it was the quickest one we could integrate with FI-WARE, so we consider this system to be a very successful concept test.



Our robots are always loaded with different devices capable of measuring distances or temperature, detecting the presence of people or locating the magnetic orientation, etc. So one of the main objectives was that all this information would be available in the Cloud and accessible in FI-WARE, just as the traffic information in Santander is. To do this, every now and then the robot´s brain publishes the value of each sensor in the Context Broker and the widget takes care of displaying the information graphically. 


The Mashup is the “desktop” that every FI-LAB user can create. Simply by opening an account and navigating through the library of widgets, it is possible to create one´s own desktop with traffic information, parking information, weather reports… and to use the Control Widget Control and the Sensor Widget to access your robot. Both Widgets interact with the Context Broker that they are configured with and they connect to the robot available. This is how we replaced our local control panel with a control panel in the Cloud, thanks to the tools provided by FI-WARE.

Angel Hernandez

Related articles