KNoT VirtualThing is part of the KNoT project. It aims to provide an abstraction to allow certain protocols to interact with a cloud service using the KNoT AMQP Protocol, by virtualizing a KNoT Device.
Build:
- build-essential
- autoconf v2.69
- libtool v2.4.6-11
- automake v1.16.1
- pkg-config v0.29.1
- ell v0.18
- json-c v0.14-20200419
- rabbitmq-c v0.10.0
- knot-protocol 891d01d
- libmodbus v3.1.4
Test:
- check v0.10.0
Other versions might work, but aren't officially supported
$ sudo apt-get install automake libtool libssl-dev valgrind
The Embedded Linux Library (ELL) provides core, low-level functionality for system daemons. To install libell, you have to follow the instructions below:
git clone git://git.kernel.org/pub/scm/libs/ell/ell.git
git checkout 0.18
to checkout to version 0.18- Follow instructions on
INSTALL
file
json-c provides helpers functions to manipulate JSON datas. To install json-c lib, you have to follow the instructions below:
git clone https://github.com/json-c/json-c.git && cd json-c
git checkout json-c-0.14-20200419 && cd ..
- Follow instructions on
README.md
file
rabbitmq-c is a C-language AMQP client library for use with v2.0+ of the RabbitMQ broker. After install cmake, install rabbitmq-c. You have to follow the instructions below to install it:
git clone https://github.com/alanxz/rabbitmq-c
git checkout v0.10.0
to checkout to version 0.10.0- Follow instructions on
README.md
file
KNOT Application layer protocol library provides the application layer messages definition for exchanging messages between KNoT Nodes (KNoT Thing Devices), KNoT Gateway and KNoT Apps. To install KNoT Protocol, you have to follow the instructions below:
git clone git@github.com:CESARBR/knot-protocol-source.git
git checkout 891d01d
to checkout to a hash on devel branch.- Follow instructions on
README
file
libmodbus is a free software library to send/receive data according to the Modbus protocol. To install libmodbus, you must follow the instructions:
- Grab the release package for version 3.1.4 from libmodus website
https://libmodbus.org/releases/libmodbus-3.1.4.tar.gz
- Extract it with
tar -xzvf libmodbus-3.1.4.tar.gz
- Change into the extracted folder with
cd libmodbus-3.1.4
- Finally, build and install libmodbus with
./configure && make && sudo make install
Run ./bootstrap-configure
and then make
Start the daemon:
./src/thingd
To see the daemon options:
./src/thingd --help
Start the daemon with the options to indicate the configuration files path:
./src/thingd -n -c confs/credentials.conf -d confs/device.conf -r confs/rabbitmq.conf
valgrind --leak-check=full --track-fds=yes ./src/thingd -n -c
confs/credentials.conf -d confs/device.conf -r confs/rabbitmq.conf
Run ./bootstrap-configure --with-check
, make
and then make check
You can run the KNoT Virtual Thing on Docker using the configuration files located under the confs/ folder.
To build:
docker build -t thingd .
You can also use the options --build-arg ENV=value to install other dependencies versions.
The build arguments available are:
- LIBELL_VERSION (Default: v0.18)
- JSONC_VERSION (Default: 0.14-20200419)
- RABBITMQC_VERSION (Default: v0.10.0)
- KNOT_PROTOCOL_VERSION (Default: 891d01d)
- LIBMODBUS_VERSION (Default: v3.1.4)
To run the container:
docker run -it thingd
All KNoT VirtualThing files are under LGPL v2.1 license, you can check COPYING
file for details.
The checkpatch.pl
and spelling.txt
files, on hooks folder, are under the
Linux Kernel's GPL v2 license.