User Tools

Site Tools


windows

Windows Build Instructions

Prerequisites

Install Visual Studio 2017 or Visual Studio 2015 or Visual Studio 2013. All editions, including the free Community Edition, are supported.

Note: Ensure “C++ Common Tools” is selected. This option can be found under Programming languages → Visual C++ → Common Tools for Visual C++.

When installing Visual Studio 2017, make sure you select “Desktop development with C++”. Also, in the right column of the Visual Studio 2017 install screen, make sure that the “VC++ 2015.3 v140 toolset option” is checked. If you previously installed Visual Studio 2017 without that toolset option checked, it can be added later as follows:

  1. Open “Visual Studio Installer” (probably found at “C:\Program Files (x86)\Microsoft\Visual Studio\Installer”)
  2. Select “Individual Components” tab
  3. Select the “VC++ 2015.3 v140 toolset” option
  4. Click “Modify”

Install dependencies from the web and add to PATH

  • Python 2.7.0 (select “Install just for me”)
  • SCons (if SCons can't find Python, try installing 32 bit version of Python) (IMPORTANT: It must be 2.5.1. Version 3.0 forces Python 3.0 styles and IoTivity scripts have not been updated to Python 3.0 support.)
  • Download 7-Zip. Use the “.exe” version for “64-bit x64”. Run the setup.exe and make sure your 7-zip installation folder is part of your PATH.
  • Download cmake-3.6.0-rc1-win64-x64.msi from CMake. Make sure you install into a folder included in your PATH.
  • Optional: for reliable multi-threaded builds (the default), please install Pywin32. You'll need to pick the installer that matches your Python. For example, choose pywin32-220.win-amd64-py2.7.exe for amd64.

The following is an example command to update your PATH for building IoTivity, assuming all dependencies have been installed to their default locations on a 64-bit machine. Note: this command must be run from an administrator command prompt:

  setx  PATH   %PATH%;C:\Python27\;C:\Python27\Scripts;C:\Program Files\CMake\bin;C:\Program Files\7-Zip
  

If the above command causes a max buffer overflow error, you can instead use “Start → System → Advanced system settings → Environment Variables”, then select the “Path” System variable and click “Edit…”. Then add the following paths:

  • C:\Python27\
  • C:\Python27\Scripts
  • C:\Program Files\CMake\bin
  • C:\Program Files\7-Zip

Build

*Note: may have to set up proxy for https

Open a Command Prompt and use the “run.bat” convenience script to call into SCons.

 run build

Or call into SCons directly.

scons TARGET_OS=windows TARGET_ARCH=amd64 \
RELEASE=0 WITH_RA=0 TARGET_TRANSPORT=IP SECURED=1 WITH_TCP=1 WITH_UPSTREAM_LIBCOAP=1 \
BUILD_SAMPLE=ON LOGGING=OFF TEST=1

For Visual Studio 2017: from the Start menu, select and click the “VS2017 Pro Command Console”, and do “set vs140” before cd'ing into the iotivity directory building with “run build”.

At the end of the run log, you should see the following:

scons: done building targets.

You should be able to run the samples that are built in the following sub-directory:

out\windows\win32\amd64\debug\resource\examples

Windows Example Apps

Samples

Examples Description
SimpleServer and SimpleClient A basic sample for hosting, discovering and performing GET, PUT, POST and OBSERVE operations on a resource. We recommend that you start with these two apps.
MediaServer and WinUIClient WinUIClient is a Win32 GUI application for managing the MediaServer application. MediaServer is an application that allows remote control over the PC running the app: specifically volume and playback (play/pause) control
ProvisioningClient SampleServer_JustWorks SampleServer_RandomPin Example for demonstrating Provisioning Manager
OCServer and OCClient An advanced version of SimpleServer/SimpleClient for hosting, discovering and performing GET, PUT, POST and OBSERVE operations on a resource. Allows user to specify 1 of 20 different sequences.

Source Code Location

Source code location of the sample code:

 iotivity\resource\examples\

Provisioning Source code location of the sample code:

 iotivity\resource\csdk\security\provisioning\sample\

OCServer/OCClient Source code location of the sample code (works on Windows from this directory):

 iotivity\resource\csdk\stack\samples\linux\simpleclientserver\

Execution

How to execute samples (in two seperate windows):

 C:\path\to\iotivity\> run server
 C:\path\to\iotivity\> run client

 C:\path\to\iotivity\> run mediaserver
 C:\path\to\iotivity\> run winuiclient

{{:mediaserverwinuiclient.jpg?nolink&200|

 C:\path\to\iotivity\> run justworks    OR    run randompin
 C:\path\to\iotivity\> run provclient
windows.txt · Last modified: 2017/09/22 22:26 by Joseph Morrow