We have moved at community.getvera.com

Author Topic: OpenLuup OS X  (Read 339 times)

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
OpenLuup OS X
« on: January 03, 2019, 04:02:35 am »
Morning all.
I'm looking at alternatives to Vera and happen to have stumbled across some posts on OpenLuup
I also happen to have a Mac Mini I'm about to retire from mail server duties and wondered if there was any way I could re-purpose this and avoid having (another) RaspberryPi around the house (I keep losing track of the ones I already have!)

Any pointers, or a How To I can give a peruse at?

Cheers

C

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: OpenLuup OS X
« Reply #1 on: January 03, 2019, 05:29:06 am »
I don't think that OSX comes with a Lua install, but it's really easy to get it.  You need v5.1 to be compatible with Vera.  I think the latest 5.1 is, in fact, 5.1.5.

You can build from scratch or use a pre-built binary.

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: OpenLuup OS X
« Reply #2 on: January 03, 2019, 05:42:44 am »
You are a gent sir.

Lua installed
Trying to install OpenLuup and hitting an error:
lua: openLuup_install.lua:15: module 'socket.http' not found:

To the googles :)

C

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: OpenLuup OS X
« Reply #3 on: January 03, 2019, 05:45:46 am »
The openLuup User Guide says which additional libraries you need.  Includes LuaSocket, LuaSec, plus a few others, mostly which comes as standard in pre-built versions.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: OpenLuup OS X
« Reply #4 on: January 03, 2019, 05:47:05 am »
Ta

Luarocks :)

C

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: OpenLuup OS X
« Reply #5 on: January 03, 2019, 06:11:30 am »
The openLuup User Guide says which additional libraries you need.  Includes LuaSocket, LuaSec, plus a few others, mostly which comes as standard in pre-built versions.

Thanks.  So I've installed what appear to be the other required libraries (LuaSocket, Lua Sec and Luafilesystem) Got a snag that doesn't appear to be library related:

openLuup_install   2018.08.05   @akbooer
lua: error loading module 'ssl.core' from file '/usr/local/lib/lua/5.3/ssl.so':
   dlopen(/usr/local/lib/lua/5.3/ssl.so, 6): Symbol not found: _EVP_PKEY_base_id
  Referenced from: /usr/local/lib/lua/5.3/ssl.so
  Expected in: dynamic lookup

stack traceback:
   [C]: in ?
   [C]: in function 'require'
   /usr/local/share/lua/5.3/ssl.lua:8: in main chunk
   [C]: in function 'require'
   /usr/local/share/lua/5.3/ssl/https.lua:10: in main chunk
   [C]: in function 'require'
   openLuup_install.lua:16: in main chunk
   [C]: in ?

Googling rapidly loses me that there appears to be (possibly) some compatibility issue with the version installed by Luarocks and the version required by current OpenLuup.

If anyone can share some guidance or pointers, that would be simply super, or just some thoughts.

Many thanks

C

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: OpenLuup OS X
« Reply #6 on: January 03, 2019, 08:08:00 am »
That's a Lua 5.3 version, not 5.1. 
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: OpenLuup OS X
« Reply #7 on: January 03, 2019, 08:25:21 am »
Doh!

<hands head in shame>

Thanks

C

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: OpenLuup OS X
« Reply #8 on: January 03, 2019, 12:54:15 pm »
That's a Lua 5.3 version, not 5.1.

OK, tried to get this correct

Removed Lua 5.3
Removed everything luarocks
deleted everything I could find that looked like it might be an issue.

Updated my brew installation so that that was working properly then did
brew install lua@5.1

That seemed to work fine

brew install luarocks

The same (although it *also* installed lua 5.3)

Then told me this:
LuaRocks supports multiple versions of Lua. By default it is configured
to use Lua5.3, but you can require it to use another version at runtime
with the `--lua-dir` flag, like this:

Fine, I thought so...

sudo luarocks --lua-dir=/usr/local/Cellar/lua@5.1/5.1.5_8 install luasocket
luasocket 3.0rc1-2 is now installed in /usr/local (license: MIT)

sudo luarocks --lua-dir=/usr/local/Cellar/lua@5.1/5.1.5_8 install luasec
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/config.c -o src/config.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/ec.c -o src/ec.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/x509.c -o src/x509.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/context.c -o src/context.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/ssl.c -o src/ssl.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/luasocket/buffer.c -o src/luasocket/buffer.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/luasocket/io.c -o src/luasocket/io.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/luasocket/timeout.c -o src/luasocket/timeout.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -O2 -fPIC -I/usr/local/Cellar/lua@5.1/5.1.5_8/include/lua5.1 -c src/luasocket/usocket.c -o src/luasocket/usocket.o -DWITH_LUASOCKET -DLUASOCKET_DEBUG -I/usr/include -Isrc/ -Isrc/luasocket
env MACOSX_DEPLOYMENT_TARGET=10.5 gcc -bundle -undefined dynamic_lookup -all_load -o ssl.so src/config.o src/ec.o src/x509.o src/context.o src/ssl.o src/luasocket/buffer.o src/luasocket/io.o src/luasocket/timeout.o src/luasocket/usocket.o -L/usr/lib -Wl,-rpath,/usr/lib: -lssl -lcrypto
luasec 0.7-1 is now installed in /usr/local (license: MIT)

But....

lua-5.1 openLuup_install.lua
openLuup_install   2018.08.05   @akbooer
lua-5.1: error loading module 'ssl.core' from file '/usr/local/lib/lua/5.1/ssl.so':
   dlopen(/usr/local/lib/lua/5.1/ssl.so, 2): Symbol not found: _EVP_PKEY_base_id
  Referenced from: /usr/local/lib/lua/5.1/ssl.so
  Expected in: dynamic lookup

stack traceback:
   [C]: ?
   [C]: in function 'require'
   /usr/local/share/lua/5.1/ssl.lua:8: in main chunk
   [C]: in function 'require'
   /usr/local/share/lua/5.1/ssl/https.lua:10: in main chunk
   [C]: in function 'require'
   openLuup_install.lua:16: in main chunk
   [C]: ?

/usr/local/lib/lua/5.1/ssl.so is timestamped to indicate it was the version I just installed.

Anything else to help a poor, feeble seeker after knowledge?

Cheers!

C

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: OpenLuup OS X
« Reply #9 on: January 03, 2019, 01:17:44 pm »
Hmm, could this be a mismatch between the env MACOSX_DEPLOYMENT_TARGET=10.5 and my target actually running 10.6.8?

Just a thought.....

Cheers

C

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: OpenLuup OS X
« Reply #10 on: January 03, 2019, 01:34:57 pm »
I'm not in front of my development system, ATM (or, indeed, anywhere near it!)

TBH, the Lua install I use is the one which comes with the fabulous Lua IDE, ZeroBrane Studio, so I've not messed with either brew or LuaRocks.  I do need to update my Mac's OpenSSL, though, since for the last few months it has not been able to cope with the security level that GitHub now requires for automatic updates (for openLuup and AltUI) but that is a separate issue.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: OpenLuup OS X
« Reply #11 on: January 03, 2019, 01:47:58 pm »
No panic. I appreciate your input!

C