Re: Presence detection based on IP and Bluetooth
Posted: Friday 03 November 2017 12:37
Have arrived at the spot where I'm to test the script:
pi@raspberrypi:~/domoticz/scripts $ lua presence.lua
lua: presence.lua:85: module 'socket.http' not found:
no field package.preload['socket.http']
no file './socket/http.lua'
no file '/usr/local/share/lua/5.1/socket/http.lua'
no file '/usr/local/share/lua/5.1/socket/http/init.lua'
no file '/usr/local/lib/lua/5.1/socket/http.lua'
no file '/usr/local/lib/lua/5.1/socket/http/init.lua'
no file '/usr/share/lua/5.1/socket/http.lua'
no file '/usr/share/lua/5.1/socket/http/init.lua'
no file './socket/http.so'
no file '/usr/local/lib/lua/5.1/socket/http.so'
no file '/usr/lib/arm-linux-gnueabihf/lua/5.1/socket/http.so'
no file '/usr/lib/lua/5.1/socket/http.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './socket.so'
no file '/usr/local/lib/lua/5.1/socket.so'
no file '/usr/lib/arm-linux-gnueabihf/lua/5.1/socket.so'
no file '/usr/lib/lua/5.1/socket.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
I have made the two new directories and downloaded the two files from https://www.domoticz.com/wiki/Remote_Co ... _Libraries and and extracted them:
pi@raspberrypi:/usr/local/share/lua/5.2 $ ls -l
total 152
-rw-r--r-- 1 root staff 2184 Oct 25 2013 ansicolors.lua
-rw-r--r-- 1 root staff 34843 May 28 2015 JSON.lua
-rw-r--r-- 1 root staff 8331 Sep 25 2014 ltn12.lua
-rw-r--r-- 1 root staff 4812 Sep 25 2014 luacolors.lua
-rw-r--r-- 1 root staff 2487 Sep 25 2014 mime.lua
-rw-r--r-- 1 root staff 62698 Sep 7 2014 mobdebug.lua
drwxr-sr-x 2 root staff 4096 Sep 25 2014 socket
-rw-r--r-- 1 root staff 5011 Sep 7 2014 socket.lua
drwxr-xr-x 2 root staff 4096 Jul 5 2015 ssl
-rw-r--r-- 1 root staff 4663 Jul 5 2015 ssl.lua
pi@raspberrypi:/usr/local/lib/lua/5.2 $ ls -l
total 68
drwxr-sr-x 2 root staff 4096 Sep 25 2014 mime
drwxr-sr-x 2 root staff 4096 Sep 7 2014 socket
-rwxr-xr-x 1 root root 61293 Jul 5 2015 ssl.so
pi@raspberrypi:/usr/local/lib/lua/5.2 $
Why is LUA searching for the files in the /5.1 directory?
pi@raspberrypi:~/domoticz/scripts $ lua presence.lua
lua: presence.lua:85: module 'socket.http' not found:
no field package.preload['socket.http']
no file './socket/http.lua'
no file '/usr/local/share/lua/5.1/socket/http.lua'
no file '/usr/local/share/lua/5.1/socket/http/init.lua'
no file '/usr/local/lib/lua/5.1/socket/http.lua'
no file '/usr/local/lib/lua/5.1/socket/http/init.lua'
no file '/usr/share/lua/5.1/socket/http.lua'
no file '/usr/share/lua/5.1/socket/http/init.lua'
no file './socket/http.so'
no file '/usr/local/lib/lua/5.1/socket/http.so'
no file '/usr/lib/arm-linux-gnueabihf/lua/5.1/socket/http.so'
no file '/usr/lib/lua/5.1/socket/http.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './socket.so'
no file '/usr/local/lib/lua/5.1/socket.so'
no file '/usr/lib/arm-linux-gnueabihf/lua/5.1/socket.so'
no file '/usr/lib/lua/5.1/socket.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
I have made the two new directories and downloaded the two files from https://www.domoticz.com/wiki/Remote_Co ... _Libraries and and extracted them:
pi@raspberrypi:/usr/local/share/lua/5.2 $ ls -l
total 152
-rw-r--r-- 1 root staff 2184 Oct 25 2013 ansicolors.lua
-rw-r--r-- 1 root staff 34843 May 28 2015 JSON.lua
-rw-r--r-- 1 root staff 8331 Sep 25 2014 ltn12.lua
-rw-r--r-- 1 root staff 4812 Sep 25 2014 luacolors.lua
-rw-r--r-- 1 root staff 2487 Sep 25 2014 mime.lua
-rw-r--r-- 1 root staff 62698 Sep 7 2014 mobdebug.lua
drwxr-sr-x 2 root staff 4096 Sep 25 2014 socket
-rw-r--r-- 1 root staff 5011 Sep 7 2014 socket.lua
drwxr-xr-x 2 root staff 4096 Jul 5 2015 ssl
-rw-r--r-- 1 root staff 4663 Jul 5 2015 ssl.lua
pi@raspberrypi:/usr/local/lib/lua/5.2 $ ls -l
total 68
drwxr-sr-x 2 root staff 4096 Sep 25 2014 mime
drwxr-sr-x 2 root staff 4096 Sep 7 2014 socket
-rwxr-xr-x 1 root root 61293 Jul 5 2015 ssl.so
pi@raspberrypi:/usr/local/lib/lua/5.2 $
Why is LUA searching for the files in the /5.1 directory?