We have moved at community.getvera.com

Author Topic: openLuup - running unmodified plugins on any machine  (Read 125215 times)

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: openLuup - running unmodified plugins on any machine
« Reply #90 on: August 15, 2015, 07:11:23 am »
Well, I got it wrong.  This, by default, appears to install Lua5.2, and you need 5.1 for Vera Luup compatibility (and, in fact, openLuup uses 5.1 features to manage environments.)  Need to read the docs further!
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 akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: openLuup - running unmodified plugins on any machine
« Reply #91 on: August 15, 2015, 07:34:02 am »
OK, so the fix appears to be:

Code: [Select]
bash-3.2$ brew install lua51

and then
Code: [Select]
bash-3.2$ luarocks-5.1 install luasocket

and to check:
Code: [Select]
bash-3.2$ lua5.1
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> x = require "socket"
>

Phew.

So to run openLuup, simply:
Code: [Select]
bash-3.2$ lua5.1 openLuup_release_2.lua

Hope THIS works for you.

---------

Edit:  However, all this mucking about screwed up my ZeroBrane Studio install, so I was left with a non-functioning IDE :(
... but now fixed, so all is well.

« Last Edit: August 15, 2015, 08:40:30 am by akbooer »
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 akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: openLuup - running unmodified plugins on any machine - Release 3
« Reply #92 on: August 15, 2015, 10:29:49 am »
Here is Release 3 of openLuup.

This is the version which should be able to run the MySensors Arduino gateway (ethernet only, not serial, sorry.)  I have not been able to test it fully since I do not have any Arduino sensors constructed (yet.)  However, I have it linked to an Arduino Uno with an Ethernet shield running the latest 1.5 gateway sketch.  When the openLuup Arduino plugin starts it receives the "Gateway startup complete" log message as the openLuup log extract below shows:
Code: [Select]
2015-08-15 15:17:58.404   luup_log:6: Arduino plugin: loading library L_Arduino ...
2015-08-15 15:17:58.407   luup_log:6: Arduino plugin: library L_Arduino loaded
2015-08-15 15:17:58.407   luup_log:6: Arduino: urn:upnp-arduino-cc:serviceId:arduino1,PluginVersion, 1.4, 6
2015-08-15 15:17:58.407   luup.variable_set:6: 6.urn:upnp-arduino-cc:serviceId:arduino1.PluginVersion was: EMPTY now: 1.4 #hooks:0
2015-08-15 15:17:58.407   luup_log:6: Arduino: Using network connection: IP address is 172.16.42.21:5003
2015-08-15 15:17:58.407   luup.io.open:6: connecting to 172.16.42.21:5003
2015-08-15 15:17:58.407   openLuup.io:6: connect OK
2015-08-15 15:17:58.407   luup_log:6: Arduino: urn:upnp-arduino-cc:serviceId:arduino1,Unit, M, 6
2015-08-15 15:17:58.407   luup.variable_set:6: 6.urn:upnp-arduino-cc:serviceId:arduino1.Unit was: EMPTY now: M #hooks:0
2015-08-15 15:17:58.407   luup_log:6: Arduino: Sending: 0;0;3;0;2;Get Version
2015-08-15 15:17:58.407   luup.io.write:6: bytes sent: 21, status: OK
2015-08-15 15:17:58.407   openLuup.scheduler:6: device startup completed: status=nil, msg=nil, name=nil
2015-08-15 15:17:58.409   luup.io.incoming:6: bytes received: 36, status: OK
2015-08-15 15:17:58.409   luup_log:6: Arduino: Log: Gateway startup complete.

It's also able to send start/stop commands for inclusion.

The major change in this release has been the addition of an asynchronous I/O module to support the luup.io calls (open / write / etc.) and the device code in the <incoming> tag.  The scheduler has been changed to accommodate this and the server restructured to run as a number of standard Luup jobs using the new I/O structure.  It works beautifully with ALTUI and also writes a special log file so that variable and scene history can be displayed there.

I have tested it extensively under Debian (on BeagleBone Black), OpenWRT (on Arduino Yun), and Mac OS.

I'd be really keen to hear feedback on anything, but particularly whether this works with a fully functioning set of Arduino MySensors.  Also, anyone willing to try on Windows?

-----

Edit: This release has been superseded.  Please see link on post #1 of this thread for latest

« Last Edit: August 31, 2015, 04:09:43 pm by akbooer »
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 mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: openLuup - running unmodified plugins on any machine
« Reply #93 on: August 15, 2015, 03:13:16 pm »
OK, so the fix appears to be:

I think i am close, but socket is not building. when i test it i get:

Code: [Select]
bash-3.2$ lua5.1
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> x = require "socket"
stdin:1: module 'socket' not found:
no field package.preload['socket']
no file './socket.lua'
no file '/usr/local/share/lua/5.1/socket.lua'
no file '/usr/local/share/lua/5.1/socket/init.lua'
no file '/usr/local/lib/lua/5.1/socket.lua'
no file '/usr/local/lib/lua/5.1/socket/init.lua'
no file './socket.so'
no file '/usr/local/lib/lua/5.1/socket.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: ?


The output from  'luarocks-5.1 install luasocket' is attached as a text file (I can not find anything on the 'dyld: Symbol not found: _NETSCAPE_X509_it
error' with google)

is it possible i am trying to install a version of luasocket for lua 5.2 rather than 5.1 somehow? (this is just a wild guess, i of course have no idea what i am talking about ;) )

i really appreciate your help... i think i am sooo close. Thanks!
« Last Edit: August 15, 2015, 03:26:48 pm by mda »

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: openLuup - running unmodified plugins on any machine
« Reply #94 on: August 15, 2015, 03:34:19 pm »
is it possible i am trying to install a version of luasocket for lua 5.2 rather than 5.1 somehow? (this is just a wild guess, i of course have no idea what i am talking about ;) )

