Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it? #1

Open
HenryChen3991 opened this issue Aug 8, 2018 · 1 comment
Open

How to use it? #1

HenryChen3991 opened this issue Aug 8, 2018 · 1 comment

Comments

@HenryChen3991
Copy link

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

@dirkfeytons
Copy link
Owner

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants