After restart the problem disappeared.
I want to modify the Domoticz database from a LUA script (yes, I know all the risks).
I installed a library (lua-sql-sqlite3) to access sqlite3 directly from LUA (sudo apt-get install lua-sql-sqlite3).
When I start LUA from a command line it starts LUA 5.1. From there I can use the library like this:
Code: Select all
local luasql = require('luasql.sqlite3')
local env = luasql.sqlite3()
local db = env:connect('/home/pi/domoticz/domoticz.db')
db.execute(' sql command ')
db:close()
env:close()
However, Domoticz uses LUA 5.2. The script says: "module 'luasql.sqlite3' not found".
The library luasql seems to be installed in both versions:
Code: Select all
$ sudo find / -name luasql
/usr/lib/arm-linux-gnueabihf/lua/5.2/luasql
/usr/lib/arm-linux-gnueabihf/lua/5.1/luasql
1. How can I 'force' the apt-get to install into LUA 5.2 ?
2. How can I move the installed library from LUA 5.1 to LUA 5.2 ?
3. How can I make Domoticz to search for the right path for the library ?
require('/usr/lib/arm-linux-gnueabihf/lua/5.2/luasql.sqlite3') didn't work.