Upload
intel-software
View
810
Download
0
Tags:
Embed Size (px)
Citation preview
Developing a NodeBot using Intel XDK IoT
Edition
Stewart Christie
Community Manager, IoT Developer Program, Intel Corporation
http://nodebots.io/
22
3
DEVELOPMENT RESOURCES: Get tools,
technical articles, code samples, and services
BUSINESS RESOURCES: Access direct consumer
sales channel, co-marketing opportunities, and
funding
ENGAGED COMMUNITY: Connect with Intel
experts and industry peers to share knowledge, get
support, and build relationship
All Things Software –
From Development to Distribution.
Intel® Developer Zone
software.intel.
com
INTEL® DEVELOPER ZONE
ANDROIDINTERNET OF
THINGS
PERCEPTUAL
COMPUTING
(REALSENSE)
HTML5
CHROME
WIN 8
AIO/2n1
4
IoT Roadshows - F2F training and
distributing Dev Kits, training videos,
technical resources and Meet-Ups
IoT On-line Community and Forums
for learning, building, sharing on Intel
Developer Zone for IoT.
University Programs to enable IoT
courseware.
Intel® IoT Developer Kit based on
Galileo & Edison boards together with
easy to use hardware, software, tools,
cloud services
4
Intel IoT Developer Program
A comprehensive program for hobbyists, students and entrepreneurial
developers that delivers everything a software developer needs to quickly and
easily turn ideas into solutions for the Internet of Things (IoT)
SW Solutions – Development tools
within the same development
framework: (Yocto) Linux image, C
/C++ JavaScript, Wyliodrin (visual
programming) , IoT Cloud Analytics+
Mashery Tools (GDB, GCC, XDK,
Eclipse plug-in)Softwar
e
TrainingCommunity/Academic
Hardware
IoT
software.intel.co
m/IoT
5
Intel® Internet of
Things Hardware
6
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)
7
Intel® Galileo Development Board – Gen 2
Board I/O:
• Mechanically compatible with Arduino 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)
8
Grove Starter Kit Plus - Intel® IoT Version
1 Base Shield v2
2 Grove - Buzzer V1.1
3 Grove – Button
4 Grove-LED v1.3
5Grove - Sound Sensor_V1.2
6 Grove - Rotary Angle Sensor
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
USB, serial
and
Ethernet
cables
9
Intel® Internet of Things
Developer Program
11
Intel® IoT Developer Kit Components
Intel Galileo
Gen 1 & 2
Board
Intel Edison
Arduino
Development
Board
Yocto based Linux OS image
API Bindings C/C++, Node JS, Python
UPM (Sensor/Actuator library repository)LibMraa
NodeJS
SupportC/C++
Tool Chain
Wyliodrin
AgentIoT Cloud
Agent
Hard
Wa
reS
/W Im
ag
e o
n Io
Tp
latf
orm
Intel XDK
IoT Edition
(coming soon)
Eclipse IDE
+
ISS
(Optional)
Wyliodrin
(Visual
Programming)
Cloud
Analytics /
Mashery
IDE
/ T
oo
ls
(Win
, M
ac, L
inu
x)
Sensors / Actuators
Arduino IDE
12
Developer Kit JavaScript Tools
• 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)
• .
JavaScript I/O Libraries for Galileo
13
WebSocket (ws)
Websocket (ws)
Debug Protocol Translator
V8 Debug Protocol
Node.js App
appDaemon Protocol
run, stop, restart, install,
debug, sync
Intel® XDK
Chrome Debug Protocol (ws)
Intel® XDK IoT Device Daemon OverviewSeparate web-sockets for debug protocol and daemon protocol
IoT
Device
Dev
Machine
Running
XDK
Chrome Debug Protocol (ws)
14
Developer Kit Python JavaScript Tools
There is one IDE for Intel® Galileo
board. Works with Generation 1 and 2.GUI based online python
development from Wyliodrin
Wyliodrin agent pre-installed in IoT devkit SD image.
(Galileo only for now)
15
Raw filesystem IO using Bash.
• Not for the faint of heart.
• GPIO filesystem mappings vary from board to board.
• Pin Direction, Drive , Value all need to be set for each pin.• # Initializing digital output pin number 8
• echo -n "26" > /sys/class/gpio/export
• echo -n "out" > /sys/class/gpio/gpio26/direction
• echo -n "strong" > /sys/class/gpio/gpio26/drive
• echo -n "0" > /sys/class/gpio/gpio26/value
• echo -n "26" > /sys/class/gpio/unexport
15
16
Overview of
“libmraa” and
“libupm”
17
Libmraa
Defines the capabilities of GPIO pins,
Autodetection of Gen 1, Gen 2 and
Edison Arduino boards
Libupm
Defines the interaction of high level
sensors.
Buttons, Buzzers, LCD, LED, Light
Sensor, Servos, Rotary Angle Sensor,
Relays, Sound Sensors, temperature
sensors … more are added continually.
Purpose of Each Library
18 18
Libmraa – Object API (node.js)
Playing with GPIO is easy
var m = require("mraajs") # Import maajs module
var x = new m.Gpio(8) # Create a GPIO object for pin 8
x.dir(m.DIR_OUT) # Set GPIO direction to output
x.write(1) # Write to GPIO
19
Clean and Build project. This may take a few minutes.Fetching packages using NPM: Installing socket.io@latestUPLOADING: Uploading project bundle to IoT device.Intel XDK - Message Received: clean|================================================================| Intel (R) IoT - NPM Rebuild - (may take several minutes)|================================================================> [email protected] install /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/ws> (node-gyp rebuild 2> builderror.log) || (exit 0)make: Entering directory '/node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build'CXX(target) Release/obj.target/bufferutil/src/bufferutil.oSOLINK_MODULE(target) Release/obj.target/bufferutil.nodeSOLINK_MODULE(target) Release/obj.target/bufferutil.node: FinishedCOPY Release/bufferutil.nodeCXX(target) Release/obj.target/validation/src/validation.oSOLINK_MODULE(target) Release/obj.target/validation.nodeSOLINK_MODULE(target) Release/obj.target/validation.node: FinishedCOPYRelease/validation.nodemake: Leaving directory '/node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build'> [email protected] install /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws> (node-gyp rebuild 2> builderror.log) || (exit 0)make: Entering directory '/node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'CXX(target) Release/obj.target/bufferutil/src/bufferutil.oSOLINK_MODULE(target) Release/obj.target/bufferutil.nodeSOLINK_MODULE(target) Release/obj.target/bufferutil.node: FinishedCOPY Release/bufferutil.nodeCXX(target) Release/obj.target/validation/src/validation.oSOLINK_MODULE(target) Release/obj.target/validation.nodeSOLINK_MODULE(target) Release/obj.target/validation.node: FinishedCOPY Release/validation.nodemake: Leaving directory '/node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'[email protected] /node_app_slot/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/debug/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/engine.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/has-cors/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parseuri/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parseuri/node_modules/better-assert/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/node_modules/better-assert/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parseqs/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parseqs/node_modules/better-assert/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/has-binary/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/parseuri/node_modules/better-assert/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-client/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-adapter/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-adapter/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-adapter/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-adapter/node_modules/socket.io-parser/node_modules/emitter/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/socket.io-adapter/node_modules/socket.io-parser/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/[email protected] /node_app_slot/node_modules/socket.io/node_modules/has-binary-data/node_modules/isarray|================================================================| NPM REBUILD COMPLETE![ 0 ] [ 0 ]|================================================================
20
Introducing the Intel Developer Program
for IOT
Introducing the Intel® IoT Developer Program - https://software.intel.com/iot
21
Final Reminders
• Come to a Intel® Internet of Things Roadshow
• Download the software pieces you need, buy a sensor kit
• Build a project, publish on Instructables, and we will demo it at our roadshows and
meetups
• Learn more at the Intel Developer Zone at http://software.intel.com/iot
2222
Links
Intel® Galileo Documentation and Getting Started Guides
https://software.intel.com/en-us/iot/getting-started
Intel® IoT Developer Kit – Sensor and Actuator Documentation
https://software.intel.com/en-us/iot/sensors
Internet Connectivity - Galileo
https://software.intel.com/en-us/internet-connectivity-galileo
Intel at Instructables.com
http://www.instructables.com/id/Intel/
Intel® IoT Developer Kit Cloud-based Analytics User Guide
https://software.intel.com/en-us/intel-iot-developer-kit-cloud-based-analytics-user-guide
23
IoT Roadshows - F2F training and
distributing Dev Kits, training videos,
technical resources and Meet-Ups
IoT On-line Community and Forums
for learning, building, sharing on Intel
Developer Zone for IoT.
University Programs to enable IoT
courseware.
Intel® IoT Developer Kit based on
Galileo & Edison boards together with
easy to use hardware, software, tools,
cloud services
23
Intel IoT Developer Program
A comprehensive program for hobbyists, students and entrepreneurial
developers that delivers everything a software developer needs to quickly and
easily turn ideas into solutions for the Internet of Things (IoT)
SW Solutions – Development tools
within the same development
framework: (Yocto) Linux image, C
/C++ JavaScript, Wyliodrin (visual
programming) , IoT Cloud Analytics+
Mashery Tools (GDB, GCC, XDK,
Eclipse plug-in)Softwar
e
TrainingCommunity/Academic
Hardware
IoT
software.intel.co
m/IoT
24
Legal DisclaimerINFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR
OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF
SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO
SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY,
OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU
PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES,
SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES,
AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY,
OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN
THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS.
Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or
instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising
from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information.
The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published
specifications. Current characterized errata are available on request.
Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order.
Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or go
to: http://www.intel.com/design/literature.htm
Intel, Core, Atom, Quark, Look Inside and the Intel logo are trademarks of Intel Corporation in the United States and other countries.
The Bluetooth® word mark and logos are registered trademarks owned by Bluetooth SIG, Inc. and any use of such marks by Intel is under license.
*Other names and brands may be claimed as the property of others.
Copyright ©2014 Intel Corporation.
2525
Backup
2626
Rick Waldron: Mr Johnny Five*JavaScript: A Digital Clock with Johnny-Five
JavaScript: Current Detection and Measurement with Johnny-Five on Node.js
JavaScript: LED Matrix Display with Johnny-Five on Node.js
JavaScript: ESC Programming and Brushless Motors on Intel Galileo
JavaScript: Laser Intrusion Detection with Johnny-Five on Node.js
JavaScript: Verifying Analog Write on Intel Galileo
JavaScript: Relay Control with Johnny-Five on Node.js
JavaScript: Tilt Sensor with Johnny-Five on Node.js
On-Board: Intel Galileo Programming with JavaScript and Node.js
* (imho)
2727
https://github.com/gomobile: XDK examplesiotapp-touch-notifier iotapp-local-temperature
Read digital data from a Grove Touch Sensor, or a Temperature Sensor, start a web server and communicate wirelessly using WebSockets.
iotapp-template-pwm
Write values to fade a LED using a Digital pin (Pulse Width Modulation) on the Intel boards.
iotapp-template-onboard-led-blink iotapp-template-digital-write iotapp-template-digital-read
Digital Read and Write Examples .
iotapp-template-analog-read
Read data from Analog pins on the Intel boards
2828
Backup
29
IoT Devkit for Edison vs. Galileo
LibMraa/ UPM
C/C++ (Eclipse)
Java script (XDK)
Visual (Wyliodrin)
Arduino
VxWorks
Intel System Studio
OS/ Image
Edison
Unified OS Image
Galileo Gen 1/Gen 2
Independent OS Image
S/W package for Edison EGLibC OS Image (Yocto 1.6)
Access to low-level I/O + Sensor libs -
Included in Edison S/W stack
Eclipse IDE (64-bit) for C/C++ dev
on Win, Linux, Mac
Node JS Support. Included in Edison
S/W stack. Coming Soon (Sept 30th )
Future
Access to low-level I/O + Sensor libs
Eclipse IDE (64-bit) for C/C++ dev on
Win, Linux, Mac
Node JS Support
Coming Soon (Sept 30th )
Wyliodrin Component
Included in Edison S/W stack
Advanced optimization tools for IoT
Future (TBD) Vx Works + Work bench
Advanced optimization tools for IoT
Multi-lib support for Arduino
IoT Cloud Analytics IoT Cloud Analytics component
- Included in Edison S/W stackIoT Cloud Analytics component
29
30
DemoIntel® XDK
30