+ All Categories
Home > Documents > Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision...

Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision...

Date post: 28-Jun-2020
Category:
Upload: others
View: 10 times
Download: 1 times
Share this document with a friend
19
Intel ® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python Script Getting Started Guide November 2015 Order No.: 333139-001
Transcript
Page 1: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

Intel® IoT Gateways: Pulling Datafrom a Temperature Sensor Using aPython ScriptGetting Started Guide

November 2015

Order No.: 333139-001

Page 2: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

By using this document, in addition to any agreements you have with Intel, you accept the terms set forth below.

You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Intel products describedherein. You agree to grant Intel a non-exclusive, royalty-free license to any patent claim thereafter drafted which includes subject matter disclosedherein.

No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document.

All information provided here is subject to change without notice. Contact your Intel representative to obtain the latest product specifications androadmaps.

Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence orcharacteristics of any features or instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have noresponsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change withoutnotice. 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 publishedspecifications. Current characterized errata are available on request.

Intel processor numbers are not a proxy for performance. Processor numbers differentiate features within a processor family, not across differentprocessor families. Learn more at: http://www.intel.com/products/processor_number/

The sample code in this document is provided AS IS without warranty of any kind. Intel disclaims all implied warranties including, without limitation,any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample anddocumentation remains with you. In no event shall Intel, its authors, or anyone else involved in the creation, production, or delivery of the code beliable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of businessinformation, or other pecuniary loss) arising out of the use of or inability to use the sample code or documentation, even if Intel has been advised ofthe possibility of such damages.

Intel, the Intel logo, Intel Atom, Intel Core and Intel Quark, are trademarks of Intel Corporation in the U.S. and/or other countries.

Wind River is a trademark of Wind River Systems, Inc.

*Other names and brands may be claimed as the property of others.

Copyright © 2015, Intel Corporation. All rights reserved.

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 20152 Order No.: 333139-001

Page 3: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

Revision History

Date Revision Description

November 2015 001 Initial public release

Revision History—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 3

Page 4: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

Contents

Revision History..................................................................................................................3

1.0 Introduction................................................................................................................. 5

2.0 Create the Directory Structure...................................................................................... 7

3.0 Create the Sample Application...................................................................................... 8

4.0 Create the BitBake Recipe...........................................................................................10

5.0 Set Up Phidgets Libraries............................................................................................12

6.0 Build and Install Gateway Operating System Image................................................... 13

7.0 Connect and Test the Temperature Sensor..................................................................16

8.0 Conclusion.................................................................................................................. 18

9.0 Development Suggestions...........................................................................................19

Intel IoT Gateway—Contents

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 20154 Order No.: 333139-001

Page 5: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

1.0 Introduction

Note: For an online version of this document, see https://software.intel.com/en-us/SetupGateway-PullSensorData-Python

Applicable to These Intel® IoT Gateway Products

• Intel® IoT Gateways based on Intel® Atom™ processors

• Intel® IoT Gateways based on Intel® Core™ processors

• Intel® IoT Gateways based on Intel® Quark™ processors

How These Instructions Help You

These instructions will guide you through the steps to create and install a customWind River® Linux 7 OS image that includes the software and libraries necessary tointerface a Phidgets* temperature sensor with your Intel® IoT Gateway using Python.Then, it will show how to attach the temperature sensor and run an example Pythonapplication that pulls temperature data from the temperature sensor and stores itlocally on the Gateway.

Sensor Hardware You Need to Provide

You need the following components:

• Phidgets Precision Temperature Sensor. Part #1124_0:

• Phidgets Interface Kit 8/8/8. Part # 1018_2:

Introduction—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 5

Page 6: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

Pre-Requisites

• Your Gateway hardware must be set up. See https://software.intel.com/en-us/SetupGateway-hardware

• Your Wind River® development environment must be installed and configured onyour Development Computer. See https://software.intel.com/en-us/Setup-IDP-DevelopmentTools

Required Experience Level

This guide assumes you have experience with:

• Executing Linux commands.

• Creating, editing, and executing scripts.

• Installing and configuring Linux software.

• Using a terminal emulation program like PuTTY* with serial connections betweencomputers.

Document Terminology and Conventions

