I am trying to test a shared lua module in the Test Luup Code window. I am using require to get access to the shared functions. Whenever I attempt to access functions in the shared module, I get a Code Failed message. To test this problem, I have done the following:
Place the file TestMod.lua in the /etc/cmh-ludl directory on Vera3.
I believe you need to upload the file via Vera’s web interface Apps → Developer Apps → Lua Files. The files are compress when uploaded. So this may be your problem.
I am not privy to the inner workings of Vera, so I cannot tell for sure.
One possible cause is that that Vera has several “run stacks” operating, and functions visible in one stack are not visible in another.
For example, on my Vera 1, the “Test LUA” code window is a different run time stack from the normal scenes’ stack. So variables and functions declared in the Test Lua window will not be visible to my scene LUA code.
I do not know if this is the same in later versions of Vera.