/liquidiot-duktape-server

This project is a masters thesis work for creating light weight runtime environment for LiquidIoT http://lively.cs.tut.fi/LiquidIoT.html

Primary LanguageC++Apache License 2.0Apache-2.0

liquidiot-duktape-server

Requirements

Some of these requirements are not absolute lower boundaries but rather tested versions

Duktape Configure

Duktape doesn't need to be complied separately (it is compiled with the program), thus only the files are required.

Inside duktape folder configure duktape.

python2 tools/configure.py --output-directory src -UDUK_USE_FATAL_HANDLER -UDUK_USE_VERBOSE_ERRORS -UDUK_USE_CPP_EXCEPTIONS

Duktape default path can be configured with env DUKTAPE_PATH and extras path can be controlled with evn DUKTAPE_EXTRAS_DIR. Paths to both duktape env variables are treated as relative paths. Default configure should work but it is not tested properly

Install

CMake assumes that duktape is located at "../duktape-2.2.1/" so one might want to look at the path if that's not the case. Might change in later releases.

mkdir build && cd build
cmake ..
make

sudo make install will try to install the package globally if that's needed

Configure

  1. Copy examples/example_config.json cp examples/example_config.json build/config.json
  2. Change all hostname and port parameters accordingly (these are mandatory)
  3. Change url parameters (only used for visibility and might be needed to communicate from outside)
  4. Everything else important is generated automatically (although only device id will be overwritten if not apppropriate)
  5. All string parameters will be saved as string (only native configs can be other than string)
  6. Only parameters used in example_config.json are natively used (although other parameters will be visible eg. "device" : { "serial":"asdf" } )

Other

Check for "examples/test" and "examples/test2" for example applications that are using the features supported by current runtime.

The runtime should start properly even when configuration is not correct.

To enable debug prints one should use -DCMAKE_BUILD_TYPE=Debug in cmake flags.