Page 1 of 1

Hue - Synology -error loading module 'socket.core'

Posted: Sunday 19 February 2017 16:53
by bertbigb
Hello,

information: I have a Synology 1515+ and I run domoticz beta V3.6708

I also have a few hue lights which I have connected to my domoticz.
In many places (also the Domoticz Hue wiki) i find the following commands which are necessary to make these scripts works

Code: Select all

   local http = require('socket.http')
   local ltn12 = require('ltn12')
   local json = require('dkjson')
 
However when I make use of these scripts I get an error:

Code: Select all

error loading module 'socket.core' from file '/usr/local/lib/lua/5.2/socket/core.so':
/usr/local/lib/lua/5.2/socket/core.so: wrong ELF class: ELFCLASS32
Can anyone help me and point out what I should or could do to solve this error?

Many thanks already

Best regards,
Bert

Re: Hue - Synology -error loading module 'socket.core'

Posted: Tuesday 09 May 2017 11:00
by TroisSix
Hi bertbigb,
Did you found a solution?

If it helps you or others, I downloaded these two modules: usrlocalliblua5p2 and usrlocalsharelua5p2, and copied it in the good folders on my NAS. It should work for most of you guys.

But I'm having these errors now because I haven't the good two core.so files in "mime" and "socket" directories:

Code: Select all

Error: EventSystem: in scriptXXX.lua: error loading module 'socket.core' from file '/usr/local/lib/lua/5.2/socket/core.so':
/usr/local/lib/lua/5.2/socket/core.so: invalid ELF header
I should get the good core.so for my Syno DS412+ (Atom 2700 cedarview = 64b I think?), but where can I find it?
If anyone has any idea please? :)

Re: Hue - Synology -error loading module 'socket.core'

Posted: Tuesday 09 May 2017 12:20
by bertbigb
Hi,

I didn't found a solution until now. Must admit that I didn't gave it much attention also in the meanwhile.

You wrote that you downloaded and installed usrlocalliblua5p2 and usrlocalsharelua5p2. Because I couldn't found out how you did it I googled and found this in domoticz EQ3 wiki when i was searching how to download and install the usrlocalliblua5p2 and usrlocalsharelua5p2

Code: Select all

First you need to update Lua to 5.2. and install some extra lua files.
sudo apt-get install lua5.2
sudo apt-get install lua-socket
sudo apt-get install luarocks
sudo luarocks install luasec
sudo luarocks install luasocket
sudo luarocks install basexx
Then check if they have all installed ok

luarocks list
Which should show

Installed rocks:
----------------
basexx
  0.3.0-1 (installed) - /usr/local/lib/luarocks/rocks
luasec
  0.6-1 (installed) - /usr/local/lib/luarocks/rocks
luasocket
  3.0rc1-2 (installed) - /usr/local/lib/luarocks/rocks
If you get a problem such as openssl.a or openssl.so or openssl.so.* not found
This may be an issue withe where different systems install/store files 
try

sudo apt-get install libssl-dev
sudo mkdir /usr/local/ssl
sudo cp /usr/lib/arm-linux-gnueabihf/libssl.* /usr/local/ssl
sudo luarocks install luasec OPENSSL_LIBDIR=/usr/local/ssl
then check

luarocks list
N.B. If you had lua5.1 installed you may need to copy some files across to lua5.2 as they appear to install differently.

sudo cp /usr/local/share/lua/5.1/*.lua /usr/local/share/lua/5.2
Hopefully, your system now has everything in place now
Could this probably help you (and me) --> https://www.domoticz.com/forum/viewtopic.php?t=10783
Her I find that it is depending on your processor

What I will try this evening when I'm home is:
sudo apt-get install lua5.2
sudo apt-get install lua-socket
sudo apt-get install luarocks
sudo luarocks install luasec
sudo luarocks install luasocket
sudo luarocks install basexx

And see what happens, will keep you informed

Re: Hue - Synology -error loading module 'socket.core'

Posted: Tuesday 09 May 2017 13:26
by TroisSix
Yep, that's the threads I read before, but no luck for me with the two files core.so incompatible with my DS412+ :(

In fact, I only downloaded the two .tar.gz here:
http://www.domoticz.com/forum/viewtopic ... 638#p22638
Then on the github zerobranestudio, I tried either the core.so for 32 and 64bits platforms, no luck :(

I will continue to search for a solution ;)

Re: Hue - Synology -error loading module 'socket.core'

Posted: Monday 29 May 2017 10:13
by TroisSix
Still searching for a solution...
I tried a few posts like this: http://www.domoticz.com/wiki/Upload_ene ... et_library and this: https://www.domoticz.com/wiki/Simple_sc ... Hue_status, but no luck :(
Has anyone any idea to have the good core.so files on Synology?
Thx for your help !

Re: Hue - Synology -error loading module 'socket.core'

Posted: Thursday 31 May 2018 15:07
by PaulM
A bit late but I solved it for my situation:

What I did:

Code: Select all

sudo apt-get install lua5.2
sudo apt-get install lua-socket
sudo cp /usr/lib/i386-linux-gnu/lua/5.2/socket/core.so /usr/local/lib/lua/5.2/socket/
sudo cp /usr/lib/i386-linux-gnu/lua/5.2/socket/core.so /usr/local/share/lua/5.2/socket/
sudo cp /usr/lib/i386-linux-gnu/lua/5.2/mime/core.so /usr/local/lib/lua/5.2/mime/
Since then the errors dissappeared.