From: lankamadan Date: Wed, 9 Sep 2015 10:35:38 +0000 (+0900) Subject: Added Build instructions document X-Git-Tag: 1.2.0+RC1~597^2^2~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ef26a5d1391b4ce4f37ec9c3c326fa752718e08;p=platform%2Fupstream%2Fiotivity.git Added Build instructions document Updated build instructions document for Android and Arduino. Change-Id: Id2fded63259bc8cf2e51a232e3883c6ca28c3c56 Signed-off-by: lankamadan Reviewed-on: https://gerrit.iotivity.org/gerrit/2420 --- diff --git a/service/easy-setup/Build_Instructions_Android_Arduino.txt b/service/easy-setup/Build_Instructions_Android_Arduino.txt new file mode 100755 index 0000000..e320e1a --- /dev/null +++ b/service/easy-setup/Build_Instructions_Android_Arduino.txt @@ -0,0 +1,131 @@ +=== Prerequisites === + +* 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. + +Note: Connectivity module building has been changed. We have to build connectivity + from the iotivity root folder. + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Android Build: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Steps to build and deploy Easysetup Mediator in Android platform +1) Compilation using Scons + 0) Prerequisite exports for Android + export ANDROID_HOME= + export ANDROID_NDK= + + a) In the IoTivity root source folder execute + scons TARGET_OS=android TARGET_ARCH=armeabi TARGET_TRANSPORT=IP RELEASE=0 + + b) If the project is setup correctly, you should see a BUILD SUCCESSFUL message on the terminal + You should see the .aar files generated inside of '/android/android_api/base/build/outputs/aar' directory. The .aar files contain jni directory and also a .jar file + + c) Now navigate to the Easysetup NDK folder + /service/easy-setup/sdk/mediator/android + + d) Execute NDK-Build with the following command to cross compiled Easysetup JNI .so files + ~/madan/android-ndk-r10d/ndk-build + + e) Step (d) will generate cross compiled Easysetup JNI .so files in the following folder + +2) Compilation using Android Studio + + 0) Prerequisite for running the Android application + Install Android Studio and use the Android SDK manager to update the Android API to 21 + + a) Import following projects to the Studio using the "File->New->Import Project" + - service\easy-setup\sdk\android\EasySetupCore + - service\easy-setup\sampleapp\android\EasySetup + + b) EasySetupCore is dependent on the .aar files generated in 1.b + 1) To add an .aar file to the 'EasySetupCore' project, + a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package + b.Select the .aar file(iotivity-armeabi-base-*.aar) from the location in steps 1.b + c.Right click on EasySetup->Open Module Settings + d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency + + c) Build EasySetupCore project using "Android Studio->Build->Make Module "easySetupCore" + If the project is setup correctly, you should see a BUILD SUCCESSFUL in the Android Studio Gradle Build terminal + You should see the .aar file generated inside of + 'iotivity\service\easy-setup\sdk\mediator\android\easySetupCore\build\outputs\aar' + + d) EasySetup application is also dependent on the .so files generated in 1.d step + 1) Drag and drop the following .so files in to the EasySetup\app\src\main\jniLibs\armeabi folder + - libeasysetup-jni.so [Easy Setup file] + + e) EasySetup is also dependent on the .aar files generated in 1.b and 2.c steps + 1) To add an .aar file to the 'EasySetup' project, + a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package + b.Select the .aar file from the location in steps 1.b and 2.b above + c.Right click on EasySetup->Open Module Settings + d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency + e.The .aar files (easySetupCore-*.aar & iotivity-armeabi-base-*.aar) selected in step 2.c.1.b above should be present. Select it. + + + e) Run "Easy Setup" as an Android application + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Arduino Build: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Steps to build and deploy Easysetup Mediator in Arduino platform +1) Compilation using Scons for Arduino Due + a) Set up Arduino first before building. Refer to "connectivity\build\arduino\Arduino_Setup_README.txt" file for help. + b) Go to "iotivity/" folder. + c) Prerequisite exports for Arduino + export ARDUINO_HOME= + d) Start Arduino IDE. Select ""Tools->Port->Programming port" + e) scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI + - With debug or logging + scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 + - With installation to Arduino + scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 UPLOAD=true + NOTE: BOARD=arduino_due_x_dbg|arduino_due_x. Default is arduino_due_x_dbg. + + Possible values for are: + -> IP : + $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 + -> BLE : + $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=WIFI RELEASE=0 + + Note :- Only single transport can be built at a time for Arduino + f) The above command will build sample. The "thinserver.hex" can be found at "out/arduino/arm/release/service/easy-setup/sampleapp/arduino/thinserver/" + g) After building sample, script will try to install on "/dev/ttyACM0" port in 'sudo' mode. + To skip installation, set command line argument 'UPLOAD=false' or without UPLOAD option + h) To set BLE Shield Name, include the option DEVICE_NAME during scons build. + -> $ scons TARGET_OS=arduino BOARD=arduino_due_x_dbg TARGET_ARCH=arm SHIELD=BLE RELEASE=0 DEVICE_NAME=OIC + + 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 + + To change the port number, please modify "port" variable in __upload() function in: "/build/arduino/SConscript". + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Folder structure: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +iotivity/ +└── service + └── easy-setup/ + │── SConscript + │── sdk + │ └── inc + │ └── src + │ └── android + │ └── arduino + │ └──wifi + │ └──inc + │ └──src + │── sampleapp + │ └──android + │ └──arduino + │ └──linux + └── Build_Instructions_Android_Arduino.txt - You are reading this. \ No newline at end of file diff --git a/service/easy-setup/readme.txt b/service/easy-setup/readme.txt deleted file mode 100644 index 19cce5b..0000000 --- a/service/easy-setup/readme.txt +++ /dev/null @@ -1,77 +0,0 @@ - -Steps to build and deploy Easysetup Mediator in Android platform - -1) Compilation using Scons - 0) Prerequisite exports for Android - export ANDROID_HOME= - export ANDROID_NDK= - a) In the IoTivity root source folder execute - scons TARGET_OS=android TARGET_ARCH=armeabi TARGET_TRANSPORT=IP RELEASE=0 - - b) If the project is setup correctly, you should see a BUILD SUCCESSFUL message on the terminal - You should see the .aar files generated inside of '/android/android_api/base/build/outputs/aar' directory. The .aar files contain jni directory and also a .jar file - - c) Now navigate to the Easysetup NDK folder - /service/easy-setup/sdk/mediator/android - - d) Execute NDK-Build with the following command to cross compiled Easysetup JNI .so files - ~/madan/android-ndk-r10d/ndk-build - - e) Step (d) will generate cross compiled Easysetup JNI .so files in the following folder - -2) Compilation using Android Studio - - 0) Prerequisite for running the Android application - Install Android Studio and use the Android SDK manager to update the Android API to 21 - - a) Import following projects to the Studio using the "File->New->Import Project" - - service\easy-setup\sdk\android\EasySetupCore - - service\easy-setup\sampleapp\android\EasySetup - - b) EasySetupCore is dependent on the .aar files generated in 1.b - 1) To add an .aar file to the 'EasySetupCore' project, - a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package - b.Select the .aar file(iotivity-armeabi-base-*.aar) from the location in steps 1.b - c.Right click on EasySetup->Open Module Settings - d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency - - c) Build EasySetupCore project using "Android Studio->Build->Make Module "easySetupCore" - If the project is setup correctly, you should see a BUILD SUCCESSFUL in the Android Studio Gradle Build terminal - You should see the .aar file generated inside of - 'iotivity\service\easy-setup\sdk\mediator\android\easySetupCore\build\outputs\aar' - - d) EasySetup application is also dependent on the .so files generated in 1.d step - 1) Drag and drop the following .so files in to the EasySetup\app\src\main\jniLibs\armeabi folder - - libeasysetup-jni.so [Easy Setup file] - - e) EasySetup is also dependent on the .aar files generated in 1.b and 2.c steps - 1) To add an .aar file to the 'EasySetup' project, - a.Right click on EasySetup->New->Module->Import .JAR or .AAR Package - b.Select the .aar file from the location in steps 1.b and 2.b above - c.Right click on EasySetup->Open Module Settings - d.Select each sample app module under 'Modules'->Dependencies->Add->Module Dependency - e.The .aar files (easySetupCore-*.aar & iotivity-armeabi-base-*.aar) selected in step 2.c.1.b above should be present. Select it. - - - e) Run "Easy Setup" as an Android application - -Folder structure -iotivity/ -└── service - └── easy-setup/ - │── SConscript - │── sdk - │ └── inc - │ └── src - │ └── android - │ └── arduino - │ └──wifi - │ └──inc - │ └──src - │── sampleapp - │ └──android - │ └──arduino - │ └──linux - └── README - You are reading this. - -