Intel Edison. Investigating IoTivity

Working Reference (After-the-post note): https://github.com/intelmakers/GETTING-STARTED/wiki/Options-for-installing-IoTivity-stack-on-Edison

Experiment goal:

To explore IoTivity and to execute client-server test using IoTivity discovery feature

Result:

  • Creation of and flashing Yocto image for Edison
    • looks to be succssessfull according to logs (see the picture below)
    • !!! but NO components named with iotivity or oic were found on Edison with fresh flashed Yocto.
  • Compiling of simpleclient and simpleserver provided at iotivity examples
    • succeeded only at Ubuntu PC host (see the picture below)
    • !!! failed to compile examples for Yocto

Conclusion

Goals not achieved yet. The investigation/experiment has to continue.

Process:

 

  • Ingredients:
    • Ubuntu LTS 14.04 64 bit
    • Intel Edison wit Arduino Extension Board
    • Iotivity 0.9 SDK

 

  • Steps:
    • install required packages

sudo apt-get install build-essential git diffstat gawk chrpath texinfo libtool gcc-multilib
sudo apt-get install libboost-dev libboost-program-options-dev libexpat1-dev libqt4-core libqt4-gui
sudo apt-get install dfu-util screen libsdl1.2-dev kate u-boot-tools

~>cp Downloads/edison-src-ww25.5-15.tgz ~
cd ~

  • extract doewnloaded file
    tar xvf edison-src-ww25.5-15.tgz
  • Build initial Yocto image for Edison:

— Initialize Yocto build environment

cd edison-src/meta-intel-edison

./setup.sh –bb_number_thread=2 –parallel_make=2

— Run bitbake to create an initial Edison image  (bitbake execution will take time: several hours)

cd /home/mpasha/edison-src/out/linux64
source poky/oe-init-build-env
bitbake edison-image

  • Add Iotivity (meta-oic) to the build

cd edison-src/device-software
git clone http://git.yoctoproject.org/git/meta-oic
cd meta-oic
git checkout

  • Add ”meta-oic” Iotivity layer to the build with editing ”bblayer.conf”
    cd ~/edison-src/build/conf
    kate bblayer.conf &
  • Add the full path of meta-oic in section [BBLAYERS ?= ” \]
    example:

    BBLAYERS ?= ” \
    /home/mpasha/edison-src/out/linux64/poky/meta \
    /home/mpasha/edison-src/out/linux64/poky/meta-yocto \
    /home/mpasha/edison-src/out/linux64/poky/meta-yocto-bsp \
    /home/mpasha/edison-src/meta-intel-edison/meta-oic$ \
    \

  • Add iotivity package to the build with editing local.confkate local.conf &

Add lines
IMAGE_INSTALL_append = ” iotivity-dev iotivity-resource-samples iotivity-service-samples”
or
IMAGE_INSTALL_append = ” iotivity-resource-samples iotivity-service-samples”
BBMASK = “meta-oic/recipes-kernel/”

Make sure to keep a space between the opening quote and “iotivity-dev”
else you will run into an error with bitbake complaining there is no provider of clloaderiotivity

  • Build Edison Yocto image again with IoTivity (this will take about 2 hours)

cd /home/mpasha/edison-src/out/linux64
source poky/oe-init-build-env
bitbake edison-image -c populate_sdk

  • setup SDK
    mpasha@mpasha-pc:~$ ./edison-src/out/linux64/build/tmp/deploy/sdk/poky-edison-glibc-x86_64-edison-image-core2-32-toolchain-1.7.2.sh
  • Finally, run the post-build script to generate the toFlash/ directory:
    mpasha@mpasha-pc:~$ sudo ./edison-src/meta-intel-edison/utils/flash/postBuild.sh ./edison-src/out/linux64/build
  • install xfstk
    https://communities.intel.com/message/257193#257193
  • Flash Yocto image to Edison
    sudo ./edison-src/out/linux64/build/toFlash/flashall.sh
    Connect Edison and your development system with 2 USB cables and execute below command

