How_To_Build.txt 5.57 KB
Newer Older
1
=== Prerequisites ===
2 3 4 5 6 7 8 9 10 11 12

* 1. Scons

Please refer to the following page to install scons:
   http://www.scons.org/doc/production/HTML/scons-user.html#chap-build-install
(Note: on Windows, install Python 2.x before installing scons)

* 2. IDE/SDK Pre-requites
To build for some OS (Android / Arduino / IOS ...), an IDE/SDK may be required,
please go to the relative page to download and install the required IDE/SDK.

13 14 15
Note: Connectivity module building has been changed. We have to build connectivity
      from the iotivity root folder.

16 17
Linux Build:

18
1) Go to "iotivity/" folder.
19 20 21 22

2) Execute following command(s) to start build based on transport selection required :

    -> Building for all transports :
23
    $ scons resource/csdk/connectivity/samples/linux/ TARGET_OS=linux TARGET_TRANSPORT=ALL
24 25

    -> Building for a specific transport :
26
    $ scons resource/csdk/connectivity/samples/linux/ TARGET_OS=linux TARGET_TRANSPORT=IP
27 28

    -> Building for multiple transports :
29
    $ scons resource/csdk/connectivity/samples/linux/ TARGET_OS=linux TARGET_TRANSPORT=IP,BT
30

31
    -> Clean Build (all transports) :
32
    scons resource/csdk/connectivity/samples/linux/ TARGET_OS=linux TARGET_TRANSPORT=ALL -c (for clean)
33 34


35
3) The above command will build sample also.
36

37
    For Enabling Secured server,
38
    * Note: tinydtls library has to copied to "connectivity/lib/tinydtls" for secured build.
39

40
    Secured Server will be only used for IP transports.
41

42
    Give command "scons resource/csdk/connectivity/samples/linux/ TARGET_OS=linux TARGET_TRANSPORT=IP SECURED=1
43 44 45

Android Build:

46
1) Go to "iotivity/" folder.
47 48 49 50

2) Execute following command(s) to start build based on transport selection required :

    -> Building for all transports :
51
    $ scons resource/csdk/connectivity/samples/android/ TARGET_OS=android TARGET_TRANSPORT=ALL TARGET_ARCH=x86 ANDROID_NDK=your_ndk_path
52 53

    -> Building for a specific transport :
54
    $ scons resource/csdk/connectivity/samples/android/ TARGET_OS=android TARGET_TRANSPORT=IP TARGET_ARCH=x86 ANDROID_NDK=your_ndk_path
55 56

    -> Building for multiple transports :
57
    $ scons resource/csdk/connectivity/samples/android/ TARGET_OS=android TARGET_TRANSPORT=IP,BT TARGET_ARCH=x86 ANDROID_NDK=your_ndk_path
58 59

Note :- Upon successful execution of above command(s) CA library will be generated at path
60
        "iotivity/out/android/TARGET_ARCH/release or debug".
61 62 63 64 65

Tizen Build:

1) If you are building first time, then delete GBS-ROOT folder from home directory.

66
2) Go to "iotivity/" folder.
67 68 69 70

3) Execute following command(s) to start build based on transport selection required :

    -> Building for all transports :
71
    $ scons -f resource/csdk/connectivity/build/tizen/SConscript TARGET_OS=tizen TARGET_TRANSPORT=ALL
72 73

    -> Building for a specific transport :
74
    $ scons -f resource/csdk/connectivity/build/tizen/SConscript TARGET_OS=tizen TARGET_TRANSPORT=IP
75 76

    -> Building for multiple transports :
77
    $ scons -f resource/csdk/connectivity/build/tizen/SConscript TARGET_OS=tizen TARGET_TRANSPORT=IP,BT,BLE
78 79 80

4) By default, above command will build sample also.
   To disable building sample, add BUILD_SAMPLE=OFF to the build command.
81
   Ex: scons -f resource/csdk/connectivity/build/tizen/SConscript TARGET_OS=tizen TARGET_TRANSPORT=ALL BUILD_SAMPLE=OFF
82 83 84 85 86 87 88
   Making this flag ON builds the sample.

Note :- Upon successful execution of above command(s) CA library and sample applications will be
        generated at path "~/GBS-ROOT/local/repos/redwood/armv7l/RPMS".

Arduino Build:

vimala.v's avatar
vimala.v committed
89
Note :- Currently Mega & Due build is supported.
90

91
1) Set up Arduino first before building. Refer to "connectivity\build\arduino\Arduino_Setup_README.txt" file for help.
92

93
2) Go to "iotivity/" folder.
94 95 96

3) Execute following command to start build :

vimala.v's avatar
vimala.v committed
97
For Arduino Mega
98
    $ scons resource/csdk/connectivity/samples/arduino/ TARGET_OS=arduino TARGET_TRANSPORT=<transport> TARGET_ARCH=avr BOARD=mega ARDUINO_HOME=<path_to_arduino_installation>
vimala.v's avatar
vimala.v committed
99
For Arduino Due
100
    $ scons resource/csdk/connectivity/samples/arduino/ TARGET_OS=arduino TARGET_TRANSPORT=<transport> TARGET_ARCH=arm BOARD=arduino_due_x_dbg ARDUINO_HOME=<path_to_arduino_installation>
vimala.v's avatar
vimala.v committed
101
    NOTE: BOARD=arduino_due_x_dbg|arduino_due_x. Default is arduino_due_x_dbg.
102 103

    Possible values for <transport> are:
104 105
    -> IP :
    $ scons resource/csdk/connectivity/samples/arduino/ TARGET_OS=arduino TARGET_TRANSPORT=IP TARGET_ARCH=avr BOARD=mega ARDUINO_HOME=<path_to_arduino_installation>
106
    -> BLE :
107
    $ scons resource/csdk/connectivity/samples/arduino/ TARGET_OS=arduino TARGET_TRANSPORT=BLE TARGET_ARCH=avr BOARD=mega ARDUINO_HOME=<path_to_arduino_installation>
108 109 110 111 112

    Note :- Only single transport can be built at a time for Arduino.

4) The above command will build sample also. The "CASample.hex" can be found at "/samples/arduino/"

113
5) After building sample, script will try to install on "/dev/ttyACM0" port in 'sudo' mode.
114
   To skip installation, set command line argument 'UPLOAD=false'.
115
   "scons resource/csdk/connectivity/samples/arduino/ TARGET_OS=arduino TARGET_TRANSPORT=ETHERNET TARGET_ARCH=avr BOARD=mega ARDUINO_HOME=<path_to_arduino_installation> UPLOAD=false"
116

117 118
6) To set BLE Shield Name, include the option DEVICE_NAME during scons build.

119
   -> $ scons resource/csdk/connectivity/samples/arduino/ TARGET_OS=arduino TARGET_TRANSPORT=ETHERNET TARGET_ARCH=avr BOARD=mega ARDUINO_HOME=<path_to_arduino_installation> DEVICE_NAME=OIC
120

121 122 123
   Specified Device name length MUST be less than 10 characters. RBL Library has this limitation.
   By Default DEVICE_NAME=OIC-DEVICE, if device name option is not specified

124
   To change the port number, please modify  "port" variable in __upload() function in: "/build/arduino/SConscript".
125