5 Please refer to the following page to install scons:
6 http://www.scons.org/doc/production/HTML/scons-user.html#chap-build-install
7 (Note: on Windows, install Python 2.x before installing scons)
9 * 2. IDE/SDK Pre-requites
10 To build for some OS (Android / Arduino / IOS ...), an IDE/SDK may be required,
11 please go to the relative page to download and install the required IDE/SDK.
13 Note: Connectivity module building has been changed. We have to build connectivity
14 from the iotivity root folder.
16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19 Steps to build and deploy Easysetup Mediator in Android platform
20 1) Compilation using Scons
21 0) Prerequisite exports for Android
22 export ANDROID_HOME=<ANDROID_HOME>
23 export ANDROID_NDK=<ANDROID_NDK>
25 a) In the IoTivity root source folder execute
26 scons TARGET_OS=android TARGET_ARCH=armeabi TARGET_TRANSPORT=IP RELEASE=0
28 b) If the project is setup correctly, you should see a BUILD SUCCESSFUL message on the terminal
29 You should see the .aar files generated inside of '<iotivity>/android/android_api/base/build/outputs/aar' directory. The .aar files contain jni directory and also a .jar file
31 c) Now navigate to the Easysetup NDK folder
32 <iotivity-root>/service/easy-setup/sdk/mediator/android
34 d) Execute NDK-Build with the following command to cross compiled Easysetup JNI .so files
35 ~/madan/android-ndk-r10d/ndk-build
37 e) Step (d) will generate cross compiled Easysetup JNI .so files in the following folder
39 2) Compilation using Android Studio
41 0) Prerequisite for running the Android application
42 Install Android Studio and use the Android SDK manager to update the Android API to 21
44 a) Import following projects to the Studio using the "File->New->Import Project"
45 - service\easy-setup\sdk\android\EasySetupCore
46 - service\easy-setup\sampleapp\android\EasySetup
48 b) EasySetupCore is dependent on the .aar files generated in 1.b
49 1) To add an .aar file to the 'EasySetupCore' project,
50 a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package
51 b.Select the .aar file(iotivity-armeabi-base-*.aar) from the location in steps 1.b
52 c.Right click on EasySetup->Open Module Settings
53 d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency
55 c) Build EasySetupCore project using "Android Studio->Build->Make Module "easySetupCore"
56 If the project is setup correctly, you should see a BUILD SUCCESSFUL in the Android Studio Gradle Build terminal
57 You should see the .aar file generated inside of
58 'iotivity\service\easy-setup\sdk\mediator\android\easySetupCore\build\outputs\aar'
60 d) EasySetup application is also dependent on the .so files generated in 1.d step
61 1) Drag and drop the following .so files in to the EasySetup\app\src\main\jniLibs\armeabi folder
62 - libeasysetup-jni.so [Easy Setup file]
64 e) EasySetup is also dependent on the .aar files generated in 1.b and 2.c steps
65 1) To add an .aar file to the 'EasySetup' project,
66 a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package
67 b.Select the .aar file from the location in steps 1.b and 2.b above
68 c.Right click on EasySetup->Open Module Settings
69 d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency
70 e.The .aar files (easySetupCore-*.aar & iotivity-armeabi-base-*.aar) selected in step 2.c.1.b above should be present. Select it.
73 e) Run "Easy Setup" as an Android application
75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
78 Steps to build and deploy Easysetup Mediator in Arduino platform
79 1) Compilation using Scons for Arduino Due
80 a) Set up Arduino first before building. Refer to "connectivity\build\arduino\Arduino_Setup_README.txt" file for help.
81 b) Go to "iotivity/" folder.
82 c) Prerequisite exports for Arduino
83 export ARDUINO_HOME=<ARDUINO_HOME_DIR>
84 d) Start Arduino IDE. Select ""Tools->Port->Programming port"
85 e) scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI
86 - With debug or logging
87 scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0
88 - With installation to Arduino
89 scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 UPLOAD=true
90 NOTE: BOARD=arduino_due_x_dbg|arduino_due_x. Default is arduino_due_x_dbg.
92 Possible values for <transport> are:
94 $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0
96 $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0
98 Note :- Only single transport can be built at a time for Arduino
99 f) The above command will build sample. The "enrollee.hex" can be found at "out/arduino/arm/release/service/easy-setup/sampleapp/enrollee/arduino"
100 g) After building sample, script will try to install on "/dev/ttyACM0" port in 'sudo' mode.
101 To skip installation, set command line argument 'UPLOAD=false' or without UPLOAD option
102 h) To set BLE Shield Name, include the option DEVICE_NAME during scons build.
103 -> $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=BLE RELEASE=0 DEVICE_NAME=OIC
105 Specified Device name length MUST be less than 10 characters. RBL Library has this limitation.
106 By Default DEVICE_NAME=OIC-DEVICE, if device name option is not specified
108 To change the port number, please modify "port" variable in __upload() function in: "/build/arduino/SConscript".
111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
128 │ └──mediator/android
130 │ └──enrollee/arduino
131 └── Build_Instructions_Android_Arduino.txt - You are reading this.