transformer
transformer copied to clipboard
How to use it?
I want to use your application to transform uci format and cwmpd format
Hi,
To get Transformer running here's roughly the steps to follow:
- 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_PATHandLUA_CPATHto the right values. I have a script for that but it's unfortunately only suitable for internal use. - Build the Lua C modules from this repo and make them available in your
LUA_CPATH. - Make the
./transformer/directory available in yourLUA_PATH(copy, symlink, ...). - Make the files in
./lib/src/lua-datamodel/available in yourLUA_PATH. - Ideally create a first data model mapping file with the root object. The
generator.shscript in thegeneratordirectory 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 intransformer/server/main.luathese 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 inmain.lua. - With all this in place you can execute
transformer/server/main.lua. To interact with the daemon you can executecli/cli.luain 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...