This thread is about my work on a LUUP plugin for controlling Modbus/TCP slaves. Right now I’m in the steep learning curve called Lua (“do more with less”) but I’ve successfully made a simple poll & respond script in Lua 5.1 using just these libraries:
- LuaSocket (already included in current firmware)
- VStruct http://www.funkyhorror.net/toxicfrog/projects/vstruct (A library for packing and unpacking binary data)
- ObjectLua (Object Oriented Programming for Lua, *why isn’t it already in the language ??? *)
Some first thoughts and questions for the community:
- Library dependencies: I know size is an issue in embedded systems, but what are the limitations? Do we have to count every byte used, both in terms of script size and runtime usage?
- Parallel tasking: the MIPS CPU inside this box seems quite powerful, but its power isn’t infinite. Since Modbus/TCP is a stateless protocol and you have to continuously poll the slaves, would it be better to write an external daemon to do all the heavy network I/O, or do we have the ability to run native threads inside the Luup engine?
- Licensing: Are there licensing issues we have to take into account? Do we have to use a licensing scheme compatible with Vera’s?