• Terminology

— Gateway: An Intel® IoT Gateway.

— Development Computer: Linux computer that you provide to developapplications for your Gateway. Ubuntu* 14.04 Base is preferred.

• Conventions

— This font is used for commands, API names, parameters,filenames, directory paths, and executables.

— Bold text is used for graphical user interface entries, buttons, and keyboardkeys.

This font in a gray box is used for commands you must type or include in a script.

Where to Perform These Steps

Begin these instructions in the $HOME/Project directory on your DevelopmentComputer.

Intel IoT Gateway—Introduction

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 20156 Order No.: 333139-001

Page 7: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

2.0 Create the Directory Structure

1. When you set up your development environment, you created a script file calledconfig.sh in the $HOME/Project directory on your Development Computer.Edit config.sh to check for and include:

• --enable-reconfig• --without-layer=wr-srm,wr-ima-appraise

2. Create the upper level example directory:

mkdir -p $HOME/Project/layers/local/recipes-local

3. Create the directory where the Phidgets libraries will be built:

mkdir -p $HOME/Project/layers/local/recipes-local/libphidget

4. Create the directory structure where the Python-specific Phidgits libraries and theexample application will be built:

mkdir -p $HOME/Project/layers/local/recipes-local/PhidgetsPython/files

Create the Directory Structure—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 7

Page 8: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

3.0 Create the Sample Application

1. Change to the example application directory:

cd $HOME/Project/layers/local/recipes-local/PhidgetsPython/files

2. Create a file called pytemp.py and copy/paste the following contents into it:

#! /usr/bin/pythonimport sysimport datetimefrom time import time, sleepfrom Phidgets . Devices . InterfaceKit import *from Phidgets . Devices . TemperatureSensor import *TEMP_SENSOR_PORT = 6 # Define an error catching function so we can call it on "try...except" blocksdef LocalErrorCatcher( event ): print ( "Phidget Exception: " + str(e.code) + " - " + str(e.details) + ",Exiting..." ) exit(1)# Get the temperature sensor reading from port #TEMP_SENSOR_PORT of the Sensor Kitdef GetTemp( device , outfile , TEMP_SENSOR_PORT ): current_time = datetime . datetime .now() # Get the board temperature in Celsius by reading sensor input and applyingconversion formula ambientTemp = ( device .getSensorValue( TEMP_SENSOR_PORT ) * .2222) - 61.111 # Write the data to the text file time_and_temp = (str(current_time) + ", " + str(ambientTemp) + "\n" ) print ( "%s" % time_and_temp) outfile .write(time_and_temp) sys .stdout.flush() # Clear and open the data file for writingoutfile = open( "phidgets_temperature_data.txt" , "w" ) # Write a header to the text file first thingoutfile.write( "Time Sensor Temperature (C)\n" ) # Connect to Interface Kit and set data sampling rate to 4msprint ( "Opening Phdgets Interface Kit object...." )try : device = InterfaceKit()except PhidgetException as e: LocalErrorCatcher(e)try : device.openPhidget()except PhidgetException as e:

Intel IoT Gateway—Create the Sample Application

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 20158 Order No.: 333139-001

Page 9: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

LocalErrorCatcher(e)try : device.waitForAttach(10000) device.setDataRate(TEMP_SENSOR_PORT, 4)except PhidgetException as e: LocalErrorCatcher(e) print ( "%d attached! Now reading temperature every second." %(device.getSerialNum()))print ( "Press 'Ctrl + c' to end anytime...\n\n" );print ( "Time Sensor Temperature (C)\n" )try : while True : sleep(1) GetTemp(device, outfile, TEMP_SENSOR_PORT)except KeyboardInterrupt: pass print ( "Phidget SensorKit gracefully detached. Exiting." )device.closePhidget()exit(0)

Create the Sample Application—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 9

Page 10: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

4.0 Create the BitBake Recipe

1. Change to the $HOME/Project/layers/local/recipes-local/PhidgetsPython directory:

cd $HOME/Project/layers/local/recipes-local/PhidgetsPython/

2. Click this link to obtain the filename of the zip file: http://www.phidgets.com/downloads/libraries/PhidgetsPython.zip. As of September 15, 2015, the filename isPhidgetsPython_2.1.8.20150326.zipNote: It is not necessary to download or install the file.

