Building your First Internet Of Things Solution - a Software Developer Perspective

Raghavendra Ural Developer Evangelist Developer Relationship Division Software @ragural

Your logo Agenda

• The Compute Model Transforms Again • Where is the opportunity? • Architecture of IOT • Challenges • Where do “I” fit in? • Where Intel® can help? • Overview of Software developer journey into IOT • Intel® Internet of Things Hardware • Tools for app building The Compute Model Transforms Again

1975 1985 1995 2005 2015 IoT is Driving the Next Compute Transformation Where is the opportunity?

• 22pt Arial font is used for an introductory line or paragraph. This text may be a single heading for the bullets below or multiple sentences when necessary. – 18pt Arial bullet one • Sub-bullet – Bullet two – Bullet three Make everything smart

Smart City Smart Energy Grid Smart Agriculture Smart Car Smart TV Many More IOT Architecture

Application Layer GatewayNetwork and Layer

Cloud Interface

Aggregation Layer

Sensor

6 Challenges

• Security & Privacy • Big Data Explosion • Countless components • Power efficiency • Standards/Interoperability • Many more Where do “I – Software Developer” fit in?

Application Layer • Tablets, Phablets, Smart Phones, , Laptops

Aggregation Layer • Embedded applications

Cloud Systems/Interfaces • Server Platforms

Sensor Layer • Building Sensors

Gateway and Network Layer • Network Interfaces Where Intel® can help you?

• Tablets, Phablets, Phones, Ultrabook, Intel Security, Application Layer Mashery API, etc

Aggregation Layer • , , MinnowboardMax

• Intel server , Wind River Platforms, BIG Cloud Interfaces/Systems platforms Data

Sensor Layer • None

Gateway and Network Layer • Intel Network Interface cards, Intel Wifi cards Let’s get started with Intel IOT

IOT Hardware Before you start Software tools APIs Coding and Debugging Intel® Internet of Things Hardware Intel® Galileo Development Board – Gen 2

– 400MHz 32-bit Intel® Pentium instruction set architecture (ISA)- compatible processor – 16 KByte L1 cache – 512 KBytes of on-die embedded SRAM – Simple to program: Single thread, single core, constant speed – ACPI compatible CPU sleep states supported – An integrated Real Time Clock (RTC), with an optional 3V “coin cell” battery for operation between turn on cycles. Intel® Galileo Development Board – Gen 2

Board I/O: – Mechanically compatible with Uno – 20 digital input/output pins including 6 pins as PWM outputs – 6 analog inputs – 2 UART (RX/TX) – 1 I2C – 1 ICSP 6-pin header (SPI) – USB device connector (Host) – Micro USB device connector (client) – SD Card connector – DC power jack (7V – 15V DC input) Intel® Edison Intel® Edison - Arduino Development Board

Board I/O: Compatible with Arduino Uno (except only 4 PWM instead of 6 PWM) – 20 digital input/output pins including 4 pins as PWM outputs – 6 analog inputs – 1 UART (RX/TX) – 1 I2C – 1 ICSP 6-pin header (SPI) – Micro USB device connector OR (via mechanical switch) dedicated standard size USB host Type-A connector – Micro USB device (connected to UART) – SD Card connector – DC power jack (7V – 15V DC input) More and More Shields

Source: sparkfun.com Grove Starter Kit Plus - Intel® IoT Version

1 Base Shield v2 2 Grove - Buzzer V1.1 3 Grove – Button 4 Grove-LED v1.3 USB, serial Grove - Sound Sensor_V1.2 5 and Ethernet 6 Grove - Rotary Angle Sensor cables 7 Grove-Touch Sensor 8 Grove - Smart Relay 9 Grove-Light Sensor 10 Grove - Temperature Sensor_V1.1 11 26AWG Grove Cable 12 Mini Servo 13 9V to Barrel Jack Adapter - 126mm 14 DIP LED Blue-Blue 15 DIP LED Green-Green 16 DIP LED Red-Red 11 Grove - LCD RGB Backlight Intel® IoT Developer Kit Components

Eclipse IDE Wyliodrin Cloud Intel XDK + Arduino IDE (Visual Analytics / IoT Edition ISS Programming) Mashery

