The Need for Fresh Air in the Internet of Things
Arduino, Raspberry PI, UDOO, Spark Core or similar prototyping boards have revolutionized the way people prototype IOT devices and robots, and have changed the paradigm also in light home automation as well as some industrial applications. However, although such boards have a great impact in prototyping the electronics, a similar revolution has not happened at the code level. In fact C/C++ is mostly used for coding and often too much time is spent in reinventing the wheel or in merging code written in the past.
Of course people with different backgrounds experience different problems but all of them frequently face similar difficulties. Product designers want to create behaviours that can co-exist at the same time and are often frustrated by "anomalous" and unexpected results of their installations. Makers who have higher competences invest a lot of time in understanding how to code multithreaded behaviours, how to manage interrupts in C++, etc. and sometimes their code becomes really hard to maintain. Programmers are frustrated by executing "boring" tasks for their "customers", one example is related (again) to the lack of multithread, interrupts, callbacks, timers and exceptions that have for them become essential. Moreover, all of them have to recode when moving from one board to another.
The Raspberry Pi success demonstrates the need for an easy programmable and usable intelligent unit for the design of smart and interactive objects. Furthermore prototyping is no more a free-time activity for makers and geeks. However the use of a microprocessor based board is not the correct choice for the design of a lightweight, battery powered and miniaturized product.
On the other hand, microcontrollers have always been associated with applications related to low-level control and real-time requirements for industrial applications. This is why little effort has been invested in the usability and programmability of these extremely efficient control units.
In order to make a microcontroller usable by everyone it is necessary to add an abstraction layer on top of the hardware. This process has been done years ago in microprocessors with the design of various operating systems. Various programming facilities have been placed on top of these hardware managers. This created Virtual Machines in which inserting another abstraction layer gave programmers the possibility to design using very high level features, together with the guarantee of portability to various operating systems and, consequently, to various hardware.
Examples of operating systems for microcontrollers are ChibiOS, FreeRTOS and many others. Most of these systems are aimed at guaranteeing real-time features but a survey we recently did showed that real time is not really required when passing from low level to high level programming.
It is worth highlighting that real time does not mean fast. Real time systems are those that guarantee time constraints on execution: the constraint can be very tight like airbags, gearboxes, and injectors (order of microseconds). However in 99.99% of household appliances, 99% of designers’ applications, artistic installations, makers’ prototypes and at least 80% of industrial applications in production and manufacturing, you need constraints in the order of milliseconds (10-100ms).
Not reinventing the wheel
What we are talking about is not reinventing an architecture for the embedded world but rather mimicking what happened in the mobile domain with Android. Android is a Java Virtual Machine that runs on top of a Linux operating system. The operating system guarantees the hardware management and allows easy porting of the entire system to various hardware; thus guaranteeing future scalability and adaptability to the new generation of mobile chips and standards.
Below we study the abstraction problem and try to identify the technical and architectural requirements by exploiting the similarity with Android.
Technical and architectural details
The software suite for the design of interactive objects based on microcontrollers should include an Operating System (OS) and a Virtual Machine (VM) but also other enabling tools like a programming environment, a set of ready to use libraries and a connection with mobile devices and apps.
A browser-based integrated development environment (IDE) with "plug and play" board capabilities seems to be a good way of allowing different users to use the work station they prefer without being driven crazy by the installation of compilers, IDEs, and board-specific tools. Boards like ArduinoDUE, UDOO, Spark Core or Spark Photon, ST Nucleo, etc. have to be easily recognized by the IDE running on all the most used PC OS (Windows, Linux and Mac).
Connectivity. The software suite has to support connectivity: TCP and UDP connections, higher level protocols such as HTTP and, in cases where the board has enough resources also HTTPS. Currently many microcontrollers have insufficient memory to allow cryptography, but, to comply with such requirements new boards appearing in the market are more and more powerful. Therefore, the suite must easily communicate with cloud services like IFTTT, Paraimpu, Carriots, Spark Cloud, etc.
Mobile apps and integration with notification services. The ever increasing demand for remote controlled devices requires a system for easily connecting devices with mobile apps. What is needed is a generic mobile app that is able to discover all the devices available on the local network or to connect with a specific remote device. The app interfaces have to be located in the device and transferred to the mobile once requested by the app. This will allow the design of interfaces within the same code used for defining the device behaviour. Such an app could allow the control of the actuators and the monitoring of the sensors integrated in the device allowing also the extension of the device actuation and sensing to the mobile ones (i.e. reading the mobile GPS or alerting through the mobile notifications service).
A solution that has been tested to efficiently address many of these items following the previously described architecture has been developed and is called VIPER. "VIPER (Viper Is Python Embedded in Real time) is an open source development suite oriented to IOT and robotics and is composed of: a Virtual Machine, an IDE, a smart networking system and an app". The solution targets all IoT enthusiasts, software developers, and also application providers. More information is available at: http://bit.ly/kickviper, www.thingsoninternet.biz and viper.thingsoninternet.biz. Videos and case studies can be found at: https://www.youtube.com/channel/UCuh5UgwOCe_nAAHHgCAIfHg.
Giacomo Baldi is a computer scientist and a medical doctor. He works as a software architect implementing algorithms, devices and Apps in his medical work. He has considerable experience in programming embedded devices and in developing software applications both for research and industry. His main research interests are in the development of interconnected and low cost medical devices for helping patients, medical doctors and hospital staff.
Gualtiero Fantoni achieved his PhD in Automation, Robotic and Bioengineering at the University of Pisa in 2005 and is an Associate professor of "New product development" and "Manufacturing engineering" at the University of Pisa. His main research interests are in the field of robotics applied to manufacturing, production engineering and maintenance.
Daniele Mazzei is a postdoctoral researcher at Research Center "E.Piaggio" of University of Pisa and a member of IEEE. He achieved the PhD in Automation, Robotic and Bioengineering at University of Pisa in 2010. Mazzei's actual research focuses on social robotics and human robot empathic interaction studies. He is the scientific coordinator of the FACETeam, a group of the Research Center "E.Piaggio" focused on the development of social and affective robotics. He also is the technical coordinator of the EASEL project aimed at developing a theoretical understanding of human-robot symbiotic interaction.
Gabriele Montelisciani has a PhD in Economics and Management Engineering. He is a Research Associate at the University of Pisa focusing on: methods and tools for early stage innovation and collaborative design; sustainable innovation and development; new business development and entrepreneurship; value creation from ICT innovation. Montelisciani is the Project Manager for the project ENDuRE – European Network of Design for Resilient Entrepreneurship (EU Erasmus+ Knowledge Alliance).
Subscribe to the Newsletter
Join our free IoT Technical Community and receive our Newsletter.
Calendar of Events
2020 IEEE Virtual World Forum on Internet of Things (WFIoT2020)
2-16 June 2020
IEEE International Conference on Omni-layer Intelligent Systems (COINS 2020)
27-29 July 2020
2020 IEEE International Conference on Internet of Things and Intelligence System (IoTaIS 2020)
3-5 November 2020
2020 IEEE Global Conference on Artificial Intelligence and Internet of Things (IEEE GCAIoT 2020)
12-15 December 2020
Call for Papers
Special Issue on Robustness and Efficiency in the Convergence of AI and IoT
Submission Deadline: 15 May 2020
Special Issue on Blockchain Enabled Edge Computing and Intelligence
Submission Deadline: 1 June 2020
Special Issue on AI‐driven IoT Data Monetization: A Transition From “Value Islands” To “Value Ecosystems”
Submission Deadline: 15 June 15, 2020
Special Issue on Industrial Security for Smart Cities
Submission Deadline: 1 July 2020
Special Issue on Age of Information and Data Semantics for Sensing, Communication and Control Co-Design in IoT”
Submission Deadline: 15 July 2020