3. Use the base part of the filename to create a .bb file with same base name. Forexample PhidgetsPython_2.1.8.20150326.bb

4. Add the following contents to the .bb file:

SUMMARY = "The PhidgetsPython package"DESCRIPTION = "The PhidgetsPython package"HOMEPAGE = "http://www.your_company_here.com"LICENSE = "CC-BY-2.5"SECTION = "devel" # Specify source directory that BitBake uses to build this package. WORKDIR isstandard.S = "${WORKDIR}" # You need to checksum the license for this package. Leave the md5sum empty,# and on the first compile pass BitBake will tell you what value to insert.LIC_FILES_CHKSUM = "file://PhidgetsPython/Phidgets/Phidget.py;beginline=1;endline=5;md5=5ed30fa0f6c0218da12eda933f341a36;"# Here is where you add packages to the build dependencies DEPENDS = "libphidget" # This is the incremental package revision number. You should# increment this value for each new revision to update the build.PR = "r0" # This is where you set the package's upstream location. The file# name at the end of the path is used as the package's .zip name when# searched in the local 'download' directories.SRC_URI = "http://www.phidgets.com/downloads/libraries/PhidgetsPython.zip \ file://pytemp.py" # Here is the checksum attribute for the package's zip file. Leave this empty,# and on the first compile pass BitBake will tell you what md5 value to insert.SRC_URI[md5sum] = "4db33d1f8fc73dc86a32c415a5c47a2f"

Intel IoT Gateway—Create the BitBake Recipe

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 201510 Order No.: 333139-001

Page 11: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

SRC_URI[sha256sum] ="070a9f7da2a99f28c9995f93ee419dbd8474f5caafb993348254241e64bca0f8" # Safe default to force a non-parallel buildPARALLEL_MAKE = "-j 1" # Individually create and populate directories to house all components of thispackagedo_install() { install -m 777 -d ${D}/root/examples/ install -m 777 -d ${D}/root/examples/PhidgetsPython/ install -m 777 ${WORKDIR}/pytemp.py ${D}/root/examples/ cp -r ${WORKDIR}/PhidgetsPython/* ${D}/root/examples/PhidgetsPython/}# List of files that BitBake will verify are installed from the do_install()FILES_${PN} = "/root/examples/pytemp.py \/root/examples/PhidgetsPython/* \/root/examples/PhidgetsPython/Phidgets/* \/root/examples/PhidgetsPython/Phidgets/Devices/* \/root/examples/PhidgetsPython/Phidgets/Events/* \"# Call the setup script after all components are in place.pkg_postinst_${PN} () { #!/bin/sh -e cd /root/examples/PhidgetsPython python setup.py install}

5. Go to your $HOME/Projects and add the PhidgetsPython package to yourGateway operating system image:

cd $HOME/Projectmake -C build PhidgetsPython.addpkgmake -C build PhidgetsPython

Ignore warning messages. However, if you see errors about md5 checksums orsha256 checksums, then the library package license has changed. The errormessage will show the expected values. Copy and paste these expected md5 andsha256 values into the appropriate lines of the bb file, save the file, and retry themake commands.

Create the BitBake Recipe—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 11

Page 12: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

5.0 Set Up Phidgets Libraries

1. Change to the directory where the Phidgets libraries will be built:

cd $HOME/Project/layers/local/recipes-c-example/libphidget

2. Click this link to obtain the filename of the tar.gz file: http://www.phidgets.com/downloads/libraries/libphidget.tar.gz. As of October 20, 2015, the filename islibphidget_2.1.8.20150410.tar.gzNote: It is not necessary to download or install the file. The files will be installed

when you next run make.

3. Use the base part of the filename to create a .bb file with same base name. Forexample libphidget_2.1.8.20150410.bb

4. Add these contents to the .bb file:

# Basic information about packageDESCRIPTION = "Phidgets Library"SECTION = "examples"LICENSE = "GPLv3"LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" SRC_URI = "http://www.phidgets.com/downloads/libraries/libphidget.tar.gz"SRC_URI[md5sum] = "a1ee9be405179370767d70c8304c3ac8"SRC_URI[sha256sum] ="491580b8f8def0cbde55202fe8297e1d811eeaf2014b8b35883f7f86225d2bee" PR = "r0"DEPENDS = "libusb" # Automatically take care of installation and verification using providedconfigure fileinherit autotools

