User Tools

Site Tools


iut_simulator_guide

IoTivity Build

Go to the top (root) directory of ‘IoTivity’ project. Run the below command:

  $ git checkout test
  $ git pull

To Build without Security:

  $ scons TARGET_OS=linux

To Build with Security:

  $ scons TARGET_OS=linux SECURED=1

To Build with Security and TCP:

  $ scons TARGET_OS=linux SECURED=1 WITH_TCP=1

(Note: C sdk requires tinycbor, secured build requires mbedTLS. Please follow the instruction in the build message to install tinycbor & mbedTLS)

IUT Simulator Build

IUT Simulator is an OCF client-server simulator which supports the basic client and server features mentioned in the OIC Core Spec. It is based upon IoTivity implementation of OCF specification. The server part supports discoverable, non-discoverable, observable, non-observable, secured and non-secured resources. Both the server and client support all CRUDN operations. Resource, Platform, Device and Collection discovery is supported for the client. The client supports both CON & NON type messaging. To build IUT Simulator, follow the bellow steps:

  $ cd test
  $ scons MODULE=iut    

If IoTivty was built in non-secure mood, then:

$ scons MODULE=iut SECURED=0

Note: IoTivity must be build before IUT Simulator build

IUT Simulator Build With a Different IoTivity Source Branch

If it is desired to build IUT Simulator using a different IoTivity base(branch), below is the procedure:

1. Pull the desired IoTivity branch. Example:

  $ cd ~
  $ git clone https://gerrit.iotivity.org/gerrit/iotivity iotivity_1.3
  $ cd iotivity_1.3
  $ git checkout 1.3-rel

2. Build IoTivity:

  $ scons TARGET_OS=linux SECURED=1 WITH_TCP=0 RD_MODE=all -j 3

3. Pull the test branch for IUTSimulator. Example:

  $ cd ..
  $ git clone https://gerrit.iotivity.org/gerrit/iotivity iotivity_test
  $ cd iotivity_test
  $ git checkout test

4. Build IUTSimulator:

  $ cd test
  $ scons MODULE=iut SECURED=1 WITH_RD=1 IOTIVITY_ROOT=<path_to_iotivity_1.3-rel_branch, ex: ~/iotivity_1.3> 

Run IUT Simulator

From the test directoty (<iotivity_root>/test), go to linux binary folder:

  $ cd bin/linux/

To run IUT Simulator using default settings( Non-confirmable, IPv6, non-secure server, OCF 1.0.0):

  $ ./IUTSimulator

Run IUT Simulator with customize settings:

  $ ./IUTSimulator [QoS<0/1>] [IP_Version<4/6>] [Security<-0/11/12/13/21/22/23/31/32/33/41/42/43>] [OCF_Version<1.0.0/2.0.0>]

Argument Type:

QoS:

  0 = NON (Non-Confirmable Message)
  1 = CON (Confirmable Message)

IP_Version:

  4 = IPv4
  6 = IPv6

Security:

  no argument, or, 0 = non-secure server/client
  11 = Secured Justworks Client (fresh database, IUT back to RFOTM)
  12 = Secured Randompin Client (fresh database, IUT back to RFOTM)
  13 = Secure Manufacturing Certificate Client (fresh database, IUT back to RFOTM)
  21 = Secured Justworks Server (fresh database, IUT back to RFOTM)
  22 = Secured Randompin Server (fresh database, IUT back to RFOTM)
  23 = Secure Manufacturing Certificate Server (fresh database, IUT back to RFOTM) 
  31 = Secured Justworks Client (Old Database, IUT retains the database used last time)
  32 = Secured Randompin Client (Old Database, IUT retains the database used last time)
  33 = Secure Manufacturing Certificate Client (Old Database, IUT retains the database used last time)
  41 = Secured Justworks Server (Old Database, IUT retains the database used last time)
  42 = Secured Randompin Server (Old Database, IUT retains the database used last time)
  43 = Secure Manufacturing Certificate Server (Old Database, IUT retains the database used last time)

OCF_Version:

  Any text input like "1.0.0", "1.3.0", "2.0.0" will mean the chosen version of OCF

Example:

  $ ./IUTSimulator 0 4    It’s for, NON-type IPv4 non-secure server/client OCF 1.0.0
  $ ./IUTSimulator 1 4    It’s for, CON-type IPv4 non-secure server/client OCF 1.0.0
  $ ./IUTSimulator 1 4 11 It’s for, CON-type IPv4 secure justworks client OCF 1.0.0
  $ ./IUTSimulator 1 6 12 2.0.0  It’s for, CON-type IPv6 secure randompin client OCF 2.0.0
  $ ./IUTSimulator 1 4 21 2.0.0  It’s for, CON-type IPv4 secure justworks server OCF 2.0.0
  $ ./IUTSimulator 1 6 22 1.3.0  It’s for, CON-type IPv6 secure randompin server OCF 1.3.0

Operate IUT Simulator

  • To start non-secured AirCon Resources, select option 102
  • To start secured AirCon Resources, select option 104
  • To start a secured server with only 1 resource, select option 105
  • To create collection, select option 6 (after selecting 102 or 104)
  • To create AirPurifier Resource, select option 116
  • To create Network Monitoring with Maintenance Resources, select 117
  • To create Blood Pressure Resources, select 119
  • To create Cloud Resource, create 120
  • To Sign Out with Cloud, select 121
  • To Deregister Cloud, select 122
  • To create Configuration Resource, select 123
  • To update local resource representation (for observe TC - CT1.2.6), select option 34, select the local resource, then provide key & value of the representation to use in POST request
  • For testing with Chomarch CTT, use the supplied PICS file from <iotivity_root>/test/PICS folder
  • To perform multicast resource discovery without query select option 12
  • To send GET request in client mode, select option 17 & next select the desired resource
  • To send POST request, select option 22, next select desired resource & then provide key & value of the representation to use in POST request
  • To send Observe request, select option 25 & select desired resource next
  • To send cancel observe request, select option 26 & select desired resource next
  • To send POST request to Cloud Configuration, select option 39

Use IUT Simulator with CTT

Select Options → Network Interface of machine running IUTSimulator

Use IUT as Server:

  • Start IUTSimulator with desired options, remember that Security argument have to start with “2”
  • In CTT, File → Select IUT, and select detected simulator
  • Choose available PICS file, default one are at CTT_location\Configuration\OCF\PICS
  • Select desired profile with tests
  • Select tests you wish to run and press start button

Use IUT as Client:

  • Start IUTSimulator with desired options, remember that Security argument have to start with “1”
  • In CTT, File → Select IUT
  • In IUTSimulator select option “12”
  • In CTT select just detected simulator (there should be 2 now, select client one)
  • Choose available PICS file, default one are at CTT_location\Configuration\OCF\PICS
  • Select desired profile with tests
  • Select tests you wish to run and press start button
iut_simulator_guide.txt · Last modified: 2018/07/13 10:27 by Michal Wieckowski