reconnect (pull the USB cables out and plug them again) the board when propmpted

  • Checking the flash process

sudo screen /dev/ttyUSB0 115200

  • Boot up and Configure Edison
    Boot up Edison, connect to it with Putty on serial port and configure name, password and wifi
    At Edison command prompt:
    configure_edison –setup

— To detect USB on Ubuntu:

sudo apt-get install input-utils

mpasha@mpasha-pc:~$ lsusb
mpasha@mpasha-pc:~$ ls -l /dev/ttyU*
crw-rw—- 1 root dialout 188, 0 אוג 15 08:36 /dev/ttyUSB0

mpasha@mpasha-pc:~$ sudo putty

 

  • #######################################################################
  • Build edisonserver and edisonclient
  • #######################################################################

install scons according: iotivity/readme.scons.txt

iotivity> sudo apt-get install libboost-dev libboost-program-options-dev libexpat1-dev libboost-thread-dev uuid-dev
iotivity> sudo apt-get install libcurl4-openssl-dev
iotivity> sudo ldconfig
iotivity>sudo apt-get install libssl-dev
iotivity>sudo apt-get install scons

if scons asks you to install additional packages – do so util scons stopps ascing and starts compiling iotivity

iotivity> git clone https://github.com/01org/tinycbor.git extlibs/tinycbor/tinycbor

mpasha@mpasha-pc:~/iotivity$ source /opt/poky-edison/1.7.2/environment-setup-core2-32-poky-linux
mpasha@mpasha-pc:~/iotivity$ scons ./examples/OICSensorBoard
mpasha@mpasha-pc:~/iotivity$ scons ./examples/OICMiddle/
mpasha@mpasha-pc:~/iotivity$ scons ./resource/examples/

  • Compilation results are here:
    /home/mpasha/iotivity/out/linux/x86_64/release/examples
    /home/mpasha/iotivity/out/linux/x86_64/release/resource/examples

sudo apt-get install libboost-all-dev

  • boost installing according : https://www.iotivity.org/documentation/linux/getting-started
    cd boost_1_55_0/
    sudo ./bootstrap.sh –with-libraries=system,filesystem,date_time,thread,regex,log,iostreams,program_options –prefix=/usr/local
    sudo apt-get update
    sudo apt-get install python-dev autotools-dev libicu-dev build-essential libbz2-dev
    sudo ./b2 install
    sudo sh -c ‘echo ‘/usr/local/lib’ >> /etc/ld.so.conf.d/local.conf’
    sudo ldconfig
  • scons commands to try

sudo scons TARGET_OS=yocto TARGET_ARCH=x86_64 resource/examples/
sudo scons TARGET_OS=yocto –extrapath=/home/mpasha/boost_1_55_0
scons RELEASE=false TARGET_OS=yocto TARGET_ARCH=x86_64

  • IoTRelated files at Edison
    on Edison
    ./usr/lib/python2.7/dist-packages/iotkit.py
    ./usr/bin/iot
    ./usr/lib/node_modules/iotkit
    ./usr/lib/node_modules/iotkit-agent
    ./usr/lib/node_modules/iotkit-comm
    ./usr/lib/opkg/info/iotkit-xxx
    ./usr/share/iotkit-lib
    ./usr/share/iotkit-comm
    ./usr/include/iotkit-lib
    ./usr/include/iotkit-comm
    ./lib/systemd/system/iotkit-agent.service
    ./etc/iotkit-lib
    ./etc/iotkit-comm

 

Pics:

  •  simpleclient and simpleserver communicate on Ubuntu

20150815_120233

  • Edison Yocto image flash suceeded, but no oic or iotiviyu files detected on Edison

20150815_145530

4 thoughts on “Intel Edison. Investigating IoTivity

  1. Same here.. nothing related files i seen in the edition board.. have you found the fix ?
    for me it was showing like

    root@edison:~# ./server
    ./server: error while loading shared libraries: liboc.so: cannot open shared object file: No such file or directory

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s