5. Go to your $HOME/Projects directory and add the libphidgets package to yourGateway operating system image:

cd $HOME/Projectmake -C build libphidget.addpkgmake -C build libphidget

Ignore warning messages. However, if you see errors about md5 checksums orsha256 checksums, then the library package license has changed. The errormessage will show the expected values. Copy and paste these expected md5 andsha256 values into the appropriate lines of the bb file, save the file, and retry themake commands.

Intel IoT Gateway—Set Up Phidgets Libraries

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 201512 Order No.: 333139-001

Page 13: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

6.0 Build and Install Gateway Operating SystemImage

Build the Gateway OS

1. In the $HOME/Projects directory on your Development Computer, build yourGateway OS image:

Note: The make command can take several hours, depending on the speed of yourDevelopment Computer.

make fs

2. Confirm that the packages were successfully included in the new image by makingsure pytemp.py was created:

cd $HOME/Project/export/dist/usr/bin/ls pytemp.py

Copy the Gateway OS to USB Flash Drive

In this section you will copy your Gateway OS onto a bootable USB flash drive. TheUSB flash drive must be at least 4 GB and any content on it will be erased.

1. From your Development Computer, display the storage devices:

ls /dev/sd?

2. Insert the USB flash drive into your Development Computer.

3. Run ls again and compare the results to determine the newly connected storagedevice (USB flash drive):

ls /dev/sd?

You will need the USB flash drive name in the next step. In this example, the USBflash drive is /dev/sdb

4. Change to the $HOME/Project directory:

cd $HOME/Project

5. Deploy the Gateway OS to the USB flash drive. The compiled OS file is named tomatch the processor type in the Gateway. Use the appropriate command for yourGateway and replace ??? with the storage device:

Build and Install Gateway Operating System Image—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 13

Page 14: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

• Intel® IoT Gateways based on Intel® Atom™ processors:

sudo ./deploy.sh -u -f export/intel-baytrail-64-idp-idp-dist.tar.bz2 \-d /dev/??? -y; sync

• Intel® IoT Gateways based on Intel® Core™ processors:

sudo ./deploy.sh -u -f export/intel-haswell-64-idp-idp-dist.tar.bz2 \-d /dev/??? -y; sync

• Intel® IoT Gateways based on Intel® Quark™ processors:

sudo ./deploy.sh -u -f export/intel-quark-idp-idp-dist.tar.bz2 \-d /dev/??? -y -u -b cross-hill; sync

The deploy process takes about 15 minutes.

6. Type your Linux password if prompted and click OK.

The bootable USB drive is created when you see DONE!7. Remove and reinsert the USB flash drive in your Development Computer. It

mounts with two partitions, one of which is /media/<username>/wr_usb_boot.

8. Copy the Gateway OS file to the flash drive. Use the appropriate command foryour Gateway and replace <username> with your Linux login name:

• Intel® IoT Gateways based on Intel® Atom™ processors:

sudo cp export/intel-baytrail-64-idp-idp-dist.tar.bz2 /media/<username>/wr_usb_boot/opt/; sync

• Intel® IoT Gateways based on Intel® Core™ processors:

sudo cp export/intel-haswell-64-idp-idp-dist.tar.bz2 /media/<username>/wr_usb_boot/opt/; sync

• Intel® IoT Gateways based on Intel® Quark™ processors:

sudo cp export/intel-quark-idp-idp-dist.tar.bz2 /media/<username>/wr_usb_boot/opt/; sync

9. Remove the USB flash drive from your Development Computer.

Install OS on Gateway

Perform these steps on the Gateway.

Important: Before using these steps, you must set your Gateway's BIOS to boot from the USBflash drive. Instructions for doing this are in the Getting Started Guide - Appendix:Setup BIOS Boot from USB. See https://software.intel.com/en-us/SetupGateway-hardware.

1. Power down the Gateway, insert the USB flash drive, and then re-apply power.Login using root for the login ID and password.

