Get access to the new Intel® IoT Developer Kit, a complete hardware and software solution that allows developers to create exciting new solutions with the Intel® Galileo and Intel® Edison boards. Visit the Intel® Developer Zone for IoT.
The Internet of Things (IoT) path-to-product project is part of a series that portrays how to develop a commercial IoT solution from the initial idea stage through prototyping and refinement to create a viable product. It uses the Intel® IoT Commercial Developer Kit, with the prototype built on an Intel® NUC Kit DE3815TYKHE small-form-factor PC and an Arduino* 101 board.
The exercise described in this article demonstrates how to recreate the prototype from the path-to-product project. It does not require special equipment or deep expertise. It is intended to be instructive toward developing prototyping phases of IoT projects in general. To see the project overview, see IoT Path-to-Product: Smart Home Overview.
Visit GitHub for this project's latest code samples and documentation.
Introduction
From this exercise, developers will learn how to do the following:
- Connect to the Intel® NUC Kit DE3815TYKHE.
- Interface with the I/O and sensor repository for the Intel® NUC using MRAA and UPM from the Intel® IoT Developer Kit, a complete hardware and software solution to help developers explore IoT and implement innovative projects.
- Run the code sample in Intel® XDK IoT Edition, an IDE for creating applications that interact with sensors and actuators, enabling a quick start for developing software for Intel® IoT Platforms.
- Set up and connect to cloud services using the IBM Bluemix* platform, which provides a data store, cloud analytics, and communications hub for various parts of the solution.
- Visit GitHub for the latest code samples and documentation.
What it Does
This project simulates the following parts of a smart home:
- Front door. When the status of the front door is changed (that is, it is opened, closed, locked, or unlocked), that status will be displayed by the administration application.
- Doorbell. When the doorbell button is pushed on the model, a notification will be displayed by the administration application.
- Garage door. Users can send commands from the mobile application to raise and lower the garage door. The mobile application will also display the door’s progress as it opens or closes and indicates whether the door is blocked from closing.
How it Works
This smart home application operates based on the following sensor data:
- Open/closed status of the garage door
- Blocked/unblocked status of the garage door
- Events: doorbell ring, lock/unlock front door, open/close front door, open/close garage door, block garage door
All data flows occur through the cloud as an intermediary. For example, if a customer opens the garage door, that command is passed to the cloud and then to the garage door itself. This approach enables status information to be maintained in the cloud, for access and analytics from multiple end points. For example, it is possible to check the status of the garage door remotely and for a user who inadvertently left the door open to close it remotely.
This demo was designed so that other capabilities not included as part of this demo can be implemented (particularly with the involvement of cloud resources).
Set up the Intel® NUC Kit DE3815TYKHE
This section gives instructions for installing the Intel® IoT Gateway Software Suite on the Intel NUC.
Note: Due to the limited size of the local storage drive, we recommend against setting a recovery partition. You can return to the factory image by using the USB drive again.
You can now use your gateway remotely from your development machine if you are on the same network as the gateway. If you would like to use the Intel® IoT Gateway Developer Hub instead of the command line, enter the IP address into your browser and go through the first-time setup.
Note: If you are on an Intel network, you need to set up a proxy server.
- Create an account on the Intel® IoT Platform Marketplace if you do not already have one.
- Order the Intel® IoT Gateway Software Suite, and then follow the instructions you will receive by email to download the image file.
- Unzip the archive, and then write the .img file to a 4 GB USB drive:
- Unplug the USB drive from your system, and then plug it into the Intel NUC along with a monitor, keyboard, and power cable.
- Turn on the Intel NUC, and then enter the BIOS by pressing F2 at boot time.
- Boot from the USB drive:
- From the Advanced menu, select Boot.
- From Boot Configuration, under OS Selection, select Linux.
- Under Boot Devices, make sure the USB check box is selected.
- Save the changes, and then reboot the system.
- Press F10 to enter the boot selection menu, and then select the USB drive.
- Log in to the system with root:root.
- Install Wind River Linux on local storage:
~# deploytool -d /dev/mmcblk0 --lvm 0 --reset-media –F
- Use the poweroff command to shut down your gateway, unplug the USB drive, and then turn your gateway back on to boot from the local storage device.
- Plug in an Ethernet cable, and then use the ifconfig eth0 command to find the IP address assigned to your gateway (assuming you have a proper network setup).
- Use the Intel IoT Gateway Developer Hub to update the MRAA and UPM repositories to the latest versions from the official repository (https://01.org). You can achieve the same result by entering the following commands:
~# smart update<br />
~# smart upgrade<br />
~# smart install upm
- Plug in an Arduino 101 board, and then reboot the Intel® NUC. The Firmata* sketch is flashed onto Arduino 101, and you are now ready to use MRAA and UPM with it.
Set up the Arduino 101 Board
Setup instructions for the Arduino 101 board are available at https://www.arduino.cc/en/Guide/Arduino101.
Connect other Components
This section covers making the connections from the Intel® NUC to the rest of the hardware components. The bill of materials for the prototype is summarized in Table 1, and the assembly of those components is illustrated in Figure 1.
Table 1. Smart home prototype components
Figure 1. Smart home proof-of-concept prototype.
Install Intel® XDK IoT Edition
The Intel® XDK IoT Edition supports JavaScript* and Node.js programming for IoT.
Note: If you are a Windows user, we recommend that you install Bonjour Print Services on your host, which allows the Intel® XDK IoT Edition to automatically detect IoT devices installed on your network. Installing Bonjour isn’t mandatory, but it makes connecting to your board easier. You can still connect to your board by manually entering your board’s IP address and any necessary login information. If you’re using a corporate host machine, your firewall may block Bonjour.
- Visit the IDE download page at https://software.intel.com/en-us/ iot/software/ide to download a copy of the Intel® XDK IoT Edition installer for your host system. Ensure that your OS platform is selected in the drop-down list, and then click the Download button.
- Run the installer by doing one of the following:
- For Windows: Right-click the installer you just downloaded, and then select Run as Administrator. If a confirmation message is displayed, click Yes to continue.
- For Mac OS*: Double-click the .dmg file you just downloaded to extract the installer. Double-click the .pkg file to start installation.
- For Linux:
- Open Terminal.
- Navigate to the folder where the installer is stored. For example, if the installer is stored in the Desktop folder, enter cd ~/Desktop/
- To extract the install files, enter tar zxvf installername
- Navigate to the folder containing the extracted files.
- To run the installer, enter ./install.sh
- Follow the instructions in the installation wizard to install the Intel XDK IoT Edition.
- Install Bonjour* Print Services (recommended; Windows OS only):
- Download Bonjour at http:// support.apple.com/kb/DL999.
- Click Download.
- Right-click BonjourPSSetup. exe, and then select Run as Administrator. If you see a confirmation message, click Yes to continue.
- Follow the instructions in the installation wizard to install Bonjour.
- In order for Intel XDK IoT Edition to detect the Intel NUC, you need to first install the xdk-daemon package, which is available from the official package repository (https://01.org). If you already have it, make sure it is updated to version 0.0.35 or higher. To perform these tasks, use the following commands:
~# smart update<br />
~# smart install xdk-daemon
- After installing or updating the package, reboot the Intel NUC to allow the service to start. You can now add the gateway from Intel XDK IoT Edition as a manual connection and start running your projects remotely.
IBM Bluemix Setup
This section covers creating a Bluemix application, adding a MongoDB* connection, and storing/retrieving data.
Create a Bluemix Application with a MongoLab Service
Figure 2. Bluemix user interface
- Log in to the Bluemix console. Visit console.ng.bluemix.net and select LOG IN.
- After logging in, you will be in the DASHBOARD view.
- Click CREATE APP.
- Select WEB.
- Select the SDK for Node.js option, and then click CONTINUE.
- Name your application, and then click FINISH.
- Once your application has been created by IBM Cloud, click ADD A SERVICE OR API.
- In the Data & Analytics section, select MongoLab.
- Click BI to confirm the creation of the service.
- After the service has been created, a popup window requesting you to restage your application will appear. Click RESTAGE.
- Wait for your application to finish staging. A message indicating that Your app is running will be displayed when done.
Deploy your IBM Bluemix application with Cloud Foundry*
Log in to your Bluemix account to install the cf command-line interface.
Restriction: The Cloud Foundry command-line interface is not supported by Cygwin. Use the Cloud Foundry command-line interface in a command- line window other than the Cygwin command-line window.
After the cf command-line interface is installed, follow the listed steps to download the starter code and learn how to push the application for IBM Bluemix to the cloud.
Connect and Run Application on the Intel® IoT Gateway
- In the Develop window within the Intel® XDK IoT Edition, click the Serial Terminal.
- Select your board in the dropdown menu associated to the Port label.
- Click the Connect button to establish a connection:
- User Name: root
- Password: <your_unique_password>
- Type the following command to view the IP address of the board: ifconfig
- Select the Add Manual Connection option:
- Enter the IP Address
- Enter the password
- After the connection is established, click the down arrow to download the project onto the board.
- Click the Run button.
The application should be running on the board at this point.
Application Details
Cloud Application for IBM Bluemix
This Node.js app for Bluemix leverages MongoDB for data storage and reveals REST API routes for inserting and getting data related to sensors and usage conditions. Web Sockets are also leveraged for real-time updates to client and mobile applications.
Prototype Application for Intel NUC Connected to an Arduino 101
This Node.js app runs on your Intel® NUC (gateway) connected to an Arduino 101 to enable interactions with sensors and peripherals. It also sends data to the IBM Bluemix cloud application for storing sensor data. Web Sockets are the primary communication protocol that allows the client (Intel NUC and Arduino 101) to communicate with the IBM Bluemix cloud application. In Offline mode, the application leverages SQLite* for data storage and sends the data to the cloud when a connection is established again. Also, the application communicates with the mobile apps when offline.
This application allows a user to interact with a touch sensor and buzzer for simulating a doorbell, a light sensor for capturing the presence of objects, a servo motor for simulating the movement of a garage door, and a rotary sensor for simulating door open or close actions.
Administration and Mobile Applications
The administration and mobile apps are embedded within and invoked by the application running on the Intel NUC. Rather than providing multiple versions of a rich-client application for different platforms (or taking on the added complexity of cross-platform, rich- client development), the team decided to implement these applications in HTML5 and JavaScript using the Intel® XDK IoT Edition. This approach allows for a single version of each application to be consumed by multiple hardware platforms in use by administrators and end users.
- The administration application displays the sensors being interacted with in near-real time and also displays a log of the information via REST API calls. It operates on a PC or tablet and allows for a detailed view into the operation of the smart home, including events, status, and logs, as well as access to the cloud data and analytics.
- The mobile application allows the user to open or close the garage door using web sockets. It operates on a smartphone or other mobile device, enabling a customer to open and close the garage door as well as monitor the progress of the door as it opens and closes or is blocked.
Conclusion
This exercise demonstrates the ability of mainstream organizations to create viable prototypes for the IoT that incorporate software to operate on an Intel® NUC (gateway), as well as administrative and mobile apps and cloud functionality.
Using the Intel® IoT Commercial Developer Kit, an Intel® NUC, and an Arduino 101 board, project teams can build prototypes for IoT projects at a relatively low cost and without specialized skill sets. The Grove Starter Kit Plus IoT Edition provides sensors and other components that further streamline rapid prototyping.
Visit GitHub for this project's latest code samples and documentation.
Additional Information
The exercise described in this article demonstrates how to recreate the prototype from the path-to-product project. To see the project overview, see IoT Path-to-Product: Smart Home
You may know us for our processors. But we do so much more. Intel invents at the boundaries of technology to make amazing experiences possible for business and society, and for every person on Earth.
Harnessing the capability of the cloud, the ubiquity of the Internet of Things, the latest advances in memory and programmable solutions, and the promise of always-on 5G connectivity, Intel is disrupting industries and solving global challenges. Leading on policy, diversity, inclusion, education and sustainability, we create value for our stockholders, customers and society.