2016.04.17 Firenze
About me Stefano Terna Technical co-founder @ TomorrowData @stefanoterna stefanoterna stefano.terna@tomorrodata.io
About TomorrowData Domain: IoT & Machine Learning for SMEs Open Source: Iottly Project Technologies: IoT continuous integration Remote machine learning
Topics Introduction to key IoT concepts Iottly live demo Working with the source code Road map
Technological phase transitions A different arrangement of parts that makes a new whole with different properties Carbon IT Infrastructures Bandwidth Virtualization Pressure > 10 GPa Storage cost CPU cost CLOUD Data Volume Velocity Variability Embedded devices Sensors cost Low power Pervasiveness Internet BIG DATA
IoT post transition issues Embedded devices Industrial automation Pre transition It works Don t touch it anymore!! (or upgrade rarely) Post transition Integrating Delivering Devices Put your logic cloud-side Don t touch it anymore!! (or upgrade rarely)
IoT post transition issues Logic and useful functions cannot just live in the cloud. They should be implemented on the field : to benefit from real-time high frequency data captured by sensors to build reliable solutions for critical industrial applications to reduce action latency and bandwidth consumption to make the data actionable even if the connection is discontinuous We have too many devices to forget about continuously integrating and delivering the firmware. what happens if the device won t reboot? what happens if firmware is corrupted during transfer?
IoT post transition issues Embedded devices Industrial automation Pre transition Post transition Security? Who cares about small devices on his local network... Who knows the meaning of the messages... Security Privacy hackers remotely kill jeep highway 2015 July Best practices Security? Don t use the same password for every device encryption
Open Source Open Source plays a fundamental role in addressing the main issues arising in the IoT scenario: interoperability, security and privacy A true interoperability can be achieved only if the building blocks can be shared by producers and developers among the different solutions, platforms and devices. In turn, such a wide spreading of the same code base will increase security, by enabling cross testing processes, performed by multiple independent parties in different application contexts. Moreover publishing the code that handles the data will result in a much stronger answer to the privacy demand than just asking the user to accept formal policies.
Distribution An IoT Platform is not just a program It is an entire ecosystem of architectural blocks They need to be properly orchestrated togheter many great open source tools already exists to cover some blocks New tech issues generated by the IoT scenario need to be addressed by new tools
Python It is easy to try out new key concepts Prototyping on both sides of the IoT pipeline (MicroPython) Orchestrating existing and new tools Fabio Pliger, The IoT (r)evolution, present and future - PYCON6
Iottly https://github.com/iottly open source Internet of Things distribution
Iottly Architecture and Python map IOTTLY Core Database IOTTLY Trust Mongo DB Web framework Tornado Web server nginx Front-end security Python decorators Python Openfire SleekXMPP MQTT Payload is free JSON Custom configuration of messages MQTT / XMPP Device authentication Mosquitto paho Real-time admin control of devices Customized on payload semantics OTA firmware upgrades Allows to start controlling devices in seconds GUI Web / Responsive Real-time Customizable (controls, icons, layout) Internet / WAN / LAN Transport Ethernet / Cellular / WiFi Arduino Raspberry Pi UDOO C/C++ Python Python Agents for devices Angular JS Ready to use control app Internet / WAN / LAN JSON Device admin console Device security Mosquitto Message designer Python IOTTLY Broker XMPP IOTTLY IoT developers tools
Live demo https://demo.iottly.org
Iottly Description Iottly is an Internet of Things enabling platform Open source: IoTtly GitHub It is specifically designed to speed up industrial IoT projects where the following aspects are important: Bidirectional complex communication scenarios with remote devices, over-the-air firmware upgrade, automatic generation of device code based on message semantics. It is designed as a distribution orchestrating already existing open tools: technical insights
Iottly Main Python components - Iottly Core Iottly Core On GitHub: https://github.com/iottly/iottly-core It is written in Python on top of Tornado Main functions include: receiving incoming messages from devices, on /msg handler, via the iottly-xmpp-broker; sending messages messages to devices, via the SleekXMPP python library, which in turn is connected to the iottly-xmpp-broker; persisting incoming messages to the Iottly database which runs on Mongo; pushing messages to the iottly-console in real-time, via websockets accepting messages from the iottly-console, via the /command handler and forwarding them to remote devices; forwarding incoming messages to a client service, iottly-client-core, registered via a client callback url.
Iottly Main Python components - Iottly device agent Iottly device agent On GitHub: https://github.com/iottly/iottly-device-agent-py Designed for devices which can run Python (like Raspberry Pi, UDOO) A porting to MicroPython is under evaluation It installs onto the device enabling it to communicate with Iottly Main features include: XMPP communication to iottly-xmpp-broker via SleekXMPP library API exposed to the user, to implement complex firmware behaviours Parallel processing of multiple firmware tasks implemented via multiprocessing Python API Ability to self upgrade upon receiving Over the Air firmware upgrade via XMPP protocol no need to remotely ssh into the device for development and maintenance
Working with the source code Iottly distribution is designed to enable developers to get involved quickly and simply. It s easy to have the full Iottly architecture up and running in minutes, starting from a fresh clone of Github repos. Just read the instructions
Road map Targeting IoT Continuous integration and delivery Smart things Branch master Smart things production Smart things Git integration with Iottly Branch newfeature Merge into master Smart things Test on the field Iottly QA On the field
Road map http://tomorrowdata.io/iottly/technical-insights/
c/o Bliss Coworking Strada Basse di Dora, 42 Torino - Italia tomorrowdata.io info@tomorrowdata.io Talk given at PyCon7, 15-17 April 2016, Florence, Italy Slides distributed under Creative Commons License Attribution-Share Alike 4.0 International (CC BY-SA 4.0)