IoT Reference Implementation: Build a Connected Transportation Solution

This Internet of Things (IoT) reference implementation 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, seeThe Making of Building a Connected Transportation Solution.

Visit GitHub Project

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.

  1. Create an account on the Intel® IoT Platform Marketplace if you do not already have one.
  2. Download the Intel® IoT Gateway Software Suite and follow the instructions received by e-mail to download the image file.
  3. 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*, use sudo dd if=GatewayOS.img of=/dev/ sdX bs=4M; sync, where sdX is your USB drive.

  4. Unplug the USB drive from your system and plug it into the Intel NUC along with a monitor, keyboard, and power cable.
  5. Turn on the Intel® NUC and enter the BIOS by pressing F2 at boot time.
  6. 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.

  7. Log into the system with root:root.
  8. Install Wind River Linux on local storage:
    ~# deploytool d /dev/mmcblk0 lvm 0 resetmedia –F
  9. 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.
  10. 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).
  11. 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
    
  12. 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

Intel® NUC Kit DE3815TYKHE

 

Arduino* 101 Board

Sensor hub

USB Type A to Type B Cable

For connecting Arduino* 101 board to NUC

Components from Grove* IoT Commercial Developer Kit

Base Shield V2

 

Touch Sensor Module

Alarm mute

Button Module

Door toggle

Temperature Sensor Module

Monitors temperature

Buzzer Module

Alarm

Red LED

Alarm status light

LCD with RGB Backlight Module

Status display

Figure 1. Connected transportation proof of concept prototype.

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.

  1. Create an account on the Intel® IoT Platform Marketplace if you do not already have one.
  2. Order the Intel® IoT Gateway Software Suite, and then follow the instructions you will receive by email to download the image file.
  3. 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 sudo dd if=GatewayOS.img of=/dev/ sdX bs=4M; sync, where sdX is your USB drive.

  4. Unplug the USB drive from your system, and then plug it into the Dell Wyse* 3290 along with a monitor, keyboard, and power cable.
  5. Turn on the Dell Wyse* 3290, and then enter the BIOS by pressing F2 at boot time.
  6. 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.

  7. Log in to the system with root:root.
  8. Install Wind River* Linux on local storage: 
    ~# deploytool d /dev/mmcblk0 lvm 0 reset¬media -F
  9. 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.
  10. 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).
  11. 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
  12. Connect the FTDI* UMFT4222EV expansion board through an USB cable.
  13. 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

Dell iSeries Wyse* 3290 IoT Gateway

 

FTDI UMFT4222EV

 

USB Type A to Type Micro-B Cable

For connecting UMFT4222EV board to Gateway

Sensors and other Components

Comet T3311

Temperature sensor

Grove* - SPDT Relay(30A)

Fan/light control

Magnetic Switch

Door sensor

10uF Capacitor (Optional)

 

5V DC Lightbulb

 

5V DC Fan

 

Figure 2. Assembled connected-transportation product.

 

How to Set up the Program

  1. 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
  2. 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.

  1. Open Intel® System Studio IoT Edition. It will start by asking for a workspace directory. Choose one and then click OK.
  2. In Intel® System Studio IoT Edition, select File -> new -> Intel(R) IoT Java Project:
  3. Give the project the name “Transportation Demo” and then click Next.
  4. 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.    
  5. 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.
  6. 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

  7. The jars can be found at the IOT Devkit installation root path\iss-iot-win\devkit-x86\sysroots\i586-poky-linux\usr\lib\java.
  8. 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 IoT reference implementation process.

More Information

You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Intel products described herein. You agree to grant Intel a non-exclusive, royalty-free license to any patent claim thereafter drafted which includes subject matter disclosed herein.
 
No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.
 
The products described 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.

Intel is providing this information “as-is” as a convenience to its customers and partners, and assumes no liability with respect to your use of the information. Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.
 
Intel, the Intel logo, Intel® IoT Developer Kit, Intel® IoT Gateway, Intel® IoT Gateway Developer Hub, Intel® IoT Gateway Software Suite, Intel® IoT Platform, Intel® IoT Platform Marketplace, Intel® NUC, Intel® NUC Kit DE3815TYKHE, and Intel® System Studio IoT Edition are trademarks of Intel Corporation or its subsidiaries in the U.S. and/or other countries.
*Other names and brands may be claimed as the property of others.

Intel copyright notice: “© Intel Corporation”

For more complete information about compiler optimizations, see our Optimization Notice.