i tried the instructions here http://sourceforge.net/p/luarocks/mailman/message/33286917/ but got the same error at the 'make bootstrap' step

Code: [Select]
dyld: Symbol not found: _NETSCAPE_X509_it
  Referenced from: /usr/local/bin/openssl
  Expected in: /usr/lib/libcrypto.0.9.8.dylib
 in /usr/local/bin/openssl

Error: Failed producing checksum: Failed to compute MD5 hash for file /usr/local/lib/luarocks/rocks-5.1/luarocks/2.2.0-1/bin/luarocks
make: *** [bootstrap] Error 1

i do have the libcrypto file

Code: [Select]
bash-3.2$ ls -lsa /usr/lib/libcrypto.0.9.8.dylib
2536 -rwxr-xr-x  1 root  wheel  2637984 Mar 19 19:16 /usr/lib/libcrypto.0.9.8.dylib

so i am stumped :(


Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: openLuup - running unmodified plugins on any machine
« Reply #95 on: August 15, 2015, 04:00:53 pm »
Have you simply tried the install(s) again ?
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 mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
openLuup - running unmodified plugins on any machine
« Reply #96 on: August 15, 2015, 04:13:55 pm »
Yes, several times. Do you happen to have the  sockets binary(ies) you could share so i can install them without compiling ? That would be a life saver! (And where do I put them?)  thanks again
« Last Edit: August 15, 2015, 04:21:06 pm by mda »

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: openLuup - running unmodified plugins on any machine
« Reply #97 on: August 15, 2015, 04:25:26 pm »
Do you happen to have the  sockets binary(ies) you could share so i can install them without compiling ? That would be a life saver! (And where do I put them?)

Don't know if these are any good.
Found them, and the contained sub-directory in /usr/local/lib/
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 Drcashman

  • Sr. Newbie
  • *
  • Posts: 26
  • Karma: +3/-0
Re: openLuup - running unmodified plugins on any machine
« Reply #98 on: August 15, 2015, 07:50:44 pm »
Got it running on a pogoplug v4 with mysensors with about 20 nodes, two vera's ,one edge and one lite and it works great and fast thanks akbooer :)

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: openLuup - running unmodified plugins on any machine
« Reply #99 on: August 15, 2015, 09:00:13 pm »
Don't know if these are any good.
Found them, and the contained sub-directory in /usr/local/lib/

worked! Thanks!!!  now on to configuring and testing openluup ;)

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: openLuup - running unmodified plugins on any machine
« Reply #100 on: August 15, 2015, 11:18:17 pm »
Don't know if these are any good.
Found them, and the contained sub-directory in /usr/local/lib/

