Getting Started with Microsoft Azure
In this article, you will have access to an overview discussion of the Intel development boards, as well as details about how to program and work with them, along with the sensors from the Grove* Kit.
What you need
If you're ready to dive into the world of IoT, you should consider acquiring an Intel® Edison board, the Grove* Starter Kit, and a Gateway that leverages a Wind River* OS. These technologies will be up and running in no time, while also providing you with a powerful set of tools to tackle any number of IoT projects. Let's take a look at each of these components.
By using the Intel® Edison board and starter kit, you will be able to experiment, create prototypes, and test your ideas on a flexible platform. Then, as your ideas mature, you can begin to consider a gateway. Let's talk about the prototyping purpose of the Intel® Edison board: It is a small, but powerful board that can be used for the Internet of Things development. The compute module has a dual-core CPU, integrated Wi-Fi, Bluetooth* 4.0, 1GB DDR and 4GB flash memory. It also has 40 multiplexed GPIO interfaces.
Read more about the Intel® Edison board
You can connect the Intel® Edison development board and an Arduino* board with the help of aspecial downloadable kit; alternatively, you can use a breakout board kit if you prefer.
To get an overview idea on what can be accomplished with the Intel® Edison board, visit Instructablesto find more projects.
The Grove Starter Kit is a modular electronic platform for quick prototyping. Every module has a different function, such as detecting the temperature, sensing touch, and more. You just have to plug in the modules you need to the base shield and then you are ready to test your projects.
The Intel® IoT Gateways along with Wind River OS connect legacy and new systems, and enables secure data flow between edge devices and the cloud.
Development Process and Prototype Purpose
We’ll continue by putting together a prototype, because it is crucial for a development team to work with it in the fastest time possible, due to the amount of useful feedback it can generate.
There are four stages in the IoT development process:
1. Learning & Experimentation: The first stage that is dedicated to assessing your software skills and discovering how they can be applied to your projects.
2. Design & Planning: This stage of the development process coincides with the moment when you get to sketch out your concepts and you analyze them.
3. Execution & Build: At this point you can use your initial concepts to build a functional prototype.
4. Go-to-Market & Scale: Finally, in this stage, you need to decide if the product you made meets the requirements to make it to market.
For more information, see The Journey of an IoT Developer.
The development process starts with Learning & Experimentation stage. In this stage you set your goals, assess your skills to reach those goals and make some experimentations with the technologies. This guide will be of assistance in this stage as you have a starting point for your learning process and you can make better assessments of skills and experimentations with the technologies.
At the early stages of a project, one of the main goals is to get as many on-point opinions as possible about the developed solution, in order to continuously improve it and tailor it after the market’s needs. The product prototype that is to be demonstrated here will use an Intel® Edison board with a temperature sensor for gathering the data, a gateway for routing it and Azure* to store the data. Your prototype can extend this model to gather more relevant data for your solution, and you can use Azure to process it, analyze the data and give valuable feedback for future improvements. This is the Design and Planning stage of the development process where you sketch out your ideas and analyze them before you start working on the prototype.
The prototype is done in The Execution & Build stage of a product, and it is relevant as it provides validation. The first proof that your concept works is a functional prototype, and it is a good subject for you to test and analyze the data. It also leads to one of the more important steps in a product’s life-cycle, the demo. The demo can attract prospective customers, partners, and investors and through it you are able to take a glimpse into the future of your product.
Finally, after the analysis of the prototype functionality, identifying the strong points and the weak points, you can scale your idea in the Go-to-Market & Scale stage. This stage should be implemented only after the prototype is thoroughly tested and analyzed, and the possible customers have offered feedback for the demo. This way you can minimize the risk and offer a better product to the market.
The Intel® Edison board is a great development board which can be used to create a prototype easily. It has great specifications for its compact size, and it is small enough that it can be used for the final product, not only for the prototype. Intel® Edison is especially good for prototyping as it has two extension boards, the mini breakout board which gives access to GPIOs and the Arduino* board, which gives compatibility with shields designed for Arduino. There are also third party extensions for the board that you can use to enhance the functionalities needed for the prototype. The small form-factor and the great specs, combined with the possibility of adding extensions make the Intel® Edison board one of the best for creating prototypes.
What are IDEs
Both beginner and advanced developers use IDE's (integrated-development-environments) to program their IoT projects. An IDE is a set of tools that help the programmer in writing other computer programs. A development environment combines all the steps of creating a program (for example: compiling, editing source code, testing, debugging, documentation generation and more) into a single software solution, which typically provides a friendly graphical user interface.
The main components of an integrated development environment are the source code editor and the debugger. Development environments call compilers or interpreters that can come in the same package with the environment itself, or they can be installed separately if needed. Facilities that are present in more sophisticated development environments include: source code explorer, version control systems, design of graphical user interface and software engineering tools.
For your IoT project, you can use Intel® System Studio and Intel® XDK, as they are well suited and provide many features that will fasten the developing time.
Intel® System Studio
Intel® System Studio IoT Edition is an IDE based on Eclipse. It is an open source integrated development environment written mostly using the Java* language. Besides working with Java language, it can be used to develop applications in other programming languages through the use of plugins, including C, C++, Python*, Perl, PHP, Javascript*, Prologue and more. Development environments include Eclipse JDT (java development tools) for Java and Scala, Eclipse PDT for PHP, and Eclipse CDT for C/C++, among others.
In case you chose to use ISS, one of the options available for you is the Azure toolkit for Eclipse, which provides functionality and allows the creation, development, testing and deployment of Java web apps to Microsoft Azure* from Mac OS*, Windows* and Linux*. The Azure toolkit for Eclipse contains features including Azure Management SDK and Storage SDK. Furthermore, the deployment of any JVM (Java Virtual Machine) to the cloud, deployment of any application server (Tomcat*, JBoss, GlassFish*, Jetty), customization and extension of the toolkit functionality with startup scripts, templates and components are featured in the toolkit to ease the development of applications.
See more details about Azure toolkit features
Installing Intel® System Studio
Go to Intel® IoT Developer Kit IDEs and select your operating system under Intel® System Studio IoT Edition to download the package, and follow the instructions in the appropriate user guide (C/C++, or Java).
Intel® XDK
Using Intel® XDK IoT Edition you can create and test projects for the intel boards (Intel® Edison and Galileo boards, as well as all the other available boards on the market). The Intel® XDK IoT Edition comes as part of the Intel® IoT Developer Kit, alongside with other software for programming in JavaScript such as Yocto* Linux system and a set of libraries. The set of libraries were created to help the developers in easing the control over the hardware components integrated with Intel IoT platforms.
The Intel® XDK is well suited for IoT applications with its IoT Edition and can work easily with Azure. The IoT Edition of XDK gives you better control over the movement of the code between your project and your development board, such as downloading code from the board to the project with ease, or uploading only modified files to the board after changes have been made, not the whole project. The capabilities of the Intel® XDK IoT Edition make it a great IDE solution for IoT development.
Installing Intel® XDK
In order to install the XDK, go to Intel® IoT Developer Kit IDEs, select your operating system underIntel® XDK IoT Edition, and follow the instructions in Getting started with the Intel® XDK IoT Edition.
Board solutions & Javascript examples
When speaking about IoT and Data Analytics as a programming language what you will always hear about is Javascript. Thanks to Node.js*, Javascript is growing constantly and is used for more and more applications because It’s easy to pick up, it’s lightweight and due to it’s speed, scalability and efficiency it fits the requirements of IoT applications perfectly (data-intensive, real-time applications).
In the example used below, we will use Node.js together with the MRAA library for javascript. The first thing you need is to setup the Intel® Edison board so you can connect it to your local network using the boards wireless adapter. Details on how to do this can be found on the Intel website.
After setting up the board, you’ll need to connect to the device using an SSH client, which will be different based on your operating system but for a quick reference you can check the wikipedia page for SSH clients. A standard way of connecting to your board using SSH would be writing the following command in your Terminal (or Command Prompt for Windows):
ssh <user>@<ip address>
To install Node.js on boards that run a lightweight Linux, like the Intel® Edison, see these instructions.
After successfully installing Node.js on your development board, first thing we need to install is the Intel mraa npm package. To do so, you will just need to run the following command in your ssh terminal:
npm install mraa
For future reference, you can go to the npm website for mraa.
The Hello World program for IoT application using development boards is usually lighting up an LED, not because it it simple, but this example shows you the basics of triggering an event with an immediate response. Instead of the LED we could even hook up the Grove Kit Relay to power up your electronics at the push of a button.
For this example to work you’ll need to connect the Grove LED socket shield to the D6 port of your Base shield.
Now, we just need to create a new javascript file (you can use the touch command in your terminal), save it with the *.js extension and write the following code in your newly created javascript file:
var mraa = require('mraa');
var led = new mraa.Gpio(6); // set up digital read on digital pin #6
led.dir(mraa.DIR_OUT); // set the GPIO direction to output
led.write(1); // set the digital pin to high (1)
As an alternative we could use the jsupm_grove npm package. More details as well as other information about working with the Grove kit sensors can be found on the Intel® Developer zone.
Now that we’ve learned how to program the Intel® Edison board and sensors, the next step in an IoT application would be to connect the data gathered to a cloud API like Microsoft Azure and work with the data. Luckily, Node.js can help us with this also. All you need to do is use the correct packages to upload the data gathered by the board. In our case the next steps would be to connect the board via USB to an IoT Gateway (which can be any general purpose computer that has Node.js installed on it, that is connected to the Internet but it is not recommended for industrial use), read data from the board using the npm package serialport and upload it to the cloud using one of many different methods like: HTTP requests using the request module or directly to the IoT hub on Microsoft Azure using the azure-iothub package.
Gateway
The devices of the future will control industrial or household temperatures, healthcare and will be part of industrial manufacturing intelligence. For this data to be aggregated, the gateway is the tool to do it. The gateway is a device that connects devices for generating intelligence, without replacing existing infrastructure.
An IoT gateway helps you easily connect devices and sensors to the cloud but also for interconnectivity between devices. Its main purpose is to route the data to wherever it is needed, acting as a storage point for analysis, or another device so it can make informed decisions.
With solutions built on IoT Gateways you can collect and analyze most sensor data at the network edge reducing data center transmission costs while enabling local and fast decision making. Data center analysis can be reserved to inform global business decisions.
The Intel® IoT Gateway offers support for multiple operating systems (Microsoft Windows® 10, Ubuntu* Linux, Wind River, and more), a variety of Intel processors for different application needs and robust device management capabilities. The Gateway securely connects the next-generation intelligent infrastructure and industrial devices to the IoT and integrates technologies and protocols for embedded control, networking, manageability and security on which third-party applications can run.
The Intel® Gateway Solutions for IoT enable:
- Connectivity to existing controllers embedded in the system and sensors
- Connectivity to enterprises (companies offering different solutions customized for a particular market) and cloud
- Pre-process filtering of selected data for delivery to servers
- Data encryption and software lockdown security
- Easy connectivity to legacy systems and local decision making.
The Intel® IoT Gateway offers the capability and connectivity to put the foundation of your IoT project in place, saving on costs and speed time to market. Proven Intel security, performance, scalability and remote manageability make it the right fit for fast deployments.
The Gateway OS (Wind River*)
Gateways using the Wind River Linux operating system were specifically developed for embedded systems. The main advantages of using them are:
- Secure connectivity – a crucial aspect when you are working with IoT devices
- Scalability – version 8 of Wind River Linux offers you special features for IoT development
- Being a Linux operating system, a great level of interoperability is at your disposal
- Cost-effectiveness
- Flexibility – open source software is an integral part of Wind River Linux
- Yocto Project compatible
Sensors – Grove* Kit
The Grove Kit is a collection of sensors, shields, cables and actuators used for Intel® IoT development. It is designed to be as simple as possible in order to put together a project based on an Intel® Galileo board, or Intel® Edison board.
The Grove system is a group of easy to use models, that minimizes the effort required to get started with microcontroller-based learning and experimentation. The sensors and actuators in the Grove Kit work with both Intel® Galileo board and the Intel® Edison board with Arduino expansion board.
Example of sensors in the Grove Kit:
Grove Rotary Angle Sensor
The Rotary Angle Sensor is mainly a potentiometer with a 10k ohms resistance. The angular change is 300 degrees with a linear change in value.
The programming is straight-forward, as it has a setup part where you set the serial communication frequency and set the pin mode (a variable for storing data and input mode, for example), and the actual reading from the sensor based on the stored data.
Grove Light Sensor
The Light sensor module incorporates a LDR (light dependent resistor or photoresistor which is a light-controlled variable resistor) in which the resistance of the LDR decreases when the ambient light intensity increases.
The programming is similar to any Grove sensor, the setup part and the reading of data is similar. The resistance is calculated as follows: (1023 – value) * 10 / value [where value is the value of the sensor]. A threshold is used to mark the light intensity drop for custom usage.
Grove Temperature Sensor
The Temperature Sensor is a sensor that uses a thermistor (a type of resistor whose resistance is dependent on temperature) to detect the ambient temperature. When the ambient temperature decreases, the resistance of the thermistor will increase.
The specific temperature value can be obtained by using the following formula:
resistance = (1023 – value) * 10000/value
[where “value” is the value from the sensor]
temperature = 1/log(resistance/10000)/B+1/298.15) – 273.15
[where B is the value of the thermistor]. The formula is a variation of Steinhart-Hart equation which approximates the temperature as a function of the resistance of the thermistor.
For more such intel IoT resources and tools from Intel, please visit the Intel® Developer Zone
Source:https://software.intel.com/en-us/articles/getting-started-with-microsoft-azure