(Optional)

IDE/ IDE/ Tools (Win, Mac, ) Mac,(Win,

NodeJS C/C++ Wyliodrin IoT Cloud Support Tool Chain Agent Agent

LibMraa UPM (Sensor/Actuator library repository) API Bindings C/C++, Node JS, Python

S/W Image on S/WImageIoT on platform Yocto based Linux OS image

Intel Galileo Intel Edison Gen 1 & 2 Arduino Board Development Hard Ware Board Sensors / Actuators Before you start

Update Galileo Firmware • Download latest IDE from http://arduino.cc/en/main/software • Extract the content to a folder • Power up the board and then (then only) connect the USB to USB client • Open Arduino IDE • Go to Help and click on Firmware Update

Be Patient, it might take sometime. It might even disconnect itself from your computer. DONT UNPLUG THE cable. It might take time but works!!! Boot the Development Environment Use PuTTy to connect to the board and execute commands. You can use WinSCP to transfer files to the board.

Login for Intel Galileo Board Username: root Password: There is no password Software Tools Developer Kit C++ Tools

• One IDE for all three supported boards • Ready to run sample code

• SSH Connection to developer board for remote GBD server. • tools also work for Arduino Sketch code build and debug Developer Kit JavaScript Tools

JavaScript I/O Libraries for Galileo • mraa – open source library for Galileo/Edison used API similar to the *MBED api (Intel Iot Devkit )

• io-js- open source library for Galileo/Edison used API similar to the Arduino API (Intel Labs China )

• johnny-five – Open source I/O library with plugins for various boards including Galileo (Gen2 demo upstairs)

• on/off – open source i/o library that can be used to manipulate ‘raw’ GPIO/PWM via sysfs interface

• i2c – node.js i2c library (uses sysfs)

• Developer Kit Python Tools

There is one IDE for Intel® Galileo board. GUI based online python Works with Generation 1 and 2. development from Wyliodrin

Wyliodrin agent pre-installed in IoT devkit SD image. (Galileo only for now) It’s Show Time Intel® Galileo Network Setup Enable WiFi

We use connection manager “connman” in DevKit

Hardware setup: 1. Connect the board through FTDI cable or through Ethernet cable. 2. Connect Intel Centrio N135 wifi card to PCi slot $ connmanctl connmanctl>enable wifi connmanctl>scan wifi connmanctl>services *Ac Wired ethernet_984fee0081e8_cable Raghs wifi_0cd292d9b3a4_5261676873_managed_psk wifi_0cd292d9b3a4_hidden_managed_wep connmanctl> agent on Agent Registered connmanctl>connect wifi_0cd292d9b3a4_5261676873_managed_psk Paraphrase? Eclipse* Setup Intel® XDK Setup Overview of “libmraa” and “libupm” Purpose of Each Library

Libmraa Libupm • Defines the capabilities • Defines the interaction of of GPIO pins, high level sensors. Autodetection of Gen 1, • Buttons, Buzzers, LCD, LED, Light Sensor, Servos, Rotary Gen 2 and Edison DVT Angle Sensor, Relays, Sound Sensors, temperature sensors … more are added continually. Using libmraa for the Blinky Light Demo Using libupm for the Blinky Light Demo Libmraa Error Codes… Read a Potentiometer Write to an LCD Buttons Light Sensor Mini Servo Temperature Sensor Call for action Intel® Internet of Things Developer Program Intel® Internet of Things Developer Program

A comprehensive developer program for hobbyists, students and entrepreneurial developers with outreach, training and tools required to rapidly develop, test and deploy applications for the Internet of Things (IoT).

Program includes: • Developer kit based on Intel® Galileo and Edison Technology with package of easy to use hardware, software tools, libraries and cloud services • 10 City IoT Roadshow distributing 1,000 kits • On-line community for learning, building, sharing

Join the community today at software.intel.com/IoT Join us @ The Lalit Ashok, Bangalore Nov 22 & 23, 2014 Sign up at iotroadshow.intel.com

#IntelMaker Questions? Contact

LinkedIn/Twitter: @ragural Email: [email protected] Resources http://software.intel.com/iot https://github.com/intel-iot-devkit