This 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 Grove* IoT Commercial Developer Kit, with the prototype built on an Intel® Next Unit of Computing (Intel® NUC) Kit DE3815TYKHE small-form-factor PC and Arduino* 101 board.
This document demonstrates how to build a prototype and utilize these same technologies in deploying an Intel® IoT Gateway and industrial sensors. It does not require special equipment or deep expertise, and as such, it is intended to be instructive toward developing IoT projects in general.
Note: Known in the US as “Arduino* 101,” this board is known elsewhere as “Genuino* 101.” It is referred to throughout the rest of this document as the “Arduino 101” board.
Building the Prototype
From this exercise, developers will learn 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 Java* code sample in Intel® System Studio IoT Edition, an IDE for creating applications that interact with sensors and actuators, enabling a quick start for developing software for Intel® IoT platforms.
To see a making of for this project, see IoT Path-to-Product: The Making of Building a Connected Transportation Solution.
Visit GitHub for this project's latest code samples and documentation.
What it Does
This project simulates the following parts of a transportation monitoring solution:
- Door. The door can be closed or opened, in which case the driver is signaled that something might be wrong.
- Temperature. The temperature inside the truck is monitored. The data is logged, and above a certain threshold, an alarm is raised.
- Alarm. Under certain conditions, an alarm is raised. The alarm can be canceled by pressing the touch button or when the parameters of the system return to normal.
- Display. Displays the status of the system, temperature, and door status.
How it Works
This connected-transportation application operates based on the following sensor data:
- Open/closed status of the truck door
- Temperature of the truck interior
- Events: open/close door, change temperature, set temperature threshold, trigger/stop alarm
All data is forwarded to the web interface, which can be used to monitor the status of the truck.
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.
- Download the Intel® IoT Gateway Software Suite and follow the instructions received by e-mail to download the image file.
- Unzip the archive and write the .img file to a 4 GB USB drive:
On Microsoft Windows*, you can use a tool like Win32 Disk Imager*: https://sourceforge.net/projects/win32diskimager.
On Linux*, usesudo dd if=GatewayOS.img of=/dev/ sdX bs=4M; sync
, wheresdX
is your USB drive. - Unplug the USB drive from your system and plug it into the Intel NUC along with a monitor, keyboard, and power cable.
- Turn on the Intel® NUC and enter the BIOS by pressing F2 at boot time.
- Boot from the USB drive:
a. From the Advanced menu, select Boot.
b. From Boot Configuration, under OS Selection, select Linux.
c. Under Boot Devices, make sure the USB check box is selected.
d. Save the changes and reboot.
e. Press F10 to enter the boot selection menu and select the USB drive. - Log into the system with root:root.
- Install Wind River Linux on local storage:
~# deploytool d /dev/mmcblk0 lvm 0 resetmedia –F
- Use the
poweroff
command to shut down your gateway, unplug the USB drive, and turn your gateway back on to boot from the local storage device. - Plug in an Ethernet cable and 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 ~# smart upgrade ~# smart install upm
- Plug in an Arduino* 101 board and 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. Connected transportation prototype components.
| Component | Details |
Base System |
| |
Sensor hub | ||
USB Type A to Type B Cable | For connecting Arduino* 101 board to NUC | |
Components from Grove* IoT Commercial Developer Kit |
| |
Alarm mute | ||
Door toggle | ||
Monitors temperature | ||
Alarm | ||
Alarm status light | ||
Status display |
How to Build the Product
From this exercise, developers will learn how to do the following:
- Connect to the Dell iSeries Wyse* 3290 IoT Gateway.
- Interface with the I/O and sensor repository 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® System Studio IoT Edition, an IDE for creating applications that interact with sensors and actuators, enabling a quick start for developing software for Intel® IoT Platforms.
Visit GitHub for this project's latest code samples and documentation.
What it Does
This project simulates the following parts of a transportation monitoring solution:
- Door. The door can be closed or opened, in which case the driver is signaled that something might be wrong.
- Temperature. The temperature inside the truck is being monitored. The data is logged and above a certain threshold an alarm is raised.
- Alarm. Under certain conditions, an alarm is raised. The alarm status can be monitored and canceled through the customer application.
- Display. Displays the status of the truck on the customer application.
How it Works
This transportation application operates based on the following sensor data:
- Open/closed status of the truck door
- Temperature of the truck interior
- Events: open/close door, change temperature, set temperature threshold, trigger/stop alarm
All data is forwarded to the admin application, which can be used to monitor the status of the truck.
Set up the Dell iSeries Wyse* 3290 IoT Gateway
This section gives instructions for installing the Intel® IoT Gateway Software Suite on the Dell Wyse* 3290.
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:
• On Microsoft Windows, you can use a tool like Win32 Disk Imager: https://sourceforge.net/projects/win32diskimager.
• On Linux, use sudodd if=GatewayOS.img of=/dev/ sdX bs=4M; sync
, wheresdX
is your USB drive. - Unplug the USB drive from your system, and then plug it into the Dell Wyse* 3290 along with a monitor, keyboard, and power cable.
- Turn on the Dell Wyse* 3290, and then enter the BIOS by pressing F2 at boot time.
- Boot from the USB drive:
a. On the Advanced tab, make sure Boot from USB is enabled.
b. On the Boot tab, put the USB drive first in the order of the boot devices.
c. Save the changes, and then reboot the system. - 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 ~# smart upgrade ~# smart install upm
- Connect the FTDI* UMFT4222EV expansion board through an USB cable.
- Connect the Comet* T3311 Temperature sensor to the serial port.
Connect other Components
This section covers making the connections from the Dell Wyse* 3290 to the rest of the hardware components. The bill of materials for the product version of the connected transportation project is summarized in Table 2, and the assembly of those components is shown in Figure 2.
Table 2. Transportation product components.
| Component | Details |
Base System |
| |
| ||
USB Type A to Type Micro-B Cable | For connecting UMFT4222EV board to Gateway | |
Sensors and other Components | Temperature sensor | |
Fan/light control | ||
Door sensor | ||
10uF Capacitor (Optional) |
| |
5V DC Lightbulb |
| |
5V DC Fan |
|
How to Set up the Program
- To begin, clone the Path to Product repository with Git* on your computer as follows:
$ git clone https://github.com/intel-iot-devkit/path-to-product.git
Alternatively, the source can be downloaded from https://github.com/intel-iot-devkit/path-to-product. Once the .zip file is downloaded, uncompress it, and then use the files in the directory for this example.
Adding the Program to Intel® System Studio IoT Edition
Note: The following screenshots are from the Alarm clock sample; however the technique for adding the program is the same, just with different source files and jars.
- Open Intel® System Studio IoT Edition. It will start by asking for a workspace directory. Choose one and then click OK.
- In Intel® System Studio IoT Edition, select File -> new -> Intel(R) IoT Java Project:
- Give the project the name “Transportation Demo” and then click Next.
- You now need to connect to your Intel® NUC from your computer to send code to it. Choose a name for the connection and enter IP address of the Intel® NUC in the "Target Name" field. You can also try to Search for it using the "Search Target" button. Click Finish when you are done.
- You have successfully created an empty project. You now need to copy the source files and the config file to the project. Drag all of the files from your git repository's “src” folder into the new project's src folder in Intel® System Studio IoT Edition. Make sure previously auto-generated main class is overridden.
The project uses the following external jars: commons-cli-1.3.1.jar, tomcat-embed-core.jar, tomcat-embed-logging-juli. These can be found in the Maven Central Repository. Create a “jars” folder in the project's root directory, and copy all needed jars in this folder. In Intel® System Studio IoT Edition, select all jar files in “jars” folder and right click -> Build path -> Add to build path. - Now you need to add the UPM jar files relevant to this specific sample. right click on the project's root -> Build path -> Configure build path. Java Build Path -> 'Libraries' tab -> click on “add external JARs...”
For this sample, you will need the following jars:• upm_buzzer.jar
• upm_grove.jar
• upm_i2clcd.jar
• upm_t3311.jar
• upm_ttp223.jar
• mraa.jar - The jars can be found at the IOT Devkit installation root path\iss-iot-win\devkit-x86\sysroots\i586-poky-linux\usr\lib\java.
- Afterwards, copy the www folder to the home directory on the target platform using scp or WinSCP. Create a new Run configuration in Eclipse for the project for the Java Application. Set the Main Class as:com.intel.pathtoproduct.JavaONEDemoMulti in the Main tab. Then, in the arguments tab:
- For the devkit version (with Intel® NUC): -config devkit -webapp <path/to/www/folder> -firmata
- For the commercial version (with Dell Wyse* 3290): -config commercial -webapp <path/to/www/folder>
Running without an IDE
Download the repo directly to the target plaform and run the start_devkit.sh or start_commercial.sh scripts.
Conclusion
As this how-to document demonstrates, IoT developers can build prototypes at relatively low cost and without specialized skill sets. Using the Grove* IoT Commercial Developer Kit and an Arduino* 101 board, project teams can conduct rapid prototyping to test the viability of IoT concepts as part of the larger path-to-product process.