2. Install the OS. Use the appropriate command for your Gateway:

Intel IoT Gateway—Build and Install Gateway Operating System Image

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 201514 Order No.: 333139-001

Page 15: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

• Intel® IoT Gateways based on Intel® Atom™ and Core™processors

tgt=/dev/sda /sbin/reset_media

• Intel® IoT Gateways based on Intel® Quark™ processors

/sbin/reset_media

When prompted to Restore the boot media to its factory defaults,answer yes. This installation can take up to 20 minutes.

Important: If you receive the message ERROR: Unmount /dev/sda1 failed!your Gateway might not have booted from the USB flash drive. Checkthe boot priority and UEFI settings to ensure the first boot priority isUEFI, using the internal storage device. See "Appendix: Setup BIOSBoot from USB" in https://software.intel.com/en-us/SetupGateway-hardware.

3. Install the OS:

/sbin/reset_media

When prompted to Restore the boot media to its factory defaults,answer yes. This installation can take up to 20 minutes.

Important: If you receive the message ERROR: Unmount /dev/sda1 failed!your Gateway might not have booted from the USB flash drive. Checkthe boot priority and UEFI settings to ensure the first boot priority isUEFI, using the internal storage device. See "Appendix: Setup BIOSBoot from USB" in https://software.intel.com/en-us/SetupGateway-hardware.

4. Installation is complete when you see the message DONE! Shut down theGateway:

poweroff

5. Remove the USB flash drive and then power up your Gateway.

Note: If you see a boot error message, such as Reboot and select properboot device or similar, ensure the Gateway BIOS has Boot Priority 1 setfor: UEFI via internal storage. See "Appendix: Setup BIOS Boot from USB"in https://software.intel.com/en-us/SetupGateway-hardware.

6. Login using root for both the login ID and password.

Build and Install Gateway Operating System Image—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 15

Page 16: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

7.0 Connect and Test the Temperature Sensor

1. Connect the temperature sensor to your Gateway.

• Connect the Phidgets temperature sensor to port 6 of the Phidgets 1018Interface Kit.

• Connect the Phidgets 1018 Interface Kit plugged into any USB port on yourGateway.

2. Execute the pytemp.py application on your Gateway:

python /root/examples/pytemp.py

3. This application will read the temperature from the Phidgets Temperature sensoreach second. The output to your screen displays the temperature and the time atwhich the temperature was recorded, similar to this:

Intel IoT Gateway—Connect and Test the Temperature Sensor

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 201516 Order No.: 333139-001

Page 17: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

This content is also written to a local text file namedphidgets_temeprature_data.txt

Connect and Test the Temperature Sensor—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 17

Page 18: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

8.0 Conclusion

In this guide, you accomplished these tasks:

• Created a custom Wind River® Linux 7 Gateway operating system image thatincluded Phidgets packages and a Python application.

• Install this image onto your Gateway using a USB flash drive.

• Connected a Phidgets temperature sensor to the Gateway.

• Ran an example Python application to obtain temperature data from thetemperature sensor.

Continue to the next section for further development suggestions.

Intel IoT Gateway—Conclusion

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptGetting Started Guide November 201518 Order No.: 333139-001

Page 19: Intel® IoT Gateways: Pulling Data from a Temperature ... · Revision History Date Revision Description November 2015 001 Initial public release Revision History—Intel IoT Gateway

9.0 Development Suggestions

Try these ideas to enhance your development:

• Create an application that uses other Phidgets sensors. For Phidgets source codeexamples that use Python, see: http://www.phidgets.com/downloads/examples/Python.zip

• Modify the example application so that it uploads the data to an online database.

• Use Python to publish data over MQTT from an Intel® IoT Gateway. For help, seeIntel® IoT Gateway: Publishing Data to an MQTT Broker Using Python GettingStarted Guide at https://software.intel.com/en-us/SetupGateway-MQTT.

• Use Python to publish data to an external cloud service from an Intel® IoTGateway.

Development Suggestions—Intel IoT Gateway

Intel® IoT Gateways: Pulling Data from a Temperature Sensor Using a Python ScriptNovember 2015 Getting Started GuideOrder No.: 333139-001 19


Recommended