worked! Thanks!!!  now on to configuring and testing openluup ;)

looks like it is working working! Yay! now to try to some cameras and other plugins...

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: openLuup - running unmodified plugins on any machine
« Reply #101 on: August 15, 2015, 11:49:41 pm »
@akbooer

I moved over the camera and foscam files from my vera (decompressed). I tried a foscam device which OpenLuup loaded from my Vera but it does not get an image. Attached is screen shot.

The log shows:

Code: [Select]
015-08-15 20:45:19.498   openLuup.server:: /data_request?id=request_image&cam=166 tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:19.498   openLuup.server:: request completed (10 bytes, 0 ms) tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:21.060   openLuup.server:: /data_request?id=request_image&cam=166'&t=1439696721005 tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:21.061   openLuup.server:: request completed (10 bytes, 0 ms) tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:22.511   openLuup.server:: /data_request?id=request_image&cam=166'&t=1439696722508 tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:22.512   openLuup.server:: request completed (10 bytes, 0 ms) tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:24.014   openLuup.server:: /data_request?id=request_image&cam=166'&t=1439696724012 tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:24.014   openLuup.server:: request completed (10 bytes, 0 ms) tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:25.519   openLuup.server:: /data_request?id=request_image&cam=166'&t=1439696725517 tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:25.519   openLuup.server:: request completed (10 bytes, 0 ms) tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:27.025   openLuup.server:: /data_request?id=request_image&cam=166'&t=1439696727023 tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:27.025   openLuup.server:: request completed (10 bytes, 0 ms) tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:28.526   openLuup.server:: /data_request?id=request_image&cam=166'&t=1439696728524 tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:28.526   openLuup.server:: request completed (10 bytes, 0 ms) tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:30.031   openLuup.server:: /data_request?id=request_image&cam=166'&t=1439696730029 tcp{client}: 0x7ff3b384ae28
2015-08-15 20:45:30.032   openLuup.server:: request completed (10 bytes, 0 ms) tcp{client}: 0x7ff3b384ae28

(I also tried creating a new camera device in openLuup AltUI in case that was the right approach, but the device did not create).

Please let me know if there is anything i can do to help debug. Next i will test connected to OpenLuup from the HomeWave iPhone app.


Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: openLuup - running unmodified plugins on any machine
« Reply #102 on: August 16, 2015, 02:09:08 am »
I haven't tried cameras (haven't got one.)   I don't think I've done anything explicit to support them, so it may need something extra.  The log should be a good diagnostic of anything missing.  You should not have to create anything locally explicitly when bridging to an existing remote Vera.

What worries me about that screen shot is the "Waiting for initial data" at the bottom.  This is not how it should be: it's missing the 'donate' button.  Look like ALTUI has not started up right?  (Just to be clear, this will be an openLuup issue, rather than an ALTUI one!)

I think it's important to walk before we can run.  What else, more basic, do you have and how is that working (switches, sensors, etc.) ?

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 mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: openLuup - running unmodified plugins on any machine
« Reply #103 on: August 16, 2015, 02:23:20 am »
Should I copy all my json and xml files from Vera to my Mac and try the various devices?

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: openLuup - running unmodified plugins on any machine
« Reply #104 on: August 16, 2015, 03:12:20 am »
Ah yes, that's a good plan... probably the reason that ALTUI hangs if you have bridged devices for which you don't have local files.
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.