Page 1 of 1
cannot load luasocket
Posted: Tuesday 28 February 2017 17:50
by gbordier
Hi,
on RPI with lua-socket/stable v3.0 installed a require ("socket.http") command in an lua script triggers the following message:
/usr/lib/arm-linux-gnueabihf/lua/5.1/socket/core.so: undefined symbol: luaL_openlib
however running the same script from the lua command line does not trigger the same message.
it seems compiling lua into domoticz may require a some specific compilation flags for this to work, any idea ?
Thanks
Guillaume
Re: cannot load luasocket
Posted: Tuesday 28 February 2017 20:12
by simonrg
gbordier wrote:Hi,
on RPI with lua-socket/stable v3.0 installed a require ("socket.http") command in an lua script triggers the following message:
/usr/lib/arm-linux-gnueabihf/lua/5.1/socket/core.so: undefined symbol: luaL_openlib
however running the same script from the lua command line does not trigger the same message.
it seems compiling lua into domoticz may require a some specific compilation flags for this to work, any idea ?
Thanks
Guillaume
If you have a look at Lua on the command line on your RPI, I guess it says Lua 5.1.......
Domoticz normally uses Lua version 5.2, so you need to have the correct libraries for Lua 5.2, so Domoticz should not even be looking at 5.1 which possibly suggests something is set up incorrectly. Have you purposely compiied in Version 5.1?
How did you install lua-socket?
If you have a normal version of Domoticz then following these instructions will install the correct libraries -
http://www.domoticz.com/wiki/Remote_Con ... _Libraries.
If you want to debug your installation a bit more then add a line like:
to a Lua script that Domoticz runs then check the log and do the same thing with Lua on the command line you should get something like this with both, which will tell you what paths the different Lua installations are searching for Libraries.
Code: Select all
stdin:1: module 'red' not found:
no field package.preload['red']
no file '/usr/local/share/lua/5.2/red.lua'
no file '/usr/local/share/lua/5.2/red/init.lua'
no file '/usr/local/lib/lua/5.2/red.lua'
no file '/usr/local/lib/lua/5.2/red/init.lua'
no file '/usr/share/lua/5.2/red.lua'
no file '/usr/share/lua/5.2/red/init.lua'
no file './red.lua'
no file '/usr/local/lib/lua/5.2/red.so'
no file '/usr/lib/arm-linux-gnueabihf/lua/5.2/red.so'
no file '/usr/lib/lua/5.2/red.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './red.so'
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?
Re: cannot load luasocket
Posted: Thursday 02 March 2017 0:48
by gbordier
Thanks a lot it DID work.
but it is a pity luasocket libs for 5.2 have to be installed manually (5.1 libs are part of wheezy on rpi) .
How can we make this part of the Domoticz wiki ?
Re: cannot load luasocket
Posted: Saturday 15 June 2019 14:20
by Derik
I the same errror, only i run lua 5.2