iotivity代码地址
https://github.com/iotivity/iotivity
相关资料
cloud结构:https://wiki.iotivity.org/iotivity_cloud
使用指南:https://wiki.iotivity.org/iotivity_cloud_-_programming_guide。
一、环境信息
微软云。ubuntu14.04。自带python2.7.6
二、下载安装编译
*********************************************************************************************************************************************************************************************************
参照根目录下的Readme.scons.txt文件及https://wiki.iotivity.org/build_iotivity_with_ubuntu_build_machine。
sudo apt-get update
sudo apt-get install git(1.9.1)
sudo apt-get install lrzsz(方便上传文件)
sudo apt-get install scons(2.3)
git clone https://github.com/iotivity/iotivity.git
*********************************** Error: ************************************
* Please download cbor using the following command:
* $ git clone https://github.com/01org/tinycbor.git extlibs/tinycbor/tinycbor -b v0.4.1
*******************************************************************************
*********************************** Error: ************************************
* The iotivity repository does not include cryptgraphic software,
* but requires it to be added by the developer.
* Please download mbedtls using the following command:
* $ git clone https://github.com/ARMmbed/mbedtls.git extlibs/mbedtls/mbedtls -b mbedtls-2.4.2
*******************************************************************************
git clone https://github.com/ARMmbed/mbedtls.git extlibs/mbedtls/mbedtls
sudo apt-get install build-essential scons libtool autoconf valgrind doxygen wget unzip libboost-all-dev libcurl4-openssl-dev pkg-config
sudo apt-get install libboost-dev libboost-program-options-dev libboost-thread-dev uuid-dev libexpat1-dev libglib2.0-dev libsqlite3-dev libcurl4-gnutls-dev
scons cloud WITH_TCP=yes RELEASE=yes TARGET_TRANSPORT=IP WITH_CLOUD=yes WITH_MQ=PUB,SUB
但是按照上面的方式执行虽然编译成功,但是仍没有生成可执行文件,修改编译命令。去掉cloud,修改RELEASE=false后在debug文件下生成可执行文件.
路径为:iotivity/out/linux/x86_64/debug/cloud/samples/client
mongod安装
1:参考https://docs.mongodb.com/master/tutorial/install-mongodb-on-ubuntu/
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start