BLE Adapter implementation for Arduino
[platform/upstream/iotivity.git] / resource / csdk / connectivity / build / arduino / Arduino_Setup_README.txt
1 STEPS to setup Arduino on linux machine for building CA code:
2
3 1) Download the Arduino package as per your system specification from the given link :
4         http://arduino.cc/en/main/software
5
6 2) Unzip the downloaded package to some location say ARDUINO_DIR(This is the arduino installation directory).
7         ARDUINO_DIR = <PATH_TO_ARDUINO_INSTALL_DIR>/arduino-1.5.x
8
9 3) Change permissions for executable in your "ARDUINO_DIR"
10                 chmod -R +x <ARDUINO_DIR>
11
12 4.1) ONE TIME ONLY - ADDITIONAL LIBRARIES (Time)
13         Arduino builds are dependent on latest Time library. Download it from here:
14                 I. http://playground.arduino.cc/uploads/Code/Time.zip
15         Place this library in the "ARDUINO_DIR/libraries/Time" folder where other libraries are present.
16                 [P.S - The Time library files path should be as follows "ARDUINO_DIR/libraries/Time/Time/{***files***}"]
17         Some files in this library has windows style line endings, for patch to run properly, please execute following command:
18                 cd <ARDUINO_DIR>
19                 find ./libraries/Time/ -type f -exec dos2unix {} \;
20
21 4.2) ONE TIME ONLY - ADDITIONAL LIBRARIES (BLE)
22         Note: Prior to building for BLE Transport, following additional steps are required:
23         (1) Download RedBearLab Arduino RBL_nRF8001 Library from link(https://github.com/RedBearLab/nRF8001/archive/25643e7b1b7da3740406325a471e3faa4b948747.zip)
24         (2) Extract zip file and apply RBL patch(connectivity/lib/arduino/RBL_nRF8001.patch) to "RBL_nRF8001" folder by following below steps,
25                 i)  Go to downloaded RBL_Library Folder ("nRF8001-master/Arduino/libraries/RBL_nRF8001")
26                 ii) Apply dos2unix for RBL_Library Folder and RBL Patch File (RBL_nRF8001.patch), if we have downloaded Library in Non UNIX Platform.
27                 iii) Apply RBL Patch[connectivity\lib\arduino\RBL_nRF8001.patch] by using the below command
28                         patch -p1 < RBL_Patch_File_Location(RBL_nRF8001.patch)
29         (3) Copy the patched RBL_nRF8001 Library and place it in "arduino-<x.x.x>/libraries" folder
30         (4) Download Nordic Arduino BLE library [Tag: "0.9.5.Beta" Version] from the link (https://github.com/NordicSemiconductor/ble-sdk-arduino/archive/0.9.5.beta.zip).
31                 Extract the zip file and copy the "BLE" folder available under "libraries" folder and place it in "arduino-<x.x.x>/libraries" folder
32                 i)  Apply dos2unix for the "BLE" folder.
33                 ii) Go to the BLE folder and apply the patch[connectivity\lib\arduino\arduino_due_ble.patch] using the below command.
34                         patch -p1 < path/to/arduino_due_ble.patch
35
36 5) ONE TIME ONLY - PATCH
37         Complete patch has been provided at : "connectivity\lib\arduino\arduino_libraries.patch"
38                 Copy this patch file to "ARDUINO_DIR/"
39
40 6) To apply patch give the command :
41                 patch -p1 < arduino_libraries.patch
42         To undo the patch give the command :
43                 patch -R -p1 < arduino_libraries.patch
44
45 7) ONE TIME ONLY - FIRMWARE UPGRADE (FOR WIFI SHIELD)
46         To support UDP over WiFi, WiFi shield needs to run latest firmware. Please refer:
47         (http://arduino.cc/en/Hacking/WiFiShieldFirmwareUpgrading)
48         for instructions on how to upgrade your firmware.
49
50 8) Launch Arduino IDE (required for logs and port and board selection.)
51         Goto to "ARDUINO_DIR" directory.
52         Launch command := sudo ./arduino
53
54 9) Select your board and port under the tools option in Arduino IDE.