A new user has been having problems in running the rfxcom plugin on his Vera Lite device.
I have tracked the problem down to a missing lua bitw library.
On my Vera2 device with UI4, when I run the following code:
function some_test()
luup.log(“some_test2”)
luup.log( string.format(“%02X”, bitw.bnot(96)))
end
some_test()
I get this in my log:
50 04/25/12 21:10:51.406 luup_log:42: some_test2 <0x2c0c>
50 04/25/12 21:10:51.407 luup_log:42: FFFFFF9F <0x2c0c>
which is correct!
but the other user in UI5 gets the following result:
50 04/26/12 10:04:08.011 luup_log:0: some_test2 <0x2caa1680>
01 04/26/12 10:04:08.011 [31;1mLuaInterface::StartEngine failed run: 0 [string “function some_test()…”]:3: attempt to index global ‘bitw’ (a nil value) [0m <0x2caa1680>
I’m not sure how the first code worked, I didn’t think the bit lib was pre-loaded.
There’s no call to [tt]require()[/tt] to load the Bit manipulation lib, so it should have errored out there as well. Have you tried manually loading it using:
bitw = require('bit')
and/or looking on the Vera fs for the library files to see where they are in the old and new environments, and if they can be loaded (not sure they why they would have loaded bit by default in older revs)