This is documentation for the old, first-generation Kaa platform v0.x.
Next generation Kaa Enterprise IoT platform is now available! Try it free with a 30-days trial.
Kaa Enterprise documentation is here.
. . .

Samsung Artik 5

This guide explains how to cross-compile Kaa C++ SDK for Samsung Artik 5.

If this is the first time you use the Artik board, see official Artik getting started guide on how to configure your board and make it accessible through both serial terminal and the ssh client.

NOTE: This guide is verified against:

  • Host OS: Ubuntu 14.04 LTS Desktop 64-bit
  • Device: Samsung Artik 5


Perform the following instructions on the host machine:

  1. Install CMake.

    sudo apt-get install cmake
  2. If your host system has 64-bit architecture, you must also install 32-bit version of some packages to be able to run 32-bit toolchain.

    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 libstdc++6:i386

Install the required third-party components:

  1. Install the toolchain.

    mkdir artik_root && cd artik_root
    export ARTIK_ROOT="$(pwd)"
    tar xvjf gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.bz2
    mv gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux "${ARTIK_ROOT}"/gcc-linaro-arm-linux-gnueabihf
  2. Install zlib (for Avro version newer than 1.7.5).

    cd "${ARTIK_ROOT}"
    tar -xvzf zlib-1.2.8.tar.gz
    export INSTALLDIR="${ARTIK_ROOT}"/gcc-linaro-arm-linux-gnueabihf/libc/usr
    export PATH="${ARTIK_ROOT}"/gcc-linaro-arm-linux-gnueabihf/bin:"${PATH}"
    export TARGETMACH=arm-linux-gnueabi
    export BUILDMACH=i686-pc-linux-gnu
    export CROSS=arm-linux-gnueabihf-
    cd zlib-1.2.8
    CROSS_PREFIX="${CROSS}" ./configure --prefix="${INSTALLDIR}"
    make install
  3. Install bzip2 (for Avro version newer than 1.7.5).

    cd "${ARTIK_ROOT}"
    tar -xvzf bzip2-1.0.6.tar.gz
    cd bzip2-1.0.6
    sed -e "/^all:/s/ test//" Makefile > Makefile-libbz2_so
    make -f Makefile-libbz2_so CC="${CROSS}"gcc AR="${CROSS}"ar
    make PREFIX="${INSTALLDIR}" install
  4. Install Boost (1.54 or higher).

    cd "${ARTIK_ROOT}"
    wget -O boost_1_59_0.tar.bz2
    tar xvjf boost_1_59_0.tar.bz2
    cd boost_1_59_0
    sed -r 's/(using\s+gcc)(\s+;)/\1 : arm : arm-linux-gnueabihf-c++\2/g' -i project-config.jam
    ./b2 install toolset=gcc-arm --prefix="${INSTALLDIR}"
  5. Install Apache Avro.

    cd "${ARTIK_ROOT}"
    tar zxf avro-cpp-1.7.5.tar.gz
    cd avro-cpp-1.7.5
    patch < avro-cpp-disable-tests.patch
    mkdir build && cd build
    make && make install
  6. Install Botan.

    cd "${ARTIK_ROOT}"
    tar -xvzf Botan-1.11.28.tgz
    cd Botan-1.11.28
    python --cpu=arm --cc-bin="${CROSS}"g++ --prefix="${INSTALLDIR}"
    make install
  7. Copy libraries to the Artik device.

    scp "${INSTALLDIR}"/lib/libboost_*.so* root@<put Artik ip address here>:/usr/lib
    scp "${INSTALLDIR}"/lib/libbotan*.so* root@<put Artik ip address here>:/usr/lib
    scp "${INSTALLDIR}"/lib/libavrocpp*.so* root@<put Artik ip address here>:/usr/lib

Create application

After you installed the required dependencies and built the C++ SDK, you can build and run your Kaa application.

Since Artik runs on Linux, you can use the Linux guide to build and run your application.

NOTE: The CMAKE_CXX_COMPILER specifies C++ compiler to use and CMAKE_FIND_ROOT_PATH tells CMake where to look for required libraries installed in previous step.