transformer icon indicating copy to clipboard operation
transformer copied to clipboard

How to use it?

Open HenryChen3991 opened this issue 7 years ago • 1 comments

I want to use your application to transform uci format and cwmpd format

HenryChen3991 avatar Aug 08 '18 03:08 HenryChen3991

Hi,

To get Transformer running here's roughly the steps to follow:

  1. Install the dependencies as listed in the README. To avoid 'contaminating' your system I usually install everything in a subdirectory of the repo and set the relevant LD_LIBRARY_PATH, LUA_PATH and LUA_CPATH to the right values. I have a script for that but it's unfortunately only suitable for internal use.
  2. Build the Lua C modules from this repo and make them available in your LUA_CPATH.
  3. Make the ./transformer/ directory available in your LUA_PATH (copy, symlink, ...).
  4. Make the files in ./lib/src/lua-datamodel/ available in your LUA_PATH.
  5. Ideally create a first data model mapping file with the root object. The generator.sh script in the generator directory can be used to generate a skeleton mapping file for an object; afterwards you have to add the logic on how everything maps to the platform. I've just commited a mapping file for the Device root object to get things started. As can be seen in transformer/server/main.lua these mappings are expected in /usr/share/transformer/mappings/ by default but this can be overridden in the UCI config that Transformer reads on startup. If you don't want to bother with creating such a config (it's optional) you can always change the default values in main.lua.
  6. With all this in place you can execute transformer/server/main.lua. To interact with the daemon you can execute cli/cli.lua in a different terminal and issue commands there.

I realize this is far from ideal to get up and running quickly. I know how to improve this drastically but I lack the time, and I'm not actively working on Transformer anymore. But I'm gonna try my best...

dirkfeytons avatar Aug 10 '18 13:08 dirkfeytons