The Vera Community forums have moved!

Advanced => Plugins & Plugin Development => Programming => openLuup => Topic started by: akbooer on May 22, 2015, 01:31:03 pm

Title: openLuup - running unmodified plugins on any machine
Post by: akbooer on May 22, 2015, 01:31:03 pm
This is my 2000th post, so I wanted to make it significant to me, if to nobody else!

I'm aware that this can be a pivotal time for some developers (three years ago @Ap15e made his 2000th post his last: My final post (http://forum.micasaverde.com/index.php/topic,10469.msg72387.html#msg72387)) and it's sadly no surprise to note the issues which drove him away:
Nowadays, read 'UI7' and 'Vera3/Lite'.  We've seen others remove their apps from the forum too. The direction of developer drift now seems to be OpenHAB... but I'm loathe to abandon my investment in MiOS, and Lua, so I agree with this comment:
Quote from: Ap15e
IMHO, MiOS' architecture is quite excellent (leaving aside security aspects, mainly inherited from UPnP)

So what to do?  I'm not going to pull my apps from the public domain (EventWatcher, Netatmo, DataYours) in fact I want to continue to develop and support them.  But I want to work in a more open and stable environment.  I note the following:
All would be solved if Luup was open source and could be run on the plethora of cheap and reliable hardware available today.  But it's not.  But we could get something like that effect if we engineered a sufficient subset of Luup to run on such a platform.  Could it be done?  What would we need?
What we wouldn't need is UPnP.

What have we (nearly) got already?

Is it worth the effort?  Probably not.  Will I pursue this quest?  Yes, because as @Aaron noted in @Ap15's final thread:
The coders do what they do for 2 reasons... 1) they want the code for themselves & 2) they want to help the community ...

I plan to post the code on GitHub in due course: and now it is here https://github.com/akbooer/openLuup

=============================

October 2015: A summary of the project status...

openLuup is an environment which supports the running of some MiOS (Vera) plugins on generic Unix systems (or, indeed, Windows systems.) Processors such as Raspberry Pi and BeagleBone Black are ideal for running this environment, although it can also run on Apple Mac, Microsoft Windows PCs, anything, in fact, which can run Lua code (most things can - even an Arduino Yun board.) The intention is to offload processing (cpu and memory use) from a running Vera to a remote machine to increase system reliability.

Running on non-specific hardware means that there is no native support for Z-wave, although plugins to handle Z-wave USB sticks may support this. The full range of MySensors (http://www.mysensors.org/) Arduino devices are supported though the Ethernet Bridge plugin available on that site. A plugin to provide a bi-directional 'bridge' (monitoring / control) to remote MiOS (Vera) systems is provided in the openLuup installation.

openLuup is extremely fast to start (a few seconds before it starts running any created devices startup code) has very low cpu load, and has a very compact memory footprint. Whereas each plugin on a Vera system might take ~4 Mbytes, it's far less than this under openLuup, in fact, the whole system can fit into that sort of space. Since the hardware on which it runs is anyway likely to have much more physical memory than current Vera systems, memory is not really an issue.

There is no built-in user interface, but we have, courtesy of @amg0, the most excellent altUI: Alternate UI to UI7 (see the Vera forum board http://forum.micasaverde.com/index.php/board,78.0.html) An automated way of installing and updating the ALTUI environment is now built-in to openLuup. There's actually no requirement for any user interface if all that's needed is an environment to run plugins.

Devices, scenes, rooms and attributes are persisted across restarts. The startup initialisation process supports both the option of starting with a 'factory-reset' system, or any saved image, or continuing seamlessly with the previously saved environment. A separate utility is provided to transfer a complete set of uncompressed device files and icons from any Vera on your network to the openLuup target machine.

What openLuup does:

What it doesn't do:

Latest release available now available on GitHub: https://github.com/akbooer/openLuup
Title: Re: openLuup - running unmodified plugins on any machine
Post by: Tank on May 22, 2015, 03:04:08 pm
This is fantastic!   I will be watching this project closely  :)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: wilme2 on May 22, 2015, 03:19:51 pm
All would be solved if Luup was open source and could be run on the plethora of cheap and reliable hardware available today.  But it's not.  But we could get something like that effect if we engineered a sufficient subset of Luup to run on such a platform.  Could it be done?  What would we need?

I wish MiOS would adopt a software model.  I just don't trust them to put enough specs into VeraPlus or VeraSecure.  But I would pay good money to run their software on the hardware of my choosing.

Failing that, I will watch this project with interest...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nitehawk on May 26, 2015, 02:11:16 pm

Can't wait to try this out!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on May 26, 2015, 02:16:30 pm
Can't wait to try this out!

Might be looking for suitable guinea pigs soon!  Have you a particular use case (favourite apps, ...) you'd want to try first (starting simple) ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: Brientim on May 26, 2015, 03:15:55 pm
Fantastic 2000 post and significant roadmap of future achievements.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on June 06, 2015, 04:41:31 pm
happy to support where I can.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: racarter on June 07, 2015, 01:03:26 am
+1 here  :)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on June 07, 2015, 05:52:47 pm
Just an update on progress... I'm afraid it's been a bit slow since I've not had as much time to work continuously on this as I wanted, and anyway, I'm not as quick as you @amg0.

One of the frustrations in reverse engineering some of the functionality has been that it's obvious that there are some better ways to do things, but you have to stick to the same API and the same format.  One example: the crucial internal variable "DataVersion" which keeps track of when anything changes, but has hugely inconsistent naming in HTTP request outputs:

Sigh...

Anyway, some progress is being made.  From the outset, I wanted as few external dependencies as possible - everything is in Lua.  This means that I've had to craft my own HTTP server for the port 3480 access, although I rely on the native web server of the target platform to deliver the port 80 requests.  I did toy with the idea of using CGI or FastCGI, but in the end that seemed to make things harder rather than easier.  I also have a job scheduler and the complete (well, nearly) Luup API.  I've had enormous fun writing the timer code - particularly the sunrise/sunset calculations (I see that @futzle went through this ages ago when writing the heliotrope plugin.)

What it doesn't have, at the moment, is:

I just have a bit more work to do on the device loader before making a release.

I'd welcome any comments on the architecture, such as I have described it, or simple test cases to start out with (in particular, then, favourite non-Zwave plugins.)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nitehawk on June 12, 2015, 05:46:43 am
One of the first plugins I want to try is : NorthQ Watt Calculator

I'm using this plugin to calculate Watts from KwH from several devices (not only the NorthQ).

multiple instances of this plugin are running and they take up a lot of memory on the Vera.

I also have Hue, Netatmo, Foscam and KodiRemote running, Hue and netatmo are already working on openluup.

It would be nice to run the Vera free of (non zwave) plugins and free up some of the very needed ram.
I have an raspberry 2 available for testing.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on June 12, 2015, 05:56:44 am
One of the first plugins I want to try is : NorthQ Watt Calculator

I'm using this plugin to calculate Watts from KwH from several devices (not only the NorthQ).

multiple instances of this plugin are running and they take up a lot of memory on the Vera.
Interesting.  I have a stand-alone implementation of this (runs on Vera) which does the calculation for all installed NorthQ devices and puts the Watts result back into their respective devices.  Not a plugin, but runs as startup code, taking almost no memory.

Quote
I also have Hue, Netatmo, Foscam and KodiRemote running, Hue and netatmo are already working on openluup.
Oh! ...so you've done some hacking already, with Hue running OK?  I don't have a Hue - what did you need to change to make this work?

Quote
It would be nice to run the Vera free of (non zwave) plugins and free up some of the very needed ram.
I have an raspberry 2 available for testing.
One of the things that's missing in the published code so far is implementation of device actions.  I've been working on this, and am just about there.  Rather depends on how involved you want to be as to when I share this (ie. how much beta testing you really want to do!)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nitehawk on June 12, 2015, 06:37:25 am

I haven't have openluup running at the moment. That was my bad english, I thought i read somewhere that you had those running already.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on June 12, 2015, 01:20:58 pm
One of the first plugins I want to try is : NorthQ Watt Calculator

I'm using this plugin to calculate Watts from KwH from several devices (not only the NorthQ).

multiple instances of this plugin are running and they take up a lot of memory on the Vera.

Further to this, I've posted my NorthQ code here: http://forum.micasaverde.com/index.php/topic,16082.msg237849.html#msg237849 (http://forum.micasaverde.com/index.php/topic,16082.msg237849.html#msg237849).  You can remove your multiple NorthQ Watt Calculator plugins entirely.  This should save some memory on Vera whilst I keep working on openLuup!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nitehawk on June 15, 2015, 03:17:16 pm
Thank you for the code.

I don't have multiple northq energy meters, just one, i was using the calculator to calculate watts for my green wave powernodes. http://forum.micasaverde.com/index.php/topic,18747.msg142098.html#msg142098

Can i use your code to see if i can get it to work with these powernodes?

Title: Re: openLuup - running unmodified plugins on any machine
Post by: Ramias on June 16, 2015, 12:50:52 am
I am not skilled enough to contribute much at all but I wholeheartedly offer my moral support.

I have openHab downloaded (but not running) at the moment.  But I just have too much invested in Vera/LUUP and I know how to do what I need to do (various LUUP scripts, nested decisions etc.

But my Vera is just too unstable; perhaps due to resources.  The ability to keep Vera for HW gateway and then code separately is very appealing.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 06, 2015, 10:49:48 am
Time for an update.

I'm pleased to say that Release 1 of openLuup is on the blocks. 

What openLuup Release 1 does:
As an existence proof, I attach a parent/child diagram, produced by the splendid ALTUI plugin from @amg0.  It shows openLuup on a BeagleBone Black (might as well be a Raspberry Pi, could be anything really) running Netatmo and DataYours and also four copies of the VeraBridge plugin which connects (both monitoring and control) to three remote VeraLites running UI5 and one Vera Edge running UI7 - some 228 devices in all.  (I posted this on the ALTUI thread too, so apologies if you have seen it there already.)

What it doesn't do:
I can't release this on the MiOS App Store, of course, since it doesn't run on Vera!  For release 1 I'll post a .zip file with the lua code and the VeraBridge plugin (which, itself,  probably would run on Vera, since it's just a normal plugin) and some initial documentation to get you going.  Just tidying up a few things before I do that.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mcalistair on July 06, 2015, 11:19:35 am
Kudos & Respect, thanks for all your work!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 09, 2015, 08:12:21 am
Here is Release 1 of openLuup.  I have done my best with the documentation (and the code!) but have no doubt that there will be questions.  I'm happy to help, but bear in mind that you're installing a system on hardware that I probably don't have, running under a version of unix that I don't have, on a network that's different from mine, ...

Nevertheless, openLuup is pure Lua (5.1) so should run as expected.

I'm very keen to get any feedback on this.  I'm now regularly using openLuup running on my BeagleBone Black linked to four Veras and running ALTUI as my main system interface.  I have a vested interested in making this work, and making it better.  There is more to do, but this is a start.

Good luck.

------

Edit:  My first erratum... you do also need to install the LuaSocket library on your machine - "apt-get install lua-socket" worked for me.

Edit: Release 2 available here: http://forum.micasaverde.com/index.php/topic,32315.msg243104.html#msg243104 (http://forum.micasaverde.com/index.php/topic,32315.msg243104.html#msg243104)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nitehawk on July 09, 2015, 10:41:07 am

awesome, will try this next weekend.

I will let you know the results
Title: Re: openLuup - running unmodified plugins on any machine
Post by: vosmont on July 09, 2015, 11:36:45 am
Great !

I've tried to install it and run with ZeroBrane Studio on Windows 7 64bit :
Code: [Select]
error loading module 'openLuup.init' from file './openLuup\init.lc':
./openLuup\init.lc: cannot load incompatible bytecode

It seems that you have compiled with your Mac, perhaps is it the problem ?
http://stackoverflow.com/questions/1047236/lua-compiled-scripts-on-mac-os-x-intel-vs-ppc
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 09, 2015, 11:55:32 am
@vosmont

Make sure that in ZeroBrane Studio you have selected the "Lua"  (not 5.2 or 5.3) interpreter under the Project menu.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: vosmont on July 09, 2015, 11:59:27 am
Yes, it's Lua (5.1)

If I choose Lua 5.2, the error is :
Code: [Select]
error loading module 'openLuup.init' from file './openLuup\init.lc':
./openLuup\init.lc: version mismatch in precompiled chunk

The version of ZeroBrane is 1.10
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 09, 2015, 12:03:42 pm
It seems that you have compiled with your Mac, perhaps is it the problem ?
http://stackoverflow.com/questions/1047236/lua-compiled-scripts-on-mac-os-x-intel-vs-ppc

Ah!  Interesting read - I had hoped for more portability than that!

At a pinch, I could provide modules compiled on a PC.

I run ZBS on a Mac (as you can tell) and openLuup runs fine within it - except that you must bear in mind that the Port:80 server directories are not likely to be correctly configured so the ALTUI interface will almost certainly not work.

 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 09, 2015, 01:05:18 pm
OK.  Here's the files compiled on a Windows machine.  I hope this is right...

... I had to find a PC, install Lua 5.1.4, and generate the files!

Title: Re: openLuup - running unmodified plugins on any machine
Post by: vosmont on July 09, 2015, 01:37:24 pm
Sorry, it does the same.

My config : Windows 7 64bit / ZeroBrane 1.10 32bit

I will try on a linux VM
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 09, 2015, 01:46:20 pm
Sorry, it does the same.

My config : Windows 7 64bit / ZeroBrane 1.10 32bit

I will try on a linux VM

Ah, OK.  Sorry.  In fact, I now recall that these were compiled on my BeagleBone Black, not the Mac at all!  Linux may be good (fingers crossed.)

Title: Re: openLuup - running unmodified plugins on any machine
Post by: vosmont on July 10, 2015, 11:27:35 am
I've not yet tried on a Linux VM, but I think the problem under Windows and ZeroBrane is that the embeded Lua is in 32bit.

I've tried with the Lua 5.1 64bit, but there's problems with the socket.lua, which is for 32bit.
Perhaps could you compile with a Lua 32bit version ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 10, 2015, 11:37:23 am
No, can't be having that... I just thought that compiled code would be worth a try.  Nothing to hide, although these bits of the system are liable to change (come to think of it, all of it is!)

Here's the sources.  Would still be interested in whether anyone can, in fact, use the .lc files.  But it's more important to get feedback on a working system!

Thanks - sorry for the inconvenience.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: mvader on July 10, 2015, 11:55:47 am
this looks like a great start to the project.. thanks for taking it on.
I'll be looking to run this once you can make the arduino plugin work as i'd like to offload that from the vera.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 10, 2015, 12:13:34 pm
this looks like a great start to the project.. thanks for taking it on.
I'll be looking to run this once you can make the arduino plugin work as i'd like to offload that from the vera.

Thanks indeed.  Sorry to disappoint with Release 1 not supporting Arduino.  I'm wondering how many people use a serial connection versus IP - I'd rather do internet since it involves fewer hardware issues.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on July 10, 2015, 12:15:09 pm
Hi akbooer,

I'm using Datayours on Rpi. Do I have to follow any particular instructions to install openLuup on Rpi and continue to use Datayours ?

tnks

donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 10, 2015, 12:25:48 pm
I'm using Datayours on Rpi. Do I have to follow any particular instructions to install openLuup on Rpi and continue to use Datayours ?

Oh hi there!  I was wondering if I should post instructions on transitioning to openLuup, but I thought I would make sure it worked OK for others first!  DataYours certainly works for me on this distribution, although I have made one change to it to make startup easier on openLuup.

All you would need to do is add to the startup code:
Code: [Select]
do -- DataYours
  local dy7 = luup.create_device ('', '', "DataYours", "D_DataYours7.xml","I_DataYours7.xml")        -- create the device
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "DAEMONS", "Graph, Dash, Cache, Watcher", dy7)
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "LOCAL_DATA_DIR", "/nas/whisper/", dy7)
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "VERAS", "172.16.42.10, 172.16.42.11, 172.16.42.12, 172.16.42.14", dy7)
end
...obviously with IP addresses, etc. tailored to your system.

I'll post the update to DataYours on that thread, to keep this focused on openLuup issues.

Thanks for the interest.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: vosmont on July 10, 2015, 03:08:59 pm
Everything is Awesome !!!

It seems to work (LuaUPnP.log created and "alive" command responds "OK")

But, when I call "http://127.0.0.1:3480/data_request?id=lr_ALTUI_Handler&command=home#"
the response is "No handler".

The ALTUI files are in /etc/cmh-ludl
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 10, 2015, 03:43:13 pm
Everything is Awesome !!!
Well, not quite everything, it would appear...

Quote
It seems to work (LuaUPnP.log created and "alive" command responds "OK")
Looking at the log file, then, are there any error messages from ALTUI ?  There are really three places to look: (a) early on, to be sure that the create device process has worked,
Code: [Select]
2015-07-10 17:04:49.229   luup.create_device:: [5] D_ALTUI.xml / I_ALTUI.xml
2015-07-10 17:04:49.233   luup.attr_set:: 5.device_json = D_ALTUI_UI7.json

... and (b) a bit later after the scheduler starts up and runs the job initialisation.
Code: [Select]
2015-07-10 17:04:51.798   openLuup.scheduler:5: device startup
2015-07-10 17:04:51.801   luup_log:5: ALTUI: initstatus(5) starting version: v0.52
2015-07-10 17:04:51.838   luup.register_handler:5: global_function_name=myALTUI_Handler, request=lr_ALTUI_Handler
2015-07-10 17:04:51.841   openLuup.scheduler:5: device startup completed: status=nil, msg=nil, name=nil

...and (c) a bit later still because ALTUI also has a delayed startup branch.
Code: [Select]
2015-07-10 17:05:04.421   luup_log:5: ALTUI: startupDeferred, called on behalf of device:5
2015-07-10 17:05:04.425   luup.variable_set:5: 5.urn:upnp-org:serviceId:altui1.Debug was: EMPTY now: 0 #hooks:0
2015-07-10 17:05:04.427   luup.variable_set:5: 5.urn:upnp-org:serviceId:altui1.Version was: EMPTY now: v0.52 #hooks:0
2015-07-10 17:05:04.430   luup.variable_set:5: 5.urn:upnp-org:serviceId:altui1.Present was: EMPTY now: 0 #hooks:0
2015-07-10 17:05:04.432   luup.variable_set:5: 5.urn:upnp-org:serviceId:altui1.RemoteAccess was: EMPTY now: https://vera-ui.strongcubedfitness.com/Veralogin.php #hooks:0
2015-07-10 17:05:04.434   luup.variable_set:5: 5.urn:upnp-org:serviceId:altui1.ThemeCSS was: EMPTY now:  #hooks:0
2015-07-10 17:05:04.436   luup.variable_set:5: 5.urn:upnp-org:serviceId:altui1.Version was: v0.52 now: v0.52 #hooks:0
2015-07-10 17:05:04.449   luup.variable_set:5: 5.urn:upnp-org:serviceId:altui1.PluginConfig was: EMPTY now: {...

Quote
But, when I call "http://127.0.0.1:3480/data_request?id=lr_ALTUI_Handler&command=home#"
the response is "No handler".
There should be a log file entry where ALTUI does a luup.register_handler - do you see that?  ALTUI also does a lot of fetches of files through the port:80 server - look for 404 errors in your regular HTTP server log.

Quote
The ALTUI files are in /etc/cmh-ludl
I have a feeling that I didn't mention this in the Guide, but you need to start up the openLuup process with your default directory as /etc/cmh-ludl/

One more question: have you create any other devices?  I've not tested ALTUI on openLuup without any.  Did you start the VeraBridge, for example?

Anyway, some progress is good.  ALTUI is actually a complex app to begin with, but we really have no choice since we need the interface!

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 10, 2015, 05:10:21 pm
@Vosmont

Forget all that... I think I have found it.

ALTUI uses a shell script to determine its machine's IP address.  openLuup used to do the same, but now has a pure Lua way to do it...

The answer I posted a while ago here: http://forum.micasaverde.com/index.php/topic,31078.msg225192.html#msg225192 (http://forum.micasaverde.com/index.php/topic,31078.msg225192.html#msg225192) !!

You can suppress this message by creating the file /usr/bin/GetNetworkState.sh with the contents:
Code: [Select]
echo -n 172.16.42.88
replacing the IP address with that of your own (RPi) machine. 

in the absence of this script, ALTUI should have failed with an error message... which should be in the log?

I've never removed my copy from my machine, so all runs smoothly, although I had long forgotten it was there! 

Title: Re: openLuup - running unmodified plugins on any machine
Post by: vosmont on July 10, 2015, 05:21:12 pm
It's OK now. The file "L_ALTUI.lua" was missing.

Really great !

some remarks :
- In ZeroBrane log, there is an error about "GetNetworkState.sh"
- lots of errors in ALTUI on the browser : "GET http://ip:3480/luvd/D_MotionSensor1.xml 404 Not Found". It seems that all the definitions of devices must be on openLuup.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 10, 2015, 05:24:08 pm
- In ZeroBrane log, there is an error about "GetNetworkState.sh"
- lots of errors in ALTUI on the browser : "GET http://ip:3480/luvd/D_MotionSensor1.xml 404 Not Found". It seems that all the definitions of devices must be on openLuup.

Both of these are related and solved in my previous post (posted just before yours!)

...and just to be clear, you DO need all the .xml, .json files in /etc/cmh-ludl/ so that openLuup can load them.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 10, 2015, 05:39:28 pm
You can suppress this message by creating the file /usr/bin/GetNetworkState.sh with the contents...

Actually, here, now, is a better version of GetNetworkState.sh which uses a Lua script to, quite generally, find your IP address...

Code: [Select]
#! /usr/bin/env lua
--------------------------------------------------------------------------------
-- discover main IP address of machine and write to standard output
-- http://forums.coronalabs.com/topic/21105-found-undocumented-way-to-get-your-devices-ip-address-from-lua-socket/
--------------------------------------------------------------------------------
local socket = require "socket"
function myIP ()   
  local mySocket = socket.udp ()
  mySocket:setpeername ("42.42.42.42", "424242")  -- arbitrary IP and PORT
  local ip = mySocket:getsockname ()
  mySocket: close()
  return ip or "127.0.0.1"
end
io.write (myIP())
--------

if you have multiple versions of Lua installed, you may need to change the first line to:
Code: [Select]
#! /usr/bin/env lua5.1

This should be much better than having to craft a file specifically for your own machine IP - I'll put it in the next distribution.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: vosmont on July 10, 2015, 06:53:39 pm
As I am on Windows, I'm not sure that the script ".sh" will work.
For the moment I've modified the function getIP in L_ALTUI.lua, and it's OK.

I can controll the lights on the Vera via the bridge.

ALTUI is OK and putting the files of the plugin in /etc/cmh-ludl, lets ALTUI display their tabs.

The plugin RGB Controller doesn't work :
http://ip:3480/data_request?id=action&output_format=json&DeviceNum=41&serviceId=urn:upnp-org:serviceId:RGBController1&action=GetColorChannelNames
returns "-1"

I will do more tests but for the moment it seems to work well  :)

Bravo !
Title: Re: openLuup - running unmodified plugins on any machine
Post by: vosmont on July 11, 2015, 04:06:08 am
The plugin RGB Controller doesn't work :
http://ip:3480/data_request?id=action&output_format=json&DeviceNum=41&serviceId=urn:upnp-org:serviceId:RGBController1&action=GetColorChannelNames
returns "-1"

I think the problem is that this action is for the distant Vera (the plugin is installed on it). So when it is executed on openLuup, it can't respond.
So for the javascript in the tab of the distant plugin, it lacks perhaps a proxy.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 11, 2015, 05:45:46 am
As I am on Windows, I'm not sure that the script ".sh" will work.
For the moment I've modified the function getIP in L_ALTUI.lua, and it's OK.
I never imagined that openLuup would be run on a Windows machine!  A fair number of plugins will be written with the assumption that the underlying system is Unix.  In particular, anything with an os.execute(...) call will likely fail.  Your ALTUI fix is what I originally did - hooray for open source!

The plugin RGB Controller doesn't work :
http://ip:3480/data_request?id=action&output_format=json&DeviceNum=41&serviceId=urn:upnp-org:serviceId:RGBController1&action=GetColorChannelNames
returns "-1"

I think the problem is that this action is for the distant Vera (the plugin is installed on it). So when it is executed on openLuup, it can't respond.
So for the javascript in the tab of the distant plugin, it lacks perhaps a proxy.

A couple of points here:

Sounds like you've made a lot of progress.  Interested in hearing further.

---

Edit:  having re-read my reply, I suddenly realise that the action call you are making, which needs to be handled by VeraBridge, is NOT in its list of implemented actions (as given in the implementation file.)  This is perhaps what you implied by mentioning a proxy.  It would be a step forward to insert that action into I_VeraBridge.xml, but you may still have difficulties with the JavaScript.  Running it locally still makes sense to me.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 11, 2015, 05:59:11 am
Just for the sake of completeness, the serviceId / actions currently handled by VeraBridge are:

Code: [Select]
<serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
<name>SetTarget</name>

<serviceId>urn:upnp-org:serviceId:Dimming1</serviceId>
<name>SetLoadLevelTarget</name>

<serviceId>urn:micasaverde-com:serviceId:DoorLock1</serviceId>
<name>SetTarget</name>
 
<serviceId>urn:upnp-org:serviceId:TemperatureSetpoint1_Heat</serviceId>
<name>SetCurrentSetpoint</name>

<serviceId>urn:upnp-org:serviceId:HVAC_UserOperatingMode1</serviceId>
<name>SetModeTarget</name>

<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Up</name>

<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Down</name>

<serviceId>urn:upnp-org:serviceId:WindowCovering1</serviceId>
<name>Stop</name>

<serviceId>urn:micasaverde-com:serviceId:SecuritySensor1</serviceId>
<name>SetArmed</name>
Title: Re: openLuup - running unmodified plugins on any machine
Post by: tomvanbreda on July 11, 2015, 08:29:04 am
Hi
I tried this in Ubuntu and get the following response:

/etc/cmh-ludl$ sudo lua5.1 openLuup_release_1.lua /dev/null

lua5.1: ./openLuup/logs.lua:6: module 'socket' not found:
        no field package.preload['socket']
        no file './socket.lc'
        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 '/usr/share/lua/5.1/socket.lua'
        no file '/usr/share/lua/5.1/socket/init.lua'
        no file './socket.so'
        no file '/usr/local/lib/lua/5.1/socket.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/socket.so'
        no file '/usr/lib/lua/5.1/socket.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 11, 2015, 08:38:37 am
Hi
I tried this in Ubuntu and get the following response:

/etc/cmh-ludl$ sudo lua5.1 openLuup_release_1.lua /dev/null

lua5.1: ./openLuup/logs.lua:6: module 'socket' not found:

Yes.  I think it means what it says - you haven't installed the LuaSocket library.

See the bottom line of this earlier post: http://forum.micasaverde.com/index.php/topic,32315.msg240753.html#msg240753 (http://forum.micasaverde.com/index.php/topic,32315.msg240753.html#msg240753)

It may be that you need a different instruction on Ubuntu to install it, but if you have already managed to install Lua then this should be along the same lines.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 11, 2015, 10:33:46 am
@vosmont

The solution is surely, simply to run RGB Controller on the openLuup machine...

So I tried this and got quite a long way using this startup code:
Code: [Select]
do -- RGB Controller
  local Drgb = luup.create_device ('', '', "RGBW Controller", "D_RGBController1.xml", "I_RGBController1.xml")
  luup.attr_set ("device_json", "D_RGBController1_UI7.json", Drgb)
  luup.variable_set ("urn:upnp-org:serviceId:RGBController1", "DeviceType", "FGRGBWM-441", Drgb)
  luup.variable_set ("urn:upnp-org:serviceId:RGBController1", "DeviceId", "217", Drgb)
end

I had to force the DeviceType and DeviceId variables, because I couldn't get the settings tab on the control panel to display for some reason.  The problem I ran into, however, is that, currently, the VeraBridge does not honour parent/child relationship from the bridged Vera: all remote devices are children of the VeraBridge (I think this is how it works on natively bridged Veras too, so it wouldn't work there either.)  This means that the target master device (Fibaro, in my case) does not have any RGBW children.

If you want to discuss this further, I'd recommend starting a new thread because we are drifting away from the general issues around openLuup.  Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 12, 2015, 01:38:50 pm
...currently, the VeraBridge does not honour parent/child relationship from the bridged Vera: all remote devices are children of the VeraBridge
I have now modified the behaviour of VeraBridge and it does now reflect the parent/child relationships.  Attached is an ALTUI Parent/Child map now showing clearly that some of the remote machines have Netatmos attached with their plethora of child devices.  Also some multi-sensors and an RGBController.

Quote
If you want to discuss this further, I'd recommend starting a new thread because we are drifting away from the general issues around openLuup.  Thanks.
So I ignored my own advice, because this is a general issue, but I have also discovered why my setup screen is not displaying for the RGBController - I'll raise that on the appropriate thread.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on July 30, 2015, 11:16:46 am
I'm using Datayours on Rpi. Do I have to follow any particular instructions to install openLuup on Rpi and continue to use Datayours ?

Oh hi there!  I was wondering if I should post instructions on transitioning to openLuup, but I thought I would make sure it worked OK for others first!  DataYours certainly works for me on this distribution, although I have made one change to it to make startup easier on openLuup.

All you would need to do is add to the startup code:
Code: [Select]
do -- DataYours
  local dy7 = luup.create_device ('', '', "DataYours", "D_DataYours7.xml","I_DataYours7.xml")        -- create the device
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "DAEMONS", "Graph, Dash, Cache, Watcher", dy7)
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "LOCAL_DATA_DIR", "/nas/whisper/", dy7)
  luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "VERAS", "172.16.42.10, 172.16.42.11, 172.16.42.12, 172.16.42.14", dy7)
end
...obviously with IP addresses, etc. tailored to your system.

I'll post the update to DataYours on that thread, to keep this focused on openLuup issues.

Thanks for the interest.

Hi akbooer,

I've installed  openLuup with AltUI Veraridge on another Rpi and all seems ok.

To install Datayours on this Rpi I've to copy all the Datayours Lua files on /etc/cmh-ludl directory and add the code to startup.lua as you indicated in this post ?

tnks

donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 30, 2015, 12:03:24 pm
I've installed  openLuup with AltUI Veraridge on another Rpi and all seems ok.

To install Datayours on this Rpi I've to copy all the Datayours Lua files on /etc/cmh-ludl directory and add the code to startup.lua as you indicated in this post ?

Excellent!  Glad it's going well - I have a new release of openLuup very soon (with scenes, timers, actions, ALTUI history, ...)

You need the full set of installation files, since ALTUI (and, to some extent, openLuup) also need the S_xxx.xml, D_xxx.xml, I_xxx.xml, D_xxx.json information, as well as the actual Lua code - all in the same directory (/etc/cmh-ludl/)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on July 30, 2015, 02:47:50 pm
I've installed  openLuup with AltUI Veraridge on another Rpi and all seems ok.

To install Datayours on this Rpi I've to copy all the Datayours Lua files on /etc/cmh-ludl directory and add the code to startup.lua as you indicated in this post ?

Excellent!  Glad it's going well - I have a new release of openLuup very soon (with scenes, timers, actions, ALTUI history, ...)

You need the full set of installation files, since ALTUI (and, to some extent, openLuup) also need the S_xxx.xml, D_xxx.xml, I_xxx.xml, D_xxx.json information, as well as the actual Lua code - all in the same directory (/etc/cmh-ludl/)

Hi akbooer,

where can I  find the full updated set of Datayours files to upload on Rpi ?

tnks

donato

 
Title: openLuup - release 2 - Luup on any platform
Post by: akbooer on July 31, 2015, 10:36:38 am
Release 2 attached, including VeraBridge plugin to connect to remote Veras.

New features include:
This should run on any Unix system - someone even has it running under Windows (some features don't work there.)

The biggest thing missing is still the luup.io module so some plugins (including Arduino) do not yet run - it's really the next thing on the list.

-----

Edit: This release has been superseded.  Please see link on post #1 of this thread for latest
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on July 31, 2015, 11:30:22 am
Hi akooer

I copied  all files of Datayours on etc/cmh-ludl directory and modified the startup.lua as you indicated, but when I call the dashboard ("http://xxxxxxxx:3480/data_request?id=lr_dashboard2&page=home) I get the msg "no handler" . Do I have to do any other operation ?

tnks

donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 31, 2015, 12:24:39 pm
I copied  all files of Datayours on etc/cmh-ludl directory and modified the startup.lua as you indicated, but when I call the dashboard ("http://xxxxxxxx:3480/data_request?id=lr_dashboard2&page=home) I get the msg "no handler" . Do I have to do any other operation ?

You should be using the Lua files here?
http://forum.micasaverde.com/index.php/topic,30808.msg242800.html#msg242800 (http://forum.micasaverde.com/index.php/topic,30808.msg242800.html#msg242800)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on July 31, 2015, 05:56:01 pm
Hi akooer

I've installed v2 of Openluup ut when I start it I get the following message :

pi@raspberrypi /etc/cmh-ludl $ lua5.1 openLuup_release_2.lua
lua5.1: openLuup_release_2.lua:6: module 'openLuup.init' not found:


Have you any idea ?

I'd like to install a Rpi or similar machine with only Openluup and Datayours (Watcher, Cache, Graph, Dash).

tnks

donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on July 31, 2015, 06:23:23 pm
Have you retained the directory structure of the .zip file?  All the openLuup modules should be in a sub directory of the same name within your nominal /etc/cmh-ludl/ directory where all your D_xxx.xml files, etc, live.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on July 31, 2015, 07:00:43 pm
Have you retained the directory structure of the .zip file?  All the openLuup modules should be in a sub directory of the same name within your nominal /etc/cmh-ludl/ directory where all your D_xxx.xml files, etc, live.

Yes I've copied your structure of the zip file where is the "openluup" sub directory and within it I've copied Datayours, Altui files.

But the error msg is the same.



 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 01, 2015, 02:31:23 am
OK, I'm not convinced we're quite on the same page re. directory structure.

You should have, at a minimum:
Your current directory, when you start, should be /etc/cmh-ludl/

-------

Edit: added .lua reference
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on August 01, 2015, 02:56:45 am
OK, I'm not convinced we're quite on the same page re. directory structure.

You should have, at a minimum:
  • 'home' directory, usually called /etc/cmh-ludl/ containing:
    • all your required device .xml and .json files
    • the openLuup_release_2 startup file
    • subdirectory 'openLuup' containing
      • only the distribution files
Your current directory, when you start, should be /etc/cmh-ludl/

The lua files (datayours, altui) should be in the /etc/cmh-ludl/ directory ?

Tnks Donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 01, 2015, 02:58:40 am
Yes.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on August 01, 2015, 04:18:16 am
Yes.

Hi akbooer,

excuse me if I'm doing some mistake but I've redo a check and the files location seem ok : the error message is the same.

I've substituted the R2 distribution with the R1 and all is ok included Datayours Dashboard.

Can I do any other check to find my error ?

tnks

donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 01, 2015, 05:09:36 am
Can you send me a directory listing of your openLuup directory?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 01, 2015, 05:55:11 am
Can you send me a directory listing of your openLuup directory?

Forget that - so sorry - this is my problem: I screwed up the zip file for the release 2.  How that happened, I have no idea.

Will repost shortly.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 01, 2015, 06:04:00 am
Apologies to any out there struggling with the new release (there have been a few downloads.)

The .zip file was in error and has now (hopefully) been corrected as updated on this post: http://forum.micasaverde.com/index.php/topic,32315.msg243104.html#msg243104 (http://forum.micasaverde.com/index.php/topic,32315.msg243104.html#msg243104)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on August 01, 2015, 02:36:11 pm
Hi akbooer,

tnks now the release 2 seems ok. Perhaps I'll have to annoy you again because I'm trying to setup a configuration with Openluup , several Datayour watchers remote and one central Datayours with only cache, dash, graph.

tnks again

donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on August 01, 2015, 02:39:30 pm
@akbooer Would it be possible to run the Blue Iris plug in or direct camera devices on openLuup so I can offload cameras from my Vera but still have the HomeWave app and VeraAlerts access them? Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 01, 2015, 03:02:48 pm
tnks now the release 2 seems ok. Perhaps I'll have to annoy you again because I'm trying to setup a configuration with Openluup , several Datayour watchers remote and one central Datayours with only cache, dash, graph.

Not annoying at all!  Glad the updated release 2 file seems OK.  The DataYours configuration sounds straightforward ( I run one like it.). Perhaps continue that discussion on the DY on RPi thread.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 01, 2015, 03:10:14 pm
Would it be possible to run the Blue Iris plug in or direct camera devices on openLuup so I can offload cameras from my Vera but still have the HomeWave app and VeraAlerts access them?

Interesting thought.  I run HomeWave on my 4 real Vera's, but haven't tried this with openLuup.  The whole idea is that it should work with these types of remotes.  ALTUI is a good test for that, I think.

I know nothing about Blue Iris and haven't had a camera on Vera for several years, but I'm willing to see what needs to be done.  If it uses direct Luasocket calls, then this should be fine, but it may need to wait for the asynchronous io package which is in the works.  There may be a couple of camera-specific Luup requests which I haven't implemented, but that shouldn't be a problem.  The goal is to have a fairly complete implementation.

I'll take a look at the Blue Iris plugin but if you have any insight then please share.

---

Edit:  I've just looked on GitHub and the implementation file seems very standard, so the plugin itself should run.    The actions are just a bunch of HTTP requests using luup.inet.wget which is fully functional in openLuup.  I don't know if ALTUI has implemented a display panel for this?? (Maybe it doesn't need much of one?)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: parkerc on August 01, 2015, 03:49:21 pm
Hi @akbooer

Hope you're well.

While I'm not as active as I used to be in this forum due to other commitments, my own attempts at getting OpenHAB to work with Vera have never gone well, so much so, that I've given up :)

Anyway I digress, after stumbling across your post, I felt it was just another example of the great ideas you have, and I really admire your commitment & dedication to the cause..

If it's  of any help/interest, thinking of how I would use it - nowadays wherever possible I look to use my QNAP NAS as much as possible to run such such apps, so if you would ever consider creating an install file for the main NASs (QNAP .qpkg & Synololgy) - I'd be a willing tester :) ?

Like you, I've invested a lot of time/effort (swear words) in VERA/MIOS/LUA/LUUP etc. over the years that I'd love to find a way to keep using it all, and if I could get it more running on my NAS (natively)  it would be a great addition.

I'm not quite at my 2000 post yet, but getting closer :)

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 01, 2015, 03:54:43 pm
Would it be possible to run the Blue Iris plug in or direct camera devices on openLuup so I can offload cameras from my Vera but still have the HomeWave app and VeraAlerts access them?

So far, so good.  Here's a snapshot of some of the device actions running under ALTUI / openLuup.

How to take this further I couldn't say, not having a camera or a Blue Iris server.

-----------

Edit: I've tried out HomeWave, and that works with openLuup too!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on August 01, 2015, 10:57:03 pm
Thanks! I will install openLuup on my Mac and test with the cameras and HomeWave tonight or tomorrow.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 02, 2015, 12:52:46 am
Hi @akbooer

Hope you're well.
Hi @parkerc !  Great to hear from you after a long while - you have been to blame as the source of several GREAT IDEAS in the past!

Quote
While I'm not as active as I used to be in this forum due to other commitments, my own attempts at getting OpenHAB to work with Vera have never gone well, so much so, that I've given up :)
Now that IS interesting.  I've looked from a distance at OpenHAB and worried about the difficulties of switching to it.  It does, however, have a large and active community.  I've noted the comments about how RPi, etc, is not perhaps powerful enough, and startup times are long.   The level of computing required in home automation should not, really, be that onerous.  openLuup starts up in seconds, uses only a modest amount of memory and an even more modest amount of cpu - after startup my system bridged to four Veras with ~200 devices and running ALTUI, Netatmo and DataYours only uses ~10 Mbytes and ~2% of the cpu! (on a BeagleBone Black)

Quote
If it's  of any help/interest, thinking of how I would use it - nowadays wherever possible I look to use my QNAP NAS as much as possible to run such such apps, so if you would ever consider creating an install file for the main NASs (QNAP .qpkg & Synololgy) - I'd be a willing tester :) ?

Like you, I've invested a lot of time/effort (swear words) in VERA/MIOS/LUA/LUUP etc. over the years that I'd love to find a way to keep using it all, and if I could get it more running on my NAS (natively)  it would be a great addition.
My current NAS is an Apple Time Capsule - so not as open as the ones you list - but my understanding is that if it's basically Unix underneath the covers and you can configure it to run Lua then you should be fine.  I don't know anything (yet) about creating specific installs for them.  My goal at the moment has been smaller systems like BeagleBone Black and Raspberry Pi, and I've just acquired an Arduino Yun, which has an onboard openWRT system (as does Vera.)  Although I've created a VeraBridge for Z-wave components, the future direction will be open-source Arduino-based sensors a la MySensors.org.

Hard to debug without having the actual hardware, so if you care to see how easy it is to get Lua running on your NAS, I'm very happy to collaborate.

Quote
I'm not quite at my 2000 post yet, but getting closer :)
Very close!  Hang in there.  I have to say that off-loading apps to openLuup has done wonders for my Vera systems stability and they typically run for weeks without restarts now.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 03, 2015, 03:47:54 pm
Attached you will find a new startup file for openLuup, which checks the installation for anomalies like missing files or directories before launching openLuup.  It aborts if there's a fatal flaw in the setup configuration, but otherwise issues warning messages to standard output.  This should be a great help to diagnosing any initial configuration problems without having to trouble shoot logs or the like.

If you're starting openLuup with the "nohup" command, then standard output is redirected to the file "nohup.out".
Title: Re: openLuup - running unmodified plugins on any machine
Post by: parkerc on August 03, 2015, 05:06:58 pm
Hey @akbooer !

Looking into the process for creating an install package for my QNAP, I came across the following documents.

http://download.qnap.com/dev/QDK_Quick_Start_Guide_v4_eng.pdf
https://www.qnap.com/event/dev/uk/p_qdk.php#qdk_btn1_show

Based upon your guide Lua 5.1 and luascockets needs to be installed as part of the process and then there's a directory structure to be created.  It seems like it is doable but I fear my Linux skills are so poor, I'm going to struggle.

As the QNAP already has a web services running, the ability to use ALT UI too would be awesome - plus being able to VPN in to the NAS too (with 2 factor auth), it could even allow me to explore the potential of not having my Vera exposed directly to the Internet.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 03, 2015, 05:29:44 pm
Looking into the process for creating an install package for my QNAP, I came across the following documents...

I'm really hoping you wouldn't need all that.  You really on need to be able to ssh in to the NAS and then do a bit of hacking.  I found this: http://forum.qnap.com/viewtopic.php?f=50&t=101092 (http://forum.qnap.com/viewtopic.php?f=50&t=101092)

However, without the hardware, it's hard for me to go further.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: parkerc on August 03, 2015, 06:24:45 pm
Agreed, SSH would be a way to go, but I do like a challenge  :P and I was thinking that if I could turn your steps into an install package, it would make things easier for others.

Plus if successfull it would also place an icon on the QNAP dashboard, which anyone with access to my NAS could then use to run the ALT UI.

All of this is very new ground for me, so I've kicked off a thread on the QNAP site too to see if I could get any support there as well to package up your openLuup initiative :)

http://forum.qnap.com/viewtopic.php?f=128&t=112659&p=493669#p493669
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mvader on August 04, 2015, 09:50:13 am
picked up a rpi2 the other day and am ready to give this a go.
i downloaded the release2.zip but didn't see any docs to get it installed.
can someone point me to the install instructions?
Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ctguess on August 04, 2015, 12:33:32 pm
Page 4 (reply #49) of this topic...the same post that contains the zip file...there is a user guide attached.  Also attached to this reply for ease/redundancy
Title: Re: openLuup - running unmodified plugins on any machine
Post by: wilme2 on August 04, 2015, 02:17:10 pm
If it's  of any help/interest, thinking of how I would use it - nowadays wherever possible I look to use my QNAP NAS as much as possible to run such such apps, so if you would ever consider creating an install file for the main NASs (QNAP .qpkg & Synololgy) - I'd be a willing tester :) ?

I just wanted to add I have the same interests and I use a Synology.  I am willing to help test running openLuup on a NAS, but my Unix skills are pretty poor so might take me a while.

Today, in addition to raw storage on my NAS, I also run my camera recording app (Synology Surveillance Station) and my Vera Syslog (Event Watcher to native Synology Syslog) on my NAS.  Even more exciting, I am part of the HDHomerun network DVR Kickstarter too - so hope to run my cable card DVR on my NAS in the near future (eliminating the dedicated Windows PC I use today).

Title: Re: openLuup - running unmodified plugins on any machine
Post by: parkerc on August 04, 2015, 05:35:21 pm
I'm with you @wilme2.  8)

Based on the openLuup guide @akbooer created, one of the first steps looks to be to instal Lua and Lua Sockets  - and from what i can tell, some work needs to done to prepare a NAS like ours to install these packages..

I'm learning as I go too, but as a start Ive found this post which might be of help  -> http://forum.synology.com/enu/viewtopic.php?f=40&t=95346
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 04, 2015, 05:49:34 pm
I'm learning as I go too, but as a start Ive found this post which might be of help  -> http://forum.synology.com/enu/viewtopic.php?f=40&t=95346

...that looks like a very good start, with both Lua and LuaSocket apparently available.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 07, 2015, 12:21:53 pm
Very excited... have just got openLuup (a fairly complete implementation of the Vera environment) up and running on an Arduino Yun.

The Arduino Yun is a microcontroller board based on the ATmega32u4 and the Atheros AR9331. The Atheros processor (400 MHz) supports a Linux distribution based on OpenWrt (so very much like a VeraLite) and that's what runs openLuup.

The board has built-in Ethernet and WiFi support, a USB-A port, micro-SD card slot, 20 digital input/output pins , ... so should be a fabulous platform for the Arduino Bridge plugin.  I am close to completing an adequate implementation of the luup.io module, so from there the Arduino Bridge should be plug'n play (not to be confused with UPnP!)

Start up time is very fast:
ALTUI is very responsive (but then, it runs mostly on the browser.)

Happy days.


Title: Re: openLuup - running unmodified plugins on any machine
Post by: mvader on August 10, 2015, 10:15:48 am
Very excited... have just got openLuup (a fairly complete implementation of the Vera environment) up and running on an Arduino Yun.

The Arduino Yun is a microcontroller board based on the ATmega32u4 and the Atheros AR9331. The Atheros processor (400 MHz) supports a Linux distribution based on OpenWrt (so very much like a VeraLite) and that's what runs openLuup.

The board has built-in Ethernet and WiFi support, a USB-A port, micro-SD card slot, 20 digital input/output pins , ... so should be a fabulous platform for the Arduino Bridge plugin.  I am close to completing an adequate implementation of the luup.io module, so from there the Arduino Bridge should be plug'n play (not to be confused with UPnP!)

Start up time is very fast:
  • less than half a second before it starts running the user startup Lua,
  • another second to load ALTUI, VeraBridge, and a complete DataYours installation,
  • about six more seconds for each remote VeraBridge connection with about 50 devices on each.
ALTUI is very responsive (but then, it runs mostly on the browser.)

Happy days.


great work.. will the arduino plugin require another arduino or will the RPI still be the only thing you need?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 10, 2015, 10:35:26 am
.. will the arduino plugin require another arduino or will the RPI still be the only thing you need?

My hope would be that the Yun would replace both the Vera and the gateway Arduino, so what you'd need is a radio connected to the Yun and then some remote sensors communicating with that... at least, I THINK that's the way it should work.  I haven't built any MySensor devices yet so couldn't be sure!  You could probably attach some sensors directly to the Yun board too, but that seems less useful, and would probably require some customisation.

There is some old thread on the MySensors board discussing running the gateway software on that, but nothing recent, so I'm hoping to stir things up there a bit and see whether anyone has done anything more.  I'd rather not have to delve into the Arduino sketch.  If you have expertise along those lines, we could perhaps continue the discussion in that forum.

-----

Edit:  Just re-read your comment again (!) and note that you mention RPi.  With openLuup running on the Linux cpu on the Yun board, you wouldn't need an RPi at all.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mvader on August 11, 2015, 09:16:59 am
.. will the arduino plugin require another arduino or will the RPI still be the only thing you need?

My hope would be that the Yun would replace both the Vera and the gateway Arduino, so what you'd need is a radio connected to the Yun and then some remote sensors communicating with that... at least, I THINK that's the way it should work.  I haven't built any MySensor devices yet so couldn't be sure!  You could probably attach some sensors directly to the Yun board too, but that seems less useful, and would probably require some customisation.

There is some old thread on the MySensors board discussing running the gateway software on that, but nothing recent, so I'm hoping to stir things up there a bit and see whether anyone has done anything more.  I'd rather not have to delve into the Arduino sketch.  If you have expertise along those lines, we could perhaps continue the discussion in that forum.

-----

Edit:  Just re-read your comment again (!) and note that you mention RPi.  With openLuup running on the Linux cpu on the Yun board, you wouldn't need an RPi at all.

I already have a gateway and several sensors built and deployed (working great)
i guess what i was trying to ask was as far as running openluup. would that still run on the rpi or does it now run on an arduino?

my thinking (correct me if i'm wrong) sensor - > gateway -> <openluup device> -> vera
where <openluup device> is a rpi2 (or maybe a yun if I'm understanding correctly)
correct?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 11, 2015, 09:36:40 am
<openLuup device> Can be almost anything... RPi, Mac, even a Windows machine... Anything that runs Lua.  Given that openLuup plus ALTUI does (will do, in due course) almost everything that Vera does (except Zwave) then you might not need Vera at all.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on August 13, 2015, 01:41:12 am
@akbooer - can you please help me find a Lau sockets binary for Mac OS 10.10 ? I have googled but can only seem to find source (I don't have Xcode installed so can't compile). Thanks!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 13, 2015, 05:58:09 am
I'm actually using the excellent ZeroBrane Studio as an IDE, and that comes with all sorts of flavours of Lua, including the LuaSocket library.  However, just trying it, I notice that it doesn't out-of-the-box provide the command line hooks for running Lua.  On the Mac, I'm only running Lua within the IDE.

How have you installed Lua in the first place?  My first port of call would be the pre-compiled libraries at sourceforge, but I don't know if that includes LuaSocket.

I've installed quite successfully on Debian (BeagleBone Black) and OpenWRT (Arduino Yun) using apt-get install lua-socket and opkg install luasocket, respectively, but that's apparently not applicable to the Mac.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 13, 2015, 08:05:58 am
The Lua distribution here seems to contain lots of things, include the socket library:

http://luadist.org/ (http://luadist.org/)

Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on August 15, 2015, 02:30:17 am
The Lua distribution here seems to contain lots of things, include the socket library:

http://luadist.org/ (http://luadist.org/)

Thanks. From the luadist binary disc image at https://github.com/LuaDist/Binaries/archive/LuaDist-batteries-0.9.8-Darwin-x86_64.zip i installed:

- everything in /bin into /usr/local/bin/lua5.1/
- everything in /lib into /usr/local/lib/lua/5.1/socket.lua
- everything /share into /usr/local/share/lua/5.1/

my package path variables are:

Code: [Select]
sh-3.2# lua5.1
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> print(package.path..'\n'..package.cpath)
./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua
./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;./lib?51.so;/usr/local/lib/lua/5.1/lib?51.so;

But when i run

Code: [Select]
lua5.1 openLuup_release.lua /dev/null from /etc/cmh-ludl
i get the error:

Code: [Select]
lua5.1: error loading module 'socket.core' from file '/usr/local/lib/lua/5.1/socket/core.so':
dlopen(/usr/local/lib/lua/5.1/socket/core.so, 2): Library not loaded: @executable_path/../lib/liblua.dylib
  Referenced from: /usr/local/lib/lua/5.1/socket/core.so
  Reason: image not found
stack traceback:
[C]: ?
[C]: in function 'require'
/usr/local/lib/lua/5.1/socket.lua:13: in main chunk
[C]: in function 'require'
./openLuup/logs.lua:6: in main chunk
[C]: in function 'require'
./openLuup/init.lua:19: in main chunk
[C]: in function 'require'
openLuup_release.lua:6: in main chunk
[C]: ?

I have been at it for hours and i am stumped. I hate to bother you but can you offer any help? I suspect i have not installed things in the right place or set the necessary variables (which i do not know how to do) but i can't figure it out. Thanks again for your help.

-mda
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 15, 2015, 03:20:19 am
How did you install the original Lua5.1?
What directory are you running in?

It looks from the error that it is looking on a relative path to the current directory?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 15, 2015, 07:02:56 am
@mda

Wow!  I simply cannot believe how difficult it is to install Lua with LuaSocket on a Mac !

This may not be the best way BUT here goes:

1) Install Homebrew, following the instruction here: http://brew.sh/ (http://brew.sh/) BUT note that you need to be running bash:
Code: [Select]
% bash
bash-3.2$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

then proceed as prompted.

2) Follow these instructions to use Homebrew to install Lua: https://github.com/keplerproject/luarocks/wiki/Installation-instructions-for-Mac-OS-X (https://github.com/keplerproject/luarocks/wiki/Installation-instructions-for-Mac-OS-X)

Code: [Select]
bash-3.2$ brew update
Already up-to-date.
bash-3.2$ brew install lua
==> Downloading https://homebrew.bintray.com/bottles/lua-5.2.4_1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring lua-5.2.4_1.yosemite.bottle.tar.gz
==> Caveats
Please be aware due to the way Luarocks is designed any binaries installed
via Luarocks-5.2 AND 5.1 will overwrite each other in /usr/local/bin.

This is, for now, unavoidable. If this is troublesome for you, you can build
rocks with the `--tree=` command to a special, non-conflicting location and
then add that to your `$PATH`.

3) Then follow these instructions to use LuaRocks(which comes with the above Lua install) to install LuaSocket: https://github.com/keplerproject/luarocks/wiki/Using-LuaRocks (https://github.com/keplerproject/luarocks/wiki/Using-LuaRocks)

Code: [Select]
bash-3.2$ luarocks install luasocket
Installing https://luarocks.org/luasocket-3.0rc1-2.src.rock...
Using https://luarocks.org/luasocket-3.0rc1-2.src.rock... switching to 'build' mode
...
Updating manifest for /usr/local/lib/luarocks/rocks-5.2
No existing manifest. Attempting to rebuild...
luasocket 3.0rc1-2 is now built and installed in /usr/local (license: MIT)

4) Now, with luck, you have a Lua install with the socket library too:
Code: [Select]
bash-3.2$ lua
Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> local socket = require "socket"
>

5) Breathe a sigh of relief.

I know I must be doing something wrong, but that's what I found so far. 

Hope this helps.


Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer 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!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer 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.

Title: Re: openLuup - running unmodified plugins on any machine - Release 3
Post by: akbooer 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

Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda 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!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda 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 :(

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 15, 2015, 04:00:53 pm
Have you simply tried the install(s) again ?
Title: openLuup - running unmodified plugins on any machine
Post by: mda 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
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer 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/
Title: Re: openLuup - running unmodified plugins on any machine
Post by: Drcashman 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 :)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda 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 ;)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda 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...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda 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.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer 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.) ?

Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda 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?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer 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.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 16, 2015, 07:36:40 am
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 :)

Wow, that's amazing!  I shouldn't sound surprised, but it sounds like you went for the whole works straight away.  You're saying that the Arduino gateway plugin works OK as well as the bridge to both of your Veras?   What sensors are you running on the Veras?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: Drcashman on August 16, 2015, 01:54:16 pm
Basically the vera's are just controling my zwave devices and some PLEG on the edge. I started with the lite but ran into memory issues causing multiple restarts a day when i added more than 5 mysensors nodes. I added the edge last December and it works a lot better but the buggy firmware is still frustrating. I bought a pogo plug v4 on ebay for $5 and hacked to to run Debian Linux but it was just sitting around do nothing so when i saw this i thought why not and tried it.
I have LED, temp, motion,light and rainsensors.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 16, 2015, 02:19:53 pm
Well you're obviously an expert, and that's a great example of how I imagined it being used.  If there are any lessons learned during the commissioning, or suggestions for improvements, I'd be happy to hear them.

So well done again, and thanks for thinking "why not" in the first place!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on August 16, 2015, 03:31:44 pm
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.

i decompressed and copied all the files from /etc/cmh-lu and /etc/cmh-ludl on vera to /etc/cmh on my mac. I could not bring over the Vera Alerts plug in or a couple other encrypted files.

The good news is i can turn z-wave lights on/off from AltUI on openluup and the multiswitch values display (though clicking on a multiswitch button does not have any effect, which is fine ;). I can also connect to openluup with HomeWave on iOS and can control bridged vera z-wave lights through openluup.

But, the bridged cameras still do not display images on altUI or on Homewave -- however this does not matter to me since I want to connect openluup directly to the camera and avoid the camera being in vera as my next step, so i do not need to get bridged cameras working.

But...

I have changed OpnLuup's startup.lua to have my location but AltUI shows Chantilly Virginia as my location (I am in California), and "Waiting Initial Data" so something is still not right. I also replaced "Upstairs" with "Master" in the Room setup in startup.lua but AltUI is showing Upstairs, Downstairs, and Master (where is it getting "Upstairs" from?)

So before i start to create devices in startup.lua i think i still need to figure out why OpenLuup is not taking into account my startup.lua changes correctly and still "Waiting Initial Data"?

I will PM you my logs.

Thanks!


Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 16, 2015, 05:19:27 pm
The good news is i can turn z-wave lights on/off from AltUI on openluup and the multiswitch values display (though clicking on a multiswitch button does not have any effect, which is fine ;). I can also connect to openluup with HomeWave on iOS and can control bridged vera z-wave lights through openluup.
That is good news.

Quote
But, the bridged cameras still do not display images on altUI or on Homewave -- however this does not matter to me since I want to connect openluup directly to the camera and avoid the camera being in vera as my next step, so i do not need to get bridged cameras working.
OK, fair plan.  I've taken a look and there is one critical HTTP request that I have not yet implemented: request_image, as documented (not very well) here: http://wiki.micasaverde.com/index.php/Luup_Requests#request_image (http://wiki.micasaverde.com/index.php/Luup_Requests#request_image)

I'll take a look at doing this.  My initial worry is that cameras seem (from reading other posts) to be a bit of a challenge to set up.  I'm not sure why this is, but no doubt I will find out.  Not having a camera at all will mean a bit of trial and error on the way.

Quote
I have changed OpnLuup's startup.lua to have my location but AltUI shows Chantilly Virginia as my location (I am in California)
I'll take a look at the startup file and see what that tells me.  To help further diagnostics it would be good to have the output from the id=user_data request.

Quote
and "Waiting Initial Data" so something is still not right. I also replaced "Upstairs" with "Master" in the Room setup in startup.lua but AltUI is showing Upstairs, Downstairs, and Master (where is it getting "Upstairs" from?)
As documented, room states, and scenes, are persistent.  The are saved in the file user_data.json on a clean exit from openLuup (ie. after an HTTP request with id=exit).  You can directly edit that file to remove the room, or use and HTTP request (documented here http://wiki.micasaverde.com/index.php/Luup_Requests#room (http://wiki.micasaverde.com/index.php/Luup_Requests#room)) to remove it.

Quote
So before i start to create devices in startup.lua i think i still need to figure out why OpenLuup is not taking into account my startup.lua changes correctly and still "Waiting Initial Data"?
Sounds like we both have a bit of work to do.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on August 16, 2015, 05:34:16 pm
Hi akbooer,

how can I change the listening  port of Datayours Cache on a Openluup/Datayours ?

tnks

donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 16, 2015, 05:40:40 pm
@mda
Quote
I have changed OpnLuup's startup.lua to have my location but AltUI shows Chantilly Virginia as my location (I am in California)

What ALTUI shows is a weather location - I don't know exactly where it gets it from.  Simply click on the banner to go to the weather website and select your desired location.

The ACTUAL location used (for sunrise / sunset) is taken from the latitude and longitude settings.  The convention, for Vera, is , I believe, NEGATIVE for WEST of the meridian, so you should be using -118, or thereabouts?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on August 16, 2015, 05:48:34 pm
@mda
Quote
I have changed OpnLuup's startup.lua to have my location but AltUI shows Chantilly Virginia as my location (I am in California)

What ALTUI shows is a weather location - I don't know exactly where it gets it from.  Simply click on the banner to go to the weather website and select your desired location.

The ACTUAL location used (for sunrise / sunset) is taken from the latitude and longitude settings.  The convention, for Vera, is , I believe, NEGATIVE for WEST of the meridian, so you should be using -118, or thereabouts?

ALTUI uses accuweather widget in autolocation mode ( so it is accuweather which determines your location based on your ip ).
you can check out http://www.accuweather.com/en/free-weather-widgets/current
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on August 16, 2015, 07:16:01 pm
Thanks!

@akbooer - i have PM'd you a link that may be helpful. Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: Jeff on August 17, 2015, 03:18:47 am
First of Thanks for this Virtual Vera I stumbled upon it tonight and I'm having fun so far but the ALTUI is not coming up after boot. I even removed the MYS and VeraBridge just in case that was the hangup. I can access the webpage for calling up user_data, etc. The images come up when called like in the tutorial as well. I tink this is something with apache? but not sure what to do.

Code: [Select]
2015-08-17 00:10:00.215 openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0x850908 6
2015-08-17 00:10:00.216 openLuup.server:: error 'timeout' sending 379225 bytes to tcp{client}: 0x850908 11

why is this happening?

Here is a little core of the log for perspective...
Code: [Select]
2015-08-17 00:22:44.167 openLuup.server:: new client connection: tcp{client}: 0x8508a8 8
2015-08-17 00:22:44.167 openLuup.server:: new client connection: tcp{client}: 0x840af8 8
2015-08-17 00:22:44.167 openLuup.server:: new client connection: tcp{client}: 0x915e28 8
2015-08-17 00:22:44.167 openLuup.server:: new client connection: tcp{client}: 0x9218b8 8
2015-08-17 00:22:44.172 openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=home tcp{client}: 0x8508a8 6
2015-08-17 00:22:44.172 luup_log:3: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler 8
2015-08-17 00:22:44.172 luup_log:3: ALTUI: ALTUI_Handler: parameters is: {"command":"home"} 8
2015-08-17 00:22:44.172 luup_log:3: ALTUI: ALTUI_Handler: outputformat is: null 8
2015-08-17 00:22:44.174 luup_log:3: ALTUI: getScriptContent(J_ALTUI_plugins.js) 5
2015-08-17 00:22:44.174 luup_log:3: ALTUI: getScriptContent(J_ALTUI_iphone.js) 5
2015-08-17 00:22:44.174 luup_log:3: ALTUI: getScriptContent(J_ALTUI_jquery.ui.touch-punch.min.js) 5
2015-08-17 00:22:44.176 openLuup.server:: request completed (65197 bytes, 4 ms) tcp{client}: 0x8508a8 11
2015-08-17 00:22:44.410 openLuup.server:: /J_ALTUI_utils.js tcp{client}: 0x8508a8 6
2015-08-17 00:22:44.410 openLuup.server:: request completed (33527 bytes, 0 ms) tcp{client}: 0x8508a8 11
2015-08-17 00:22:44.410 openLuup.server:: /J_ALTUI_verabox.js tcp{client}: 0x840af8 6
2015-08-17 00:22:44.411 openLuup.server:: request completed (89086 bytes, 0 ms) tcp{client}: 0x840af8 11
2015-08-17 00:22:44.418 openLuup.server:: /J_ALTUI_multibox.js tcp{client}: 0x840af8 6
2015-08-17 00:22:44.419 openLuup.server:: request completed (26181 bytes, 0 ms) tcp{client}: 0x840af8 11
2015-08-17 00:22:44.424 openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0x840af8 6
2015-08-17 00:22:44.425 openLuup.server:: error 'timeout' sending 379225 bytes to tcp{client}: 0x840af8 11
2015-08-17 00:22:44.425 openLuup.server:: request completed (379225 bytes, 1 ms) tcp{client}: 0x840af8 11

Thanks,
Jeff
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 17, 2015, 05:54:56 am
First of Thanks for this Virtual Vera I stumbled upon it tonight and I'm having fun so far ...
Oh good, I'm glad you found it.  I nearly called it 'Virtual Vera' before then worrying about trademarks, etc.

Quote
...but the ALTUI is not coming up after boot. I even removed the MYS and VeraBridge just in case that was the hangup. I can access the webpage for calling up user_data, etc. The images come up when called like in the tutorial as well. I tink this is something with apache? but not sure what to do.
OK, this is a real problem - you're the second one to find this problem: it was @amg0 (of ALTUI fame) who ran into this too, but that was running in a virtual machine environment, so I put it down to that.

Quote
Code: [Select]
2015-08-17 00:10:00.215 openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0x850908 6
2015-08-17 00:10:00.216 openLuup.server:: error 'timeout' sending 379225 bytes to tcp{client}: 0x850908 11
why is this happening?

There's two theories so far:
Your observation is extremely helpful in underlining the issue, but I've not been able to replicate it on Debian or Open-WRT, although neither of these are running Apache.  I also run on a Mac which does use that and doesn't show the problem either.

However, the transaction which is failing is to the port 3480 server - which is definitely an openLuup problem, and seems to be file-length related.  The file J_ALTUI_uimgr.js is the big one in the ALTUI package - I don't know if there's an easy way to split it, I'm not in any way JavaScript competent.

If anyone has suggestions or insights into this, I'm very happy to listen.  But I will anyway pursue my own investigations.

Sorry for the inconvenience.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on August 17, 2015, 06:14:59 am
First of Thanks for this Virtual Vera I stumbled upon it tonight and I'm having fun so far ...
Oh good, I'm glad you found it.  I nearly called it 'Virtual Vera' before then worrying about trademarks, etc.

Quote
...but the ALTUI is not coming up after boot. I even removed the MYS and VeraBridge just in case that was the hangup. I can access the webpage for calling up user_data, etc. The images come up when called like in the tutorial as well. I tink this is something with apache? but not sure what to do.
OK, this is a real problem - you're the second one to find this problem: it was @amg0 (of ALTUI fame) who ran into this too, but that was running in a virtual machine environment, so I put it down to that.

Quote
Code: [Select]
2015-08-17 00:10:00.215 openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0x850908 6
2015-08-17 00:10:00.216 openLuup.server:: error 'timeout' sending 379225 bytes to tcp{client}: 0x850908 11
why is this happening?

There's two theories so far:
  • it genuinely IS a timeout on the transaction,
  • it is length-related, perhaps a buffer length problem.
Your observation is extremely helpful in underlining the issue, but I've not been able to replicate it on Debian or Open-WRT, although neither of these are running Apache.  I also run on a Mac which does use that and doesn't show the problem either.

However, the transaction which is failing is to the port 3480 server - which is definitely an openLuup problem, and seems to be file-length related.  The file J_ALTUI_uimgr.js is the big one in the ALTUI package - I don't know if there's an easy way to split it, I'm not in any way JavaScript competent.

If anyone has suggestions or insights into this, I'm very happy to listen.  But I will anyway pursue my own investigations.

Sorry for the inconvenience.

AK,
I wonder about the client:setoption(option [, value]) or client:settimeout(value [, mode]) API documented in http://w3.impa.br/~diego/software/luasocket/tcp.html
especially the 'linger' option  ,or the 'b' and 't' timeout options..

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 17, 2015, 06:35:56 am
I wonder about the client:setoption(option [, value]) or client:settimeout(value [, mode]) API documented in http://w3.impa.br/~diego/software/luasocket/tcp.html
especially the 'linger' option  ,or the 'b' and 't' timeout options..

Yes, good steer.  I'm wondering about that too.  I thought I had set a 10 second timeout, but looking at it right now.  Thanks!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on August 17, 2015, 06:44:34 am
Hi akbooer,

how can I change the listening  port of Datayours Cache on a Openluup/Datayours ?

tnks

donato

Hi akbooer,

to change the parameter indicated above Have I to set the following in startup.lua ?

luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "UDP_RECEIVER_PORT", "port_number", dy7)

tnks

donato
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 17, 2015, 07:21:56 am
to change the parameter indicated above Have I to set the following in startup.lua ?

luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "UDP_RECEIVER_PORT", "port_number", dy7)

Sorry I missed your original post.  Yes, that's all you need to do.  But you must make sure that your DESTINATIONS ip:port match that port number.

This is perhaps more of a DataYours question than an openLuup one, but I see the dilemma.  Maybe better for future similar queries to ask in the "DataYours on Rpi" thread?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on August 17, 2015, 07:38:35 am
to change the parameter indicated above Have I to set the following in startup.lua ?

luup.variable_set ("urn:akbooer-com:serviceId:DataYours1", "UDP_RECEIVER_PORT", "port_number", dy7)

Sorry I missed your original post.  Yes, that's all you need to do.  But you must make sure that your DESTINATIONS ip:port match that port number.

This is perhaps more of a DataYours question than an openLuup one, but I see the dilemma.  Maybe better for future similar queries to ask in the "DataYours on Rpi" thread?

Sorry if I reply in this post but it's only for a question, the next one I'll post in the correct thread.

I changed the parameter , reboot the rpi but the port parameter in the dash interface (configuration) is 2003.


Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 17, 2015, 08:10:08 am
Sorry if I reply in this post but it's only for a question, the next one I'll post in the correct thread.

I changed the parameter , reboot the rpi but the port parameter in the dash interface (configuration) is 2003.

No problem.  Yes there is an error: that parameter is never passed on to DataCache by DataYours.  I never imagined someone would want to change it through this mechanism!  I will post an update in one of the DY threads shortly.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 17, 2015, 09:27:14 am
I wonder about the client:setoption(option [, value]) or client:settimeout(value [, mode]) API documented in http://w3.impa.br/~diego/software/luasocket/tcp.html
especially the 'linger' option  ,or the 'b' and 't' timeout options..

Yes, good steer.  I'm wondering about that too.  I thought I had set a 10 second timeout, but looking at it right now.  Thanks!

So I checked and there IS already a 10 second timeout set on the socket.  I'm loathe to tinker with the lower levels of the socket library, particularly since it comes with dire warnings:
Quote
You should only modify an option if you are sure you need it.
Quote
I do not advise you to set this to anything other than zero

However, I have added one small diagnostic to the send routine to log how many bytes have been successfully sent before the timeout.  I'd be grateful for a copy of what this produces in the event of a timeout.

PS: if you were into hacking and wanted to play with the socket.setoptions call then the line directly after 343 would be the place to do it.
Code: [Select]
  sock:settimeout(10)                                    -- this is a timeout on the HTTP read
Title: Re: openLuup - running unmodified plugins on any machine
Post by: Jeff on August 17, 2015, 11:59:32 am
I wonder about the client:setoption(option [, value]) or client:settimeout(value [, mode]) API documented in http://w3.impa.br/~diego/software/luasocket/tcp.html
especially the 'linger' option  ,or the 'b' and 't' timeout options..

Yes, good steer.  I'm wondering about that too.  I thought I had set a 10 second timeout, but looking at it right now.  Thanks!

So I checked and there IS already a 10 second timeout set on the socket.  I'm loathe to tinker with the lower levels of the socket library, particularly since it comes with dire warnings:
Quote
You should only modify an option if you are sure you need it.
Quote
I do not advise you to set this to anything other than zero

However, I have added one small diagnostic to the send routine to log how many bytes have been successfully sent before the timeout.  I'd be grateful for a copy of what this produces in the event of a timeout.

PS: if you were into hacking and wanted to play with the socket.setoptions call then the line directly after 343 would be the place to do it.
Code: [Select]
  sock:settimeout(10)                                    -- this is a timeout on the HTTP read

and here is what I got with the modified server code...

Code: [Select]
2015-08-17 08:50:31.390 luup_log:3: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler 8
2015-08-17 08:50:31.390 luup_log:3: ALTUI: ALTUI_Handler: parameters is: {"command":"home"} 8
2015-08-17 08:50:31.390 luup_log:3: ALTUI: ALTUI_Handler: outputformat is: null 8
2015-08-17 08:50:31.391 luup_log:3: ALTUI: getScriptContent(J_ALTUI_plugins.js) 5
2015-08-17 08:50:31.391 luup_log:3: ALTUI: getScriptContent(J_ALTUI_iphone.js) 5
2015-08-17 08:50:31.391 luup_log:3: ALTUI: getScriptContent(J_ALTUI_jquery.ui.touch-punch.min.js) 5
2015-08-17 08:50:31.393 openLuup.server:: request completed (65196 bytes, 4 ms) tcp{client}: 0x2606ac8 11
2015-08-17 08:50:31.664 openLuup.server:: /J_ALTUI_utils.js tcp{client}: 0x2606ac8 6
2015-08-17 08:50:31.664 openLuup.server:: request completed (33527 bytes, 0 ms) tcp{client}: 0x2606ac8 11
2015-08-17 08:50:31.667 openLuup.server:: /J_ALTUI_verabox.js tcp{client}: 0x2606ac8 6
2015-08-17 08:50:31.668 openLuup.server:: request completed (89086 bytes, 0 ms) tcp{client}: 0x2606ac8 11
2015-08-17 08:50:31.668 openLuup.server:: /J_ALTUI_multibox.js tcp{client}: 0x262b7a8 6
2015-08-17 08:50:31.669 openLuup.server:: request completed (26181 bytes, 0 ms) tcp{client}: 0x262b7a8 11
2015-08-17 08:50:31.695 openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0x2606ac8 6
2015-08-17 08:50:31.696 openLuup.server:: error 'timeout' sending 379225 bytes to tcp{client}: 0x2606ac8 11
2015-08-17 08:50:31.696 openLuup.server:: ...only 247608 bytes sent 7
2015-08-17 08:50:31.696 openLuup.server:: request completed (379225 bytes, 1 ms) tcp{client}: 0x2606ac8 11
2015-08-17 08:52:02.697 openLuup.server:: closing client connection: tcp{client}: 0x2606ac8 8
2015-08-17 08:52:02.697 openLuup.server:: closing client connection: tcp{client}: 0x262b7a8 8
2015-08-17 08:52:03.547 openLuup.heartbeat:: memory used: 703kB, stats: elapsed: 0.00 days, cpu: 87.043 sec (71.94%) 14
2015-08-17 08:54:03.548 openLuup.heartbeat:: memory used: 1126kB, stats: elapsed: 0.00 days, cpu: 206.716 sec (85.77%) 14

And this is running in a VM of Ubuntu running on a ESXi server, I will pull it down to my Mac and try later tonight. I do not understand what to change the time out to is less better or more point me to some docs on the internet and I will hack around with it.

Thanks,
Jeff
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 17, 2015, 12:27:30 pm
Quote
and here is what I got with the modified server code...
Code: [Select]
2015-08-17 08:50:31.696 openLuup.server:: error 'timeout' sending 379225 bytes to tcp{client}: 0x2606ac8 11
2015-08-17 08:50:31.696 openLuup.server:: ...only 247608 bytes sent 7
Aha! So at least it is sending a considerable part of it.

Quote
And this is running in a VM of Ubuntu running on a ESXi server, I will pull it down to my Mac and try later tonight. I do not understand what to change the time out to is less better or more point me to some docs on the internet and I will hack around with it.
OK, so a smoking gun for VMs then.  I would suggest to look at the VM configuration to see if there's a parameter hiding there.

Also, I started looking around the web and found mention of two possibly relevant parameters executionTimeout="90000" maxRequestLength="204800" (also I don't know what system or where to find these)

Typical post here: http://stackoverflow.com/questions/1696117/web-config-maxrequestlength-not-taking-effect (http://stackoverflow.com/questions/1696117/web-config-maxrequestlength-not-taking-effect)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 17, 2015, 12:51:07 pm
Jeff

Another server file to try -it includes the magic incantation:
Code: [Select]
  sock:setoption ("linger", {on = true, timeout = 1})

I've tried it on Debian (which was working anyway) and it doesn't break anything - but does it actually fix anything?

Otherwise, on with the VM parameter search!

Good luck.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 17, 2015, 01:28:08 pm
But, the bridged cameras still do not display images on altUI or on Homewave -- however this does not matter to me since I want to connect openluup directly to the camera and avoid the camera being in vera as my next step, so i do not need to get bridged cameras working.

Cameras work OK for me, see attached...

These are not bridged to a Vera, but created directly on openLuup startup thus:
Code: [Select]
do -- Camera
  local dev = luup.create_device ('', "Camera", "Camera", "D_DigitalSecurityCamera1.xml") 
  local sid = "urn:micasaverde-com:serviceId:Camera1"
  luup.variable_set (sid, "Timeout", "5", dev)
  luup.variable_set (sid, "URL", "/your_snapshot_url_goes_here", dev)
  luup.variable_set (sid, "DirectStreamingURL", "/your_direct_streaming_url_goes_here", dev)
end

This is as simple as it gets - I've no way of testing presets or the like.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on August 24, 2015, 02:50:20 am
Cameras work OK for me, see attached...


@akbooer Even if i remove the cameras and the Vera Bridge devices from startup.lua i still get the "Waiting Initial Data" in ALTUI. That said, ALTUI seems to be working ok as far as i can tell. Should I be concerned, or should i ignore the error and get on with instantiating plugins?

Here is by LuaUPnP.log ALTUI entries (with the cameras and vera bridge commented out of startup.lua):

Code: [Select]
mda$ grep ALT LuaUPnP.log
2015-08-23 23:40:13.012   luup.create_device:: [3] D_ALTUI.xml / I_ALTUI.xml
2015-08-23 23:40:13.012   luup.attr_set:: 3.device_json = D_ALTUI_UI7.json
2015-08-23 23:40:13.012   luup_log:3: ALTUI: initstatus(3) starting version: v0.65
2015-08-23 23:40:13.021   luup.register_handler:3: global_function_name=myALTUI_Handler, request=lr_ALTUI_Handler
2015-08-23 23:40:14.352   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2015-08-23 23:40:14.352   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalHome was: EMPTY now: /port_3480/data_request?id=lr_ALTUI_Handler&command=home #hooks:0
2015-08-23 23:40:14.352   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.PluginConfig was: EMPTY now: {"urn:schemas-micasaverde-com:device:PowerMeter:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:SmokeSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawSmoke","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-a-lurker-com:device:InfoViewer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawInfoViewer","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:IPX800:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPX","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-upnp-org:device:IPhoneLocator:1":{"StyleFunc":"ALTUI_IPhoneLocator.getStyle","DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPhone","ScriptFile":"J_ALTUI_iphone.js"},"urn:antor-fr:device:SamsungTVRemote:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHeater","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:CountdownTimer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCountDown","ScriptFile":"J_ALTUI_plugins.js"},"urn:demo-micasaverde-com:device:weather:1":{"DeviceIconFunc":"ALTUI_PluginDisplays.drawWeatherIcon","DeviceDrawFunc":"ALTUI_PluginDisplays.drawWeather","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:DoorLock:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorLock","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DimmableLight:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDimmable","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:altui:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawAltUI","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-micasaverde-com:device:DoorSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorSensor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:HumiditySensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHumidity","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:cplus:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawCanalplus","ControlPanelFunc":"ALTUI_IPhoneLocator.drawCanaplusControlPanel","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:2":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-cd-jackson-com:device:DataMine:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDataMine","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:holidayvirtualswitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawVacation","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:RGBController:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:BinaryLight:1":{"StyleFunc":"ALTUI_PluginDisplays.getStyle","DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:MotionSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMotion","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:TemperatureSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawTempSensor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:PowerMeter:2":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:Heater:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHeater","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:LightSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:WindowCovering:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawWindowCover","ScriptFile":"J_ALTUI_plugins.js"}} #hooks:0
2015-08-23 23:40:14.353   luup_log:3: ALTUI: startup completed
2015-08-23 23:40:16.593   openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=home tcp{client}: 0x7fc99b004828
2015-08-23 23:40:16.593   luup_log:3: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler
2015-08-23 23:40:16.593   luup_log:3: ALTUI: ALTUI_Handler: parameters is: {"command":"home"}
2015-08-23 23:40:16.593   luup_log:3: ALTUI: ALTUI_Handler: outputformat is: null
2015-08-23 23:40:16.594   luup_log:3: ALTUI: getScriptContent(J_ALTUI_plugins.js)
2015-08-23 23:40:16.595   luup_log:3: ALTUI: getScriptContent(J_ALTUI_iphone.js)
2015-08-23 23:40:16.595   luup_log:3: ALTUI: getScriptContent(J_ALTUI_jquery.ui.touch-punch.min.js)
2015-08-23 23:40:16.614   openLuup.server:: /J_ALTUI_utils.js tcp{client}: 0x7fc99b004828
2015-08-23 23:40:16.615   openLuup.server:: /J_ALTUI_verabox.js tcp{client}: 0x7fc99b006a28
2015-08-23 23:40:16.621   openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0x7fc99b8f2e28
2015-08-23 23:40:16.624   openLuup.server:: /J_ALTUI_multibox.js tcp{client}: 0x7fc99b8bd028
2015-08-23 23:40:17.071   openLuup.server:: /luvd/D_ALTUI.xml tcp{client}: 0x7fc99b006a28

and here is /var/log/cmh/LuaUPnP.log:

Code: [Select]
06      08/23/15 23:40:14.352   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mDebugESC[0m was: EMPTY now: 0 #hooks: 0
06      08/23/15 23:40:14.352   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mVersionESC[0m was: EMPTY now: v0.65 #hooks: 0
06      08/23/15 23:40:14.352   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mPresentESC[0m was: EMPTY now: 0 #hooks: 0
06      08/23/15 23:40:14.352   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mRemoteAccessESC[0m was: EMPTY now: https://vera-ui.strongcubedfitness.com/Veralogin.php #hooks: 0
06      08/23/15 23:40:14.352   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mLocalHomeESC[0m was: EMPTY now: /port_3480/data_request?id=lr_ALTUI_Handler&command=home #hooks: 0
06      08/23/15 23:40:14.352   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mThemeCSSESC[0m was: EMPTY now:  #hooks: 0
06      08/23/15 23:40:14.352   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mLocalCDNESC[0m was: EMPTY now:  #hooks: 0
06      08/23/15 23:40:14.352   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mExtraControllerESC[0m was: EMPTY now:  #hooks: 0
06      08/23/15 23:40:14.353   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mPluginConfigESC[0m was: EMPTY now: {"urn:schemas-micasaverde-com:device:PowerMeter:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:SmokeSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawSmoke","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-a-lurker-com:device:InfoViewer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawInfoViewer","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:IPX800:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPX","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-upnp-org:device:IPhoneLocator:1":{"StyleFunc":"ALTUI_IPhoneLocator.getStyle","DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPhone","ScriptFile":"J_ALTUI_iphone.js"},"urn:antor-fr:device:SamsungTVRemote:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHeater","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:CountdownTimer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCountDown","ScriptFile":"J_ALTUI_plugins.js"},"urn:demo-micasaverde-com:device:weather:1":{"DeviceIconFunc":"ALTUI_PluginDisplays.drawWeatherIcon","DeviceDrawFunc":"ALTUI_PluginDisplays.drawWeather","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:DoorLock:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorLock","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DimmableLight:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDimmable","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:altui:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawAltUI","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-micasaverde-com:device:DoorSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorSensor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:HumiditySensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHumidity","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:cplus:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawCanalplus","ControlPanelFunc":"ALTUI_IPhoneLocator.drawCanaplusControlPanel","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:2":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-cd-jackson-com:device:DataMine:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDataMine","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:holidayvirtualswitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawVacation","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:RGBController:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:BinaryLight:1":{"StyleFunc":"ALTUI_PluginDisplays.getStyle","DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:MotionSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMotion","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:TemperatureSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawTempSensor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:PowerMeter:2":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:Heater:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHeater","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:LightSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:WindowCovering:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawWindowCover","ScriptFile":"J_ALTUI_plugins.js"}} #hooks: 0
06      08/23/15 23:40:14.353   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ESC[35;1mVersionESC[0m was: v0.65 now: v0.65 #hooks: 0

Thanks!

ps: i have been able to get the direct openluup cameras to work in ALTUI but not in HomeWave (hopefully Homewave will soon support direct cameras so we do not need to debug this any further.)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 24, 2015, 02:57:28 am
What browser are you using? Can you try a different one?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on August 24, 2015, 03:00:44 am
What browser are you using? Can you try a different one?

Same error on Safari and Chrome (Mac), but as i said above it does appear to be working ok i think.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 24, 2015, 05:11:32 am
Well, your startup log looks incomplete.  The one at /var/log/cmh/ is merely a formatted subset of variables and scenes for ALTUI's benefit.  I've just logged the following with ALTUI as the only device configured.
Code: [Select]
2015-08-24 10:05:25.878   openLuup.scheduler:: starting
2015-08-24 10:05:25.878   openLuup.scheduler:3: device startup
2015-08-24 10:05:25.878   luup_log:3: ALTUI: initstatus(3) starting version: v0.67
2015-08-24 10:05:25.891   luup.register_handler:3: global_function_name=myALTUI_Handler, request=lr_ALTUI_Handler
2015-08-24 10:05:25.891   openLuup.scheduler:3: device startup completed: status=nil, msg=nil, name=nil
2015-08-24 10:05:26.901   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2015-08-24 10:05:26.901   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Debug was: EMPTY now: 0 #hooks:0
2015-08-24 10:05:26.901   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: EMPTY now: v0.67 #hooks:0
2015-08-24 10:05:26.901   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Present was: EMPTY now: 0 #hooks:0
2015-08-24 10:05:26.901   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.RemoteAccess was: EMPTY now: https://vera-ui.strongcubedfitness.com/Veralogin.php #hooks:0
2015-08-24 10:05:26.901   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalHome was: EMPTY now: /port_3480/data_request?id=lr_ALTUI_Handler&command=home #hooks:0
2015-08-24 10:05:26.901   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.ThemeCSS was: EMPTY now:  #hooks:0
2015-08-24 10:05:26.901   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalCDN was: EMPTY now:  #hooks:0
2015-08-24 10:05:26.902   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.ExtraController was: EMPTY now:  #hooks:0
2015-08-24 10:05:26.903   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.PluginConfig was: EMPTY now: {"urn:schemas-upnp-org:device:Heater:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawHeater"},"urn:schemas-rts-services-com:device:ProgramLogicEG:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawPLEG"},"urn:antor-fr:device:SamsungTVRemote:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight"},"urn:schemas-upnp-org:device:BinaryLight:1":{"ScriptFile":"J_ALTUI_plugins.js","StyleFunc":"ALTUI_PluginDisplays.getStyle","DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight"},"urn:schemas-micasaverde-com:device:TemperatureSensor:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawTempSensor"},"urn:schemas-cd-jackson-com:device:DataMine:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawDataMine"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:2":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera"},"urn:schemas-micasaverde-com:device:SmokeSensor:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawSmoke"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera"},"urn:schemas-micasaverde-com:device:DoorSensor:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorSensor"},"urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawZoneThermostat"},"urn:schemas-upnp-org:device:IPX800:1":{"ScriptFile":"J_ALTUI_iphone.js","DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPX"},"urn:schemas-upnp-org:device:IPhoneLocator:1":{"ScriptFile":"J_ALTUI_iphone.js","StyleFunc":"ALTUI_IPhoneLocator.getStyle","DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPhone"},"urn:schemas-futzle-com:device:CountdownTimer:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawCountDown"},"urn:schemas-upnp-org:device:RGBController:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight"},"urn:schemas-futzle-com:device:holidayvirtualswitch:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawVacation"},"urn:schemas-micasaverde-com:device:HumiditySensor:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawHumidity"},"urn:schemas-a-lurker-com:device:InfoViewer:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawInfoViewer"},"urn:schemas-micasaverde-com:device:PowerMeter:2":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter"},"urn:schemas-micasaverde-com:device:DoorLock:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorLock"},"urn:schemas-micasaverde-com:device:PowerMeter:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter"},"urn:schemas-micasaverde-com:device:WindowCovering:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawWindowCover"},"urn:schemas-micasaverde-com:device:MotionSensor:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawMotion"},"urn:schemas-upnp-org:device:DimmableLight:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawDimmable"},"urn:schemas-upnp-org:device:altui:1":{"ScriptFile":"J_ALTUI_iphone.js","DeviceDrawFunc":"ALTUI_IPhoneLocator.drawAltUI"},"urn:demo-micasaverde-com:device:weather:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceIconFunc":"ALTUI_PluginDisplays.drawWeatherIcon","DeviceDrawFunc":"ALTUI_PluginDisplays.drawWeather"},"urn:schemas-upnp-org:device:cplus:1":{"ScriptFile":"J_ALTUI_iphone.js","ControlPanelFunc":"ALTUI_IPhoneLocator.drawCanaplusControlPanel","DeviceDrawFunc":"ALTUI_IPhoneLocator.drawCanalplus"},"urn:schemas-micasaverde-com:device:LightSensor:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_PluginDisplays.drawLight"}} #hooks:0
2015-08-24 10:05:26.903   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: v0.67 now: v0.67 #hooks:0
2015-08-24 10:05:26.903   luup.set_failure:3: status = 0
2015-08-24 10:05:26.903   luup_log:3: ALTUI: startup completed

This is without an ALTUI window opened in the browser.  If you then go to http://<VeraIP>:3480/data_request?id=lr_ALTUI_Handler&command=home#

Code: [Select]
2015-08-24 10:06:51.244   openLuup.server:: new client connection: tcp{client}: 0x4276c8
2015-08-24 10:06:51.316   openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=home tcp{client}: 0x4276c8
2015-08-24 10:06:51.316   luup_log:3: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler
2015-08-24 10:06:51.316   luup_log:3: ALTUI: ALTUI_Handler: parameters is: {"command":"home"}
2015-08-24 10:06:51.316   luup_log:3: ALTUI: ALTUI_Handler: outputformat is: null
2015-08-24 10:06:51.318   luup_log:3: ALTUI: getScriptContent(J_ALTUI_plugins.js)
2015-08-24 10:06:51.331   luup_log:3: ALTUI: getScriptContent(J_ALTUI_iphone.js)
2015-08-24 10:06:51.333   luup_log:3: ALTUI: getScriptContent(J_ALTUI_jquery.ui.touch-punch.min.js)
2015-08-24 10:06:51.341   openLuup.server:: request completed (69211 bytes, 24 ms) tcp{client}: 0x4276c8
2015-08-24 10:06:51.878   openLuup.server:: /J_ALTUI_utils.js tcp{client}: 0x4276c8
2015-08-24 10:06:51.891   openLuup.server:: request completed (33527 bytes, 13 ms) tcp{client}: 0x4276c8
2015-08-24 10:06:51.891   openLuup.server:: new client connection: tcp{client}: 0x1de420
2015-08-24 10:06:51.892   openLuup.server:: new client connection: tcp{client}: 0x1dc2e8
2015-08-24 10:06:51.892   openLuup.server:: new client connection: tcp{client}: 0x1c7020
2015-08-24 10:06:51.892   openLuup.server:: /J_ALTUI_verabox.js tcp{client}: 0x1de420
2015-08-24 10:06:51.892   openLuup.server:: /J_ALTUI_multibox.js tcp{client}: 0x1dc2e8
2015-08-24 10:06:51.892   openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0x1c7020
2015-08-24 10:06:51.899   openLuup.server:: request completed (89086 bytes, 6 ms) tcp{client}: 0x1de420
2015-08-24 10:06:51.900   openLuup.server:: request completed (26293 bytes, 7 ms) tcp{client}: 0x1dc2e8
2015-08-24 10:06:51.916   openLuup.server:: request completed (385725 bytes, 24 ms) tcp{client}: 0x1c7020
2015-08-24 10:06:52.397   openLuup.server:: /data_request?id=user_data&output_format=json&DataVersion=407125042&_=1440407211897 tcp{client}: 0x1c7020
2015-08-24 10:06:52.402   openLuup.server:: request completed (18923 bytes, 4 ms) tcp{client}: 0x1c7020
2015-08-24 10:06:52.417   openLuup.server:: /data_request?id=variableget&DeviceNum=0&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&Variable=Mode&_=1440407211901 tcp{client}: 0x1c7020
2015-08-24 10:06:52.417   openLuup.server:: request completed (1 bytes, 0 ms) tcp{client}: 0x1c7020
2015-08-24 10:06:52.454   openLuup.server:: /luvd/D_ALTUI.xml tcp{client}: 0x1de420
2015-08-24 10:06:52.454   openLuup.server:: /luvd/D_ZWaveNetwork.xml tcp{client}: 0x1c7020
2015-08-24 10:06:52.455   openLuup.server:: request completed (1086 bytes, 1 ms) tcp{client}: 0x1de420
2015-08-24 10:06:52.455   openLuup.HTTP.FILE:: file not found:D_ZWaveNetwork.xml
2015-08-24 10:06:52.455   openLuup.server:: request completed (0 bytes, 1 ms) tcp{client}: 0x1c7020
2015-08-24 10:06:54.475   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=1&Timeout=60&MinimumDelay=1500&_=1440407211902 tcp{client}: 0x1c7020
2015-08-24 10:06:55.993   openLuup.server:: request completed (6473 bytes, 1517 ms) tcp{client}: 0x1c7020
2015-08-24 10:06:56.105   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=407125057&Timeout=60&MinimumDelay=1500&_=1440407211903 tcp{client}: 0x1c7020

This is a test worth copying and comparing results.

As an aside, what processor are you running on?  5 cameras with 50% load - I have no idea whether this is good or bad.  Is this with the Blue Iris plugin, or just the cameras?  Anyway, delighted that this works for you.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 24, 2015, 05:20:00 am
ps: i have been able to get the direct openluup cameras to work in ALTUI but not in HomeWave (hopefully Homewave will soon support direct cameras so we do not need to debug this any further.)

Just noticed this PS!  Yes, I would expect that - I have not yet implemented the request_image call that HomeWave uses... mostly because I don't know what format to use for the image.  Fortunately, regular camera operations don't use this.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on August 31, 2015, 12:55:46 pm
Here are the files for Release 4.

Release 4 is a very extensive (but not complete) implementation of Luup, and includes a set of features which are generally sufficient to run a number of standard plugins on any machine (Unix or Windows) that can run Lua.  The biggest change from the previous release is support for device persistence. This has been necessary since a number of plugins (not least, MySensors) require it for their successful configuration.

This version runs a wide variety of plugins, but most notably the MySensors Gateway (www.MySensors.org) connecting by ethernet to an Arduino Gateway and a whole world of non-Zwave, but radio-linked homebrew sensors.  It also includes the VeraBridge plugin to monitor and control remote Veras for all your Zwave requirements.  Of course, it also runs the fabulous ALTUI user interface plugin by @amg0.

Also attached are a couple of screen shots showing:
Keen, as ever, to hear feedback: good or bad.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: mvader on September 01, 2015, 01:03:17 pm
great job.. that's what' I've been waiting for.
please clarify something for me.

if i have a scene in vera for example
turn on lights when motion is detected.
the light is controlled by a aeon in wall zwave device.
the motion is on a my sensors sensor running your open luup

if motion is detected on my sensor, it sends a signal back to the ethernet gateway, which then tells openluup/plugin, motion has been detected.

the question then is
will open luup go tell vera, motion has been detected, and thus vera will fire off the scene to turn on the light?

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 01, 2015, 01:59:58 pm
Not automatically.

The VeraBridge does not copy MySensors devices from openLuup to the Vera, so your Vera scene would have no way of telling.

What you'd need is a scene on openLuup triggered by the MySensors device and then sending a request to Vera to run the scene.

All straight-forward, except that I've not yet included scene triggers in openLuup functionality.  I am working on it as we speak - it is the last major missing piece.   You could already, perhaps, use a timer instead of a trigger to poll the MySensors device(s) and fire off the Vera scene if necessary.  Run every minute, it might be good enough?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 01, 2015, 03:06:09 pm
You could already, perhaps, use a timer instead of a trigger to poll the MySensors device(s) and fire off the Vera scene if necessary.

Or, even better, use a luup.register_handler callback on openLuup to call the Vera scene the moment that the MySensors detector(s) change state - it's easy.

Title: openLuup - running unmodified plugins on any machine
Post by: mda on September 01, 2015, 09:14:06 pm
@akbooer Do you plan to make the VeraBridge show the native openLuup devices on the vera so it would become easy to trigger scenes on the vera with triggers from the openLuup devices? (that approach would make it pretty easy to migrate plugins from vera to opeluup without having to do too many changes to the scene logic that exists). Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on September 03, 2015, 03:29:09 am
Hi akbooer,

I've in openluup/Datayours some  watched variables with the archive 1d:10y but the single item of the day is at 2 am.

In the startup of openluup I've :

attr ("timezone", "1")

and I'm at GMT+2 now.

The time of the system (Rpi) is correct.

Have you any idea?

tnks

donato

 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 03, 2015, 04:50:30 am
Do you plan to make the VeraBridge show the native openLuup devices on the vera so it would become easy to trigger scenes on the vera with triggers from the openLuup devices? (that approach would make it pretty easy to migrate plugins from vera to opeluup without having to do too many changes to the scene logic that exists). Thanks.

I must be missing something here...  the idea is to try and migrate stuff OFF the real Vera.  I suppose if you're using something (say, PLEG) that not going to move over to openLuup, then I can see the reasoning, but an approach could simply be to run VeraBridge on the real Vera and link to anything on openLuup (be careful not to do it both ways, though!)  I've never tried this.  There are some openLuup-specific tricks in VeraBridge, but the intention is that the plugin itself should also be able to run on an actual Vera.
Title: openLuup - running unmodified plugins on any machine
Post by: mda on September 03, 2015, 11:25:41 am
I must be missing something here...

My use case is:

- I have lots of z-wave devices, scenes, and plug ins running on my Vera

- my Vera is unstable

-  I also have several plugins I wish I could use that I can not install on my Vera because they make it even more unstable

- so I want to migrate all (most) of my plug in devices off my Vera onto a pc running OpenLuup to reduce the load on Vera

- since openLuup does not support triggers I can not easily migrate my hundreds of scenes from Vera to openLuup (and migrating all of the scenes would also be time consuming, I don't use pleg)

- so i imagine the easiest path for me is to move the plugins to openLuup and keep the scenes on Vera so triggers (including triggers from plug in devices running on openLuup and from z-wave devices on Vera) can trigger them

If I am not thinking about this right, please fix me ;)

I will try verabridge on my Vera. Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ninux on September 08, 2015, 04:08:18 pm
Hello,

I try to install Release 4 on my Ubuntu server.
When I try http://MyIP:3480/data_request?id=lr_ALTUI_Handler&command=home# I have message No handler

If I try http://MyIP:3480/data_request?id=user_data I have a lots of data from my Vera but it never stop.

Thank you
Ninux
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 08, 2015, 04:21:47 pm
I try to install Release 4 on my Ubuntu server.
When I try http://MyIP:3480/data_request?id=lr_ALTUI_Handler&command=home# I have message No handler
I suspect that you have not installed the ALTUI plugin modules correctly?

Quote
If I try http://MyIP:3480/data_request?id=user_data I have a lots of data from my Vera but it never stop.
It should stop, but it may well be several hundred kilobytes.

If you're following the installation steps, do the LuaUPnP.log and user_data.json files look right ( like the Appendices in the user guide)?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mlavelle42 on September 09, 2015, 09:16:52 pm
Akboor - OpenLuup is interesting. Would you be willing to consider a licensed version? If so please reply with a message. mlavelle42
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mvader on September 10, 2015, 11:31:37 am
Akboor - OpenLuup is interesting. Would you be willing to consider a licensed version? If so please reply with a message. mlavelle42

it's called O P E N
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ninux on September 13, 2015, 09:54:36 am
I suspect that you have not installed the ALTUI plugin modules correctly?
Some ALTUI was missing, now I have not error message, but nothing on page http://myip:3480/data_request?id=lr_ALTUI_Handler&command=home# only page Name VERA AltUI...

http://myip:3480/data_request?id=user_data return all the file correctly.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 13, 2015, 12:14:37 pm
Does the log file give any insights?

The ALTUI startup is quite extensively reported in the log file, showing several distinct phases and the loading of all the JavaScript files, so at least you should see where it's getting stuck.

What machine are you running this on?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 16, 2015, 09:28:42 am
Just wanted to point that that you can now trigger scenes in openLuup - not because of any update I have made, but because of the fabulous work that @amg0 has done on the latest release of ALTUI.  It uses variable watch callbacks to trigger scenes.  This is the method I've been using in my HA code, but now we have a super interface to make it easy for folk other than developers.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mvader on September 16, 2015, 10:40:38 am
very cool.. thanks to you both!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: RichardTSchaefer on September 16, 2015, 07:51:55 pm
Quote
It uses variable watch callbacks to trigger scenes.

Yep that's what device property inputs to PLEG are ... they greatly expand the automation options ... no longer limited to pre-defined triggers.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ctguess on September 17, 2015, 05:58:41 pm
So you have plugins, scenes, and a UI. How long until we can plug in a zwave stick, define our own zwave devices (much in the same way one has to do in OpenHAB) and remove Vera from the equation altogether? 

This is coming from a guy that can get PLEG to work, but not without quite a bit of trouble, so I realize my question may (inadvertently) trivialize some really hard underneath-the-covers work to be done.  It certainly seems like a worthy goal, though.  I've been playing with OpwnHAB a bit and editing sitemaps and item files and it all makes sense, but your combined solution is much easier and way more elegant for the somewhat experienced "layman", in my opinion. 

Of course...compliments to both akbooer and amg0 for amazing work so far
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 17, 2015, 06:15:05 pm
So you have plugins, scenes, and a UI. How long until we can plug in a zwave stick, define our own zwave devices (much in the same way one has to do in OpenHAB) and remove Vera from the equation altogether? 
Yes, it's an obvious next step.  I haven't looked into a USB stick yet - for me, Vera has been that stick, but it would be good to have an alternative. 

Actually, my first alternative has been MySensors (ie. abandoning Zwave altogether) and I have just got a combined Arduino MySensors RF gateway and openLuup running on a single Arduino Yun board (this is a combination of an Arduino 16Mhz micro-controller and a 400Mhz Linux system.)  So in one small package I have a WiFi accessible Vera-like controller and bridge to other sensors.  The Linux processor itself is currently running a configuration managing the MySensors network, two WiFi connected Netatmo systems, the DataYours suite logging key events to a remote NAS, ALTUI, and a remotely bridged Vera with around 70 devices.   

Even with the relative low-power processor the Linux cpu is only running at about 5% loading and the whole system fits in under 10 Mbytes.  Also, unlike Vera, it does not spontaneously reset and has run continuously for many weeks.

It does have a spare USB port too, so room for that stick...
... I have no idea how difficult that might be.  Any experience anyone?

Quote
your combined solution is much easier and way more elegant for the somewhat experienced "layman", in my opinion. 
I wanted an easy transition for existing Vera users (ie. me), because I like Luup (but not UPnP) and Lua.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcsv75 on September 30, 2015, 03:00:41 am
Hi,

I have a raspberry pi with an open z-wave card called Razberry. This is an internal card, not USB. (http://razberry.z-wave.me/).

Do you think this will work with Openluup? I am ready to give it a try but would like know how likely this will work before potentially waisting hours of time on something that will not work anyway.

One more question about the bridge plugin: I currently run 2 vera's in upnp bridge mode. Do I need to remove this bridge mode first before installing the bridge plugin from Openluup/AltUI?

Finally, for an easy installation of Openluup on the rpi, would it be possible to create an SD card image with all necessary files?

Thanks a lot,

Jacques
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 30, 2015, 07:33:53 am
I have a raspberry pi with an open z-wave card called Razberry. This is an internal card, not USB. (http://razberry.z-wave.me/).

Do you think this will work with Openluup? I am ready to give it a try but would like know how likely this will work before potentially waisting hours of time on something that will not work anyway.
No, out of the box, it won't work.

I've taken a look at USB sticks, and the Razberry, and for the most part they seem to support a fairly low-level serial protocol.  There is a Zway library which also supports a higher-level JSON interface, which I think would be the one to use.  But it would be a lot of work, which, for the moment, I'm not considering.  Also, frankly, this is the bit which tends to go wrong with anyone's Zwave implementation, so my current approach of using Vera as the 'stick' seems not so bad.  Vera is well enough behaved if you don't load it with extra plugins, etc., which is what openLuup is all about.

Quote
One more question about the bridge plugin: I currently run 2 vera's in upnp bridge mode. Do I need to remove this bridge mode first before installing the bridge plugin from Openluup/AltUI?
Not if you're happy with it (I never was, or at least not for long.)  You could simply bridge openLuup to your primary machine and it should see all the devices.  However, performance is likely to be better using openLuup's VeraBridge.  Having said that, I do know that 'unbridging' Veras is not totally trivial, so for a start I wouldn't try that yet.

Quote
Finally, for an easy installation of Openluup on the rpi, would it be possible to create an SD card image with all necessary files?
Yes, this is a really good point which I've been considering.  I'm not sure if I'm allowed to include the basic Zwave device files which come with Vera. Also, I must ask @amg0 if I can bundle ALTUI into a distribution like that.  I am currently implementing the auto-update functionality for ALTUI so that you could easily keep it up to date (a necessary thing with the rate at which @amg0 develops code!)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on September 30, 2015, 08:43:04 am
Hi,

First of all thanks a lot for all your efforts.  I do believe your approach is the way to go.  I tried the openluup together with altui but bumped into 2 issues.
FIrst one is that the rooms defined in the startup.lua are not visible and I cannot find a trace of the create rooms in the logs
Second issue is that none of the scenes are created which seems normal as the user_data only contains "scenes":[]
Could it be something is missing in the bridge?

I appreciate all your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 30, 2015, 09:40:54 am
First of all thanks a lot for all your efforts.  I do believe your approach is the way to go. 
Thanks for that!

Quote
I tried the openluup together with altui but bumped into 2 issues.
FIrst one is that the rooms defined in the startup.lua are not visible and I cannot find a trace of the create rooms in the logs
OK.  Need a bit more information here, but I can guess... The startup.lua file is read just once to initialize a new system.  If you're using the openLuup_reload shell script, then supplying startup.lua as a parameter will run it, initializing your system.  If you don't, it will never be read.  Subsequently, any reloads (without that parameter) will not access that file, but just reconstruct the system from the user_data.json file.

So if you never specified that startup file, you'll never have defined any rooms (although VeraBridge should create a room named after the remote Vera and place all the bridged devices into that.)  If you've done any significant customization of the system and don't want to reinitialize, then it's trivial to create the rooms you need, either manually, with a luup call, or using the ALTUI interface.

Quote
Second issue is that none of the scenes are created which seems normal as the user_data only contains "scenes":[]
Could it be something is missing in the bridge?
Scenes are not bridged from the remote machine to the openLuup environment.  The simple reason for this is that all the device numbers are different on the bridged machine and it's not so straight-foward just to take a scene definition and remap all the device numbers (because a scene can be very complex with Lua code, device lookups, ...)  Define new scenes on openLuup (using ALTUI and the variable watch triggers NOT the original Vera style ones.)

Quote
I appreciate all your help
It's quite possible that I've not really addressed your issues, so just ask again if necessary.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on September 30, 2015, 11:12:49 am
Thanks for your reply,

I do use the reload and startup.lua but I have the impression the startup.lua is not loaded.  If I load the startup example file I should see 2 new rooms "upstairs" and "Downstairs" which is not the case.  I run ./openLuup_reload ./startup.lua
This is what I see in the log
2015-09-30 16:58:05.345   :: openLuup STARTUP ::
2015-09-30 16:58:05.346   openLuup.init::      version 2015.08.30  @akbooer
2015-09-30 16:58:05.422   openLuup.scheduler:: version 2015.08.23  @akbooer
2015-09-30 16:58:05.424   openLuup.server::    version 2015.08.23  @akbooer
2015-09-30 16:58:05.443   openLuup.scenes::    version 2015.08.30  @akbooer
2015-09-30 16:58:05.452   openLuup.chdev::     version 2015.08.26  @akbooer
2015-09-30 16:58:05.457   openLuup.io::        version 2015.08.15  @akbooer
2015-09-30 16:58:05.458   openLuup.luup::      version 2015.08.26  @akbooer
2015-09-30 16:58:05.479   openLuup.rooms::     version 2015.08.15  @akbooer
2015-09-30 16:58:05.480   openLuup.requests::  version 2015.08.24  @akbooer
2015-09-30 16:58:05.509   luup.create_device:: [1] urn:schemas-micasaverde-com:device:ZWaveNetwork:1 / no-implementation-file
2015-09-30 16:58:05.538   luup.create_device:: [2] urn:schemas-micasaverde-com:device:SceneController:1 / no-implementation-file
2015-09-30 16:58:05.538   openLuup.init:: loading configuration user_data.json
2015-09-30 16:58:05.539   openLuup.init:: loading user_data json...
2015-09-30 16:58:05.564   openLuup.init:: loading rooms...
2015-09-30 16:58:05.564   openLuup.init:: ...room loading completed
2015-09-30 16:58:05.565   openLuup.init:: loading devices...
2015-09-30 16:58:05.565   openLuup.init:: [1] 'ZWave', urn:schemas-micasaverde-com:device:ZWaveNetwork:1
2015-09-30 16:58:05.570   openLuup.init:: [2] '_SceneController', urn:schemas-micasaverde-com:device:SceneController:1

SHould there be an entry when loading the startup.lua?

Thanks for clarifying the scenes.  I was just thinking today it would be nice to have a kind of mapping between the real device ID and a logical name which can be used in the code.  I already had to replace twice a device and it's not funny to search and replace the old device ID all over the code. Maybe an idea for new plugin  :-)

I appreciate your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 30, 2015, 12:06:33 pm
I do use the reload and startup.lua but I have the impression the startup.lua is not loaded. 

OK, my bad, good catch.  Truly embarrassed about this - an error not caught by my extensive (no joking) unit testing.  Some refactoring of the init module  for Release 4 meant that no callback handlers were defined before the startup code was run.  So it WAS run, but those particular luup.inet.wget requests were never run.  Everything else in startup should have worked (eg. device creation, etc.)  Replacement module below...

Quote
Thanks for clarifying the scenes.  I was just thinking today it would be nice to have a kind of mapping between the real device ID and a logical name which can be used in the code.  I already had to replace twice a device and it's not funny to search and replace the old device ID all over the code. Maybe an idea for new plugin  :-)

My solution to this is always to use Lua code in scenes to effect any action.  Then I always use a table lookup to map between device name (which changes rarely) and and device number (which, as you have found, is a moveable feast.)

Please tell me that the new init module works OK.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on September 30, 2015, 01:02:13 pm
and guess what, it's working! Thanks a lot for solving this
I also use lua code in my scenes but how do you use the device name?  For example the call_action command expects an ID not a name
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },75)
I use this to act on motion sensors.  My experience is that the call_action works much faster than using the gui to select the action on the device

I appreciate your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 30, 2015, 01:19:16 pm
and guess what, it's working! Thanks a lot for solving this
Thank you for finding the error!

Quote
I also use lua code in my scenes but how do you use the device name?  For example the call_action command expects an ID not a name
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },75)
I use this to act on motion sensors.  My experience is that the call_action works much faster than using the gui to select the action on the device

I have some generic code in my Startup Lua (the one that is run each time, NOT the openLuup startup.lua !!)
Code: [Select]

-- generic reverse lookup table constructor for element table.field
function lookupTable (table, field)
field = field or "description" -- default field name
local lookup = {} 
for i,d in pairs (table) do  -- create the lookup table
lookup [d[field] ] = i
end
return lookup
end

-- deviceNo (deviceName) returns matching device number
function deviceNo (name)
    deviceLookupTable = deviceLookupTable or lookupTable (luup.devices)
return deviceLookupTable[name]
end

-- sceneNo (sceneName) returns matching scene number
function sceneNo (name)
    sceneLookupTable = sceneLookupTable or lookupTable (luup.scenes)
return sceneLookupTable[name]
end

this enables me to use:
Code: [Select]
local devNo = deviceNo "myDeviceName"
local scnNo = sceneNo  "mySceneName"

You might also care to look at this post from a while ago: Object-oriented get/set of Luup device variables (http://forum.micasaverde.com/index.php/topic,15138.msg115045.html#msg115045) which lets you write stuff like:
Code: [Select]
t = OutDoorTemp:get()
Temp:set(42)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on September 30, 2015, 02:06:22 pm
wow, respect! that's exactly what I was looking for.
I'm not at the point of writing my own plugin but all my scenes are running mostly luup code so this is realy a very big help.
One more question, I just checked and find out the plugins screen is only showing the three default plugins(altui,verbridge and zwavenetwork) is that a normal behaviour?

Thanks again
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 30, 2015, 03:38:20 pm
wow, respect! that's exactly what I was looking for.
Happy to be of help.

Quote
I'm not at the point of writing my own plugin but all my scenes are running mostly luup code so this is realy a very big help.
Plugins are very over-rated, especially with all the UPnP nonsense.  In fact, in openLuup you can get away without that stuff.  Only use a device if you really need a device.  So often you don't.

Quote
One more question, I just checked and find out the plugins screen is only showing the three default plugins(altui,verbridge and zwavenetwork) is that a normal behaviour?
Yes, that's fine. You've quickly discovered another shortcoming... I've not yet populated any of the plugin stuff.  There's very little point, since I can't download anything from the MiOS App Store.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcsv75 on September 30, 2015, 03:38:35 pm

Quote
I've taken a look at USB sticks, and the Razberry, and for the most part they seem to support a fairly low-level serial protocol.  There is a Zway library which also supports a higher-level JSON interface, which I think would be the one to use.  But it would be a lot of work, which, for the moment, I'm not considering.  Also, frankly, this is the bit which tends to go wrong with anyone's Zwave implementation, so my current approach of using Vera as the 'stick' seems not so bad.  Vera is well enough behaved if you don't load it with extra plugins, etc., which is what openLuup is all about.

That makes sense so I will start using my vera as a zwave stick -:)

Quote
Not if you're happy with it (I never was, or at least not for long.)  You could simply bridge openLuup to your primary machine and it should see all the devices.  However, performance is likely to be better using openLuup's VeraBridge.  Having said that, I do know that 'unbridging' Veras is not totally trivial, so for a start I wouldn't try that yet.

I will go ahead try to 'un-bridge' my vera's. I am not too happy with how this works currently anyway. Too many empty device icons.

Quote
Yes, this is a really good point which I've been considering.  I'm not sure if I'm allowed to include the basic Zwave device files which come with Vera. Also, I must ask @amg0 if I can bundle ALTUI into a distribution like that.  I am currently implementing the auto-update functionality for ALTUI so that you could easily keep it up to date (a necessary thing with the rate at which @amg0 develops code!)

Thanks, I am looking forward to that.

Cheers,

Jacques
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on September 30, 2015, 04:39:32 pm
See this post http://forum.micasaverde.com/index.php/topic,14083.msg106548.html#msg106548 and the linked ones re. unbridging.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 01, 2015, 10:04:55 am
This is wonderful!!!! :D :D :D

I do have a few doubts/questions.

After following the documentation on the PDF file I'm experiencing the following.

- ALTUI can only be access it from localhost (the machine that is running openLuup)
- ALTUI Show the vera that has been configured in the startup.lua at the bottom of the left column and all the device are listed on the right but interacting does not do anything.
- ALTUI show at the bottom a message that reads "lua5.1 openLuup/init.lua reset"

What could I be missing?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 01, 2015, 11:31:24 am
This is wonderful!!!! :D :D :D
Steady on... have you tried it yet ??   ;)

Quote
I do have a few doubts/questions.
Ah, here we go...

Quote
- ALTUI can only be access it from localhost (the machine that is running openLuup)
ALTUI brings remote access capabilities - although I've never used it myself.

Quote
- ALTUI Show the vera that has been configured in the startup.lua at the bottom of the left column and all the device are listed on the right but interacting does not do anything.
Sorry, don't understand this fully.  You're talking about VeraBridge?  The 'left column' is, in fact, a list of rooms (VeraBridge makes a room for each remote machine's devices)  Interacting (eg. switch on/off) with the bridged devices should, certainly, work - that's the whole point of the bridge.

Quote

- ALTUI show at the bottom a message that reads "lua5.1 openLuup/init.lua reset"
Don't quite follow this either - 'at the bottom' of what?  That command is, indeed, the one which should do a 'factory reset' of the current configuration, but where/why you're seeing this I don't know.

Perhaps a slightly more enumerated description of when these things happen along with some screen shots??  Might help.

-----

Having re-read the above before posting, I'm wondering if the problem is that you're not using the openLuup_reload script, which contains a loop to restart after each Luup reload command (which may happen on startup depending on which plugins you have - VeraBridge included.)  In the absence of that script, then openLuup will only run once through part of the setup process for plugins and then exit.  Obviously, in that case, no interaction with devices will happen, since openLuup is not running any more.

Am I any closer to an explanation?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 01, 2015, 12:21:36 pm
I'm sorry for being so brief.

I will try to be more specific this time.

first I reset the engine by executing:

sudo lua5.1 openLuup/init.lua reset

I have modified a little bit startup.lua to start testing:

Code: [Select]
-- Example startup.lua

do -- define top-level attributes required to personalise the installation 
  local attr = luup.attr_set

  attr ("City_description", "Miami")
  attr ("Country_description", "UNITED STATES")
  attr ("KwhPrice", "0.13")
  attr ("PK_AccessPoint", "88800127")   -- TODO: use machine serial number?
  attr ("Region_description", "USA")
  attr ("TemperatureFormat", "F")

  attr ("currency", "$")
  attr ("date_format", "mm/dd/yy")
  attr ("latitude", "25.7753")
  attr ("longitude", "-80.2089")
  attr ("model", "Ctrlable Brain")
  attr ("timeFormat", "24hr")
  attr ("timezone", "0")
end

do -- create rooms (strangely, there's no Luup command to do this directly)
 local function room(n)
   luup.inet.wget ("127.0.0.1:3480/data_request?id=room&action=create&name="..n)
 end
  room "Kichen"                 -- these are persistent across restarts
  room "Living_Room"
end

do -- ALTUI
  local dev = luup.create_device ('', "ALTUI", "ALTUI", "D_ALTUI.xml")
end

--do -- ARDUINO     
--  local dev = luup.create_device ('', "Arduino", "Arduino", "D_Arduino1.xml")       
--  luup.ip_set ("172.16.42.21", dev)       -- your Arduino gateway IP address 
--end

do -- the VERA BRIDGE !!
  local dev = luup.create_device ('', "Vera", "Vera", "D_VeraBridge.xml")
  luup.ip_set ("10.10.10.224", dev)         -- set remote Vera IP address
end

-- set up whatever Startup Lua code you normally need here
luup.attr_set ("StartupCode", [[

luup.log "Hello from my very own startup code"

]])

-----------

I start the engine executing the following command from within the /etc/cmh-ludl/

sudo ./openLuup_reload startup.lua

and the terminal returns:

device 3 'ALTUI' requesting reload
device 4 'Vera' requesting reload

I assume this is all good....

I have tailed the /var/log/cmh/LuaUPnp.log and it shows the following which seems good to my eyes:

Code: [Select]
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 103 service: urn:micasaverde-com:serviceId:DoorLock1 variable: ^[[35;1mNumSchedules^[[0m was: EMPTY now: 7,1 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 105 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 106 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 107 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 108 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 109 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 110 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 111 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 112 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 113 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:38.565   Device_Variable::m_szValue_set device: 114 service: urn:micasaverde-com:serviceId:HaDevice1 variable: ^[[35;1mConfigured^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:39.066   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mDebug^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:39.066   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mVersion^[[0m was: EMPTY now: v0.84 #hooks: 0
06      10/01/15 12:06:39.067   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mPresent^[[0m was: EMPTY now: 0 #hooks: 0
06      10/01/15 12:06:39.067   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mRemoteAccess^[[0m was: EMPTY now: https://vera-ui.strongcubedfitness.com/Veralogin.php #hooks: 0
06      10/01/15 12:06:39.067   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mLocalHome^[[0m was: EMPTY now: /port_3480/data_request?id=lr_ALTUI_Handler&command=home #hooks: 0
06      10/01/15 12:06:39.067   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mThemeCSS^[[0m was: EMPTY now:  #hooks: 0
06      10/01/15 12:06:39.067   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mExtraController^[[0m was: EMPTY now:  #hooks: 0
06      10/01/15 12:06:39.067   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mLocalCDN^[[0m was: EMPTY now:  #hooks: 0
06      10/01/15 12:06:39.067   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mLocalBootstrap^[[0m was: EMPTY now:  #hooks: 0
06      10/01/15 12:06:39.068   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mPluginConfig^[[0m was: EMPTY now: {"urn:schemas-micasaverde-com:device:PowerMeter:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:CombinationSwitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCombinationSwitch","ScriptFile":"J_ALTUI_plugins.js"},"urn:richardgreen:device:VeraAlert:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawVeraAlerts","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:UPnPProxy:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPnPProxy","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:Heater:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHeater","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawZoneThermostat","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:DoorLock:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorLock","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:DoorSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorSensor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-rts-services-com:device:ProgramLogicTS:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawProgLogicTimerSwitch","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:RGBController:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:PowerMeter:2":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:IPX800:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPX","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-arduino-cc:device:arduino:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMySensors","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:Sonos:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawSonos","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:2":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:MotionSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMotion","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:TempLeakSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawTempLeak","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-rts-services-com:device:ProgramLogicEG:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPLEG","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-cd-jackson-com:device:SystemMonitor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawSysMonitor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-rts-services-com:device:DayTime:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDayTime","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:VSwitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawVswitch","ScriptFile":"J_ALTUI_plugins.js"},"urn:demo-micasaverde-com:device:weather:1":{"DeviceIconFunc":"ALTUI_PluginDisplays.drawWeatherIcon","DeviceDrawFunc":"ALTUI_PluginDisplays.drawWeather","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:IPhoneLocator:1":{"StyleFunc":"ALTUI_IPhoneLocator.getStyle","DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPhone","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-utz-com:device:GCal:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawGCal","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:VContainer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMultiString","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:altui:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawAltUI","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-micasaverde-com:device:HumiditySensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHumidity","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:SmokeSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawSmoke","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-a-lurker-com:device:InfoViewer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawInfoViewer","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-cd-jackson-com:device:DataMine:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDataMine","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:CountdownTimer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCountDown","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:holidayvirtualswitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawVacation","ScriptFile":"J_ALTUI_plugins.js"},"urn:antor-fr:device:SamsungTVRemote:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DimmableLight:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDimmable","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:cplus:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawCanalplus","ControlPanelFunc":"ALTUI_IPhoneLocator.drawCanaplusControlPanel","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-micasaverde-com:device:TemperatureSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawTempSensor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:BinaryLight:1":{"StyleFunc":"ALTUI_PluginDisplays.getStyle","DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:LightSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:WindowCovering:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawWindowCover","ScriptFile":"J_ALTUI_plugins.js"}} #hooks: 0
06      10/01/15 12:06:39.068   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mVersion^[[0m was: v0.84 now: v0.84 #hooks: 0
06      10/01/15 12:06:39.068   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: ^[[35;1mVariablesToWatch^[[0m was: EMPTY now:  #hooks: 0

When I access ALTUI from my laptop like this:

server_ip:3480/data_request?id=lr_ALTUI_Handler&command=home#
I get a blank page.

But if I access it from the actual machine that is running openLuup engine like this

127.0.0.1:3480/data_request?id=lr_ALTUI_Handler&command=home# then the ALTUI interface shows up but I can't interact with any of the devices being pulled by the verabridge.

At the bottom it also show a "Waiting for initial data"

attaached is a screenshot

The http://server_ip:3480/data_request?id=user_data seems incomplete while being access from a remote browser but when accessed from the server running the openLuup engine is complete so I decided to start accessing my tryouts on the machine running the engine and once I can figure everything out then find out the rest.

Hope this helps to explain a little better my situation.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 01, 2015, 01:36:42 pm
All very helpful.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 01, 2015, 08:39:22 pm
- The openluup engine is running on Ubuntu 14.04 and is not a Virtual Machine.

- Is there something I could do try to solve the "Waiting for initial data"?

- The log file "/etc/cmh-ludl/LuaUPnP.log" is attached :

- I have to use sudo since I'm not logging this machine as root.

- I've tried refreshing the browser many times but I just tried to reload loa from the ALTUI and I was able to partially control some device (Turn Off some binary light switches) But that was it. Dimmer switches did not work not thermostats etc. so progress... I guess...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 02, 2015, 08:25:26 am
Hi,
I created a few scenes for testing and after restart(reload) all the scenes disappeared. Also the startup code was not updated.  What am I doing wrong?

Thanks for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 02, 2015, 10:00:19 am
My apologies, the startup code was indeed updated after a few minutes, forgot to wait 6 minutes:-)
It seems scenes info is not saved in the user_data

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 02, 2015, 10:11:47 am
@delle

OK, now I'm really confused.

Indeed, there is a six minute update to checkpoint the current state to user_data.json.  Perhaps this is what you mean by startup code?

However, the state should also be saved just before a restart and also an exit generated through the relevant HTTP request.  Scene data is included in that state.

If, on the other hand, you run openLuup_reload with the startup.lua parameter (or the reset keyword) then everything is reset.  If you kill the process, then of course you may lose some state information too.


Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 02, 2015, 10:23:14 am
OK my fault.  I confirm the info is saved in the user_data.json even after an exit.  But indeed I use a reload startup.lua as default so...
What if we have to load the startup.lua again?(eg startup code)  Is there a way to add the info from user_data?

Thanks for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 02, 2015, 11:05:17 am
But indeed I use a reload startup.lua as default so...
Can you expand on your scenario for this a little bit?  I'm struggling to see why you need to revert to startup... it's not an option you have on Vera at all!!  Maybe there is an alternative way to achieve what you need.

Quote
What if we have to load the startup.lua again?(eg startup code)  Is there a way to add the info from user_data?

You're totally at liberty to save any user_data.json file and then use that as a parameter to openLuup_reload, so you can always backup and restore any configuration you like.  In fact, you could probably clone the (uncompressed) user_data from a real Vera, although I've not actually tried this!

Equally, you don't need to be shy about editing the user_data.json file - it's not compressed, and everything is pretty-printed and in alphabetical order.  Scenes appear near the end.  You could just cut and paste.  (On an earlier version I did, in fact, have a separate scenes file, but when I started saving more of the device state it made sense to combine, as in a real Vera.)   The only thing you need to be careful of is that the devices used in the scenes have not been renumbered on your new configuration.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 02, 2015, 12:32:02 pm
- Is there something I could do try to solve the "Waiting for initial data"?

This is something we ran into earlier in this thread, but at that time it seemed confined to VMs.  See a post and linked references here: http://forum.micasaverde.com/index.php/topic,32315.msg245117.html#msg245117.  It might be worth checking the configuration of your TCP buffer lengths.

However, this is something that I am looking further into, but it is tough since we don't share the same hardware or system software and I can't easily reproduce this problem.

If you happen to be an HTTP expert and can tell me how to transparently split an HTTP request response into separate smaller transactions, then I'm all ears!
(or anyone else?)  It does seem to be a message length problem - we investigated timeouts, which is how it's reported - and the files that ALTUI uses are getting longer and longer (blockly is a case in point.)

Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 02, 2015, 03:41:28 pm
Of all the solutions that have been on the table, this is one that has piqued my interest. Going to order some hardware this weekend... Any preferred platform I should install (going on a RPi2) ? Also very interested in the raZberry but I'll hold off until I'm able to get this working first ...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 02, 2015, 03:52:54 pm
Of all the solutions that have been on the table, this is one that has piqued my interest.
You must be desperate... no, hold on, we're talking Vera here... could easily drive you to anything.

Seriously, though, there seem to be lots of more fully developed and supported alternatives?  OpenHAB, Domotique, ... ??  Of course, they're all seriously different from Vera.

Quote
Going to order some hardware this weekend... Any preferred platform I should install (going on a RPi2) ?
It's really quite hardware (and even OS) agnostic.  You just have to be able to install Lua and the LuaSocket library.  I have it running on Mac (OS), BeagleBone Black (Debian), Arduino Yun (OpenWRT) and it should even work on Windows PC (somebody tried it!)

Quote
Also very interested in the raZberry but I'll hold off until I'm able to get this working first ...
Well, of course, if you're going to try that then the RPi is probably the machine of choice.  It's just that I haven't got one.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 02, 2015, 04:57:37 pm
Yeah, got my drinking/spending/life under control. I just can't say the same for Vera and the constant reboots I'm plagued with. But I will honestly say, your first post in this thread sum'd up my feelings exactly. Use Vera as a z-wave controller, utilize pure LUA and run on my own hw/sw platform. Bliss ! So, order is placed and getting lua/socket/sec and 5.1 should be common place for say openWRT.. If all goes well then maybe we just need to hook you up with a pi and a raZ for further development .. I'm totally up for that ! Will be back once I've got everything in hand...

OH and like others have stated, I appreciate the hard work and effort you've put into this....

Of all the solutions that have been on the table, this is one that has piqued my interest.
You must be desperate... no, hold on, we're talking Vera here... could easily drive you to anything.

Seriously, though, there seem to be lots of more fully developed and supported alternatives?  OpenHAB, Domotique, ... ??  Of course, they're all seriously different from Vera.

Quote
Going to order some hardware this weekend... Any preferred platform I should install (going on a RPi2) ?
It's really quite hardware (and even OS) agnostic.  You just have to be able to install Lua and the LuaSocket library.  I have it running on Mac (OS), BeagleBone Black (Debian), Arduino Yun (OpenWRT) and it should even work on Windows PC (somebody tried it!)

Quote
Also very interested in the raZberry but I'll hold off until I'm able to get this working first ...
Well, of course, if you're going to try that then the RPi is probably the machine of choice.  It's just that I haven't got one.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 03, 2015, 08:18:43 am
@ronluna, and any others having a "waiting for data" or incomplete HTTP transfer problem...

Here is an experimental version of the openLuup server module to try and address this issue.

It upgrades the server to HTTP 1.1 and uses chunked transfer encoding for large request responses (in fact, for all messages)

As I mentioned earlier, this is not a problem that I can easily duplicate, but some seem to run into it quite reliably, so I'd be very grateful for any feedback for the efficacy of this.  I'm using it now on my regular openLuup system, and I don't think it's broken anything... but does it fix your problem?

Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 03, 2015, 11:27:53 am
Good Morning @akbooer,

Just finish testing your newly uploaded server.lua which address the "Waiting initial data" msg displayed on the AltUI UI but unfortunately it didn't solve the problem... The message continues to show at the bottom and not all the devices are shown nor are correctly displayed.

I was reviewing the openLuup user guide one more time and section 2 is not very clear and I'd like to know if that might have something to do with this issue.

the user guide recommends to construct a more complete emulation of the Vera environment. So I manually created a directory called /etc/cmh-ludl/ and place the decompressed Release_4 files (attached on one of your previous posts) in there.

Then I created a directory tree called /www/cmh/skins/default/icons/ but I was not sure what icons to throw in there so I copied all the content from the same path in Vera into our newly created directory for the openluup server.

While create the symlink inside  /www/cmh/skins/default/img/devices/ with the command
ln -s /www/cmh/skins/default/icons/device_states I've noticed I was getting a broken symlink so I decided to copy the device_states found on the vera unit on to the openluup server.

This is what made sense to me but I'm not 100% sure if there might be other folders that might be needed to the openluup environment to run as it should.


Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 03, 2015, 12:08:12 pm
Just finish testing your newly uploaded server.lua which address the "Waiting initial data" msg displayed on the AltUI UI but unfortunately it didn't solve the problem... The message continues to show at the bottom and not all the devices are shown nor are correctly displayed.
Well, that's a shame.  On the other hand, it may be diagnostic of this not being the problem at all.  Let's dig further...

Quote
I was reviewing the openLuup user guide one more time and section 2 is not very clear and I'd like to know if that might have something to do with this issue.

the user guide recommends to construct a more complete emulation of the Vera environment. So I manually created a directory called /etc/cmh-ludl/ and place the decompressed Release_4 files (attached on one of your previous posts) in there.
Sorry if the docs are not clear... must try harder.  I understand from the above that /etc/cmh-ludl has all your device .xml, .js, .lua, .json, ... files in it AND a subdirectory called openLuup with all its Lua files there.

Have you run the install checker:
Code: [Select]
lua openLuup_check.lua
Does it give any diagnostic messages?

Quote
Then I created a directory tree called /www/cmh/skins/default/icons/ but I was not sure what icons to throw in there so I copied all the content from the same path in Vera into our newly created directory for the openluup server.

While create the symlink inside  /www/cmh/skins/default/img/devices/ with the command
ln -s /www/cmh/skins/default/icons/device_states I've noticed I was getting a broken symlink so I decided to copy the device_states found on the vera unit on to the openluup server.
Icons are purely decorative, but it's nice to get them right.  Their absence shouldn't cause a problem.  The basic idea here is to somehow construct both the icon directories which are used by UI5 and UI7, in case your plugins are a mixture of both.  You should have:
Code: [Select]
/www/cmh/skins/default/icons/
/www/cmh/skins/default/img/devices/device_states/
both containing exactly the same thing.  If one is a symlink to the other, then fine.  You should be able to access these files through your regular port 80 HTTP server on your target machine with, for example, either or both of
Code: [Select]
http://<VeraIP>/cmh/skins/default/icons/Binary_Light.png
http://<VeraIP>/cmh/skins/default/img/devices/device_states/Binary_Light.png

Quote
This is what made sense to me but I'm not 100% sure if there might be other folders that might be needed to the openluup environment to run as it should.
openLuup itself needs only the current directory and the openLuup subdirectory.  Everything else is really for ALTUI to function correctly.

Aside from running the above check, a copy of the full log file covering the time that you do a refresh of the ALTUI web page followed by selecting the Devices page would be hugely helpful - we'll be looking for incomplete data transfers.  Another thing to check is that you can actually access all the ALTUI .js files manually through the port 3480 server. For example.
Code: [Select]
http://<VeraIP>/J_ALTUI_b_blockly_compressed.js
Check that you receive the complete file by checking the end with a tail of the the actual file.

Let's see if that moves us any further forward.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 03, 2015, 08:04:39 pm
Finally some progress.

I was able to get rid of the "Waiting initial data" msgs by copying all the file that were originally inside the /etc/cmh-ludl/ on vera into the openLuup directory (decompressed). Now ALTUI loads correctly from localhost, although now I'm experiencing some issues with the cameras and displaying some of the devices correctly (some device such locks, sonos etc do not show any of the buttons to be controlled).

I believe you meant http://<VeraIP>:3480/J_ALTUI_b_blockly_compressed.js and yes it loads on localhost but incomplete on any remote browser. maybe it's related to the same isuue while  trying to access ALTUI from a remote browser openluup shows a bunch errors on the logs and the interface won't load.


Code: [Select]
2015-10-03 20:10:08.047   openLuup.server:: request completed (1 bytes, 0 ms) tcp{client}: 0x1df2238
2015-10-03 20:10:15.456   luup.variable_set:4: 13.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 27405 now: 27406 #hooks:0
2015-10-03 20:10:15.457   luup.variable_set:4: 14.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 27426 now: 27427 #hooks:0
2015-10-03 20:10:15.457   luup.variable_set:4: 14.urn:micasaverde-com:serviceId:ZWaveNetwork1.LastPollSuccess was: 1443916920 now: 1443917410 #hooks:0
2015-10-03 20:10:15.471   openLuup.server:: request completed (8828 bytes, 15697 ms) tcp{client}: 0x2db6d58
2015-10-03 20:10:15.491   openLuup.server:: request completed (8828 bytes, 15556 ms) tcp{client}: 0x2db9638
2015-10-03 20:10:15.638   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=916416626&Timeout=60&MinimumDelay=1500&_=1443911397127 tcp{client}: 0x2db6d58
2015-10-03 20:10:15.786   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=916416626&Timeout=60&MinimumDelay=1500&_=1443886464753 tcp{client}: 0x2db9638
2015-10-03 20:10:18.053   openLuup.server:: /data_request?id=variableget&DeviceNum=0&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&Variable=Mode&_=1443886464754 tcp{client}: 0x1df2238
2015-10-03 20:10:18.053   openLuup.server:: request completed (1 bytes, 0 ms) tcp{client}: 0x1df2238
2015-10-03 20:10:20.278   openLuup.server:: new client connection: tcp{client}: 0x28b20c8
2015-10-03 20:10:20.279   openLuup.server:: new client connection: tcp{client}: 0x28af9d8
2015-10-03 20:10:20.280   openLuup.server:: new client connection: tcp{client}: 0x202c668
2015-10-03 20:10:20.280   openLuup.server:: /J_ALTUI_b_blockly_compressed.js tcp{client}: 0x28b20c8
2015-10-03 20:10:20.289   openLuup.server:: error 'timeout' sending 601986 bytes to tcp{client}: 0x28b20c8
2015-10-03 20:10:20.289   openLuup.server:: ...only 27506 bytes sent
2015-10-03 20:10:20.290   openLuup.server:: request completed (601986 bytes, 9 ms) tcp{client}: 0x28b20c8
2015-10-03 20:10:20.521   openLuup.server:: new client connection: tcp{client}: 0x2b585a8
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 04, 2015, 04:16:06 am
@akbooer

I'm running several scenes now with sucess. Coming now to more special devices I tried to run the eventwatcher to have a list a local devices.  When running <openluup_ip>:3480/data_request?id=lr_EventWatcher&report=devices the system returned "no handler"
Any ideas?

Thanks for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 04, 2015, 07:17:53 am
I'm running several scenes now with sucess. Coming now to more special devices I tried to run the eventwatcher to have a list a local devices.  When running <openluup_ip>:3480/data_request?id=lr_EventWatcher&report=devices the system returned "no handler"
Any ideas?

I have run EventWatcher under openLuup in the past, but not recently.  Are there any messages in the LuUPnP.log file in /etc/cmh-ludl ?

Actually, there is very little point in running EventWatcher under openLuup, since the log file(s) are much simpler than on Vera and ALTUI does a fabulour job of listing devices... have you looked under the Misc > Devices menu?  You can sort the devices by clicking on the column head (as in EventWatcher) and extend the flist to the length you need.  Sorting by parent device easily separates local from remote devices.

I will, however, take a further look and try EventWatcher here too.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 04, 2015, 07:38:37 am
I will, however, take a further look and try EventWatcher here too.

..and I have, and it works.  Extract from the log at startup...
Code: [Select]
2015-10-04 12:29:48.555   openLuup.scheduler:111: device startup
2015-10-04 12:29:48.558   luup_log:111: EventWatcher: starting...
2015-10-04 12:29:48.565   luup.variable_get:111: NO SUCH DEVICE: nil
2015-10-04 12:29:48.568   luup.variable_set:111: NO SUCH DEVICE: nil
2015-10-04 12:29:48.573   luup.variable_get:111: NO SUCH DEVICE: nil
2015-10-04 12:29:48.576   luup.variable_set:111: NO SUCH DEVICE: nil
2015-10-04 12:29:48.580   luup.variable_get:111: NO SUCH DEVICE: nil
2015-10-04 12:29:48.586   luup.variable_set:111: NO SUCH DEVICE: nil
2015-10-04 12:29:48.590   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.ServerKeyFile was: EMPTY now: /eventWatcher/EventWatcher.key #$
2015-10-04 12:29:48.595   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.ServerCertificateFile was: EMPTY now: /eventWatcher/EventWatch$
2015-10-04 12:29:48.610   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.Syslog was: EMPTY now:  #hooks:0
2015-10-04 12:29:48.614   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.LogDirectory was: EMPTY now:  #hooks:0
2015-10-04 12:29:48.629   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.WatchCategories was: EMPTY now: THXYSM #hooks:0
2015-10-04 12:29:48.634   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.CacheSize was: EMPTY now: 1000 #hooks:0
2015-10-04 12:29:48.649   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.Debug was: EMPTY now: 0 #hooks:0
2015-10-04 12:29:49.059   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.ExtraVariablesFile was: EMPTY now:  #hooks:0
2015-10-04 12:29:49.125   luup.variable_set:111: 111.urn:akbooer-com:serviceId:EventWatcher1.ExcludeVariablesFile was: EMPTY now:  #hooks:0 
2015-10-04 12:29:49.130   luup_log:111: EventWatcher: defining CLI...
2015-10-04 12:29:49.149   luup_log:111: EventWatcher: Starting Event service...
2015-10-04 12:29:49.153   luup_log:111: EventWatcher: No server socket
2015-10-04 12:29:49.158   luup_log:111: EventWatcher: Starting Watch service...
2015-10-04 12:29:49.174   luup.variable_watch:111: callback=watchBlog, watching=8.urn:micasaverde-com:serviceId:HumiditySensor1.CurrentLevel   
2015-10-04 12:29:49.181   luup.variable_watch:111: callback=watchBlog, watching=9.urn:upnp-org:serviceId:TemperatureSensor1.CurrentTemperature
2015-10-04 12:29:49.185   luup.variable_watch:111: callback=watchBlog, watching=10.urn:micasaverde-com:serviceId:HumiditySensor1.CurrentLevel
2015-10-04 12:29:49.190   luup.variable_watch:111: callback=watchBlog, watching=12.urn:upnp-org:serviceId:TemperatureSensor1.CurrentTemperature

I clearly need to investigate the "NO SUCH DEVICE" error message, but it all seems to be working from a reporting point of view: the links from the control page are all live and produce reports as expected, including my favourite: "Where am I".

I would suggest that you are missing an EventWatcher device file.  You should have:
Code: [Select]
# ls *Event* -l
-rwxr-xr-x    1 root     root         14839 Aug  7 16:44 D_EventWatcher.json
-rwxr-xr-x    1 root     root           761 Aug  7 16:44 D_EventWatcher.xml
-rwxr-xr-x    1 root     root           224 Oct  4 12:28 I_EventWatcher.xml
-rwxr-xr-x    1 root     root         48287 Aug  7 16:44 L_EventWatcher.lua
-rwxr-xr-x    1 root     root         22794 Aug  7 16:44 L_EventWatcher2.lua
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 04, 2015, 07:58:04 am
I was able to get rid of the "Waiting initial data" msgs by copying all the file that were originally inside the /etc/cmh-ludl/ on vera into the openLuup directory (decompressed). Now ALTUI loads correctly from localhost, although now I'm experiencing some issues with the cameras and displaying some of the devices correctly (some device such locks, sonos etc do not show any of the buttons to be controlled).
Makes sense - that's why I asked for a log file during a reload of the Devices page, it should have shown missing device files.  I need to make this more obvious - perhaps a separate error file.

Regarding locks and Sonos, I have neither of these on my system at the moment, so I'm not sure what the device panel rendering in ALTUI is, although I do see some reference to those devices in the default configuration.  If you look on the control panels of those devices individually, is the functionality there?  One thing, also, to check:  the action requests passed to the remote Vera are limited (and listed in the User Guide appendix) and may not support some of these device actions.  I can (and should) fix that.

Quote
I believe you meant http://<VeraIP>:3480/J_ALTUI_b_blockly_compressed.js and yes it loads on localhost but incomplete on any remote browser. maybe it's related to the same isuue while  trying to access ALTUI from a remote browser openluup shows a bunch errors on the logs and the interface won't load.
Yes, that's exactly what I meant - sorry!  And yes, this is definitely the same issue as before.  However, the fact that it runs locally (and correctly for some others) seems to indicate a system configuration problem outside of openLuup.  Its very hard to think of what to do to fix it within the confines of the pure Lua environment.

One thought, though.  Are you absolutely sure that you are using the modified HTTP 1.1 server module?  This has to be put into /etc/cmh-ludl/openLuup/ and NOT into /etc/cmh-ludl/.  A check of the version numbers at the top of the log file after a restart should tell all (or, indeed, looking at the HTTP headers of a browser request to port 3480.  You should see both HTTP 1.1 and Transfer_Encoding: chunked)

Quote

Code: [Select]
2015-10-03 20:10:08.047   openLuup.server:: request completed (1 bytes, 0 ms) tcp{client}: 0x1df2238
2015-10-03 20:10:15.456   luup.variable_set:4: 13.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 27405 now: 27406 #hooks:0
2015-10-03 20:10:15.457   luup.variable_set:4: 14.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 27426 now: 27427 #hooks:0
2015-10-03 20:10:15.457   luup.variable_set:4: 14.urn:micasaverde-com:serviceId:ZWaveNetwork1.LastPollSuccess was: 1443916920 now: 1443917410 #hooks:0
2015-10-03 20:10:15.471   openLuup.server:: request completed (8828 bytes, 15697 ms) tcp{client}: 0x2db6d58
2015-10-03 20:10:15.491   openLuup.server:: request completed (8828 bytes, 15556 ms) tcp{client}: 0x2db9638
2015-10-03 20:10:15.638   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=916416626&Timeout=60&MinimumDelay=1500&_=1443911397127 tcp{client}: 0x2db6d58
2015-10-03 20:10:15.786   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=916416626&Timeout=60&MinimumDelay=1500&_=1443886464753 tcp{client}: 0x2db9638
2015-10-03 20:10:18.053   openLuup.server:: /data_request?id=variableget&DeviceNum=0&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&Variable=Mode&_=1443886464754 tcp{client}: 0x1df2238
2015-10-03 20:10:18.053   openLuup.server:: request completed (1 bytes, 0 ms) tcp{client}: 0x1df2238
2015-10-03 20:10:20.278   openLuup.server:: new client connection: tcp{client}: 0x28b20c8
2015-10-03 20:10:20.279   openLuup.server:: new client connection: tcp{client}: 0x28af9d8
2015-10-03 20:10:20.280   openLuup.server:: new client connection: tcp{client}: 0x202c668
2015-10-03 20:10:20.280   openLuup.server:: /J_ALTUI_b_blockly_compressed.js tcp{client}: 0x28b20c8
2015-10-03 20:10:20.289   openLuup.server:: error 'timeout' sending 601986 bytes to tcp{client}: 0x28b20c8
2015-10-03 20:10:20.289   openLuup.server:: ...only 27506 bytes sent
2015-10-03 20:10:20.290   openLuup.server:: request completed (601986 bytes, 9 ms) tcp{client}: 0x28b20c8
2015-10-03 20:10:20.521   openLuup.server:: new client connection: tcp{client}: 0x2b585a8

You could also edit the chunk size in the server.lua file to something small than the 27506 bytes that failed earlier - perhaps as small as 16000 ? (It's line 220 of that file - current set to 30000)

Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 04, 2015, 08:21:21 am
Thanks for the info. 
I still need to dig into the altui.  And indeed there is an option in altui which shows the devices (More/Devices)
All files for EventWatcher are present. For the startup of EventWatcher I don't have the same info in the logfile though.  The only entry I see is
2015-10-04 14:10:45.724   openLuup.init:: [42] 'Event Watcher', urn:akbooer-com:device:EventWatcher:1

The reason I wanted to know the devices numbers is that I have a problem with a scene where a device is not switched off. Logfile only shows following error
2015-10-03 23:45:00.504   luup_log:4: switchPower
2015-10-03 23:45:00.504   openLuup.context_switch::  ERROR: [string "device_4"]:182: invalid value (nil) at index 7 in table for 'concat'
2015-10-03 23:45:00.505   openLuup.scheduler:: job aborted : [string "device_4"]:182: invalid value (nil) at index 7 in table for 'concat'
I use your way(described in this post) for dynamically finding the deviceNo.  But device 4 seems to be the vera itself

I appreciate your help

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 04, 2015, 09:05:19 am
I still need to dig into the altui.  And indeed there is an option in altui which shows the devices (More/Devices)
Actually, the device numbers show at the top right hand side of each device panel in ALTUI anyway.

Quote
All files for EventWatcher are present. For the startup of EventWatcher I don't have the same info in the logfile though.  The only entry I see is
2015-10-04 14:10:45.724   openLuup.init:: [42] 'Event Watcher', urn:akbooer-com:device:EventWatcher:1
This is just from the initial load of the device.  There should be much more when the scheduler start, further down the log.  Does the Front panel of the device display?  What are the device variables showing?

Quote
The reason I wanted to know the devices numbers is that I have a problem with a scene where a device is not switched off. Logfile only shows following error
2015-10-03 23:45:00.504   luup_log:4: switchPower
2015-10-03 23:45:00.504   openLuup.context_switch::  ERROR: [string "device_4"]:182: invalid value (nil) at index 7 in table for 'concat'
2015-10-03 23:45:00.505   openLuup.scheduler:: job aborted : [string "device_4"]:182: invalid value (nil) at index 7 in table for 'concat'
I use your way(described in this post) for dynamically finding the deviceNo.  But device 4 seems to be the vera itself
If device 4 is, in fact, the VeraBridge plugin, then this is an error in the bridge code itself.  I'll take a look at the code.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 04, 2015, 09:14:51 am
It is an error from the bridge, but it's probably caused by a scene trying to switch a device that does not exist.  I need a better diagnostic message.  One thing to remember is that scenes running on openLuup should be using the device numbering on the openLuup machine NOT those from the original Vera.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 04, 2015, 11:29:05 am
I checked all logfiles but no more info the EventWatcher.  One thing I noticed looking at the variables is the location for the crt and key files.   It seems on vera these files are saved under / eventWatcher and /overlay/eventWatcher.  Should I create these 2 directories and copy over those 2 files?
The device 4 is still a mistery.  SInce I only use your procedure to retrieve local device numbers(deviceNo), they all exist locally
One more question if I may.  Vera uses an alias /port_3480/ as part of the URL to map the port number 3480. Is this also possible with openluup?

Thank you so much for all your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 04, 2015, 12:03:23 pm
I checked all logfiles but no more info the EventWatcher. 
Very odd indeed - what command are you using (or did you use) to create the plugin in the first place?  Does it appear on the UI?  Can I see your startup.lua script?

Quote
One thing I noticed looking at the variables is the location for the crt and key files.   It seems on vera these files are saved under / eventWatcher and /overlay/eventWatcher.  Should I create these 2 directories and copy over those 2 files?
They're totally redundant for EventWatcher in openLuup.  Their normal use is for the SSL connection used by the Alternate Event Server.  openLuup itself, does not generate such calls.  The only possible time you would need it is if you specified you openLuup machine as an Alternate Event Server for a real Vera - not a totally unlikely scenario, but not something (I'm sure) that you're doing at the moment.  My recent test didn't have those files at all.

Quote
The device 4 is still a mistery.
No, it shouldn't be.  It is the VeraBridge plugin itself. 

Quote
SInce I only use your procedure to retrieve local device numbers(deviceNo), they all exist locally
Well the error is definitely generated by a call to a device that VeraBridge can't map to a real one.

Quote
One more question if I may.  Vera uses an alias /port_3480/ as part of the URL to map the port number 3480. Is this also possible with openluup?
No, it isn't.  The /port_3480 syntax is mapped on Vera by the lighttpd server that it uses.  Since you could be running on any OS with any HTTP server I couldn't say how to do it.  You probably CAN get your existing server to do that mapping, but you'd have to work it out for yourself.  Why would you want to do this?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 04, 2015, 12:08:16 pm
@delle

I should add that right at the start of the openLuup LuaUPnP.log file is a numbered list of all the devices currently in the system.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 04, 2015, 02:26:49 pm
Tried from scratch and upgraded ALTUI to latest version.  I'm now missing all my devices(just empty lines).  Scenes are still visible.  The log is showing again the phantom device

2015-10-04 20:09:31.337   luup.chdev.append:4: [123] 101 Power TV Dining
2015-10-04 20:09:31.338   luup.chdev.append:4: [124] _Appliance Module
2015-10-04 20:09:31.338   luup.chdev.append:4: [125] YouLess Energymeter
2015-10-04 20:09:31.339   luup.chdev.append:4: [126] ALTUI
2015-10-04 20:09:31.340   luup.chdev.sync:4: syncing 62 children
2015-10-04 20:09:31.348   luup.create_device:4: [68] urn:schemas-upnp-org:device:altui:1 / no-implementation-file
2015-10-04 20:09:31.348   openLuup.context_switch::  ERROR: ./openLuup/chdev.lua:104: attempt to index field 'device' (a number value)
2015-10-04 20:09:31.349   openLuup.scheduler:: job aborted : ./openLuup/chdev.lua:104: attempt to index field 'device' (a number value)
2015-10-04 20:09:31.851   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2015-10-04 20:09:31.862   luup_log:3: ALTUI: Version upgrade => Reseting Plugin config to default

How can I debug my json file

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 04, 2015, 03:26:35 pm
@delle

Try this fix for the missing devices...
...it's my current development version.

@amg0 develops so quickly, I can't keep up!

Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 04, 2015, 08:30:17 pm
I can't seem to get luasec installed on my Windows 7 machine. (Need it before I can try the iPhone Locator plugin). I seem to be missing the OpenSSL dev version necessary for luarocks to build luasec. Can anyone help point me in the right direction here (i am a noob when it comes to windows dev)? Thanks !


Code: [Select]
C:\Program Files (x86)\Microsoft Visual Studio 14.0>cd ..

C:\Program Files (x86)>cd Lua

C:\Program Files (x86)\Lua>cd 5.1

C:\Program Files (x86)\Lua\5.1>luarocks install luasec
Installing http://luarocks.org/repositories/rocks/luasec-0.5-2.src.rock...
cl /MD /O2 -c -Fosrc/x509.obj -IC:/Program Files (x86)/Lua/5.1/include src/x509.c -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DLUASEC_EXPORTS -DBUFFER_DEBUG -DLUASEC_API=__declspec(dllexport) -Isrc/ -Isrc/luasocket
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

x509.c
src/x509.c(15): fatal error C1083: Cannot open include file: 'openssl/ssl.h': No such file or directory

Error: Build error: Failed compiling object src/x509.obj
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 05, 2015, 01:07:52 am
@akbooer
Thanks for the new version. Unfortunately it didn't help for the devices problem.  I just see empty lines.  What is also weird is that I'm missing a scene when using chrome.  This scene is also the one which is not executed in all cases.
Indeed it must be hard to follow up with amg0.

I appreciate your work
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 05, 2015, 03:30:59 am
Two key requirements for debugging:
Any errors in either?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 05, 2015, 11:47:09 am
I remember having issues setting my Windows system up (it was awhile ago) as well but then I switched over to ZeroBrane and it had the necessary modules. Here's what I have in my dev folder, not sure it will help though. I also included a SSL.dll. 

lmk if that helps...

I can't seem to get luasec installed on my Windows 7 machine. (Need it before I can try the iPhone Locator plugin). I seem to be missing the OpenSSL dev version necessary for luarocks to build luasec. Can anyone help point me in the right direction here (i am a noob when it comes to windows dev)? Thanks !


Code: [Select]
C:\Program Files (x86)\Microsoft Visual Studio 14.0>cd ..

C:\Program Files (x86)>cd Lua

C:\Program Files (x86)\Lua>cd 5.1

C:\Program Files (x86)\Lua\5.1>luarocks install luasec
Installing http://luarocks.org/repositories/rocks/luasec-0.5-2.src.rock...
cl /MD /O2 -c -Fosrc/x509.obj -IC:/Program Files (x86)/Lua/5.1/include src/x509.c -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DLUASEC_EXPORTS -DBUFFER_DEBUG -DLUASEC_API=__declspec(dllexport) -Isrc/ -Isrc/luasocket
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

x509.c
src/x509.c(15): fatal error C1083: Cannot open include file: 'openssl/ssl.h': No such file or directory

Error: Build error: Failed compiling object src/x509.obj
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 05, 2015, 01:24:12 pm
Thanks for the suggestions
the logfile shows
2015-10-05 19:18:02.139   openLuup.server:: request completed (1239743 bytes, 1921 ms) tcp{client}: 0xbeda80
2015-10-05 19:18:03.911   openLuup.server:: /J_ALTUI_utils.js tcp{client}: 0xdb3228
2015-10-05 19:18:03.920   openLuup.server:: request completed (34233 bytes, 9 ms) tcp{client}: 0xdb3228
2015-10-05 19:18:04.015   openLuup.server:: /J_ALTUI_verabox.js tcp{client}: 0xbeda80
2015-10-05 19:18:04.062   openLuup.server:: request completed (98266 bytes, 51 ms) tcp{client}: 0xbeda80
2015-10-05 19:18:04.119   openLuup.server:: /J_ALTUI_multibox.js tcp{client}: 0xdb3228
2015-10-05 19:18:04.125   openLuup.server:: request completed (28606 bytes, 6 ms) tcp{client}: 0xdb3228
2015-10-05 19:18:04.180   openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0xbeda80
2015-10-05 19:18:04.247   openLuup.server:: request completed (411450 bytes, 67 ms) tcp{client}: 0xbeda80
2015-10-05 19:18:05.002   openLuup.server:: /luvd/D_FUP_uuid%205f9ec1b3-ed59-1900-4530-00117FAFD00A.xml tcp{client}: 0xdb3228
2015-10-05 19:18:05.004   openLuup.HTTP.FILE:: file not found:D_FUP_uuid%205f9ec1b3-ed59-1900-4530-00117FAFD00A.xml
2015-10-05 19:18:05.005   openLuup.server:: request completed (0 bytes, 3 ms) tcp{client}: 0xdb3228
2015-10-05 19:18:05.006   openLuup.server:: /luvd/D_YouLess.xml tcp{client}: 0xbeda80
2015-10-05 19:18:05.009   openLuup.HTTP.FILE:: file not found:D_YouLess.xml
2015-10-05 19:18:05.010   openLuup.server:: request completed (0 bytes, 3 ms) tcp{client}: 0xbeda80
2015-10-05 19:18:05.011   openLuup.server:: new client connection: tcp{client}: 0xbccf98
2015-10-05 19:18:05.012   openLuup.server:: new client connection: tcp{client}: 0x9c85d8

I know about the youless device which is not defined on the openluup server, the other device seems weird
The js log shows
SCRIPT5007: Unable to get value of the property 'ui_static_data': object is null or undefined
J_ALTUI_multibox.js, line 106 character 3
not sure but could be linked to the above errors

Thanks

Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 05, 2015, 01:45:15 pm
What is altUI version? I suggest you try the latest as I think this was fixed.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 05, 2015, 02:03:52 pm
Thanks, I'm using AltUI v0.81.744
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 05, 2015, 02:33:43 pm
Thanks, I'm using AltUI v0.81.744
there is a very good chance that latest version fixes the symptom of this. not sure how to upgrade on openluup so here is a version
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 05, 2015, 02:51:21 pm
You guys are incredible. 

The latest version of altui solved my problem and all devices are now visible.
Though I still have the problem when using chrome in that one of the scenes is not shown
js log shows

Font from origin data_request?id=lr_ALTUI_Handler&command=home&lang=en:1 'http://xxx.xxx.xxx.xxx' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://xxx.xxx.xxx.xxx:3480' is therefore not allowed access. The response had HTTP status code 404.
/fonts/glyphicons-halflings-regular.ttf:1 GET http://xxx.xxx.xxx.xxx/fonts/glyphicons-halflings-regular.ttf

Any ideas?

I appreciate both your help
Title: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 05, 2015, 03:25:49 pm
Not sure if openLuup supports this syntax , but proper urn for altUI is /port_3480, otherwise you get cross domain protection issues...

AK ,  potentially a workaround could be to put cors headers in http responses.

 Access-Control-Allow-Origin  *



Envoy? de mon iPad en utilisant Tapatalk
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 05, 2015, 03:45:06 pm
Not sure if openLuup supports this syntax , but proper urn for altUI is /port_3480, otherwise you get cross domain protection issues...

No it doesn't - I mentioned the reasons to @delle, a couple of posts back.

Quote
AK ,  potentially a workaround could be to put cors headers in http responses.

 Access-Control-Allow-Origin  *

Thanks - it's already there in the release 4.5 I posted, I believe.
Easy to tell by inspecting an HTTP header to any 3480 request...
should be both version 1.1 and with that particular header.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 05, 2015, 03:51:38 pm
Reading the OP and my response once again, I see that the problem is the other way around:  you are asking for the port 80 server to put in the header to allow CORS, whereas I have modified the port 3480 do do that.

What you are asking, then, is for a modification of something outside of openLuup, since it depends on the native port 80 server.  I would be fairly sure there is some configuration change you could make to allow this, but exactly how depends on the OS and server that you are using.  In my limited experience (with Mac, Vera, Arduino Yun, and BeagleBone Black) I have come across apache, lighttpd, cloud9, ... servers.  All different.  It also depends on the strictness of the browser?

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 05, 2015, 04:03:37 pm
@delle, further thoughts...

This log segment is interesting:
Code: [Select]
2015-10-05 19:18:02.139   openLuup.server:: request completed (1239743 bytes, 1921 ms) tcp{client}: 0xbeda80
2015-10-05 19:18:03.911   openLuup.server:: /J_ALTUI_utils.js tcp{client}: 0xdb3228
2015-10-05 19:18:03.920   openLuup.server:: request completed (34233 bytes, 9 ms) tcp{client}: 0xdb3228
2015-10-05 19:18:04.015   openLuup.server:: /J_ALTUI_verabox.js tcp{client}: 0xbeda80
2015-10-05 19:18:04.062   openLuup.server:: request completed (98266 bytes, 51 ms) tcp{client}: 0xbeda80
2015-10-05 19:18:04.119   openLuup.server:: /J_ALTUI_multibox.js tcp{client}: 0xdb3228
2015-10-05 19:18:04.125   openLuup.server:: request completed (28606 bytes, 6 ms) tcp{client}: 0xdb3228
2015-10-05 19:18:04.180   openLuup.server:: /J_ALTUI_uimgr.js tcp{client}: 0xbeda80
2015-10-05 19:18:04.247   openLuup.server:: request completed (411450 bytes, 67 ms) tcp{client}: 0xbeda80
2015-10-05 19:18:05.002   openLuup.server:: /luvd/D_FUP_uuid%205f9ec1b3-ed59-1900-4530-00117FAFD00A.xml tcp{client}: 0xdb3228
...I'm keen to know what the previous line was, or at least the item which led to a 1.2Mbyte response.  At the same time it's very encouraging to see that the long transfer length problem seems to have been solved by the chunked transfer mode in the latest server version.

More helpfully, perhaps, this item:
Code: [Select]
D_FUP_uuid%205f9ec1b3-ed59-1900-4530-00117FAFD00A.xml
is UDN syntax, so UPnP origin, but I have absolutely no idea what it refers to.  Strictly speaking, Vera is capable of using UDN in place of device numbers, but I've never seen it happen, and anyway this is a placeholder for a device filename.  openLuup does not do UPnP (so not then, perhaps, a very good name for it!)  Do you actually have anything like that file on your original Vera?  (perhaps not in /etc/cmh-ludl/ but in /etc/cmh/ or elsewhere?)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 05, 2015, 04:47:10 pm
As requested the previous lines from the log

2015-10-05 21:08:43.223   openLuup.server:: /data_request?id=lr_ALTUI_Handler&command=home&lang=en tcp{client}: 0x1f56678
2015-10-05 21:08:43.225   luup_log:3: ALTUI: ALTUI_Handler: request is: lr_ALTUI_Handler
2015-10-05 21:08:43.226   luup_log:3: ALTUI: ALTUI_Handler: parameters is: {"command":"home","lang":"en"}
2015-10-05 21:08:43.226   luup_log:3: ALTUI: ALTUI_Handler: outputformat is: null
2015-10-05 21:08:43.264   luup_log:3: ALTUI: getScriptContent(J_ALTUI_plugins.js)
2015-10-05 21:08:43.268   luup_log:3: ALTUI: getScriptContent(J_ALTUI_iphone.js)
2015-10-05 21:08:43.270   luup_log:3: ALTUI: getScriptContent(J_ALTUI_jquery.ui.touch-punch.min.js)
2015-10-05 21:08:43.272   luup_log:3: ALTUI: getScriptContent(J_ALTUI_b_blockly_compressed.js)
2015-10-05 21:08:43.313   luup_log:3: ALTUI: getScriptContent(J_ALTUI_b_blocks_compressed.js)
2015-10-05 21:08:43.325   luup_log:3: ALTUI: getScriptContent(J_ALTUI_b_en.js)
2015-10-05 21:08:43.336   luup_log:3: ALTUI: getScriptContent(J_ALTUI_b_javascript_compressed.js)
2015-10-05 21:08:43.348   luup_log:3: ALTUI: getScriptContent(J_ALTUI_b_lua_compressed.js)
2015-10-05 21:08:43.361   luup.variable_get:3: NO SUCH DEVICE: nil
2015-10-05 21:08:43.362   luup.variable_set:3: NO SUCH DEVICE: nil
2015-10-05 21:08:45.325   openLuup.server:: request completed (1262539 bytes, 2101 ms) tcp{client}: 0x1f56678

For the UPnP you are right(as always).  I played around adding a rocki device and indeed it has the same ID, didn't thought about that device.  Anyway I'm happy with the actual setup and continue testing the scenes

Thanks for all your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 05, 2015, 04:58:10 pm
Ah yes, the blokly inclusion is the culprit to the long request - thanks for showing that.

Also pleased that you have enough to be going on with.  Hope the system meets your needs.  Don't hesitate to ask for help again.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 06, 2015, 12:16:46 pm
Anyone have a quick method to decompress all the lzop'd files or is this something that has to be performed directly on Vera (e.g. pluto-lzo) ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 06, 2015, 12:41:17 pm
I use the Vera Ui7 (or UI5) menu App > Develop Apps > Luup files and just run down the "download" buttons.  Files arrive uncompressed.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 06, 2015, 01:29:06 pm
Perfect, thanks - love simple solutions...

I use the Vera Ui7 (or UI5) menu App > Develop Apps > Luup files and just run down the "download" buttons.  Files arrive uncompressed.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 07, 2015, 04:10:48 am
@akbooer
I apologise but I need your help again.  None of my scenes seems to work.  Altui shows the the scene ran successfuly but nothing is executed.
In the log I find following
2015-10-07 08:07:07.224   luup.call_action:: 0.urn:micasaverde-com:serviceId:HomeAutomationGateway1.RunScene
2015-10-07 08:07:07.225   luup.call_action:0: 65.urn:upnp-org:serviceId:SwitchPower1.SetTarget
2015-10-07 08:07:07.226   luup.call_action:0: action will be handled by parent: 4
2015-10-07 08:07:07.226   luup.scenes:0: running 2, TV Living ON, initiated by command
2015-10-07 08:07:07.229   openLuup.server:: request completed (111 bytes, 7 ms) tcp{client}: 0x126b9c8
2015-10-07 08:07:07.229   luup_log:4: switchPower
2015-10-07 08:07:07.231   openLuup.context_switch::  ERROR: [string "device_4"]:182: invalid value (nil) at index 7 in table for 'concat'
2015-10-07 08:07:07.231   openLuup.scheduler:: job aborted : [string "device_4"]:182: invalid value (nil) at index 7 in table for 'concat'
2015-10-07 08:07:56.883   openLuup.server:: request completed (1374 bytes, 60079 ms) tcp{client}: 0x1287878

Any idea?

Thanks for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 07, 2015, 07:57:37 am
I apologise but I need your help again.  None of my scenes seems to work.  Altui shows the the scene ran successfuly but nothing is executed.

No need to apologise - good catch!  In fact, I should apologise.  I seem to have handled scene parameters incorrectly (another case of MiOS being hugely inconsistent in the way that things are named and represented, but also of inadequate testing on my part.)

I'm hoping the attached file (to replace the existing one in the openLuup/ subdirectory) should fix things?  If not, another copy of the log would help, but it may need another interim release to fix things properly.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 07, 2015, 08:40:30 am
Unfortunately the new version didn't help.
I attach the complete logfile

Thanks for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 07, 2015, 10:15:42 am
OK.  I hate doing things in a piecemeal fashion, but here's the version of the VeraBridge which I'm currently running (which won't have been updated in all the shenanigans we've been doing to get to this point.)

Can you give this a go? 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 07, 2015, 12:11:15 pm
didn't work neither but please take your time, just let me know when I can test

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 09, 2015, 06:35:33 pm
@AK

Finally had a chance to configure the pi today... Kudos on the documentation, I had a couple of issues but that's because I'm Linux impaired...  Should be able to contribute soon, just need to take this thing home and let it have a stern talk with Vera3 first. I documented all the steps for configuring the rPi2 in the event anyone has questions. I decided on Ubuntu Mate and Lighttpd. So far, no issues with either - everyone seems to be playing nicely.

And some memory stats....

Code: [Select]
cuda@Ubuntu:~$ free -m
             total       used       free     shared    buffers     cached
Mem:           923        412        511         18         29        207
-/+ buffers/cache:        175        748
Swap:            0          0          0
cuda@Ubuntu:~$

Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 12, 2015, 04:45:53 pm
I have a lot of questions but I"ll start with this. So I created a simple scene (test the waters so to speak) and set a timer to run every 5 minutes. The code is Lua whereby it calls my Web Service and gets a Google Drive token. All seemed well, had 3 back-to-back refreshes happening every 5 minutes. I decided to reboot the rPi2. Upon startup (startup executes shell script you provided), the timer kind of lost it's mind.

Code: [Select]
1969-12-31 18:00:18.196   :: openLuup STARTUP ::
1969-12-31 18:00:18.196   openLuup.init::      version 2015.08.30  @akbooer
1969-12-31 18:00:18.289   openLuup.scheduler:: version 2015.08.23  @akbooer
1969-12-31 18:00:18.290   openLuup.server::    version 2015.08.23  @akbooer
1969-12-31 18:00:18.335   openLuup.scenes::    version 2015.08.30  @akbooer
1969-12-31 18:00:18.354   openLuup.chdev::     version 2015.08.26  @akbooer
1969-12-31 18:00:18.361   openLuup.io::        version 2015.08.15  @akbooer
1969-12-31 18:00:18.362   openLuup.luup::      version 2015.08.26  @akbooer
1969-12-31 18:00:18.383   openLuup.rooms::     version 2015.08.15  @akbooer
1969-12-31 18:00:18.383   openLuup.requests::  version 2015.08.24  @akbooer
1969-12-31 18:00:19.427   openLuup.init:: [1] 'ZWave', urn:schemas-micasaverde-com:device:ZWaveNetwork:1
1969-12-31 18:00:19.429   openLuup.init:: [2] '_SceneController', urn:schemas-micasaverde-com:device:SceneController:1
1969-12-31 18:00:19.429   openLuup.init:: [3] 'ALTUI', urn:schemas-upnp-org:device:altui:1
1969-12-31 18:00:19.482   openLuup.init:: [4] 'Remote Vera', urn:schemas-micasaverde-com:device:HomeAutomationGateway:1

-- removed for readability...

1969-12-31 18:00:21.897   luup_log:3: ALTUI: startup completed
1969-12-31 18:00:20.864   openLuup.init:: loading scenes...
1969-12-31 18:00:20.865   openLuup.init:: number of scenes = 1
1969-12-31 18:00:20.866   openLuup.init:: scene#1 'Get Token'
1969-12-31 18:00:20.866   openLuup.init:: ...scene loading completed
1969-12-31 18:00:20.866   openLuup.init:: ...user_data loading completed
1969-12-31 18:00:20.866   openLuup.init:: running Startup Lua
1969-12-31 18:00:20.866   openLuup.init:: startup completed
1969-12-31 18:00:20.868   openLuup.server:: starting HTTP server on 0.0.0.0:3480 tcp{server}: 0x1cecc00
1969-12-31 18:00:20.869   openLuup.scheduler:: starting
1969-12-31 18:00:20.869   openLuup.scheduler:3: device startup
1969-12-31 18:00:20.870   luup_log:3: ALTUI: initstatus(3) starting version: v0.85
1969-12-31 18:00:20.870   openLuup.scheduler:3: device startup completed: status=nil, msg=nil, name=nil
1969-12-31 18:00:20.870   openLuup.scheduler:4: device startup
1969-12-31 18:00:20.870   luup_log:4: VeraBridge
1969-12-31 18:00:20.870   luup_log:4: 2015.08.24   @akbooer
1969-12-31 18:00:20.870   luup_log:4: device_4
1969-12-31 18:00:20.871   luup_log:4: 192.168.{removed}
1969-12-31 18:00:20.882   luup.variable_set:4: 4.urn:akbooer-com:serviceId:VeraBridge1.Devices was: 0 now: 0 #hooks:0
1969-12-31 18:00:20.882   luup.variable_set:4: 4.urn:upnp-org:serviceId:altui1.DisplayLine1 was: 0 devices now: 0 devices #hooks:0
1969-12-31 18:00:20.883   luup.variable_set:4: 4.urn:upnp-org:serviceId:altui1.DisplayLine2 was: 192.168.{removed} now: 192.168{removed} #hooks:0
1969-12-31 18:00:20.887   openLuup.scheduler:4: device startup completed: status=true, msg=OK, name=device_4
1969-12-31 18:00:21.889   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
1969-12-31 18:00:21.894   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: v0.85 now: v0.85 #hooks:0
1969-12-31 18:00:21.894   luup.set_failure:3: status = 0
1969-12-31 18:00:21.894   luup.register_handler:3: global_function_name=myALTUI_Handler, request=lr_ALTUI_Handler
1969-12-31 18:00:21.895   luup.call_action:3: 0.urn:micasaverde-com:serviceId:HomeAutomationGateway1.RunLua
1969-12-31 18:00:21.897   luup.register_handler:0: global_function_name=ALTUI_LuaRunHandler, request=lr_ALTUI_LuaRunHandler
1969-12-31 18:00:21.897   luup_log:3: ALTUI: startup completed
2015-10-12 15:20:38.258   openLuup.heartbeat:: memory used: 7.2Mb, stats: elapsed: 16720.85 days, cpu: 2.188 cpu2: 2.188 sec (0.00%)
2015-10-12 15:20:39.571   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:40.367   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:41.157   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:41.963   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:42.744   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:43.550   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:44.331   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:45.136   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:45.918   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:46.694   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:47.500   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:48.291   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:49.074   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:49.851   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:50.629   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:51.552   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:52.370   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:53.156   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:53.938   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:54.743   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:55.526   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:56.310   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:57.094   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:57.878   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:58.688   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:20:59.489   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:00.307   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:01.123   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:01.991   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:02.855   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:03.692   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:04.480   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:05.382   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:06.318   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:07.185   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:07.990   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:08.829   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:09.646   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:10.473   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:11.304   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:12.093   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:12.925   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:13.713   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:14.556   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:15.343   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:16.124   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:16.905   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:17.685   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:18.469   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:19.253   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:20.038   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:20.822   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:21.609   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:22.389   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:23.170   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:23.951   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:24.734   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:25.514   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:26.298   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:27.081   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:28.024   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:28.810   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:29.592   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:30.373   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:31.162   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:31.946   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:32.732   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:33.518   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:34.302   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:35.096   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:35.882   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:36.664   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:37.449   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:38.238   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:39.030   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:39.815   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:40.597   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:41.384   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:42.174   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:42.957   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:43.737   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:44.518   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:45.304   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:46.108   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:46.894   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:47.683   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:48.491   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:49.274   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:50.058   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:50.850   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:51.637   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:52.422   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:53.229   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:54.010   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:54.794   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:55.582   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:56.364   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:57.150   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:57.942   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:58.725   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:21:59.509   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:00.299   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:01.119   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:02.237   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:03.143   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:03.948   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:04.741   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:05.534   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:06.362   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:07.155   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:07.938   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:08.727   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:09.524   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:10.326   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:11.123   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:11.933   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:12.732   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:13.584   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:14.374   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:15.177   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:16.003   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:16.827   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:17.755   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:18.583   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:19.506   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:20.346   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:21.136   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:21.928   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:22.727   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:23.522   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:24.328   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:25.126   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:25.924   luup.scenes:0: running 1, Get Token, initiated by Google Drive
2015-10-12 15:22:26.722   luup.scenes:0: running 1, Get Token, initiated by Google Drive

I've paused the scene and can confirm it is indeed - paused... However, once I reboot it seems it un-pauses itself...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 12, 2015, 05:22:11 pm
So far, no issues with either - everyone seems to be playing nicely.
Completely missed seeing this post - apologies.   Anyway, sounds like good news to start with...
Quote
And some memory stats....
...which seems OK.  How's the cpu usage?  Ought to be minimal at this stage.

I have a lot of questions but I"ll start with this. So I created a simple scene (test the waters so to speak) and set a timer to run every 5 minutes. The code is Lua whereby it calls my Web Service and gets a Google Drive token. All seemed well, had 3 back-to-back refreshes happening every 5 minutes. I decided to reboot the rPi2. Upon startup (startup executes shell script you provided), the timer kind of lost it's mind.

Code: [Select]
1969-12-31 18:00:18.196   :: openLuup STARTUP ::

Judging from the data on the log, it's not the timer that's lost its mind, but your system clock...?  Have you tried setting that to the right time?

Quote
I've paused the scene and can confirm it is indeed - paused... However, once I reboot it seems it un-pauses itself...
Now that surprises me even more, since I haven't implemented pause for scenes.  In fact, there is a comment in my source code:
Code: [Select]
  luup_scene = {
      description = scene.name,
      hidden = false,
--      page = 0,           -- TODO: discover what page / paused / remote are for
--      paused = false,
--      remote = 0,
      room_num = scene.room,
    }

I can fix that fairly quickly if it's an issue.*

Not sure you're running the latest 4.5 release?  Available here http://forum.micasaverde.com/index.php/topic,32315.msg251000.html#msg251000 (but also see a subsequent update for one or two files - I'll post an full update shortly.)

Regarding your even earlier query about getting the uncompressed sources, I've been working on a utility to pull those across from Vera.  In my latest development version, ALTUI also self-installs and can be upgraded online too.

-----

*Edit:  However, enable/disable for timers IS implemented.  Perhaps this is what you meant.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 12, 2015, 05:50:40 pm
Quote
Completely missed seeing this post - apologies.   Anyway, sounds like good news to start with...

No need, it was merely more informational than anything else. Setup was fairly painless considering how long it's been since I've used Linux..

Quote
...which seems OK.  How's the cpu usage?  Ought to be minimal at this stage.

Almost nil since this is it's sole purpose in life..

Quote
Judging from the data on the log, it's not the timer that's lost its mind, but your system clock...?  Have you tried setting that to the right time?

You are correct, however if I understand this thing (pi) correctly - it has to make a call out to the internet to get it's bearing. I might have to add an RTC to the GPIO as it has no other means...

Quote
Now that surprises me even more, since I haven't implemented pause for scenes.  In fact, there is a comment in my source code:
Code: [Select]
  luup_scene = {
      description = scene.name,
      hidden = false,
--      page = 0,           -- TODO: discover what page / paused / remote are for
--      paused = false,
--      remote = 0,
      room_num = scene.room,
    }

I can fix that fairly quickly if it's an issue. 

Not sure you're running the latest 4.5 release?  Available here http://forum.micasaverde.com/index.php/topic,32315.msg251000.html#msg251000 (but also see a subsequent update for one or two files - I'll post an full update shortly.)

Regarding your even earlier query about getting the uncompressed sources, I've been working on a utility to pull those across from Vera.  In my latest development version, ALTUI also self-installs and can be upgraded online too.

Your code is telling the truth (of course).... When I thought I had paused the scene, I checked and it was still hitting my WS, so I disabled it ..
Logs look interesting though, appears to refresh every 500ms.

As far as being an issue (pause), nah - I'm following your lead on this.. I'll wait for your full update, no hurry - just enjoying what I'm seeing so far...

Code: [Select]
2015-10-12 16:32:38.438   openLuup.scenes:0: timer disabled
2015-10-12 16:32:38.939   openLuup.scenes:0: timer disabled
2015-10-12 16:32:39.440   openLuup.scenes:0: timer disabled
2015-10-12 16:32:39.941   openLuup.scenes:0: timer disabled
2015-10-12 16:32:40.442   openLuup.scenes:0: timer disabled
2015-10-12 16:32:40.946   openLuup.scenes:0: timer disabled
2015-10-12 16:32:41.448   openLuup.scenes:0: timer disabled
2015-10-12 16:32:41.949   openLuup.scenes:0: timer disabled
2015-10-12 16:32:42.450   openLuup.scenes:0: timer disabled
2015-10-12 16:32:42.952   openLuup.scenes:0: timer disabled
2015-10-12 16:32:43.453   openLuup.scenes:0: timer disabled
2015-10-12 16:32:43.954   openLuup.scenes:0: timer disabled
2015-10-12 16:32:44.455   openLuup.scenes:0: timer disabled
2015-10-12 16:32:44.957   openLuup.scenes:0: timer disabled
2015-10-12 16:32:45.458   openLuup.scenes:0: timer disabled
2015-10-12 16:32:45.961   openLuup.scenes:0: timer disabled
2015-10-12 16:32:46.462   openLuup.scenes:0: timer disabled
2015-10-12 16:32:46.964   openLuup.scenes:0: timer disabled
2015-10-12 16:32:47.465   openLuup.scenes:0: timer disabled
2015-10-12 16:32:47.966   openLuup.scenes:0: timer disabled
2015-10-12 16:32:48.468   openLuup.scenes:0: timer disabled
2015-10-12 16:32:48.969   openLuup.scenes:0: timer disabled
2015-10-12 16:32:49.470   openLuup.scenes:0: timer disabled
2015-10-12 16:32:49.972   openLuup.scenes:0: timer disabled
2015-10-12 16:32:50.473   openLuup.scenes:0: timer disabled
2015-10-12 16:32:50.976   openLuup.scenes:0: timer disabled
2015-10-12 16:32:51.477   openLuup.scenes:0: timer disabled
2015-10-12 16:32:51.979   openLuup.scenes:0: timer disabled
2015-10-12 16:32:52.480   openLuup.scenes:0: timer disabled
2015-10-12 16:32:52.981   openLuup.scenes:0: timer disabled
2015-10-12 16:32:53.483   openLuup.scenes:0: timer disabled
2015-10-12 16:32:53.984   openLuup.scenes:0: timer disabled
2015-10-12 16:32:54.485   openLuup.scenes:0: timer disabled
2015-10-12 16:32:54.987   openLuup.scenes:0: timer disabled
2015-10-12 16:32:55.488   openLuup.scenes:0: timer disabled
2015-10-12 16:32:55.991   openLuup.scenes:0: timer disabled
2015-10-12 16:32:56.493   openLuup.scenes:0: timer disabled
2015-10-12 16:32:56.994   openLuup.scenes:0: timer disabled
2015-10-12 16:32:57.495   openLuup.scenes:0: timer disabled
2015-10-12 16:32:57.997   openLuup.scenes:0: timer disabled
2015-10-12 16:32:58.498   openLuup.scenes:0: timer disabled
2015-10-12 16:32:58.999   openLuup.scenes:0: timer disabled
2015-10-12 16:32:59.501   openLuup.scenes:0: timer disabled
2015-10-12 16:33:00.002   openLuup.scenes:0: timer disabled
2015-10-12 16:33:00.504   openLuup.scenes:0: timer disabled
2015-10-12 16:33:01.007   openLuup.scenes:0: timer disabled
2015-10-12 16:33:01.508   openLuup.scenes:0: timer disabled
2015-10-12 16:33:02.010   openLuup.scenes:0: timer disabled
2015-10-12 16:33:02.511   openLuup.scenes:0: timer disabled
2015-10-12 16:33:03.012   openLuup.scenes:0: timer disabled
2015-10-12 16:33:03.513   openLuup.scenes:0: timer disabled
2015-10-12 16:33:04.015   openLuup.scenes:0: timer disabled
2015-10-12 16:33:04.516   openLuup.scenes:0: timer disabled
2015-10-12 16:33:05.017   openLuup.scenes:0: timer disabled
2015-10-12 16:33:05.519   openLuup.scenes:0: timer disabled
2015-10-12 16:33:06.022   openLuup.scenes:0: timer disabled
2015-10-12 16:33:06.523   openLuup.scenes:0: timer disabled
2015-10-12 16:33:07.024   openLuup.scenes:0: timer disabled
2015-10-12 16:33:07.525   openLuup.scenes:0: timer disabled
2015-10-12 16:33:08.027   openLuup.scenes:0: timer disabled
2015-10-12 16:33:08.528   openLuup.scenes:0: timer disabled
2015-10-12 16:33:09.029   openLuup.scenes:0: timer disabled
2015-10-12 16:33:09.531   openLuup.scenes:0: timer disabled
2015-10-12 16:33:10.032   openLuup.scenes:0: timer disabled
2015-10-12 16:33:10.533   openLuup.scenes:0: timer disabled
2015-10-12 16:33:11.036   openLuup.scenes:0: timer disabled
2015-10-12 16:33:11.538   openLuup.scenes:0: timer disabled
2015-10-12 16:33:12.039   openLuup.scenes:0: timer disabled
2015-10-12 16:33:12.540   openLuup.scenes:0: timer disabled
2015-10-12 16:33:13.042   openLuup.scenes:0: timer disabled
2015-10-12 16:33:13.543   openLuup.scenes:0: timer disabled
2015-10-12 16:33:14.044   openLuup.scenes:0: timer disabled
2015-10-12 16:33:14.545   openLuup.scenes:0: timer disabled
2015-10-12 16:33:15.047   openLuup.scenes:0: timer disabled
2015-10-12 16:33:15.548   openLuup.scenes:0: timer disabled
2015-10-12 16:33:16.051   openLuup.scenes:0: timer disabled
2015-10-12 16:33:16.552   openLuup.scenes:0: timer disabled
2015-10-12 16:33:17.054   openLuup.scenes:0: timer disabled
2015-10-12 16:33:17.555   openLuup.scenes:0: timer disabled
2015-10-12 16:33:18.056   openLuup.scenes:0: timer disabled
2015-10-12 16:33:18.557   openLuup.scenes:0: timer disabled
2015-10-12 16:33:19.059   openLuup.scenes:0: timer disabled
2015-10-12 16:33:19.560   openLuup.scenes:0: timer disabled
2015-10-12 16:33:20.061   openLuup.scenes:0: timer disabled
2015-10-12 16:33:20.563   openLuup.scenes:0: timer disabled
2015-10-12 16:33:21.066   openLuup.scenes:0: timer disabled
2015-10-12 16:33:21.567   openLuup.scenes:0: timer disabled
2015-10-12 16:33:22.068   openLuup.scenes:0: timer disabled
2015-10-12 16:33:22.569   openLuup.scenes:0: timer disabled
2015-10-12 16:33:23.071   openLuup.scenes:0: timer disabled
2015-10-12 16:33:23.572   openLuup.scenes:0: timer disabled
2015-10-12 16:33:24.073   openLuup.scenes:0: timer disabled
2015-10-12 16:33:24.575   openLuup.scenes:0: timer disabled
2015-10-12 16:33:25.076   openLuup.scenes:0: timer disabled
2015-10-12 16:33:25.577   openLuup.scenes:0: timer disabled
2015-10-12 16:33:26.080   openLuup.scenes:0: timer disabled
2015-10-12 16:33:26.582   openLuup.scenes:0: timer disabled
2015-10-12 16:33:27.083   openLuup.scenes:0: timer disabled
2015-10-12 16:33:27.584   openLuup.scenes:0: timer disabled
2015-10-12 16:33:28.085   openLuup.scenes:0: timer disabled
2015-10-12 16:33:28.587   openLuup.scenes:0: timer disabled
2015-10-12 16:33:29.088   openLuup.scenes:0: timer disabled
2015-10-12 16:33:29.589   openLuup.scenes:0: timer disabled
2015-10-12 16:33:30.090   openLuup.scenes:0: timer disabled
2015-10-12 16:33:30.592   openLuup.scenes:0: timer disabled
2015-10-12 16:33:31.095   openLuup.scenes:0: timer disabled
2015-10-12 16:33:31.596   openLuup.scenes:0: timer disabled
2015-10-12 16:33:32.097   openLuup.scenes:0: timer disabled
2015-10-12 16:33:32.599   openLuup.scenes:0: timer disabled
2015-10-12 16:33:33.100   openLuup.scenes:0: timer disabled
2015-10-12 16:33:33.601   openLuup.scenes:0: timer disabled
2015-10-12 16:33:34.103   openLuup.scenes:0: timer disabled
2015-10-12 16:33:34.604   openLuup.scenes:0: timer disabled
2015-10-12 16:33:35.105   openLuup.scenes:0: timer disabled
2015-10-12 16:33:35.606   openLuup.scenes:0: timer disabled
2015-10-12 16:33:36.109   openLuup.scenes:0: timer disabled
2015-10-12 16:33:36.610   openLuup.scenes:0: timer disabled
2015-10-12 16:33:37.112   openLuup.scenes:0: timer disabled
2015-10-12 16:33:37.613   openLuup.scenes:0: timer disabled
2015-10-12 16:33:38.114   openLuup.scenes:0: timer disabled
2015-10-12 16:33:38.616   openLuup.scenes:0: timer disabled
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 12, 2015, 06:31:02 pm
There is a 500ms throttle on infinite loops.  I think if you set the time manually (date command) and reload, this will go away.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 12, 2015, 06:49:52 pm
Logs look calm... I ordered an RTC which will alleviate this date/time issue, I think in the interim I'll add a sleep command to rc.local so the date/time is set prior to executing openLuup.

Code: [Select]
1969-12-31 18:00:18.196   :: openLuup STARTUP ::
1969-12-31 18:00:21.897   luup_log:3: ALTUI: startup completed
2015-10-12 15:20:38.258   openLuup.heartbeat:: memory used: 7.2Mb, stats: elapsed: 16720.85 days, cpu: 2.188 cpu2: 2.188 sec (0.00%)

There is a 500ms throttle on infinite loops.  I think if you set the time manually (date command) and reload, this will go away.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 13, 2015, 04:52:07 pm
Having issues deleting scenes (delete and they re-appear) and also noticed this...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 13, 2015, 05:15:13 pm
Having issues deleting scenes (delete and they re-appear)
Can you be more explicit?  WHEN do they reappear?  I have seen a problem with scenes updating (or not) their run time on the screen.  Reloading the web page normally sorts that (ie. the underlying behaviour is correct.)

If you force an openLuup exit before the user_data.json file is written (checkpointing happens every six minutes or on restart) then the changes are not saved.

Quote
and also noticed this...
So do you have those files all sitting in /etc/cmh-ludl/ or not?  How are you starting the process in the first place?  Is it running in the right directory?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 13, 2015, 05:45:21 pm
Apologies,

Wasn't sure what data you needed so I kind of kept it open ended... I created one scene called Testing. When I click delete, it prompts me - I confirm. The message box indicates, "10/13/2015, 4:31:22 PM Deleted Scene 4 successfully". I click back on the room again again and it's back. In fact I have two.

As for the directory, yes - I have a select number of device files within the /etc/cmh-ludl directory. I haven't had a chance to move the others over yet as I'm working through how all of this works in my spare time. What was throwing me off was the /luvd/, I wasn't sure if I had missed a step or what.

Sorry about that...

Having issues deleting scenes (delete and they re-appear)
Can you be more explicit?  WHEN do they reappear?  I have seen a problem with scenes updating (or not) their run time on the screen.  Reloading the web page normally sorts that (ie. the underlying behaviour is correct.)

If you force an openLuup exit before the user_data.json file is written (checkpointing happens every six minutes or on restart) then the changes are not saved.

Quote
and also noticed this...
So do you have those files all sitting in /etc/cmh-ludl/ or not?  How are you starting the process in the first place?  Is it running in the right directory?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 13, 2015, 06:00:02 pm
I think I found the issue, I'm executing your shell script from rc.local (startup) and forgot to place the startup.lua behind it. That seemed to correct the issue of deleting scenes. Again, sorry for the confusion (on my part).
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 13, 2015, 06:27:16 pm
I think I found the issue, I'm executing your shell script from rc.local (startup) and forgot to place the startup.lua behind it. That seemed to correct the issue of deleting scenes. Again, sorry for the confusion (on my part).
Good, that's one I won't pursue further, then.

Re /luvd/ it's a throwback to earlier MiOS versions, I believe. Anyway, openLuup steadfastly ignores that part of the path name, so everything (pretty much) should be in /etc/cmh-ludl/.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 14, 2015, 02:30:34 pm
Perfect, thanks for confirming.

Quote
Re /luvd/ it's a throwback to earlier MiOS versions, I believe. Anyway, openLuup steadfastly ignores that part of the path name, so everything (pretty much) should be in /etc/cmh-ludl/.

Hue bulbs respond faaast, however I haven't had a chance to troubleshoot the color picker - the option exists but fails to function. I'll look into it more tonight as well as testing the Sonos system.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 14, 2015, 03:22:15 pm
Hue bulbs respond faaast,
That's the plan.

Quote
however I haven't had a chance to troubleshoot the color picker - the option exists but fails to function.
Haven't got one, Haven't tried - except with the RGBController plugin from @vosmont, which, at least for some supported devices, does tricky things directly with Zwave.  Hue should be different, though.

Quote
I'll look into it more tonight as well as testing the Sonos system.
Haven't tried that either - it does clever things with the UPnP plugin.  Happy to help.


New release (5) out tomorrow.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 14, 2015, 11:25:02 pm
Ran a couple of tests on Sonos.

luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="Testing openLuup.", Volume=20}, 131)
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "PlayURI", {URIToPlay="x-file-cifs://192.168.2.2/vera/wakeup/alarm2.mp3", Volume=20}, 131)

Code: [Select]
2015-10-14 20:36:21.957   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="Testing openLuup.", Volume=20}, 131))
2015-10-14 20:36:21.958   luup.call_action:0: 131.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-14 20:36:21.958   openLuup.context_switch::  ERROR: ./openLuup/luup.lua:310: attempt to index field 'services' (a function value)
2015-10-14 20:36:21.958   openLuup.server:: error in callback: lr_ALTUI_LuaRunHandler, error is ./openLuup/luup.lua:310: attempt to index field 'services' (a function value)

--

2015-10-14 22:04:17.114   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "PlayURI", {URIToPlay="x-file-cifs://192.168.2.2/vera/wakeup/alarm2.mp3", Volume=20}, 131))
2015-10-14 22:04:17.115   luup.call_action:0: 131.urn:micasaverde-com:serviceId:Sonos1.PlayURI
2015-10-14 22:04:17.116   openLuup.context_switch::  ERROR: ./openLuup/luup.lua:310: attempt to index field 'services' (a function value)
2015-10-14 22:04:17.116   openLuup.server:: error in callback: lr_ALTUI_LuaRunHandler, error is ./openLuup/luup.lua:310: attempt to index field 'services' (a function value)

Title: Re: openLuup - running unmodified plugins on any machine
Post by: Aaron on October 15, 2015, 12:11:10 am
akboor,
Just curious if you might update the 1st post with the status of how this project is going? It would be cool to be able to run openLUUP on a full PC, in a virtual machine, or on a RPi - and relegate the Vera3 to the closet. I have a Wink which has BT, Zwave & Zigbee so that woul be a much better interface to teh devices while being able to use the Vera plugins to do all the great stuff they do!

thx!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 15, 2015, 02:13:14 am
I remember having issues setting my Windows system up (it was awhile ago) as well but then I switched over to ZeroBrane and it had the necessary modules. Here's what I have in my dev folder, not sure it will help though. I also included a SSL.dll. 

lmk if that helps...


Thanks @CudaNet - I was able to get luasocket and luasec installed on my Windows 7 machine. I now have Lua installed in C:\Program Files (x86)\Lua\5.1\

and i have openluup installed in C:\etc\cmh-ludl

When i run lua openLuup/init.lua reset it looks correct i think:

Code: [Select]
C:\etc\cmh-ludl>lua openLuup/init.lua reset
device 0 '_system_' requesting reload

but when i then run C:\etc\cmh-ludl>lua openLuup/init.lua i get an error:

Code: [Select]
C:\etc\cmh-ludl>lua openLuup/init.lua
lua: C:\Program Files (x86)\Lua\5.1\lua\socket.lua:29: attempt to call field 'getaddrinfo' (a nil value)
stack traceback:
        C:\Program Files (x86)\Lua\5.1\lua\socket.lua:29: in function 'bind'
        .\openLuup\server.lua:361: in function 'start'
        openLuup/init.lua:176: in main chunk
        [C]: ?

LuaUPnP.log is:

Code: [Select]
C:\etc\cmh-ludl>more LuaUPnP.log
2015-10-14 22:57:23.883   :: openLuup STARTUP ::
2015-10-14 22:57:23.883   openLuup.init::      version 2015.08.30  @akbooer
2015-10-14 22:57:23.903   openLuup.scheduler:: version 2015.08.23  @akbooer
2015-10-14 22:57:23.903   openLuup.server::    version 2015.08.23  @akbooer
2015-10-14 22:57:23.923   openLuup.scenes::    version 2015.08.30  @akbooer
2015-10-14 22:57:23.933   openLuup.chdev::     version 2015.08.26  @akbooer
2015-10-14 22:57:23.933   openLuup.io::        version 2015.08.15  @akbooer
2015-10-14 22:57:23.933   openLuup.luup::      version 2015.08.26  @akbooer
2015-10-14 22:57:23.943   openLuup.rooms::     version 2015.08.15  @akbooer
2015-10-14 22:57:23.943   openLuup.requests::  version 2015.08.24  @akbooer
2015-10-14 22:57:23.943   luup.create_device:: [1] urn:schemas-micasaverde-com:device:ZWaveNetwork:1 / no-implementation-file
2015-10-14 22:57:23.943   luup.create_device:: [2] urn:schemas-micasaverde-com:device:SceneController:1 / no-implementation-file
2015-10-14 22:57:23.943   openLuup.init:: loading configuration user_data.json
2015-10-14 22:57:23.943   openLuup.init:: loading user_data json...
2015-10-14 22:57:23.943   openLuup.init:: loading rooms...
2015-10-14 22:57:23.943   openLuup.init:: ...room loading completed
2015-10-14 22:57:23.943   openLuup.init:: loading devices...
2015-10-14 22:57:23.943   openLuup.init:: [1] 'ZWave', urn:schemas-micasaverde-com:device:ZWaveNetwork:1
2015-10-14 22:57:23.943   openLuup.init:: [2] '_SceneController', urn:schemas-micasaverde-com:device:SceneController:1
2015-10-14 22:57:23.943   openLuup.init:: loading scenes...
2015-10-14 22:57:23.943   openLuup.init:: number of scenes = 0
2015-10-14 22:57:23.943   openLuup.init:: ...scene loading completed
2015-10-14 22:57:23.943   openLuup.init:: ...user_data loading completed
2015-10-14 22:57:23.943   openLuup.init:: running Startup Lua
2015-10-14 22:57:23.943   openLuup.init:: startup completed

and when i run openluup_check, i get an error which i assume has to do with the script using unix syntax vs windows syntax but i am such a windows noob that i don't know what to do :(

Code: [Select]
C:\etc\cmh-ludl>lua openLuup_check.lua
lua: openLuup_check.lua:2: unexpected symbol near '#'

@CudaNet, @akbooer  -- i think i am just not setting something up right on windows... could you please point me in the right direction? Thanks!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 15, 2015, 04:46:42 am
When i run lua openLuup/init.lua reset it looks correct i think:
Yes, that looks file.

Quote
but when i then run C:\etc\cmh-ludl>lua openLuup/init.lua i get an error:
This is clearly a Lua install issue since it comes from the low-level C binding.

Quote
LuaUPnP.log is:
Strangely, that all looks correct, too - I suppose to the point where it crashes?

Quote
and when i run openluup_check, i get an error which i assume has to do with the script using unix syntax vs windows syntax but i am such a windows noob that i don't know what to do :(

Code: [Select]
C:\etc\cmh-ludl>lua openLuup_check.lua
lua: openLuup_check.lua:2: unexpected symbol near '#'
That's really odd,since I don't see that the code has a '#' in it?
openLuup_check.lua is pure Lua and should be totally machine independent (although I can imagine one thing which is - the opening of binary files sometimes requires an 'rb' modified in the open statement.)

Quote
@CudaNet, @akbooer  -- i think i am just not setting something up right on windows... could you please point me in the right direction? Thanks!
I haven't tried on Windows for a while, I will give it a go.  Everything points to a Lua install problem.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 15, 2015, 05:43:37 am
Ran a couple of tests on Sonos.
I just installed this to give it a go.  Wow! It's very chatty in the log file (this may help.)

Tried this:
Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="Testing openLuup.", Volume=20}, 131)

...it pauses the current play and then resumes it after a short while without saying anything.  There's lots of stuff in the logs, but no errors (I am using the new openLuup release 5).

The only problem I see (apart from it not working!) is an error in the console window:
Code: [Select]
# rm: cannot remove `/www/Say.4.mp3': No such file or directory

So I'm guessing there was a problem creating the speech file in the first place.  Perhaps someone who knows Sonos can help us with this - it is a complex plugin, but I have to say that I'm pleased the basics seem to work.

I'm just about to post Release 5, so install that first and we'll take it from there.  Backup your user_data.json file before you start, just in case.
Title: Re: openLuup - Release 5
Post by: akbooer on October 15, 2015, 06:54:40 am
Here is Release 5 - a comprehensive (but not totally complete) implementation of Luup, including a set of features which are generally sufficient to run a number of standard plugins. 

Changes from the previous release include:

All you need to do to upgrade is to replace all the files in you openLuup subdirectory with those from the distribution below.  It would also be wise to update your VeraBridge (if you are using it.)  You could also drag down all your device files and icons from your Vera using the new getfiles utility.

It's now, I think, to a state where we can start compiling a list of compatible plugins.  I'm very happy to help, but it's very hard to debug some problems running under different systems and different hardware.  If you can isolate any difficulties to, say, a system running a single device which fails to work, then so much the better.

--------------------

Tested Plugins:
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 15, 2015, 07:16:51 am
Just curious if you might update the 1st post with the status of how this project is going? It would be cool to be able to run openLUUP on a full PC, in a virtual machine, or on a RPi - and relegate the Vera3 to the closet. I have a Wink which has BT, Zwave & Zigbee so that woul be a much better interface to teh devices while being able to use the Vera plugins to do all the great stuff they do!

I've updated the first post as you suggest.  I'm not a PC user, generally, nor a VM one either, focusing more on small Linux systems.  I'm now running openLuup on the Linux bit of an Arduino Yun board, with a gateway to MySensors hardware on the Arduino bit of the same board. Don't know anything about Wink, either.

There have been a few problems with PC and VMs, but I hope we can work through those.  openLuup is pure Lua and places very few demands on its environment.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 15, 2015, 08:47:26 am
@AK... Wow, you've been busy, this looks great. Will load '5' this morning before I head off to work.
@mda, I have a VM environment (Ubunutu 15.04) at work as well as a Win7 system I can set this up on and test. Will see what I can find today.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 15, 2015, 09:29:50 am
My first attempt (w/ v5) was testing via the Lua test code. This returned a result of  "./openLuup/luup.lua:317: attempt to index field 'services' (a function value)".
In v4.5, testing directly within the plugin I never got a result, however today with 5 it worked once. Second attempt failed ...

Code: [Select]
2015-10-15 08:18:01.410   openLuup.server:: /data_request?id=lu_action&output_format=xml&DeviceNum=25&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&Text=Testing%20open%20luup...&Language=en&Engine=OSX_TTS_SERVER&Volume=&GroupZones=&SameVolumeForAll=false tcp{client}: 0x27ed178
2015-10-15 08:18:01.411   luup.call_action:: 25.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-15 08:18:01.411   luup.call_action:: action will be handled by parent: 4
2015-10-15 08:18:01.413   openLuup.server:: request completed (124 bytes, 1 chunks, 2 ms) tcp{client}: 0x27ed178
2015-10-15 08:18:01.413   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&DeviceNum=25&action=Say&Language=en&serviceId=urn:micasaverde-com:serviceId:Sonos1&Text=Testing open luup...&Engine=OSX_TTS_SERVER&SameVolumeForAll=false
2015-10-15 08:18:01.428   luup_log:4: failed requests status: 0
[/code]

Ran a couple of tests on Sonos.
I just installed this to give it a go.  Wow! It's very chatty in the log file (this may help.)

Tried this:
Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="Testing openLuup.", Volume=20}, 131)

...it pauses the current play and then resumes it after a short while without saying anything.  There's lots of stuff in the logs, but no errors (I am using the new openLuup release 5).

The only problem I see (apart from it not working!) is an error in the console window:
Code: [Select]
# rm: cannot remove `/www/Say.4.mp3': No such file or directory

So I'm guessing there was a problem creating the speech file in the first place.  Perhaps someone who knows Sonos can help us with this - it is a complex plugin, but I have to say that I'm pleased the basics seem to work.

I'm just about to post Release 5, so install that first and we'll take it from there.  Backup your user_data.json file before you start, just in case.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 15, 2015, 10:08:43 am
My first attempt (w/ v5) was testing via the Lua test code. This returned a result of  "./openLuup/luup.lua:317: attempt to index field 'services' (a function value)".
Interesting.  That line of code contains the comment: 
-- TODO: fix error on missing device access
This is, then, a badly-flagged error meaning: there is no such device.

Quote
In v4.5, testing directly within the plugin I never got a result, however today with 5 it worked once.
Curiouser and curiouser.

Quote
Second attempt failed ...

Code: [Select]
2015-10-15 08:18:01.410   openLuup.server:: /data_request?id=lu_action&output_format=xml&DeviceNum=25&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&Text=Testing%20open%20luup...&Language=en&Engine=OSX_TTS_SERVER&Volume=&GroupZones=&SameVolumeForAll=false tcp{client}: 0x27ed178
2015-10-15 08:18:01.411   luup.call_action:: 25.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-15 08:18:01.411   luup.call_action:: action will be handled by parent: 4
2015-10-15 08:18:01.413   openLuup.server:: request completed (124 bytes, 1 chunks, 2 ms) tcp{client}: 0x27ed178
2015-10-15 08:18:01.413   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&DeviceNum=25&action=Say&Language=en&serviceId=urn:micasaverde-com:serviceId:Sonos1&Text=Testing open luup...&Engine=OSX_TTS_SERVER&SameVolumeForAll=false
2015-10-15 08:18:01.428   luup_log:4: failed requests status: 0

AHA!  Now it makes more sense. 
You didn't tell me:  this looks like you are actually issuing an HTTP request to openLuup to invoke Sonos installed on a remote Vera through the VeraBridge? 

We're trying to run before we can walk here - there's so many steps in this chain!  Let's see how we can break it down.  Can you confirm this IS what's you're doing and that

The error is clear in this line of the log:
Code: [Select]
2015-10-15 08:18:01.413   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&DeviceNum=25&action=Say&Language=en&serviceId=urn:micasaverde-com:serviceId:Sonos1&Text=Testing open luup...&Engine=OSX_TTS_SERVER&SameVolumeForAll=false

...notice this bit: DeviceNum=131&DeviceNum=25... duplicate device numbers!  This is an error (I think) introduced somehow by the VeraBridge, but I need to investigate more.

All I was doing in my previous testing was to install Sonos on openLuup.  It works fine except for TTS - I suspect I've not got that set up right:  I don't know, I've never tried to use it before.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 15, 2015, 10:15:04 am
@CudaNet

Here's a possible fix for the VeraBridge error.  If you could confirm this works, then I will replace it in the release.

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 15, 2015, 11:02:25 am

I haven't tried on Windows for a while, I will give it a go.  Everything points to a Lua install problem.

Thanks ! I could also move back to my Mac if I could get luasec working there now that I have zerobrane. (I tried but no luck either). If you have step by step instructions to install lua, luasocket, and luasec on a Mac lying around :) I could try to follow those from scratch if it's easier than debugging my windows install? Thanks again.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 15, 2015, 11:04:47 am

@mda, I have a VM environment (Ubunutu 15.04) at work as well as a Win7 system I can set this up on and test. Will see what I can find today.

Thanks! I would happily uninstall everything and follow any step by step instructions you might be able to jot down to get lua, luasocket, and luasec installed ! (Perhaps that could also help others on the forum who are as noob as I am :). Thanks for your help!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 15, 2015, 11:24:17 am
Will have to try tonight, I'm limited when I'm behind my corporate firewalls. Good catch on the duplicate devices, all I saw was 131 which is the correct device id.
Gotta run to a meeting, will try to catch up later...

@CudaNet

Here's a possible fix for the VeraBridge error.  If you could confirm this works, then I will replace it in the release.

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 15, 2015, 12:03:10 pm
@akbooer,
Thanks for this new version.  First tests show my scenes are now executing as predicted
I still have another issue in that the altui device is created twice.  The first one (device 3) was created by the startup file and the second one is coming from the vera.  My problem is I cannot delete one of both, message is "could not delete device".  Also tried to remove it from the startup json file but I must do something wrong as each time the system refuses to startup.  Is there a way to delete one of both altui devices?

Thank you so much for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 15, 2015, 12:43:00 pm
Thanks for this new version.  First tests show my scenes are now executing as predicted
Well, that is good news.

Quote
I still have another issue in that the altui device is created twice.  The first one (device 3) was created by the startup file and the second one is coming from the vera. 
Yes, that's normal behaviour.

Quote
My problem is I cannot delete one of both, message is "could not delete device". 
How are you trying to delete a device?

Quote
Also tried to remove it from the startup json file but I must do something wrong as each time the system refuses to startup.  Is there a way to delete one of both altui devices?
Why are you trying to delete a device?  Your device #3 provides you with a UI to the openLuup system.  Your other one presumably does the same for your remote Vera.

You could, however, hide them.  For example, this code executed in the Lua Test window does the trick:
Code: [Select]
luup.attr_set ("invisible" ,"1", 3)

Similarly, replacing the 3 with the device id of the other one will do the same on the openLuup system.  Or you could do that on the remote system too.  But why?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 15, 2015, 12:58:10 pm
Thanks for your reply
I thought amg0 didn't like to have 2 instances of altui but after your info I better understand the difference. I'll leave it the way it is, anyway I didn't have any issues with it.

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 15, 2015, 01:31:46 pm
@mda

I just copied over all the v5 files provided by Akbooer and initialized w/o errors. Looks like you may be missing a module.

[1] At a command prompt, type lua. You should get this...
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
>

[2] Now enter this at the lua prompt.
> require('socket')

Hopefully you get the below an not an error.

C:\etc\cmh-ludl>lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require('socket')
>

And here's what I get when I initialize it on my Win7 machine, wait a few seconds then I hit cntrl-c to interrupt.

C:\etc\cmh-ludl>lua openLuup/init.lua
lua: .\openLuup\scheduler.lua:344: interrupted!
stack traceback:
        [C]: in function 'select'
        .\openLuup\scheduler.lua:344: in function 'socket_callbacks'
        .\openLuup\scheduler.lua:412: in function 'start'
        openLuup/init.lua:203: in main chunk
        [C]: ?

C:\etc\cmh-ludl>
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 15, 2015, 01:54:28 pm
I've done this for the rPi2 w/Ubuntu Mate (15.04) in the event someone wanted a step by step guide...


@mda, I have a VM environment (Ubunutu 15.04) at work as well as a Win7 system I can set this up on and test. Will see what I can find today.

Thanks! I would happily uninstall everything and follow any step by step instructions you might be able to jot down to get lua, luasocket, and luasec installed ! (Perhaps that could also help others on the forum who are as noob as I am :). Thanks for your help!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 15, 2015, 04:37:45 pm
@Akbooer

Quote
device 4 (on openLuup) is the VeraBridge
Yes
Quote
device 25 (on openLuup) is the bridged Sonos
Yes
Quote
device 131 on the remote Vera is the actual Sonos
Yes
Title: Re: openLuup - running unmodified plugins on any machine
Post by: Aaron on October 15, 2015, 04:49:44 pm
@Akbooer
Thank you for updating the 1st post. One thing I may be missing is if some of my core plugins work... PLEG, Vera Alerts, SmartSwitch, EVL3, WINK, etc

thx
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 15, 2015, 05:27:56 pm
Thank you for updating the 1st post. One thing I may be missing is if some of my core plugins work... PLEG, Vera Alerts, SmartSwitch, EVL3, WINK, etc

I don't use any of the above, sadly.  PLEG, most assuredly, will NOT currently work since it is licensed and encrypted.  You'd need to ask Richard about that.

For the rest, I would think they are more 'normal' plugins, so you can either try it yourself, or wait until somebody else does the work for you.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 15, 2015, 08:59:59 pm
VeraBridge file (Lua) updated, system reloaded.

Code: [Select]
cuda@Ubuntu:/etc/cmh-ludl$ ls -ld *VeraBridge*
-rw-r--r-- 1 cuda cuda   732 Jul  5 21:22 D_VeraBridge.json
-rw-r--r-- 1 cuda cuda   758 Jul  3 17:19 D_VeraBridge.xml
-rw-r--r-- 1 cuda cuda  2316 Aug 24 21:42 I_VeraBridge.xml
-rw-rw-r-- 1 cuda cuda 11717 Oct 15 10:41 L_VeraBridge.lua
-rw-r--r-- 1 cuda cuda 11623 Oct  8 17:30 L_VeraBridge.old
cuda@Ubuntu:/etc/cmh-ludl$

When directing the TTS to device 131 (Vera).

Code: [Select]
2015-10-15 19:43:18.486   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Amicasaverde-com%3AserviceId%3ASonos1%22%2C%20%22Say%22%2C%20%7BText%3D%22This%20is%20a%20test%20of%20the%20American%20broadcast%20system%2C%20this%20is%20only%20a%20openLuup%20test.%22%2C%20Volume%3D30%7D%2C%2025)&_=1444955898615 tcp{client}: 0x2301060
2015-10-15 19:43:18.488   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is a test of the American broadcast system, this is only a openLuup test.", Volume=30}, 25))
2015-10-15 19:43:18.488   luup.call_action:0: 25.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-15 19:43:18.488   luup.call_action:0: action will be handled by parent: 4
2015-10-15 19:43:18.488   luup_log:0: ALTUI: Evaluation of lua code returned: null
2015-10-15 19:43:18.490   openLuup.server:: request completed (9 bytes, 1 chunks, 3 ms) tcp{client}: 0x2301060
2015-10-15 19:43:18.490   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&Text=This is a test of the American broadcast system, this is only a openLuup test.&Volume=30
2015-10-15 19:43:18.497   luup_log:4: failed requests status: 0

Submitting the request through a browser worked..

Code: [Select]
"http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&Text=This is a test of the American broadcast system, this is only a openLuup test.&Volume=30"
<u:SayResponse xmlns:u="urn:schemas-micasaverde-com:service:Sonos:1">
<OK>OK</OK>
</u:SayResponse>

And finally, this was directed to Device 25 (bridged).

Code: [Select]
2015-10-15 19:52:23.690   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Amicasaverde-com%3AserviceId%3ASonos1%22%2C%20%22Say%22%2C%20%7BText%3D%22This%20is%20a%20test%20of%20the%20American%20broadcast%20system%2C%20this%20is%20only%20a%20openLuup%20test.%22%2C%20Volume%3D30%7D%2C%2025)&_=1444955898714 tcp{client}: 0x2900358
2015-10-15 19:52:23.691   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is a test of the American broadcast system, this is only a openLuup test.", Volume=30}, 25))
2015-10-15 19:52:23.691   luup.call_action:0: 25.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-15 19:52:23.691   luup.call_action:0: action will be handled by parent: 4
2015-10-15 19:52:23.691   luup_log:0: ALTUI: Evaluation of lua code returned: null
2015-10-15 19:52:23.693   openLuup.server:: request completed (9 bytes, 1 chunks, 3 ms) tcp{client}: 0x2900358
2015-10-15 19:52:23.694   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&Text=This is a test of the American broadcast system, this is only a openLuup test.&Volume=30
2015-10-15 19:52:23.698   luup_log:4: failed requests status: 0

As for CIFS file, it works perfectly in scenes.... So how is your TTS setup, from my logs I'm using OSX (Wolf Paulus).

CIFS log

Code: [Select]
2015-10-15 20:00:33.134   luup.call_action:0: 25.urn:micasaverde-com:serviceId:Sonos1.PlayURI
2015-10-15 20:00:33.134   luup.call_action:0: action will be handled by parent: 4
2015-10-15 20:00:33.134   luup.scenes:0: running 1, Grandfather Clock, initiated by Clock Refresh
2015-10-15 20:00:33.156   openLuup.server:: request completed (7077 bytes, 1 chunks, 20290 ms) tcp{client}: 0x2b5d1f8
2015-10-15 20:00:33.156   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=PlayURI&DeviceNum=131&URIToPlay=x-file-cifs://192.168.2.2/music/16bit/vera/clock/8-clock.mp3&Volume=32
2015-10-15 20:00:33.872   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=955535989&Timeout=60&MinimumDelay=1500&_=1444955898780 tcp{client}: 0x2b5d1f8
2015-10-15 20:00:37.920   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.TransportState was: STOPPED now: PLAYING #hooks:0
2015-10-15 20:00:37.921   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.AVTransportURI was: x-file-cifs://192.168.2.2/music/16bit/vera/wakeup/alarm2.mp3 now: x-file-cifs://192.168.2.2/music/16bit/vera/clock/8-clock.mp3 #hooks:0
2015-10-15 20:00:37.921   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentTrackDuration was: 0:00:14 now: 0:00:53 #hooks:0
2015-10-15 20:00:37.921   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentTrackURI was: x-file-cifs://192.168.2.2/music/16bit/vera/wakeup/alarm2.mp3 now: x-file-cifs://192.168.2.2/music/16bit/vera/clock/8-clock.mp3 #hooks:0
2015-10-15 20:00:37.922   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentTrackMetaData was: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="x-file-cifs:*:audio/mpeg:*" duration="0:00:14">x-file-cifs://192.168.2.2/music/16bit/vera/wakeup/alarm2.mp3</res><r:streamContent></r:streamContent><r:radioShowMd></r:radioShowMd><dc:title>alarm2.mp3</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite> now: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="x-file-cifs:*:audio/mpeg:*" duration="0:00:53">x-file-cifs://192.168.2.2/music/16bit/vera/clock/8-clock.mp3</res><r:streamContent></r:streamContent><r:radioShowMd></r:radioShowMd><dc:title>Chimes</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:creator>Grand Father Chimes</dc:creator><upnp:album>http://www.Sounddogs.com</upnp:album><r:albumArtist>Grand Father Chimes</r:albumArtist></item></DIDL-Lite> #hooks:0
2015-10-15 20:00:37.922   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentStatus was: alarm2.mp3 now: Chimes:  (Grand Father Chimes) #hooks:0
2015-10-15 20:00:37.922   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentTitle was: alarm2.mp3 now: Chimes #hooks:0
2015-10-15 20:00:37.922   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentArtist was:  now: Grand Father Chimes #hooks:0
2015-10-15 20:00:37.923   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentAlbum was:  now: Grand Father Chimes #hooks:0
2015-10-15 20:00:37.923   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.RelativeTimePosition was: 0:00:00 now: 0:00:01 #hooks:0
2015-10-15 20:00:37.923   luup.variable_set:4: 25.urn:upnp-org:serviceId:RenderingControl.Volume was: 20 now: 32 #hooks:0
2015-10-15 20:00:37.923   luup.variable_set:4: 25.urn:micasaverde-com:serviceId:HaDevice1.LastUpdate was: 1444956340 now: 1444957234 #hooks:0
2015-10-15 20:00:37.924   luup.variable_set:4: 67.urn:micasaverde-com:serviceId:ZWaveDevice1.LastWakeup was: 1444956336 now: 1444957236 #hooks:0
2015-10-15 20:00:38.476   openLuup.server:: request completed (30569 bytes, 2 chunks, 4604 ms) tcp{client}: 0x2b5d1f8
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 16, 2015, 03:50:33 am
@CudaNet - thanks for your help!

@akbooer - i have reinstalled everything on the mac. (the trick to installing luasec i think was to install and link openssl first... but we shall see if it actually works once i am ready to install iPhone Locator).

installed version 5 of openLuup and went through the commissioning steps. I can get AltUI to work with a reset system, but when i take startup_example.lua and copy it to startup.lua and put in the IP of my vera, altui hangs with "waiting initial data". I wonder if a device on my vera is causing altui on openluup to hang?

I will pm you my LuaUpnp.log and hopefully you have not given up on helping me yet ;)

Thanks !

-mda
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 16, 2015, 05:08:25 am
@mda

Thanks for the logs.  A bit concerned to see this error in one of them

Code: [Select]
2015-10-16 00:40:48.640   openLuup.HTTP.FILE:3: file not found:J_ALTUI_jquery.ui.touch-punch.min.js

I need to investigate further, but this used to be part of the ALTUI download.  It may be the embedded '-' in the file name causing problems.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 16, 2015, 05:35:18 am
@mda

Yes, it was an error in the download (actually it was the multiple '.' in the filename that screwed things up.)

Here's a replacement plugin file to go into the openLuup/ subdirectory.

Sorry!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 16, 2015, 10:29:26 am
So how is your TTS setup, from my logs I'm using OSX (Wolf Paulus).

I just took all the default settings - so Google is the TTS engine...

...and I have it working now!! (installed directly on openLuup.)  The problem was a very old one which has come back to bite me.  Some plugins (eg. Sonos) use a shell command /etc/bin/GetNetworkState.sh to determine the machine's IP address.  I used to provide this (actually for ALTUI, but it doesn't need it now.)  So you need to create that file with the following contents:

Code: [Select]
#! /usr/bin/env lua
------------------------------------------------------------------------
-- discover main IP address of machine and write to standard output, see:
-- http://forums.coronalabs.com/topic/21105-found-undocumented-way-to-get-your-devices-ip-address-from-lua-socket/
------------------------------------------------------------------------
local socket = require "socket"
function myIP ()
  local mySocket = socket.udp ()
  mySocket:setpeername ("42.42.42.42", "424242")  -- arbitrary IP/PORT
  local ip = mySocket:getsockname ()
  mySocket: close()
  return ip or "127.0.0.1"
end
io.write (myIP())
--------

Also you'll need to set it executable with:
Code: [Select]
chmod a+x /usr/bin/GetNetworkState.sh

Notwithstanding all this, what you're doing remotely should work, so I have some more digging to do.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 01:42:09 pm
That's good news.... I went ahead and added the script and will await your findings on the remainder.

So how is your TTS setup, from my logs I'm using OSX (Wolf Paulus).

I just took all the default settings - so Google is the TTS engine...

...and I have it working now!! (installed directly on openLuup.)  The problem was a very old one which has come back to bite me.  Some plugins (eg. Sonos) use a shell command /etc/bin/GetNetworkState.sh to determine the machine's IP address.  I used to provide this (actually for ALTUI, but it doesn't need it now.)  So you need to create that file with the following contents:

Code: [Select]
#! /usr/bin/env lua
------------------------------------------------------------------------
-- discover main IP address of machine and write to standard output, see:
-- http://forums.coronalabs.com/topic/21105-found-undocumented-way-to-get-your-devices-ip-address-from-lua-socket/
------------------------------------------------------------------------
local socket = require "socket"
function myIP ()
  local mySocket = socket.udp ()
  mySocket:setpeername ("42.42.42.42", "424242")  -- arbitrary IP/PORT
  local ip = mySocket:getsockname ()
  mySocket: close()
  return ip or "127.0.0.1"
end
io.write (myIP())
--------

Also you'll need to set it executable with:
Code: [Select]
chmod a+x /usr/bin/GetNetworkState.sh

Notwithstanding all this, what you're doing remotely should work, so I have some more digging to do.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 03:44:05 pm
Played around with Virtual Container, all seems to work perfectly (28=local device) for those using it.

Code: [Select]
2015-10-16 14:17:17.622   luup_log:0: Wunderground.
2015-10-16 14:17:17.622   luup.variable_set:0: 28.urn:upnp-org:serviceId:VContainer1.VariableName2 was: 40% now: 39% #hooks:0
2015-10-16 14:17:17.622   luup.variable_set:0: 28.urn:upnp-org:serviceId:VContainer1.VariableName3 was: 10.1 now: 9.1 #hooks:0
2015-10-16 14:17:17.623   luup.variable_set:0: 28.urn:upnp-org:serviceId:VContainer1.Variable1 was: 722 now: 715 #hooks:0
2015-10-16 14:17:17.623   luup.variable_set:0: 28.urn:upnp-org:serviceId:VContainer1.Variable2 was: 79.5 now: 79.5 #hooks:0
2015-10-16 14:17:17.623   luup.variable_set:0: 28.urn:upnp-org:serviceId:VContainer1.Variable4 was:  now:  #hooks:0
2015-10-16 14:17:17.623   luup.variable_set:0: 28.urn:upnp-org:serviceId:VContainer1.Variable5 was: 17.3 now: 10.4 #hooks:0
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 16, 2015, 03:52:19 pm
VeraBridge file (Lua) updated, system reloaded.

Code: [Select]
cuda@Ubuntu:/etc/cmh-ludl$ ls -ld *VeraBridge*
-rw-r--r-- 1 cuda cuda   732 Jul  5 21:22 D_VeraBridge.json
-rw-r--r-- 1 cuda cuda   758 Jul  3 17:19 D_VeraBridge.xml
-rw-r--r-- 1 cuda cuda  2316 Aug 24 21:42 I_VeraBridge.xml
-rw-rw-r-- 1 cuda cuda 11717 Oct 15 10:41 L_VeraBridge.lua
-rw-r--r-- 1 cuda cuda 11623 Oct  8 17:30 L_VeraBridge.old
cuda@Ubuntu:/etc/cmh-ludl$

Can you confirm you don't have a S_VeraBridge.xml file?  It should be part of the distribution, but, in fact, openLuup shouldn't need it (although if you ran it on Vera, you would.)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 03:57:01 pm
Just checked, I don't have that file ...

VeraBridge file (Lua) updated, system reloaded.

Code: [Select]
cuda@Ubuntu:/etc/cmh-ludl$ ls -ld *VeraBridge*
-rw-r--r-- 1 cuda cuda   732 Jul  5 21:22 D_VeraBridge.json
-rw-r--r-- 1 cuda cuda   758 Jul  3 17:19 D_VeraBridge.xml
-rw-r--r-- 1 cuda cuda  2316 Aug 24 21:42 I_VeraBridge.xml
-rw-rw-r-- 1 cuda cuda 11717 Oct 15 10:41 L_VeraBridge.lua
-rw-r--r-- 1 cuda cuda 11623 Oct  8 17:30 L_VeraBridge.old
cuda@Ubuntu:/etc/cmh-ludl$

Can you confirm you don't have a S_VeraBridge.xml file?  It should be part of the distribution, but, in fact, openLuup shouldn't need it (although if you ran it on Vera, you would.)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 16, 2015, 04:43:04 pm
Just checked, I don't have that file ...

No, my mistake - I lied.  It uses other existing service files, and doesn't need one.  I've obviously lost the plot completely.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 16, 2015, 04:51:56 pm
When directing the TTS to device 131 (Vera).

Code: [Select]
2015-10-15 19:43:18.486   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Amicasaverde-com%3AserviceId%3ASonos1%22%2C%20%22Say%22%2C%20%7BText%3D%22This%20is%20a%20test%20of%20the%20American%20broadcast%20system%2C%20this%20is%20only%20a%20openLuup%20test.%22%2C%20Volume%3D30%7D%2C%2025)&_=1444955898615 tcp{client}: 0x2301060
2015-10-15 19:43:18.488   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is a test of the American broadcast system, this is only a openLuup test.", Volume=30}, 25))
2015-10-15 19:43:18.488   luup.call_action:0: 25.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-15 19:43:18.488   luup.call_action:0: action will be handled by parent: 4
2015-10-15 19:43:18.488   luup_log:0: ALTUI: Evaluation of lua code returned: null
2015-10-15 19:43:18.490   openLuup.server:: request completed (9 bytes, 1 chunks, 3 ms) tcp{client}: 0x2301060
2015-10-15 19:43:18.490   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&Text=This is a test of the American broadcast system, this is only a openLuup test.&Volume=30
2015-10-15 19:43:18.497   luup_log:4: failed requests status: 0

OK, on to the next one...  have I got this right?  This looks like you ran a Lua Test code in openLuup to make a luup.call_action on device 25, which is the local bridged copy of the remote Sonos.  This was correctly passed to the VeraBridge plugin and routed on to remote device 131, the actual Sonos plugin on your Vera.  That call failed. 

Yes?
 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 04:58:52 pm
Now I might be lying.. I looked back at that post/logs and when I indicated 131 (Vera), sure looks like 25 in that device id...

When directing the TTS to device 131 (Vera).

Code: [Select]
2015-10-15 19:43:18.486   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Amicasaverde-com%3AserviceId%3ASonos1%22%2C%20%22Say%22%2C%20%7BText%3D%22This%20is%20a%20test%20of%20the%20American%20broadcast%20system%2C%20this%20is%20only%20a%20openLuup%20test.%22%2C%20Volume%3D30%7D%2C%2025)&_=1444955898615 tcp{client}: 0x2301060
2015-10-15 19:43:18.488   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is a test of the American broadcast system, this is only a openLuup test.", Volume=30}, 25))
2015-10-15 19:43:18.488   luup.call_action:0: 25.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-15 19:43:18.488   luup.call_action:0: action will be handled by parent: 4
2015-10-15 19:43:18.488   luup_log:0: ALTUI: Evaluation of lua code returned: null
2015-10-15 19:43:18.490   openLuup.server:: request completed (9 bytes, 1 chunks, 3 ms) tcp{client}: 0x2301060
2015-10-15 19:43:18.490   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&Text=This is a test of the American broadcast system, this is only a openLuup test.&Volume=30
2015-10-15 19:43:18.497   luup_log:4: failed requests status: 0

OK, on to the next one...  have I got this right?  This looks like you ran a Lua Test code in openLuup to make a luup.call_action on device 25, which is the local bridged copy of the remote Sonos.  This was correctly passed to the VeraBridge plugin and routed on to remote device 131, the actual Sonos plugin on your Vera.  That call failed. 

Yes?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 05:28:07 pm
Of course my Vera is unreachable here at work, but this gives some insight into how the requests are being handled by oL. I do remember thinking that 131 should have worked because I copied the URL you generated and executed it from a browser and it worked. It's unclear to me why it wouldn't have worked... I'll retest again tonight just to make sure.

Device 131 (Vera Device ID):
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is a test of the American broadcast system, this is only a openLuup test.", Volume=30}, 131)
Code: [Select]
2015-10-16 16:02:12.331   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Amicasaverde-com%3AserviceId%3ASonos1%22%2C%20%22Say%22%2C%20%7BText%3D%22This%20is%20a%20test%20of%20the%20American%20broadcast%20system%2C%20this%20is%20only%20a%20openLuup%20test.%22%2C%20Volume%3D30%7D%2C%20131)&_=1445015688766 tcp{client}: 0x1e6cf48
2015-10-16 16:02:12.333   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is a test of the American broadcast system, this is only a openLuup test.", Volume=30}, 131))
2015-10-16 16:02:12.333   luup.call_action:0: 131.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-16 16:02:12.333   luup_log:0: ALTUI: Evaluation of lua code returned: ./openLuup/luup.lua:317: attempt to index field 'services' (a function value)

Device 25 (oL Device ID):
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is a test of the American broadcast system, this is only a openLuup test.", Volume=30}, 25)
Code: [Select]
2015-10-16 16:04:30.869   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Amicasaverde-com%3AserviceId%3ASonos1%22%2C%20%22Say%22%2C%20%7BText%3D%22This%20is%20a%20test%20of%20the%20American%20broadcast%20system%2C%20this%20is%20only%20a%20openLuup%20test.%22%2C%20Volume%3D30%7D%2C%2025)&_=1445015688771 tcp{client}: 0x1a26fe0
2015-10-16 16:04:30.870   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is a test of the American broadcast system, this is only a openLuup test.", Volume=30}, 25))
2015-10-16 16:04:30.870   luup.call_action:0: 25.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-16 16:04:30.871   luup.call_action:0: action will be handled by parent: 4
2015-10-16 16:04:30.871   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-16 16:04:30.872   openLuup.server:: request completed (8 bytes, 1 chunks, 3 ms) tcp{client}: 0x1a26fe0
2015-10-16 16:04:30.873   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=&Text=This is a test of the American broadcast system, this is only a openLuup test.&Volume=30
2015-10-16 16:04:30.875   luup_log:4: failed requests status: 0
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 16, 2015, 05:47:01 pm
@CudaNet

OK, well when you can, could you give this version a go?
...slightly improved diagnostics and a fix of a potential problem.

What would perhaps clinch the problem is a log from Vera during this time.  But I have a hunch, so see what the attached does.

Thanks
 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 06:02:12 pm
I'll load this up when I get home and get logs from both ends...

@CudaNet

OK, well when you can, could you give this version a go?
...slightly improved diagnostics and a fix of a potential problem.

What would perhaps clinch the problem is a log from Vera during this time.  But I have a hunch, so see what the attached does.

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 09:24:40 pm
Loaded the updated version (VeraBridge). When I address device 25 (openLuup), it worked perfectly ...

The oL device:
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is an openLuup TTS test.", Volume=20}, 25)
Code: [Select]
2015-10-16 20:17:18.503   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is an openLuup TTS test.", Volume=20}, 25)


)
2015-10-16 20:17:18.503   luup.call_action:0: 25.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-16 20:17:18.503   luup.call_action:0: action will be handled by parent: 4
2015-10-16 20:17:18.503   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-16 20:17:18.505   openLuup.server:: request completed (8 bytes, 1 chunks, 3 ms) tcp{client}: 0x1fb1448
2015-10-16 20:17:18.506   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:Sonos1&action=Say&DeviceNum=131&Text=This%20is%20an%20openLuup%20TTS%20test%2e&Volume=20
2015-10-16 20:17:20.546   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.AVTransportURI was: x-file-cifs://192.168.2.2/music/16bit/vera/clock/9-clock.mp3 now: http://192.168.2.189:80/Say.131.mp3 #hooks:0
2015-10-16 20:17:20.547   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentTrackDuration was: 0:00:56 now: 0:00:02 #hooks:0
2015-10-16 20:17:20.547   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentTrackURI was: x-file-cifs://192.168.2.2/music/16bit/vera/clock/9-clock.mp3 now: http://192.168.2.189:80/Say.131.mp3 #hooks:0
2015-10-16 20:17:20.547   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentTrackMetaData was: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="x-file-cifs:*:audio/mpeg:*" duration="0:00:56">x-file-cifs://192.168.2.2/music/16bit/vera/clock/9-clock.mp3</res><r:streamContent></r:streamContent><r:radioShowMd></r:radioShowMd><dc:title>Chimes</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:creator>Grand Father Chimes</dc:creator><upnp:album>http://www.Sounddogs.com</upnp:album><r:albumArtist>Grand Father Chimes</r:albumArtist></item></DIDL-Lite> now: <DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="http-get:*:audio/mpeg:*" duration="0:00:02">http://192.168.2.189:80/Say.131.mp3</res><r:streamContent></r:streamContent><r:radioShowMd></r:radioShowMd><dc:title>Say.131.mp3</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class></item></DIDL-Lite> #hooks:0
2015-10-16 20:17:20.548   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentStatus was: Chimes:  (Grand Father Chimes, http://www.Sounddogs.com) now: Say.131.mp3 #hooks:0
2015-10-16 20:17:20.548   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentTitle was: Chimes now: Say.131.mp3 #hooks:0
2015-10-16 20:17:20.549   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentArtist was: Grand Father Chimes now:  #hooks:0
2015-10-16 20:17:20.549   luup.variable_set:4: 25.urn:upnp-org:serviceId:AVTransport.CurrentAlbum was: http://www.Sounddogs.com now:  #hooks:0
2015-10-16 20:17:20.549   luup.variable_set:4: 25.urn:upnp-org:serviceId:RenderingControl.Volume was: 32 now: 20 #hooks:0

And the Vera device (131):
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is an openLuup TTS test.", Volume=20}, 131)
Code: [Select]
2015-10-16 20:21:50.398   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Amicasaverde-com%3AserviceId%3ASonos1%22%2C%20%22Say%22%2C%20%7BText%3D%22This%20is%20an%20openLuup%20TTS%20test.%22%2C%20Volume%3D20%7D%2C%20131)%0A%0A%0A&_=1445043988804 tcp{client}: 0x1bcba50
2015-10-16 20:21:50.399   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", {Text="This is an openLuup TTS test.", Volume=20}, 131)


)
2015-10-16 20:21:50.400   luup.call_action:0: 131.urn:micasaverde-com:serviceId:Sonos1.Say
2015-10-16 20:21:50.400   luup_log:0: ALTUI: Evaluation of lua code returned: ./openLuup/luup.lua:317: attempt to index field 'services' (a function value)
Title: openLuup - running unmodified plugins on any machine
Post by: mda on October 16, 2015, 09:33:14 pm
@mda

Yes, it was an error in the download (actually it was the multiple '.' in the filename that screwed things up.)

Here's a replacement plugin file to go into the openLuup/ subdirectory.

Sorry!

Thanks @akbooer. I installed this file, did a reset, used the url to install altui, then accessed altui and it did an automatic update to aultui (which i then tested and also worked fine).

But, then I started openluup with my startup.lua file and just like before and  got the same waiting error.

I have PM'd you new logs and  my startup.lua file. Thanks for helping me through this.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 10:14:30 pm
[1] Philips Lux bulbs (Grouped), addressed using openLuup device id works perfectly.

luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "50"}, 103)
Code: [Select]
2015-10-16 20:51:42.159   luup_log:0: ALTUI: runLua(luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "50"}, 103)


)
2015-10-16 20:51:42.160   luup.call_action:0: 103.urn:upnp-org:serviceId:Dimming1.SetLoadLevelTarget
2015-10-16 20:51:42.160   luup.call_action:0: action will be handled by parent: 4
2015-10-16 20:51:42.160   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-16 20:51:42.162   openLuup.server:: request completed (8 bytes, 1 chunks, 3 ms) tcp{client}: 0x1ca4a78
2015-10-16 20:51:42.162   luup_log:4: http://192.168.2.189:3480/data_request?id=action&action=SetLoadLevelTarget&serviceId=urn:upnp-org:serviceId:Dimming1&DeviceNum=342&newLoadlevelTarget=50
2015-10-16 20:51:44.374   luup.variable_set:4: 11.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 1802 now: 1803 #hooks:0
2015-10-16 20:51:44.375   luup.variable_set:4: 12.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 1805 now: 1806 #hooks:0
2015-10-16 20:51:44.383   luup.variable_set:4: 70.urn:micasaverde-com:serviceId:ZWaveDevice1.LastWakeup was: 1445045785 now: 1445046697 #hooks:0
2015-10-16 20:51:44.385   luup.variable_set:4: 103.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 2 now: 50 #hooks:0
2015-10-16 20:51:44.386   luup.variable_set:4: 103.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 2 now: 50 #hooks:0
2015-10-16 20:51:44.926   openLuup.server:: request completed (18380 bytes, 2 chunks, 6276 ms) tcp{client}: 0x1d174c0
2015-10-16 20:51:45.046   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=43741261&Timeout=60&MinimumDelay=1500&_=1445043989040 tcp{client}: 0x1d174c0
2015-10-16 20:51:49.599   luup.variable_set:4: 85.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 2 now: 50 #hooks:0
2015-10-16 20:51:49.600   luup.variable_set:4: 85.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 2 now: 50 #hooks:0
2015-10-16 20:51:49.600   luup.variable_set:4: 86.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 2 now: 50 #hooks:0
2015-10-16 20:51:49.601   luup.variable_set:4: 86.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 2 now: 50 #hooks:0

--
and the Vera3 log
08      10/16/15 20:51:41.539   JobHandler_LuaUPnP::HandleActionRequest device: 342 service: urn:upnp-org:serviceId:Dimming1 action: SetLoadLevelTarget <0x30841680>
06      10/16/15 20:51:41.545   Device_Variable::m_szValue_set device: 342 service: urn:upnp-org:serviceId:Dimming1 variable: LoadLevelStatus was: 2 now: 50 #hooks: 4 upnp: 0 skip: 0 v:0xb9d0c8/NONE duplicate:0 <0x2abe3000>
06      10/16/15 20:51:41.546   Device_Variable::m_szValue_set device: 342 service: urn:upnp-org:serviceId:Dimming1 variable: LoadLevelTarget was: 2 now: 50 #hooks: 0 upnp: 0 skip: 0 v:0x81a820/NONE duplicate:0 <0x2abe3000>
06      10/16/15 20:51:41.549   Device_Variable::m_szValue_set device: 342 service: urn:upnp-org:serviceId:SwitchPower1 variable: Status was: 1 now: 1 #hooks: 0 upnp: 0 skip: 0 v:0xb66528/NONE duplicate:1 <0

[2] Philips Hue Group (3 bulbs), addressed using openLuup device id works perfectly.

luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "75"}, 102)
Code: [Select]
2015-10-16 20:58:52.925   luup_log:0: ALTUI: runLua(luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "75"}, 102)


)
2015-10-16 20:58:52.925   luup.call_action:0: 102.urn:upnp-org:serviceId:Dimming1.SetLoadLevelTarget
2015-10-16 20:58:52.926   luup.call_action:0: action will be handled by parent: 4
2015-10-16 20:58:52.926   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-16 20:58:52.927   openLuup.server:: request completed (8 bytes, 1 chunks, 3 ms) tcp{client}: 0x15f5058
2015-10-16 20:58:52.928   luup_log:4: http://192.168.2.189:3480/data_request?id=action&action=SetLoadLevelTarget&serviceId=urn:upnp-org:serviceId:Dimming1&DeviceNum=341&newLoadlevelTarget=75
2015-10-16 20:58:56.179   luup.variable_set:4: 102.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 25 now: 75 #hooks:0
2015-10-16 20:58:56.180   luup.variable_set:4: 102.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 25 now: 75 #hooks:0
2015-10-16 20:58:56.181   luup.variable_set:4: 111.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 1768 now: 1769 #hooks:0
2015-10-16 20:58:56.181   luup.variable_set:4: 111.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 2227 now: 2261 #hooks:0
2015-10-16 20:58:56.182   luup.variable_set:4: 114.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 2227 now: 2261 #hooks:0
2015-10-16 20:58:56.182   luup.variable_set:4: 116.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 1778 now: 1779 #hooks:0
2015-10-16 20:58:56.709   openLuup.server:: request completed (11390 bytes, 1 chunks, 6282 ms) tcp{client}: 0x1d174c0
2015-10-16 20:58:56.815   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=43741459&Timeout=60&MinimumDelay=1500&_=1445043989101 tcp{client}: 0x1d174c0
2015-10-16 20:59:01.387   luup.variable_set:4: 34.urn:micasaverde-com:serviceId:EnergyMetering1.Watts was: 784 now: 782 #hooks:0
2015-10-16 20:59:01.387   luup.variable_set:4: 34.urn:micasaverde-com:serviceId:EnergyMetering1.Log was: 784,772,819,1445047078,1679 now: 782,772,819,1445047138,1739 #hooks:0
2015-10-16 20:59:01.387   luup.variable_set:4: 34.urn:micasaverde-com:serviceId:EnergyMetering1.KWHReading was: 1445047089 now: 1445047136 #hooks:0
2015-10-16 20:59:01.388   luup.variable_set:4: 34.urn:smartmeter-han:serviceId:SmartMeterHAN1.LastUpdateFormatted was: Fri 08:58:09 PM now: Fri 08:58:56 PM #hooks:0
2015-10-16 20:59:01.388   luup.variable_set:4: 34.urn:micasaverde-com:serviceId:HaDevice1.LastUpdate was: 1445047089 now: 1445047136 #hooks:0
2015-10-16 20:59:01.388   luup.variable_set:4: 80.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 25 now: 75 #hooks:0
2015-10-16 20:59:01.389   luup.variable_set:4: 80.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 25 now: 75 #hooks:0
2015-10-16 20:59:01.389   luup.variable_set:4: 81.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 25 now: 75 #hooks:0
2015-10-16 20:59:01.389   luup.variable_set:4: 81.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 25 now: 75 #hooks:0
2015-10-16 20:59:01.390   luup.variable_set:4: 82.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 25 now: 75 #hooks:0
2015-10-16 20:59:01.390   luup.variable_set:4: 82.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 25 now: 75 #hooks:0

--
and the Vera3 log
08      10/16/15 20:58:52.300   JobHandler_LuaUPnP::HandleActionRequest device: 341 service: urn:upnp-org:serviceId:Dimming1 action: SetLoadLevelTarget <0x2fa41680>
06      10/16/15 20:58:52.305   Device_Variable::m_szValue_set device: 341 service: urn:upnp-org:serviceId:Dimming1 variable: LoadLevelStatus was: 25 now: 75 #hooks: 2 upnp: 0 skip: 0 v:0xb9d0c8/NONE duplicate:0 <0x2abe3000>
06      10/16/15 20:58:52.306   Device_Variable::m_szValue_set device: 341 service: urn:upnp-org:serviceId:Dimming1 variable: LoadLevelTarget was: 25 now: 75 #hooks: 0 upnp: 0 skip: 0 v:0x81a820/NONE duplicate:0 <0x2abe3000>
06      10/16/15 20:58:52.309   Device_Variable::m_szValue_set device: 341 service: urn:upnp-org:serviceId:SwitchPower1 variable: Status was: 1 now: 1 #hooks: 0 upnp: 0 skip: 0 v:0xb66528/NONE duplicate:1 <

[3] Philips Hue Bloom (Hue/Saturation), addressed using openLuup device id works perfectly.

luup.call_action("urn:micasaverde-com:serviceId:PhilipsHue1", "SetHueAndSaturation", {Hue="64879";Saturation="253"}, 98)

Code: [Select]
2015-10-16 21:30:03.570   luup_log:0: ALTUI: runLua(luup.call_action("urn:micasaverde-com:serviceId:PhilipsHue1", "SetHueAndSaturation", {Hue="64879";Saturation="253"}, 98)


)
2015-10-16 21:30:03.570   luup.call_action:0: 98.urn:micasaverde-com:serviceId:PhilipsHue1.SetHueAndSaturation
2015-10-16 21:30:03.570   luup.call_action:0: action will be handled by parent: 4
2015-10-16 21:30:03.571   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-16 21:30:03.572   openLuup.server:: request completed (8 bytes, 1 chunks, 3 ms) tcp{client}: 0x1804750
2015-10-16 21:30:03.573   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:PhilipsHue1&action=SetHueAndSaturation&DeviceNum=337&Hue=64879&Saturation=253
2015-10-16 21:30:05.729   luup.variable_set:4: 98.urn:micasaverde-com:serviceId:PhilipsHue1.IconValue was: V now: R #hooks:0
2015-10-16 21:30:05.729   luup.variable_set:4: 98.urn:micasaverde-com:serviceId:PhilipsHue1.LampValues was: hue:60000;sat:253 now: hue:64879;sat:253 #hooks:0

--
and the Vera3 log
08      10/16/15 21:30:02.917   JobHandler_LuaUPnP::HandleActionRequest device: 337 service: urn:micasaverde-com:serviceId:PhilipsHue1 action: SetHueAndSaturation <0x30d07680>
06      10/16/15 21:30:02.923   Device_Variable::m_szValue_set device: 337 service: urn:micasaverde-com:serviceId:PhilipsHue1 variable: LampValues was: hue:60000;sat:253 now: hue:64879;sat:253 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x2b6aa000>
06      10/16/15 21:30:02.924   Device_Variable::m_szValue_set device: 337 service: urn:micasaverde-com:serviceId:PhilipsHue1 variable: IconValue was: V now: R #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 16, 2015, 11:52:58 pm
I just noticed this... I have a variable container, Lua gets the weather data and places it within the container on openLuup. Then it appears that the original values on Vera3 overwrite it, wasn't doing this before...
Is there a write up (or an example somewhere) on how to localize the plugins, independent of Vera3 (of course this wouldn't apply to zwave devices) ?

Code: [Select]

-- we get the data from Wunderground...
2015-10-16 22:40:48.244   luup_log:0: Wunderground refreshed.
2015-10-16 22:40:48.244   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName1 was: x now: Partly Cloudy #hooks:0
2015-10-16 22:40:48.245   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName2 was: x now: 46% #hooks:0
2015-10-16 22:40:48.245   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName3 was: y now: 9.8 #hooks:0
2015-10-16 22:40:48.245   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName4 was: x now: 0.0 #hooks:0
2015-10-16 22:40:48.246   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName5 was: x now: 0.00 #hooks:0
2015-10-16 22:40:48.246   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable1 was: y now: 0 #hooks:0
2015-10-16 22:40:48.246   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable2 was: y now: 66 #hooks:0
2015-10-16 22:40:48.247   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable3 was: y now: 66.0 #hooks:0
2015-10-16 22:40:48.247   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable4 was: y now:  #hooks:0
2015-10-16 22:40:48.247   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable5 was: y now: 11.5 #hooks:0
2015-10-16 22:40:48.248   luup.scenes:0: running 2, Wunderground, initiated by Refresh Weather
2015-10-16 22:40:48.502   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=50637286&Timeout=60&MinimumDelay=1500&_=1445051565617 tcp{client}: 0x14e0e38
2015-10-16 22:40:50.018   openLuup.server:: request completed (2424 bytes, 1 chunks, 1515 ms) tcp{client}: 0x14e0e38
2015-10-16 22:40:50.132   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=50637296&Timeout=60&MinimumDelay=1500&_=1445051565618 tcp{client}: 0x14e0e38
2015-10-16 22:40:52.227   luup.variable_set:4: 111.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 2257 now: 2204 #hooks:0
2015-10-16 22:40:52.231   luup.variable_set:4: 114.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 2257 now: 2204 #hooks:0
2015-10-16 22:40:52.749   openLuup.server:: request completed (7227 bytes, 1 chunks, 2617 ms) tcp{client}: 0x14e0e38
2015-10-16 22:40:52.861   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=50637298&Timeout=60&MinimumDelay=1500&_=1445051565619 tcp{client}: 0x14e0e38
2015-10-16 22:41:02.521   luup.variable_set:4: 111.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 2204 now: 2240 #hooks:0
2015-10-16 22:41:02.522   luup.variable_set:4: 114.urn:micasaverde-com:serviceId:GenericSensor1.CurrentLevel was: 2204 now: 2240 #hooks:0
2015-10-16 22:41:03.040   openLuup.server:: request completed (7227 bytes, 1 chunks, 10179 ms) tcp{client}: 0x14e0e38
2015-10-16 22:41:03.169   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=50637300&Timeout=60&MinimumDelay=1500&_=1445051565620 tcp{client}: 0x14e0e38
2015-10-16 22:41:08.867   luup.variable_set:4: 8.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 1820 now: 1821 #hooks:0

And then it's overwritten...
2015-10-16 22:41:08.880   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName1 was: Partly Cloudy now: x #hooks:0
2015-10-16 22:41:08.881   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable1 was: 0 now: y #hooks:0
2015-10-16 22:41:08.881   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName2 was: 46% now: x #hooks:0
2015-10-16 22:41:08.881   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable2 was: 66 now: y #hooks:0
2015-10-16 22:41:08.881   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName3 was: 9.8 now: y #hooks:0
2015-10-16 22:41:08.881   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable3 was: 66.0 now: y #hooks:0
2015-10-16 22:41:08.882   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName4 was: 0.0 now: x #hooks:0
2015-10-16 22:41:08.882   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable4 was:  now: y #hooks:0
2015-10-16 22:41:08.882   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName5 was: 0.00 now: x #hooks:0
2015-10-16 22:41:08.882   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable5 was: 11.5 now: y #hooks:0
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 17, 2015, 12:49:18 am
Last one for the night...  Just tested the Harmony Hub plugin... Works perfectly
Vera3 [254]
openLuup(#42)

Code: [Select]
2015-10-16 23:42:43.836   openLuup.server:: /data_request?id=action&output_format=json&DeviceNum=42&serviceId=urn:rboer-com:serviceId:HarmonyDevice1&action=SendDeviceCommand&Command=PowerOn tcp{client}: 0x1dd4e90
2015-10-16 23:42:43.838   luup.call_action:: 42.urn:rboer-com:serviceId:HarmonyDevice1.SendDeviceCommand
2015-10-16 23:42:43.838   luup.call_action:: action will be handled by parent: 4
2015-10-16 23:42:43.841   openLuup.server:: request completed (66 bytes, 1 chunks, 4 ms) tcp{client}: 0x1dd4e90
2015-10-16 23:42:43.844   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:rboer-com:serviceId:HarmonyDevice1&action=SendDeviceCommand&DeviceNum=254&serviceId=urn%3arboer%2dcom%3aserviceId%3aHarmonyDevice1&action=SendDeviceCommand&Command=PowerOn
2015-10-16 23:42:45.433   luup.variable_set:4: 40.urn:rboer-com:serviceId:Harmony1.IconSet was: 0 now: 1 #hooks:0
2015-10-16 23:42:45.433   luup.variable_set:4: 40.urn:rboer-com:serviceId:Harmony1.LastCommand was: list_devices now: issue_device_command #hooks:0
2015-10-16 23:42:45.434   luup.variable_set:4: 40.urn:rboer-com:serviceId:Harmony1.LastCommandTime was: 21:04:35 Fri, 16 Oct 2015 now: 23:42:43 Fri, 16 Oct 2015 #hooks:0
2015-10-16 23:42:45.434   luup.variable_set:4: 42.urn:rboer-com:serviceId:HarmonyDevice1.LastDeviceCommand was:  now: PowerOn #hooks:0
2015-10-16 23:42:45.434   luup.variable_set:4: 42.urn:rboer-com:serviceId:HarmonyDevice1.IconSet was: 0 now: 2 #hooks:0
2015-10-16 23:42:45.956   openLuup.server:: request completed (7862 bytes, 1 chunks, 4856 ms) tcp{client}: 0x1ad62a0
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 17, 2015, 07:13:35 am
@CudaNet

It seems like you are racking up some successes here.  To summarise:
I think the other reported problems (VariableContainer, etc.) probably arise from a slight misunderstanding as to the functioning of VeraBridge - no doubt due to the fact that I haven't really documented its features. I must add something to the User Guide, but basically...

VeraBridge provides local clones of devices on a remote Vera, which:
The device numbering is, inevitably, different from that on the remote machine and one of VeraBridge's main functions is to intecept actions on the local devices and pass them to the remote ones.  What does NOT work is to set a variable on a local device and expect that variable on the corresponding remote device to change.

I need more narrative from you to understand exactly your setup being tested, but my understanding is that mostly you have been using the ATLUI Lua Test window to issue action commands to local clone devices and checking that the actual remote devices respond accordingly.  This is what's meant to work and, so far as I can see, it does.

Your problem with the weather data in the variable container SEEMS to be that you are changing values there both from the remote machine AND from the openLuup one.  Inevitably there is the situation of one overwriting the other. 

The real promise of openLuup is that you can run most plugins directly on it, rather than on Vera, so reducing the load (and increasing reliability) of Vera.  You can, for example, create a variable container under openLuup that will be quite independent from the cloned one.  Almost any plugin which creates virtual devices, or manipulates actual Zwave ones through luup calls, should work.  However, some plugins are quite exotic:
So, once again, the goal is to have any plugin work entirely without modification under openLuup.  The reality is that not everything can work.  Because I don't have many of the devices that others do, I'm relying on your goodwill to help test and debug.  Your efforts much appreciated!  Tell me again what's NOT working (as well as what is.)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 17, 2015, 07:20:40 am
I installed this file, did a reset, used the url to install altui, then accessed altui and it did an automatic update to aultui (which i then tested and also worked fine).
Glad to hear you have, at least, a working ALTUI installation (and that the update worked OK)

Quote
But, then I started openluup with my startup.lua file and just like before and  got the same waiting error.
I think that this is related to ALTUI not finding all the files it needs to describe installed system devices.  You have a large system (150 devices) bridged to openLuup and it's quite hard to find out what might be missing.  Can you, for a start, simply comment out the VeraBridge device creation in your starup.lua and confirm that you get a running system.

Since what you DON'T want to do is start hacking about in your actual Vera, I think one approach would be for me to include some way of 'whitelisting' or 'blacklisting' remote devices in VeraBridge, to avoid it cloning them.  We could then simply work through and see where it breaks.  In the meantime, could you check that all the device files on your Vera have indeed been copied onto your openLuup machine.  The easiest way to do this would be to rerun the openLuup_getfiles utility and move the uncompressed files into your openLuup /etc/cmh-ludl/ directory.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 17, 2015, 11:33:44 am
That trick could help : Opening altUI in chrome developer tools ( built in in any chrome nstallation, or equivalent dev tools of your browse, FF has I think ) and looking at the "network" page during the startup would show you the files that altUI requests and you should see the ones that are not completing properly ( showing a pending status instead of a http 200 status ). Waiting message is an incomplete download of the page.


Envoy? de mon iPad en utilisant Tapatalk
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 17, 2015, 11:46:59 am
@amg0 - great trick!  My goodness!  I've never looked at that page.  Enlightening, yes?

Let's hope it helps @mda.

Thanks so much for this (and also for the HTTP request mod to make auto-update work!)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 17, 2015, 12:23:33 pm
Very difficult to test during the week so I hunkered down and wanted to get you as much information as possible on what's working and what might not be...

Quote
It seems like you are racking up some successes here.  To summarise:
  • Harmony Hub
  • Philips Lux
  • Philips Hue (several sorts)
  • Sonos
  • ...?

Actually your documentation is quite good, my perception of how it works is what's pulling me in opposite directions. The more you explain though, the clearer things become...

Quote
I think the other reported problems (VariableContainer, etc.) probably arise from a slight misunderstanding as to the functioning of VeraBridge - no doubt due to the fact that I haven't really documented its features. I must add something to the User Guide, but basically...

VeraBridge provides local clones of devices on a remote Vera, which:
  • reflect the status of the remote devices (ie. device variables)
  • present, through ALTUI, a display panel
  • allow control of the remote devices (eg. on/off, dimming, ...) through the usual luup.call_action mechanism

Makes complete sense and my initial use case of setting the variable container locally (not on Vera) is exactly what I was attempting to accomplish - never expecting Vera to see those updates.

Quote
The device numbering is, inevitably, different from that on the remote machine and one of VeraBridge's main functions is to intecept actions on the local devices and pass them to the remote ones.  What does NOT work is to set a variable on a local device and expect that variable on the corresponding remote device to change.


You are exactly correct, in all cases with the exception of the Variable container which is Lua code executed within a scene (addressing the clone device).

Quote
I need more narrative from you to understand exactly your setup being tested, but my understanding is that mostly you have been using the ATLUI Lua Test window to issue action commands to local clone devices and checking that the actual remote devices respond accordingly.  This is what's meant to work and, so far as I can see, it does.

The scene that used to run on Vera (now completely removed) now lives on openLuup so Vera no longer gets updates. My scene now runs on openLuup, writes the results to the cloned container and within a few moments - appears to get a refresh (well, since it was last run which was days ago) from the remote Vera thus overwriting the data.

Quote
Your problem with the weather data in the variable container SEEMS to be that you are changing values there both from the remote machine AND from the openLuup one.  Inevitably there is the situation of one overwriting the other. 

YES, love it... This is what's been needed for soo long. You summed it up perfectly on page 1...

Quote
The real promise of openLuup is that you can run most plugins directly on it, rather than on Vera, so reducing the load (and increasing reliability) of Vera.  You can, for example, create a variable container under openLuup that will be quite independent from the cloned one.  Almost any plugin which creates virtual devices, or manipulates actual Zwave ones through luup calls, should work.  However, some plugins are quite exotic:
  • ALTUI - I've worked hard to make this work as far as possible, but in fact some things that ALTUI does assume system configurations which are somewhat outside of my control - specifically expecting the HTTP port 80 request syntax '/port_3480' to do a redirect to port 3480, and also using calls to another port '/port_49451/upnp/control/hag'.  This means that a few things don't work.
  • Sonos - this is a huge and very complex plugin which also uses 'helper' modules to accomplish some tasks (UPnP, TTS)  It's mostly working directly in openLuup, with the notable exception of cover art, for some reason.  Possibly other things, and we can work on this to improve.  But just understanding the plugin's requirements is tough.
  • RGBController - from @vosmont - a great plugin which provides a colour wheel for a variety of third-party Zwave RGB(W) dimmers.  However, some of its actions are accomplished through direct Zwave calls, and so far I've not been able to find a way to make this work under arbitrary OS and hardware systems which don't have attached Zwave hardware.

Honestly, I can live with that... I'm enamored with the overall results thus far, I have 125 devices and I've intentionally had to keep my scenes to a minimum because of the instability of Vera. So I'm unable to use Vera as it was intended. What you've provided allows me/us/everyone the ability to run on their own equipment using pure Lua. I have 500 meg. of memory right now running on a quad core Pi the size just slightly larger than a pack of cigarettes. On Vera's best day I might (MIGHT) have 71 meg of memory and the CPU seems way higher than it should.

I can't thank YOU and amg0 enough for all the efforts and thought put into these projects. Testing is the very least I/we/anyone can do so I'll do whatever it takes to help make all of this work. I will say to others who are not familiar with the Raspberry Pi's, make sure you setup the system properly to obtain a proper date/time before you run any of this. This gave me the most trouble !!! Get a hardware clock OR simply allow the system enough time to get the network time.

Quote
So, once again, the goal is to have any plugin work entirely without modification under openLuup.  The reality is that not everything can work.  Because I don't have many of the devices that others do, I'm relying on your goodwill to help test and debug.  Your efforts much appreciated! 

So I've deleted the scene that runs on Vera3 that obtains weather data and stores it within the Variable Container. So the data that lives within that container was the result generated days ago - no longer getting any updates. On openLuup, I have a scene that runs every 5 minutes, gets the data from Wunderground and stores it to the 'cloned' container. This works perfectly, however it appears that openLuup may be pulling back the data stored on Vera's container and overwriting.. Here's a recent log of events.

So as it stands, my Hue/Lux/Sonos (TTS and CIFS) all work perfectly...

Code: [Select]
2015-10-17 11:10:57.358   luup_log:0: Wunderground refreshed.
2015-10-17 11:10:57.358   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName1 was: x now: Clear #hooks:0
2015-10-17 11:10:57.359   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName2 was: x now: 35% #hooks:0
2015-10-17 11:10:57.359   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName3 was: y now: 12.8 #hooks:0
2015-10-17 11:10:57.360   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName4 was: x now: 2.3 #hooks:0
2015-10-17 11:10:57.360   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.VariableName5 was: x now: 0.00 #hooks:0
2015-10-17 11:10:57.360   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable1 was: y now: 540 #hooks:0
2015-10-17 11:10:57.360   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable2 was: y now: 67.1 #hooks:0
2015-10-17 11:10:57.361   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable3 was: y now: 67.1 #hooks:0
2015-10-17 11:10:57.361   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable4 was: y now:  #hooks:0
2015-10-17 11:10:57.361   luup.variable_set:0: 129.urn:upnp-org:serviceId:VContainer1.Variable5 was: y now: 16.1 #hooks:0

2015-10-17 11:11:25.068   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=56881031&Timeout=60&MinimumDelay=1500&_=1445092427979 tcp{client}: 0x19eb620
2015-10-17 11:11:29.076   openLuup.heartbeat:: memory: 8.4Mb, uptime: 0.48 days, cpu: 851.9 sec (2.06%)
2015-10-17 11:11:31.982   luup.variable_set:4: 75.urn:micasaverde-com:serviceId:ZWaveDevice1.PollOk was: 1849 now: 1850 #hooks:0
2015-10-17 11:11:31.986   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName1 was: Clear now: x #hooks:0
2015-10-17 11:11:31.986   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable1 was: 540 now: y #hooks:0
2015-10-17 11:11:31.986   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName2 was: 35% now: x #hooks:0
2015-10-17 11:11:31.987   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable2 was: 67.1 now: y #hooks:0
2015-10-17 11:11:31.987   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName3 was: 12.8 now: y #hooks:0
2015-10-17 11:11:31.987   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable3 was: 67.1 now: y #hooks:0
2015-10-17 11:11:31.987   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName4 was: 2.3 now: x #hooks:0
2015-10-17 11:11:31.988   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable4 was:  now: y #hooks:0
2015-10-17 11:11:31.988   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.VariableName5 was: 0.00 now: x #hooks:0
2015-10-17 11:11:31.988   luup.variable_set:4: 129.urn:upnp-org:serviceId:VContainer1.Variable5 was: 16.1 now: y #hooks:0
2015-10-17 11:11:32.508   openLuup.server:: request completed (7066 bytes, 1 chunks, 7439 ms) tcp{client}: 0x19eb620

Quote
Tell me again what's NOT working (as well as what is.)

Hoping sometime today I can test the Google Calendar 3 (read and write events to our calendar) plugin as well as some Fibaro motion sensors and usual suspects (binary and dimmable z-wave switches).
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 17, 2015, 12:54:19 pm
Very difficult to test during the week so I hunkered down and wanted to get you as much information as possible on what's working and what might not be...

That's great - very much appreciated, too.

Quote
I'm enamored with the overall results thus far, I have 125 devices and I've intentionally had to keep my scenes to a minimum because of the instability of Vera. So I'm unable to use Vera as it was intended. What you've provided allows me/us/everyone the ability to run on their own equipment using pure Lua.
[...]
So as it stands, my Hue/Lux/Sonos (TTS and CIFS) all work perfectly...

Thanks for the endorsement!

Quote
I have 500 meg. of memory right now running on a quad core Pi the size just slightly larger than a pack of cigarettes. On Vera's best day I might (MIGHT) have 71 meg of memory and the CPU seems way higher than it should.

Given the above, what gives me particular pleasure is to see this little entry in your log file:

Code: [Select]
2015-10-17 11:11:29.076   openLuup.heartbeat:: memory: 8.4Mb, uptime: 0.48 days, cpu: 851.9 sec (2.06%)

On, then, to your current issue:
Quote
So I've deleted the scene that runs on Vera3 that obtains weather data and stores it within the Variable Container. So the data that lives within that container was the result generated days ago - no longer getting any updates. On openLuup, I have a scene that runs every 5 minutes, gets the data from Wunderground and stores it to the 'cloned' container. This works perfectly, however it appears that openLuup may be pulling back the data stored on Vera's container and overwriting.. Here's a recent log of events.

Yes, I understand this behaviour completely...

Since it is possible (but fairly unlikely) that the VeraBridge will miss an update to a Vera device variable, every so often (actually, probably every minute) it scans the whole lot and updates all the cloned devices on openLuup.  This means that WHATEVER changes you make to cloned device variables will get overwritten frequently. The motto is this... do NOT write variables to cloned devices.  Simply create a local variable container for the weather info.  (Now this might be hard because I think that @chixxi withdrew the code for that, but there are alternatives, I believe.)

I'm not totally familiar with that device, but if it provided an ACTION which sets variables and values then you COULD use it on the cloned device to action a variable change and let VeraBridge update the local cloned variables as normal.  This would actually be a way of sharing the data obtained on the openLuup machine with anything (scenes, etc.) on Vera.

Good luck with your continued testing!


 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 17, 2015, 03:56:14 pm
@akbooer - when i comment out the verabridge in my startup lua, do a reset then run it with startup.lua, altui does indeed load ok. If you could give me a version where i could whitelist devices that would be great (in fact, that might be a good thing generally, not just for debugging, since i would never want all my devices from vera in openluup, especially those that can not work like VeraAlerts).

@amg0 - when i then uncomment the verabridge in my startup.lua, using chrome developer tools i get 2 errors:

Code: [Select]
Uncaught SyntaxError: Unexpected identifier
J_ALTUI_uimgr.js:9646 Uncaught ReferenceError: g_DeviceTypes is not defined

i do not see any vera devices in the objects it tries to load and all the objects it does load show status 200. Screen shot attached.

Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 17, 2015, 04:05:14 pm
Try to get and save the source of the html page, there is something invalid in that page.
You can also try to reset plugin config variable with the default button then the set button to be sure.


Envoy? de mon iPad en utilisant Tapatalk
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 17, 2015, 05:07:16 pm
@akbooer - when i comment out the verabridge in my startup lua, do a reset then run it with startup.lua, altui does indeed load ok. If you could give me a version where i could whitelist devices that would be great (in fact, that might be a good thing generally, not just for debugging, since i would never want all my devices from vera in openluup, especially those that can not work like VeraAlerts).

Yes, done properly that would be useful functionality.  However, here's a quick hack to VeraBridge which works slightly differently.  There should be a new device variable MAX_DEVICES which you can set to limit the total number of cloned devices - set this in your startup.lua file:

Code: [Select]
do -- the VERA BRIDGE !!
  local dev = luup.create_device ('', "Vera", "Vera", "D_VeraBridge.xml")
  luup.ip_set ("172.16.42.10", dev)         -- set remote Vera IP address  <-- your real IP goes here
  luup.variable_set ("urn:akbooer-com:serviceId:VeraBridge1", "MAX_DEVICES", 75, dev)
end

A binary search will find your problem in logarithmic time (!)  I've set the number of devices to half your total.  If this comes up working then half the difference between 75 and 150 (or whatever you max) say 115 or so.  If it fails at 75, halve the number to 38, etc.., etc...

I've not tested the code, but as a programmer who worked for me once said "I only changed one line - what can possibly go wrong?"

Good luck.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 18, 2015, 10:59:12 am
Yes, every time I see that log entry I smile...

Quote
Given the above, what gives me particular pleasure is to see this little entry in your log file:

Code: [Select]
2015-10-17 11:11:29.076   openLuup.heartbeat:: memory: 8.4Mb, uptime: 0.48 days, cpu: 851.9 sec (2.06%)

Quote
On, then, to your current issue:

Yes, I understand this behaviour completely...

Since it is possible (but fairly unlikely) that the VeraBridge will miss an update to a Vera device variable, every so often (actually, probably every minute) it scans the whole lot and updates all the cloned devices on openLuup.  This means that WHATEVER changes you make to cloned device variables will get overwritten frequently. The motto is this... do NOT write variables to cloned devices.  Simply create a local variable container for the weather info.  (Now this might be hard because I think that @chixxi withdrew the code for that, but there are alternatives, I believe.)

I'm not totally familiar with that device, but if it provided an ACTION which sets variables and values then you COULD use it on the cloned device to action a variable change and let VeraBridge update the local cloned variables as normal.  This would actually be a way of sharing the data obtained on the openLuup machine with anything (scenes, etc.) on Vera.

Good luck with your continued testing!

I've since stopped writing variables to the cloned container, I can't say I have any idea of how to make a plugin local to openLuup. It's not that important that I make this particular plugin work (only truly used for Solar levels), I believe Rex created a multi-string plugin which I see I have installed on my Vera but not yet used. I'll explore all that later...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 18, 2015, 11:26:50 am
I can't say I have any idea of how to make a plugin local to openLuup.
[...]
I believe Rex created a multi-string plugin which I see I have installed on my Vera but not yet used. I'll explore all that later...

Well, I just gave that a go.  Assuming you have the files loaded, then it's as easy as typing this into the Lua Test window:
Code: [Select]
luup.create_device ('', "Mstring", "Mstring", "D_MString.xml")

See attached for it working. I'll add that to the 'tested OK' list.

------

Edit:  You also need to put the icon file in place
Code: [Select]
# cp MString.png /www/cmh/skins/default/icons/
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 18, 2015, 11:54:34 am
OK, that was way too easy, however I did have to install Lua 'lfs'. BIG thanks for that...
Also forgot to add that I ran your utility to pull over all the leftover (yeah I didn't get it all) icons and device files. Saaaaweet, worked perfectly (of course)...

Code: [Select]
cuda@Ubuntu:~$ sudo luarocks install luafilesystem
Installing https://luarocks.org/luafilesystem-1.6.3-1.src.rock...
Using https://luarocks.org/luafilesystem-1.6.3-1.src.rock... switching to 'build' mode
gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/lfs.c -o src/lfs.o
gcc -shared -o lfs.so -L/usr/local/lib src/lfs.o
Updating manifest for /usr/local/lib/luarocks/rocks
luafilesystem 1.6.3-1 is now built and installed in /usr/local (license: MIT/X11)

Code: [Select]
2015-10-18 10:41:05.390   luup_log:0: ALTUI: runLua(luup.create_device ('', "Mstring", "Mstring", "D_MString.xml"))
2015-10-18 10:41:05.401   luup.create_device:0: [131] urn:schemas-upnp-org:device:VContainer:1 / no-implementation-file
2015-10-18 10:41:05.402   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-18 10:41:05.403   openLuup.server:: request completed (8 bytes, 1 chunks, 13 ms) tcp{client}: 0x26aec48
2015-10-18 10:41:05.403   openLuup.scheduler:131: device startup
2015-10-18 10:41:05.405   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.VariableName1 was: EMPTY now: V1 #hooks:0
2015-10-18 10:41:05.406   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.Variable1 was: EMPTY now:  #hooks:0
2015-10-18 10:41:05.406   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.VariableName2 was: EMPTY now: V2 #hooks:0
2015-10-18 10:41:05.406   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.Variable2 was: EMPTY now:  #hooks:0
2015-10-18 10:41:05.407   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.VariableName3 was: EMPTY now: V3 #hooks:0
2015-10-18 10:41:05.407   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.Variable3 was: EMPTY now:  #hooks:0
2015-10-18 10:41:05.408   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.VariableName4 was: EMPTY now: V4 #hooks:0
2015-10-18 10:41:05.408   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.Variable4 was: EMPTY now:  #hooks:0
2015-10-18 10:41:05.408   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.VariableName5 was: EMPTY now: V5 #hooks:0
2015-10-18 10:41:05.409   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.Variable5 was: EMPTY now:  #hooks:0
2015-10-18 10:41:05.409   luup.variable_set:131: 131.urn:upnp-org:serviceId:VContainer1.Options was: EMPTY now:  #hooks:0
2015-10-18 10:41:05.410   luup.set_failure:131: status = 0
2015-10-18 10:41:05.410   openLuup.scheduler:131: device startup completed: status=nil, msg=nil, name=nil

I can't say I have any idea of how to make a plugin local to openLuup.
[...]
I believe Rex created a multi-string plugin which I see I have installed on my Vera but not yet used. I'll explore all that later...

Well, I just gave that a go.  Assuming you have the files loaded, then it's as easy as typing this into the Lua Test window:
Code: [Select]
luup.create_device ('', "Mstring", "Mstring", "D_MString.xml")

See attached for it working. I'll add that to the 'tested OK' list.

------

Edit:  You also need to put the icon file in place
Code: [Select]
# cp MString.png /www/cmh/skins/default/icons/
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 18, 2015, 12:06:19 pm
OK, that was way too easy, however I did have to install Lua 'lfs'.

Really?? What for ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 18, 2015, 12:12:02 pm
Not sure..

Code: [Select]
2015-10-18 10:34:19.796   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.create_device%20(%27%27%2C%20%22Mstring%22%2C%20%22Mstring%22%2C%20%22D_MString.xml%22)&_=1445177841028 tcp{client}: 0$
2015-10-18 10:34:19.797   luup_log:0: ALTUI: runLua(luup.create_device ('', "Mstring", "Mstring", "D_MString.xml"))
2015-10-18 10:34:19.892   luup.create_device:0: [130] urn:schemas-upnp-org:device:VContainer:1 / no-implementation-file
2015-10-18 10:34:19.892   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-18 10:34:19.894   openLuup.server:: request completed (8 bytes, 1 chunks, 97 ms) tcp{client}: 0x1e3c210
2015-10-18 10:34:19.894   openLuup.scheduler:130: device startup
2015-10-18 10:34:19.895   openLuup.context_switch::  ERROR: [string "device_130"]:46: module 'lfs' not found:
        no field package.preload['lfs']
        no file './lfs.lua'
        no file '/usr/local/share/lua/5.1/lfs.lua'
        no file '/usr/local/share/lua/5.1/lfs/init.lua'
        no file '/usr/local/lib/lua/5.1/lfs.lua'
        no file '/usr/local/lib/lua/5.1/lfs/init.lua'
        no file '/usr/share/lua/5.1/lfs.lua'
        no file '/usr/share/lua/5.1/lfs/init.lua'
        no file './lfs.so'
        no file '/usr/local/lib/lua/5.1/lfs.so'
        no file '/usr/lib/arm-linux-gnueabihf/lua/5.1/lfs.so'
        no file '/usr/lib/lua/5.1/lfs.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
2015-10-18 10:34:19.895   openLuup.scheduler:: job aborted : [string "device_130"]:46: module 'lfs' not found:
        no field package.preload['lfs']
        no file './lfs.lua'
        no file '/usr/local/share/lua/5.1/lfs.lua'
        no file '/usr/local/share/lua/5.1/lfs/init.lua'
        no file '/usr/local/lib/lua/5.1/lfs.lua'
        no file '/usr/local/lib/lua/5.1/lfs/init.lua'
        no file '/usr/share/lua/5.1/lfs.lua'
        no file '/usr/share/lua/5.1/lfs/init.lua'
        no file './lfs.so'
        no file '/usr/local/lib/lua/5.1/lfs.so'
        no file '/usr/lib/arm-linux-gnueabihf/lua/5.1/lfs.so'
        no file '/usr/lib/lua/5.1/lfs.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'

OK, that was way too easy, however I did have to install Lua 'lfs'.

Really?? What for ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 18, 2015, 12:26:42 pm
Ah, OK.  I missed that error completely.  It doesn't matter for openLuup.  It's just some checking at initialization of the Multistring plugin that everything is in the right place for UI7.

Still, you have it (lfs) now (and so do I!)  Never know when you might need it again.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 18, 2015, 01:27:01 pm
Ran into an odd one but was able to recover (backed up my user_data.json before attempting). So I figured I'd try and create a Google Calendar device..
I have the GCal3 directory with the requisite files (.email/.json/.pem) but it's not happy, restored user_json file - all good for now..

Code: [Select]
2015-10-18 11:55:12.923   openLuup.scheduler:130: device startup
2015-10-18 11:55:12.925   luup.set_failure:130: status = 0
2015-10-18 11:55:12.926   openLuup.scheduler:130: device startup completed: status=nil, msg=nil, name=nil
2015-10-18 11:55:12.926   openLuup.scheduler:132: device startup
2015-10-18 11:55:12.926   luup_log:132: GCal3 V 1.3:Delay = 132
2015-10-18 11:55:12.926   luup_log:132: GCal3 V 1.3:Device # 132 initializing
2015-10-18 11:55:12.941   luup_log:132: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/ returned 0
2015-10-18 11:55:12.955   luup_log:132: GCal3 V 1.3:Command /bin/rm -f /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-18 11:55:12.969   luup_log:132: GCal3 V 1.3:Command bin/rm -f /etc/cmh-ludl/GCal3/*.token returned 32512
2015-10-18 11:55:12.981   luup_log:132: GCal3 V 1.3:Command /bin/rm -f  /usr/lib/lua/googlejwt.sh returned 0
2015-10-18 11:55:12.982   luup.variable_get:132: NO SUCH DEVICE: nil
2015-10-18 11:55:12.982   luup.variable_set:132: No such device ?.urn:srs-com:serviceId:GCalIII.UI7Check
2015-10-18 11:55:12.982   luup.variable_set:132: No such device ?.urn:srs-com:serviceId:GCalIII.UI7Check
2015-10-18 11:55:12.996   luup_log:132: GCal3 V 1.3:Command /bin/rm -f /etc/cmh-ludl/D_GCal37.json.lzo returned 0
2015-10-18 11:55:12.996   openLuup.luup:132: device 132 'GCal3' requesting reload
2015-10-18 11:55:12.996   luup.reload:132: saving user_data

Ah, OK.  I missed that error completely.  It doesn't matter for openLuup.  It's just some checking at initialization of the Multistring plugin that everything is in the right place for UI7.

Still, you have it (lfs) now (and so do I!)  Never know when you might need it again.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 18, 2015, 02:09:45 pm
I'm not familiar at all with GCal.  I don't know what the nil device problem is, but I see that just afterwards it reference a compressed .lzo file, which, of course, is not there in openLuup.

This is an example of plugins doing fairly exotic things with very Vera-specific attributes.  You can't blame anyone for this, but it does make things more interesting when you move to a different environment. It may be a simple as actually adding a few extra compressed files.

I'll take a look.

Why was this an issue (apart from not working) was it a repeating restart loop?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 18, 2015, 02:24:08 pm
Yes, UI would load and then connection to server lost .. I have the shell script writing a log and sure enough it was stuck in a request reload.

I'm not familiar at all with GCal.  I don't know what the nil device problem is, but I see that just afterwards it reference a compressed .lzo file, which, of course, is not there in openLuup.

This is an example of plugins doing fairly exotic things with very Vera-specific attributes.  You can't blame anyone for this, but it does make things more internet sting when you move to a different environment. It may be a simple as actually adding a few extra compressed files.

I'll take a look.

Why was this an issue (apart from not working) was it a repeating restart loop?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 18, 2015, 02:33:28 pm
IOSpush plugin works (tested from Lua Test; cloned device):

Code: [Select]
2015-10-18 13:30:35.571   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.call_action(%22urn%3Aupnp-org%3AserviceId%3AIOSPush1%22%2C%20%22SendPushOverNotification%22%2C%7B%20Title%3D%22openLuup%3A%20Notification.%22%2C%20Message%3D%22Testing%20from%20openLuup.%22%2C%20Priority%3D1%2C%20Sound%3D%22Incoming%22%20%7D%2C%2010)&_=1445191466724 tcp{client}: 0x9ac010
2015-10-18 13:30:35.573   luup_log:0: ALTUI: runLua(luup.call_action("urn:upnp-org:serviceId:IOSPush1", "SendPushOverNotification",{ Title="openLuup: Notification.", Message="Testing from openLuup.", Priority=1, Sound="Incoming" }, 10))
2015-10-18 13:30:35.573   luup.call_action:0: 10.urn:upnp-org:serviceId:IOSPush1.SendPushOverNotification
2015-10-18 13:30:35.573   luup.call_action:0: action will be handled by parent: 4
2015-10-18 13:30:35.573   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-18 13:30:35.575   openLuup.server:: request completed (8 bytes, 1 chunks, 4 ms) tcp{client}: 0x9ac010
2015-10-18 13:30:35.576   luup_log:4: http://192.168.2.189:3480/data_request?id=action&serviceId=urn:upnp-org:serviceId:IOSPush1&action=SendPushOverNotification&DeviceNum=36&Message=Testing%20from%20openLuup%2e&Priority=1&Title=openLuup%3a%20Notification%2e&Sound=Incoming
2015-10-18 13:30:38.975   luup.variable_set:4: 10.urn:upnp-org:serviceId:IOSPush1.LastError was: Ok - 13:15 - (PushOver) now: Ok - 13:30 - (PushOver) #hooks:0
2015-10-18 13:30:38.975   luup.variable_set:4: 10.urn:upnp-org:serviceId:IOSPush1.PushOverCount was: 1481 now: 1482 #hooks:0
2015-10-18 13:30:38.976   luup.variable_set:4: 10.urn:upnp-org:serviceId:IOSPush1.TimeSend was: 1445192114 now: 1445193037 #hooks:0
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 18, 2015, 03:55:48 pm
This is an example of plugins doing fairly exotic things with very Vera-specific attributes.

Yes, I was right.  The code contains stuff like:
Code: [Select]
   -- check to see if openssl is on the system
    local stdout = io.popen("opkg list-installed | awk '/openssl-util/ {print $3}'")
    local version = stdout:read("*a")

and

Code: [Select]
      DEBUG(3,"Installing openssl")
      -- install the default version for the vera model
      local result = osExecute ("/bin/opkg update && opkg install openssl-util")

in other words, it's not just doing Vera-specific things, it's assuming that you're running under something which uses opkg, in Vera's case that's Open-WRT.  As a plugin, it's being very, very naughty (or clever, if you prefer that word.)

Quote from: Wikipedia
Opkg (Open PacKaGe Management) is a lightweight package management system based upon ipkg. It is written in C and resembles APT/dpkg in operation. It is intended for use on embedded Linux devices and is used in this capacity in the OpenEmbedded and OpenWrt projects.[2]

I don't think this is available for Ubuntu (I think that's what you're using.) believing that to use dpkg or aptitude.  Curiously, I'm doing much of my testing on an Arduino Yun, which actually runs Open-WRT.  I haven't fired this up to see if it works, I was just perusing the source code.

The first snippet above expects a response like 1.0.1g-1.  It's entirely possible that you could simply write a script which returns the appropriate thing, assuming that you can install openssl.  I would be loathe to change a line of source code in GCal3.  What you would run into next, I couldn't say.  But this is the nub of the problem.

Welcome to my world.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 18, 2015, 08:01:04 pm
Sigh, well .... Hmm... So it appears the diagnosis is not good... I am using Ubuntu (Mate) and OpenSSL is avail but ... Hmm
I really appreciate you looking at that, the developer is really receptive but I'm  not sure he'd be willing to adjust his code. My other option is to just look into the Google API and see what I could write in Lua (I do this for Google Drive) or continue my testing in attempt to use the clone (I've been somewhat unsuccessful but haven't readily document my results).

This is an example of plugins doing fairly exotic things with very Vera-specific attributes.

Yes, I was right.  The code contains stuff like:
Code: [Select]
   -- check to see if openssl is on the system
    local stdout = io.popen("opkg list-installed | awk '/openssl-util/ {print $3}'")
    local version = stdout:read("*a")

and

Code: [Select]
      DEBUG(3,"Installing openssl")
      -- install the default version for the vera model
      local result = osExecute ("/bin/opkg update && opkg install openssl-util")

in other words, it's not just doing Vera-specific things, it's assuming that you're running under something which uses opkg, in Vera's case that's Open-WRT.  As a plugin, it's being very, very naughty (or clever, if you prefer that word.)

Quote from: Wikipedia
Opkg (Open PacKaGe Management) is a lightweight package management system based upon ipkg. It is written in C and resembles APT/dpkg in operation. It is intended for use on embedded Linux devices and is used in this capacity in the OpenEmbedded and OpenWrt projects.[2]

I don't think this is available for Ubuntu (I think that's what you're using.) believing that to use dpkg or aptitude.  Curiously, I'm doing much of my testing on an Arduino Yun, which actually runs Open-WRT.  I haven't fired this up to see if it works, I was just perusing the source code.

The first snippet above expects a response like 1.0.1g-1.  It's entirely possible that you could simply write a script which returns the appropriate thing, assuming that you can install openssl.  I would be loathe to change a line of source code in GCal3.  What you would run into next, I couldn't say.  But this is the nub of the problem.

Welcome to my world.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 19, 2015, 12:55:45 am
Try to get and save the source of the html page, there is something invalid in that page.
You can also try to reset plugin config variable with the default button then the set button to be sure.


Envoy? de mon iPad en utilisant Tapatalk

@amg0 - here are the page source and a screen shot of what i see. Where can i get to the "default button" you mention so i can try the reset? Thanks!

@akbooer - i will try the blacklisting next.

Thanks !
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 19, 2015, 01:05:34 am
@akbooer - when i comment out the verabridge in my startup lua, do a reset then run it with startup.lua, altui does indeed load ok. If you could give me a version where i could whitelist devices that would be great (in fact, that might be a good thing generally, not just for debugging, since i would never want all my devices from vera in openluup, especially those that can not work like VeraAlerts).

Yes, done properly that would be useful functionality.  However, here's a quick hack to VeraBridge which works slightly differently.  There should be a new device variable MAX_DEVICES which you can set to limit the total number of cloned devices - set this in your startup.lua file:

Code: [Select]
do -- the VERA BRIDGE !!
  local dev = luup.create_device ('', "Vera", "Vera", "D_VeraBridge.xml")
  luup.ip_set ("172.16.42.10", dev)         -- set remote Vera IP address  <-- your real IP goes here
  luup.variable_set ("urn:akbooer-com:serviceId:VeraBridge1", "MAX_DEVICES", 75, dev)
end

A binary search will find your problem in logarithmic time (!)  I've set the number of devices to half your total.  If this comes up working then half the difference between 75 and 150 (or whatever you max) say 115 or so.  If it fails at 75, halve the number to 38, etc.., etc...

I've not tested the code, but as a programmer who worked for me once said "I only changed one line - what can possibly go wrong?"

Good luck.

Thanks @akbooer - i tried taking the max devices all the way down to 1 and it did not fix it. Hopefully amg0 can look at the altui page source and help (thanks)...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 19, 2015, 03:04:41 am
Try to get and save the source of the html page, there is something invalid in that page.
You can also try to reset plugin config variable with the default button then the set button to be sure.


Envoy? de mon iPad en utilisant Tapatalk

@amg0 - here are the page source and a screen shot of what i see. Where can i get to the "default button" you mention so i can try the reset? Thanks!

@akbooer - i will try the blacklisting next.

Thanks !

you source page contains this statement which is invalid
Code: [Select]
var g_FirstUserData = not a data request;
Normally this is
Code: [Select]
var g_FirstUserData = { "devices": [ { "id": 1, "name": "ZWave", "d   etc ... the whole user_data object

that piece of data is normally built by a piece of code in J_ALTUI.lua
Code: [Select]
------------------------------------------------
-- Get user_data
------------------------------------------------
local function getFirstUserData()
local url_req = "http://127.0.0.1:3480/data_request?id=user_data&output_format=json"
local req_status, req_result = luup.inet.wget(url_req)
if (req_status~=0) then
debug(string.format("getScriptContent(%s) failed, returns: %s",filename,req_status))
return ""
end
return req_result
end
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 19, 2015, 03:15:55 am
Thanks @amg0.

@mda

When the system is in that state, can you try this request from a browser:
Code: [Select]
http://<VeraIP>:3480/data_request?id=user_data&output_format=json

Does it return the full user_data?

-------

Edit: other thoughts...

- you HAVE just tried refreshing the page?
- can you clear the user data in the ALTUI Misc Options page?
- remind me, you're running under a VM?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 19, 2015, 07:09:04 am
Sigh, well .... Hmm... So it appears the diagnosis is not good... I am using Ubuntu (Mate) and OpenSSL is avail but ... Hmm
I really appreciate you looking at that, the developer is really receptive but I'm  not sure he'd be willing to adjust his code. My other option is to just look into the Google API and see what I could write in Lua (I do this for Google Drive) or continue my testing in attempt to use the clone (I've been somewhat unsuccessful but haven't readily document my results).

It turns out that you should be able to sidestep the startup checks by using this sequence in your startup file:
Code: [Select]

do -- GCal3
  local gcal = luup.create_device ('', "GCal3", "GCal3", "GCal3.xml")       
  local GCAL_SID = "urn:srs-com:serviceId:GCalIII"
  luup.variable_set(GCAL_SID, "UI7Check", "true", gcal)
  luup.attr_set("device_json", "D_GCal3_UI7.json", gcal)
end


...however, it STILL does a restart because of this:
Code: [Select]
2015-10-18 11:55:12.982   luup.variable_get:132: NO SUCH DEVICE: nil
2015-10-18 11:55:12.982   luup.variable_set:132: No such device ?.urn:srs-com:serviceId:GCalIII.UI7Check
2015-10-18 11:55:12.982   luup.variable_set:132: No such device ?.urn:srs-com:serviceId:GCalIII.UI7Check

which turns out to be from this source code line:
Code: [Select]
local ui7Check = luup.variable_get(GCAL_SID, "UI7Check", lul_device) or ""
where 'lul_device' is an undefined global.

I must be missing something because there are simply hundreds of these (well, 169 to be exact) spread around the .lua file and presumably it does actually work for some people - unless I"m looking at the wrong version (but I've tried both the MiOS store download and the latest one from the GCal3 thread.)

There are lots of things which could be done to make the source code more portable - you might be able to hack it, but it will not be easy.  There's lots of instances where os.execute() forks a shell process to remove files, whereas it could just use os.remove() which would be much cleaner.  Lots of other interesting things too - base64 encoding can, for example, be done in the Luasocket library, but GCal uses OpenSSL for this (actually, Luasocket is a partial wrapper for OPenSSL anyway.)


Title: Re: openLuup - running unmodified plugins on any machine
Post by: RichardTSchaefer on October 19, 2015, 08:43:27 am
I believe the MCV implementation of luup.call_action sets  lul_device ... I think they also set another variable that contains the list (table)  of arguments.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 19, 2015, 09:05:58 am
I believe the MCV implementation of luup.call_action sets  lul_device ... I think they also set another variable that contains the list (table)  of arguments.
Yes, that's certainly true.  Also lul_data and lul_job in certain circumstances, as parameters to action calls...

...but this is in a startup function where the parameter name has been overloaded, eg.

Code: [Select]
function GCalStartup(delayed)
  GC.lul_device = tostring(luup.device)   --- this sets a local, but not the global used later
 [...]

You're telling me it's still defined in that case ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 19, 2015, 11:41:27 am
You're telling me it's still defined in that case ?

Answering my own question: "apparently so."  An easy fix - I now define the variable lul_device in the global context of any device.

This let me proceed further with GCal3 and after having fixed another 'feature' of luup.call_timer (time parameter can be number as well as string) I get to here:
Code: [Select]
2015-10-19 16:26:10.076   openLuup.scheduler:3: device startup
2015-10-19 16:26:10.077   luup_log:3: GCal3 V 1.4:Delay = 3
2015-10-19 16:26:10.079   luup_log:3: GCal3 V 1.4:Device # 3 initializing
2015-10-19 16:26:10.122   luup_log:3: GCal3 V 1.4:Command /bin/ls /etc/cmh-ludl/GCal3/ returned 0
2015-10-19 16:26:10.156   luup_log:3: GCal3 V 1.4:Command /bin/rm -f /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-19 16:26:10.184   luup_log:3: GCal3 V 1.4:Command bin/rm -f /etc/cmh-ludl/GCal3/*.token returned 32512
2015-10-19 16:26:10.210   luup_log:3: GCal3 V 1.4:Command /bin/rm -f  /usr/lib/lua/googlejwt.sh returned 0
2015-10-19 16:26:10.213   luup.call_timer:3: interval: time=2, days={}
2015-10-19 16:26:10.215   openLuup.scheduler:3: device startup completed: status=nil, msg=nil, name=nil
2015-10-19 16:26:12.221   luup_log:3: GCal3 V 1.4:Delay = delayedstart
2015-10-19 16:26:12.223   luup_log:3: GCal3 V 1.4:Checking semaphore
2015-10-19 16:26:12.279   luup_log:3: GCal3 V 1.4:Command /bin/ls /etc/cmh-ludl/GCal3/GCal3.sem returned 512
2015-10-19 16:26:12.281   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: EMPTY now: GCal3.sem #hooks:0
2015-10-19 16:26:12.290   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: EMPTY now: Could not Open #hooks:0
2015-10-19 16:26:12.292   luup_log:3: GCal3 V 1.4:Semaphore file returned nil
2015-10-19 16:26:12.412   luup_log:3: GCal3 V 1.4:Device 3 requested semaphore
2015-10-19 16:26:12.453   luup_log:3: GCal3 V 1.4:Command /bin/ls /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-19 16:26:12.464   luup_log:3: GCal3 V 1.4:Device 3 claimed semaphore
2015-10-19 16:26:12.467   luup.variable_set:3: 3.urn:micasaverde-com:serviceId:SecuritySensor1.Armed was: EMPTY now: 0 #hooks:0
2015-10-19 16:26:12.469   luup.variable_set:3: 3.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: EMPTY now: 0 #hooks:0
2015-10-19 16:26:12.471   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_TrippedEvent was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.474   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_TrippedID was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.476   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_Value was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.478   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: GCal3.sem now:  #hooks:0
2015-10-19 16:26:12.481   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: Could not Open now: . #hooks:0
2015-10-19 16:26:12.483   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_Interval was: EMPTY now: 180 #hooks:0
2015-10-19 16:26:12.485   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_StartDelta was: EMPTY now: 0 #hooks:0
2015-10-19 16:26:12.487   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_EndDelta was: EMPTY now: 0 #hooks:0
2015-10-19 16:26:12.490   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_Keyword was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.492   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_exactKeyword was: EMPTY now: true #hooks:0
2015-10-19 16:26:12.494   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_ignoreKeyword was: EMPTY now: false #hooks:0
2015-10-19 16:26:12.496   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_triggerNoKeyword was: EMPTY now: false #hooks:0
2015-10-19 16:26:12.498   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_ignoreAllDayEvent was: EMPTY now: false #hooks:0
2015-10-19 16:26:12.500   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_retrip was: EMPTY now: true #hooks:0
2015-10-19 16:26:12.502   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_ExtraDays was: EMPTY now: 0 #hooks:0
2015-10-19 16:26:12.504   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_CalendarID was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.506   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_jsonEvents was: EMPTY now: [] #hooks:0
2015-10-19 16:26:12.509   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_jsonActiveEvents was: EMPTY now: [] #hooks:0
2015-10-19 16:26:12.511   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_ActiveEvents was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.513   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_EventsToday was: EMPTY now: 0 #hooks:0
2015-10-19 16:26:12.515   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_EventsLeftToday was: EMPTY now: 0 #hooks:0
2015-10-19 16:26:12.518   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_lastCheck was: EMPTY now: 2015-10-19T16:26:12 #hooks:0
2015-10-19 16:26:12.520   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_nextCheck was: EMPTY now: 2015-10-19T16:26:12 #hooks:0
2015-10-19 16:26:12.522   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_debug was: EMPTY now: 1 #hooks:0
2015-10-19 16:26:12.524   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_displaystatus was: EMPTY now: 0 #hooks:0
2015-10-19 16:26:12.526   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_notify was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.528   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_notifyName was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.530   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_notifyValue was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.533   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_notifyType was: EMPTY now:  #hooks:0
2015-10-19 16:26:12.535   luup.variable_set:3: 3.urn:srs-com:serviceId:GCalIII.gc_credentialFile was: EMPTY now: GCal3.json #hooks:0
2015-10-19 16:26:12.537   luup_log:3: GCal3 V 1.4:GCal3 V 1.4:Variables initialized ...
2015-10-19 16:26:13.581   openLuup.context_switch::  ERROR: [string "device_3"]:147: /usr/lib/lua/json.lua: No such file or directory

...the last line of which is ERROR: [string "device_3"]:147: /usr/lib/lua/json.lua: No such file or directory

So GCal is now expecting a /usr/lib/lua/ directory into which it is trying to put json.lua (it's actually JSON4Lua by Craig Mason-Jones) which it gets from here:
Code: [Select]
"http://code.mios.com/trac/mios_google_calendar_ii_plugin/raw-attachment/wiki/WikiStart/json.lua"
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 19, 2015, 12:10:42 pm
Thanks @amg0.

@mda

When the system is in that state, can you try this request from a browser:
Code: [Select]
http://<VeraIP>:3480/data_request?id=user_data&output_format=json

Does it return the full user_data?

That returns only "not a data request" (see screen shot attached)


Quote
- you HAVE just tried refreshing the page?

Yes, many times on both chrome and safari. i have rebooted the machine and gone through all the commissioning steps again as well.


Quote
- can you clear the user data in the ALTUI Misc Options page?

How do i get to that page? my altui page has no navigation on it, just a grey horizontal line and the text "AltUI, amg0, Waiting Initial Data" (see attached screen shot)


Quote
- remind me, you're running under a VM?

No VM (I gave up on the windows VM). I am running on a MacBook Air running OS X 10.11 (El Capitan) and Lua 5.1

Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 19, 2015, 12:29:36 pm
@mda

OK, well that is the problem that ALTUI is seeing too.

Currently the situation is that
Can you send me your startup file(s) with and without the bridge creation.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 19, 2015, 12:42:00 pm
@mda

OK, well that is the problem that ALTUI is seeing too.

Currently the situation is that
  • running a system after factory reset is fine
  • running a startup.lua file without the bridge if fine
  • running with the bridge, even with one one cloned device, gives the problem?
Can you send me your startup file(s) with and without the bridge creation.

Yes, all correct. Attached is my startup.lua. To remove the bridge i just comment out these 4 lines in startup.lua

Code: [Select]
do -- the VERA BRIDGE !!
  local dev = luup.create_device ('', "Vera", "Vera", "D_VeraBridge.xml")
  luup.ip_set ("192.168.1.12", dev)         -- set remote Vera IP address
end

Thanks for helping!

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 19, 2015, 01:05:59 pm
Nothing special there then.

Can I get the etc/cmh-ludl/LuaUPnP.log file (you may have sent before, I'm not sure now!)

Did this EVER work with the Bridge?  At what stage did we break something?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 19, 2015, 01:12:03 pm
@mda

Could you also try with these modified files (to be placed in the /openLuup/ subdirectory)

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 19, 2015, 01:36:06 pm
@CudaNet

I have now got to this stage in running GCal3 on openLuup (see attachment.)

My problem is now getting the appropriate authorization codes - the Google web site seems NOTHING like that described on the instructions.  I you could PM me some advice on that, it would be welcomed.

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 19, 2015, 02:58:36 pm
WOW, ok - let me see what I have. I remember there being a few out of the ordinary steps (definitely not plug-n-play) to configuring this thing. Have to run to a dentist appt. but I'll get all of this too you today.

@CudaNet

I have now got to this stage in running GCal3 on openLuup (see attachment.)

My problem is now getting the appropriate authorization codes - the Google web site seems NOTHING like that described on the instructions.  I you could PM me some advice on that, it would be welcomed.

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 19, 2015, 04:31:14 pm
Nothing special there then.

Can I get the etc/cmh-ludl/LuaUPnP.log file (you may have sent before, I'm not sure now!)

Did this EVER work with the Bridge?  At what stage did we break something?

I have PMd you the log. It never worked work the bridge. I installed lua 5.1 with brew, installed luasocket with luarocks5-1, installed and linked openssl with brew, installed luusec with luarocks5-1, then followed your commissioning steps. It broken after i got to the step where i copied startup_example to startup.lua and then edited startup.lua with vi to the version i sent you. (it worked until i put my vera IP into the verabridge startup code). Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 19, 2015, 04:34:31 pm
@mda

Could you also try with these modified files (to be placed in the /openLuup/ subdirectory)

Thanks

Thanks. I tried but unfortunately i get the same behavior as before :(
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 19, 2015, 07:31:58 pm
I sent you a PM but this should help explain all the steps necessary and if I need to test anything just let me know...
The key here is to have an account/project setup for their api.

https://console.developers.google.com/project

@CudaNet

I have now got to this stage in running GCal3 on openLuup (see attachment.)

My problem is now getting the appropriate authorization codes - the Google web site seems NOTHING like that described on the instructions.  I you could PM me some advice on that, it would be welcomed.

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 04:58:16 am
Thanks. I tried but unfortunately i get the same behavior as before :(

Does any HTTP request work in that state?  id=alive or id=exit would be good to try.

This is truly bizarre.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 06:31:40 am
I sent you a PM but this should help explain all the steps necessary and if I need to test anything just let me know...
The key here is to have an account/project setup for their api.
[...]

My problem is now getting the appropriate authorization codes - the Google web site seems NOTHING like that described on the instructions.  I you could PM me some advice on that, it would be welcomed.

Thanks for the PM and attachment.  Yes, I had read those documents, but the sticking point, now solved, what exactly which type of credentials were required. This is where the reality of the website diverged from the theory of the documentation: Oauth2, API (server or broswer, service account, ...)

However, I seem to have got a json file with the right stuff in it now.  Thanks again, and onwards!



Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 20, 2015, 06:46:02 am
@akbooer,

Having troubles running a scene which is triggered by a motion sensor connected to a fibaro universal binary sensor.  The log show the sensor is tripped but the lua code defined in the scene is not executed.
2015-10-20 12:36:10.376   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: 0 now: 1 #hooks:0
2015-10-20 12:36:10.378   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.LastTrip was: 1445336893 now: 1445337368 #hooks:0
when running the scene manually the lua code is executed as should
The trigger is defined as such
Device Triggers   MS Hall   111 UBS IN1 (#0-52)   A sensor (door/window/motion/etc.) is tripped   Tripped = 1

What am I missing?

Thanks for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 08:40:27 am
Yes, quite involved.... However it's just one of those things once setup - you really don't have to touch it again. I was about to just send you my creds if the docs and PM didn't help.

I sent you a PM but this should help explain all the steps necessary and if I need to test anything just let me know...
The key here is to have an account/project setup for their api.
[...]

My problem is now getting the appropriate authorization codes - the Google web site seems NOTHING like that described on the instructions.  I you could PM me some advice on that, it would be welcomed.

Thanks for the PM and attachment.  Yes, I had read those documents, but the sticking point, now solved, what exactly which type of credentials were required. This is where the reality of the website diverged from the theory of the documentation: Oauth2, API (server or broswer, service account, ...)

However, I seem to have got a json file with the right stuff in it now.  Thanks again, and onwards!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 08:40:45 am
@delle

OpenLuup does not support Vera-style triggers (philosophical issues around UPnP and the convoluted approach to the whole concept.). It should not even store a definition of such a trigger in a scene.

It does, however, support ALTUI device-variable triggers.  The "#hooks:0" in your log, suggests that you are not using this approach?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 20, 2015, 09:36:19 am
@akbooer,

Thanks for your reply.  Indeed I was not using the new device variable triggers as I do not understand them well and I cannot find any info on it even in the amg0 info.  Can you point me to more info on how to use it?  How should the "new" and "old" value be defined in an expression to have a condition true when the value for tripped goes from 0 to 1?

Thank you so much for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 10:14:00 am
How should the "new" and "old" value be defined in an expression to have a condition true when the value for tripped goes from 0 to 1?

The only concept to grasp is that the Lua code will be called for ANY change of the watched variable: its new value is in the variable 'new' and its old one in the variable 'old'.

Given that, the only 'coding' you need to do is:
Code: [Select]
return new == "1"

which will be 'true' when it changes to 1, and therefore allow the scene actions to run.

Or you could code strictly what you asked for: a change from 0 to 1.
Code: [Select]
return (old == "0") and (new == "1")

Rather than typing it in you may choose to use the blockly editor which gives a more graphical rendition of the code.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 20, 2015, 10:20:18 am
How should the "new" and "old" value be defined in an expression to have a condition true when the value for tripped goes from 0 to 1?

The only concept to grasp is that the Lua code will be called for ANY change of the watched variable: its new value is in the variable 'new' and its old one in the variable 'old'.

Given that, the only 'coding' you need to do is:
Code: [Select]
return new == "1"

which will be 'true' when it changes to 1, and therefore allow the scene actions to run.

Or you could code strictly what you asked for: a change from 0 to 1.
Code: [Select]
return (old == "0") and (new == "1")

Rather than typing it in you may choose to use the blockly editor which gives a more graphical rendition of the code.
The return is not needed i think. Just put a boolean expression that must evaluate to true

Envoy? de mon TouchPad en utilisant Tapatalk

Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 20, 2015, 10:37:01 am
Thank you both
And indeed the "return" is obsolete but even if the condition is true the code is not executed though I have no other triggers or timers defined

2015-10-20 16:30:52.025   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: 0 now: 1 #hooks:1
2015-10-20 16:30:52.027   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.LastTrip was: 1445351307 now: 1445351449 #hooks:0
2015-10-20 16:30:52.556   openLuup.server:: request completed (4826 bytes, 1 chunks, 14208 ms) tcp{client}: 0x113e4b0
2015-10-20 16:30:52.558   luup.watch_callback:: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped function: 0x97fe88
2015-10-20 16:30:52.670   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=351426816&Timeout=60&MinimumDelay=1500&_=1445350813949 tcp{client}: 0x113e4b0
2015-10-20 16:30:57.222   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: 1 now: 0 #hooks:1

I appreciate your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 20, 2015, 10:47:00 am
Thank you both
And indeed the "return" is obsolete but even if the condition is true the code is not executed though I have no other triggers or timers defined

2015-10-20 16:30:52.025   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: 0 now: 1 #hooks:1
2015-10-20 16:30:52.027   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.LastTrip was: 1445351307 now: 1445351449 #hooks:0
2015-10-20 16:30:52.556   openLuup.server:: request completed (4826 bytes, 1 chunks, 14208 ms) tcp{client}: 0x113e4b0
2015-10-20 16:30:52.558   luup.watch_callback:: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped function: 0x97fe88
2015-10-20 16:30:52.670   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=351426816&Timeout=60&MinimumDelay=1500&_=1445350813949 tcp{client}: 0x113e4b0
2015-10-20 16:30:57.222   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: 1 now: 0 #hooks:1

I appreciate your help

after programming a trigger with ALTUI, a reload of luup is needed so that the ALTUI device startup code is run.

I am not sure how logs behave on openluup but you may try to
1) to put ALTUI in debug mode,
2) program your trigger
3) do a Luup reload
4) force your trigger to happen
5) capture the log
6) share the whole log

Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 20, 2015, 11:15:43 am
Thanks for the tip amg0

This is what the debug shows
2015-10-20 17:11:06.915   luup_log:3: ALTUI: debug: variableWatchCallback(52,urn:micasaverde-com:serviceId:SecuritySensor1,Tripped,old:'0',new:'1')
2015-10-20 17:11:06.917   luup_log:3: ALTUI: debug: findWatch(52,urn:micasaverde-com:serviceId:SecuritySensor1,Tripped)
2015-10-20 17:11:06.919   luup_log:3: ALTUI: debug: registeredWatches: {"52":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"Expressions":{"new == \"1\"":{"SceneID":5}}}}}}
2015-10-20 17:11:06.921   luup_log:3: ALTUI: debug: registeredWatches found a match
2015-10-20 17:11:06.922   luup_log:3: ALTUI: debug: evaluateExpression(52,urn:micasaverde-com:serviceId:SecuritySensor1,Tripped,new == "1",0,1,1445353866,5)
2015-10-20 17:11:06.924   luup_log:3: ALTUI: debug: _evaluateUserExpression(0,1,1445353866,new == "1")
2015-10-20 17:11:06.927   luup_log:3: ALTUI: debug: Evaluation of user watch expression returned: [false]
2015-10-20 17:11:06.928   luup_log:3: ALTUI: debug: ignoring watch trigger, loadstring returned nil
2015-10-20 17:11:06.930   luup_log:3: ALTUI: debug: cancelExpressionTimer(52,urn:micasaverde-com:serviceId:SecuritySensor1,Tripped,new == "1")
2015-10-20 17:11:06.931   luup_log:3: ALTUI: debug: findWatch(52,urn:micasaverde-com:serviceId:SecuritySensor1,Tripped)
2015-10-20 17:11:06.934   luup_log:3: ALTUI: debug: registeredWatches: {"52":{"urn:micasaverde-com:serviceId:SecuritySensor1":{"Tripped":{"LastUpdate":1445353866,"LastOld":"0","Expressions":{"new == \"1\"":{"SceneID":5}},"LastNew":"1"}}}}
2015-10-20 17:11:06.935   luup_log:3: ALTUI: debug: registeredWatches found a match
2015-10-20 17:11:06.937   luup_log:3: ALTUI: debug: evaluateExpression() returns nil

Something with the quotes?

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 11:17:10 am
Thanks already to @amg0 for sorting me out on the errant 'return', and for providing a comprehensive list of things to help.

@delle, from what you've posted so far, it all looks good.


2015-10-20 16:30:52.025   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: 0 now: 1 #hooks:1
2015-10-20 16:30:52.027   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.LastTrip was: 1445351307 now: 1445351449 #hooks:0

...the sensor is tripped.  It has "#hooks:1" which means there is one callback function watching it (that would be ALTUI)


2015-10-20 16:30:52.558   luup.watch_callback:: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped function: 0x97fe88

...and here is the call to the trigger handler.


2015-10-20 16:30:57.222   luup.variable_set:4: 52.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: 1 now: 0 #hooks:1


Five seconds later the sensor resets (is that its normal behaviour?)

However, there is indeed no sign of the handler running any scene.

I'll set up a test on my own system to try and mirror this.  The sensor is bridged from a real Vera?

[/quote]
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 11:19:10 am
Code: [Select]
2015-10-20 17:11:06.927   luup_log:3: ALTUI: debug: Evaluation of user watch expression returned: [false]
2015-10-20 17:11:06.928   luup_log:3: ALTUI: debug: ignoring watch trigger, loadstring returned nil

Aha!  Looks like your condition makes the trigger be ignored.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 20, 2015, 11:21:52 am
Code: [Select]
2015-10-20 17:11:06.927   luup_log:3: ALTUI: debug: Evaluation of user watch expression returned: [false]
2015-10-20 17:11:06.928   luup_log:3: ALTUI: debug: ignoring watch trigger, loadstring returned nil

Aha!  Looks like your condition makes the trigger be ignored.

yes see the trace with _evaluateUserExpression(0,1,1445353866,new == "1")

so I guess new == "1" is false.   maybe it is new == 1 that we need ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 11:23:56 am
It's so easy just to type the expression in but blockly is just downright cool...  8)

How should the "new" and "old" value be defined in an expression to have a condition true when the value for tripped goes from 0 to 1?

The only concept to grasp is that the Lua code will be called for ANY change of the watched variable: its new value is in the variable 'new' and its old one in the variable 'old'.

Given that, the only 'coding' you need to do is:
Code: [Select]
return new == "1"

which will be 'true' when it changes to 1, and therefore allow the scene actions to run.

Or you could code strictly what you asked for: a change from 0 to 1.
Code: [Select]
return (old == "0") and (new == "1")

Rather than typing it in you may choose to use the blockly editor which gives a more graphical rendition of the code.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 11:34:54 am
maybe it is new == 1 that we need ?

All device variable values are (should be) strings.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 20, 2015, 11:40:37 am

I confirm no quotes needed

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 20, 2015, 11:40:52 am
maybe it is new == 1 that we need ?

All device variable values are (should be) strings.
I ll make fix in altui to force it to strings

Envoy? de mon TouchPad en utilisant Tapatalk

Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 20, 2015, 11:55:53 am
Thanks. I tried but unfortunately i get the same behavior as before :(

Does any HTTP request work in that state?  id=alive or id=exit would be good to try.

This is truly bizarre.

Yes...

http://localhost:3480/data_request?id=alive works (returns ok)

localhost:3480/data_request?id=exit works (returns requested openLuup exit at Tue Oct 20 08:54:17 2015 and terminates openluup)

http://localhost/cmh/skins/default/icons/VeraBridge.png works[/li][/list]

Truly bizarre!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 20, 2015, 01:06:07 pm
@akbooer @amg0 --

I deleted all the vera files that the getfiles script copied over from my vera (so i just have openluup, altui and verabridge files in etc/cmh-ludl) and alti loaded with my verabridge enabled !!!  Of course those vera devices don't work but that is as expected. So, it must be a problem with the vera device files (missing? corrupt?) brought over by the getfiles script ?

I will start moving the vera files over one group at a time and see where it breaks. Thanks so much for all your help on this, i really appreciate it. Once I am through that i will try to get gCal3, DLNA, iPhone Locator, etc plugins working on openluup (not the clones, native) so i can remove those from my vera. I am hopeful... :)

Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 01:09:41 pm
I deleted all the vera files that the getfiles script copied over from my vera (so i just have openluup, altui and verabridge files in etc/cmh-ludl) and alti loaded with my verabridge enabled !!!  Of course those vera devices don't work but that is as expected. So, it must be a problem with the vera device files (missing? corrupt?) brought over by the getfiles script ?

I will start moving the vera files over one group at a time and see where it breaks. Thanks so much for all your help on this, i really appreciate it. Once I am through that i will try to get gCal3, DLNA, iPhone Locator, etc plugins working on openluup (not the clones, native) so i can remove those from my vera. I am hopeful... :)

Great work!  It certainly was starting to look a LOT like some sort of installation configuration error.  Let's see what breaks it!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on October 20, 2015, 01:19:54 pm
maybe it is new == 1 that we need ?

All device variable values are (should be) strings.
I ll make fix in altui to force it to strings

Envoy? de mon TouchPad en utilisant Tapatalk

it is in rev >= 840. now quotes will be required. I have not yet published this version so if you are impatient , get it from the source code repository, otherwise, wait for the auto-update. thx !
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 02:29:27 pm
Kind of odd, I had this problem early on but it's back again (perhaps user error !?!) and I'm not sure how I'm invoking it. I was playing around with some of the watched variables (blockly). I've tried to delete the scene within the UI but it keeps re-appearing (on refresh). If I edit the scene, well - it makes a copy when I hit 'submit'. Of course I can manually correct this by restoring my user_data file but thought I'd mention it nonetheless..

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 03:00:42 pm
It been reported before, so I need to look into this.  If you do a reload and a browser refresh, it's still there?  they have that same ID number?

Perhaps you could PM me the scenes part of the user_data.json showing the problem.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 03:13:03 pm
Yes, a refresh and it's still there. Delete, refresh - still there. Device ID's aren't always the same, in the past I've had it increment by one and it would allow me to delete it without incident. It's when it persists (for whatever reason) and decides to present itself with the same id's - then I have to remove it from the user_data file. It seems to me that if you attempt to modify the scene (after it copies itself), this is when it copies itself and presents the same scene id. I noticed within the json file that the differences in the scenes were the previous scene config. and the modified scene config.

I wish I could explain more, I've modified other scenes and not had this happen.

It been reported before, so I need to look into this.  If you do a reload and a browser refresh, it's still there?  they have that same ID number?

Perhaps you could PM me the scenes part of the user_data.json showing the problem.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 03:57:26 pm
Attempted to install the IOS push plugin locally. In doing so it complained about expat.. No problem, (apt-get install lua-expat) then the implementation file was attempting to load 'json'. I modified it to use the json module I had loaded (yes, I know - different) but it's still not happy, 'device 133 'IosPush' requesting reload'. This won't keep you from running openLuup though, it just won't load the device. Going to remove it until I can play with it further..

Code: [Select]
Compile Lua error:      [string "device_133"]:10: module 'json' not found:
        no field package.preload['json']
        no file './json.lua'
        no file '/usr/local/share/lua/5.1/json.lua'
        no file '/usr/local/share/lua/5.1/json/init.lua'
        no file '/usr/local/lib/lua/5.1/json.lua'
        no file '/usr/local/lib/lua/5.1/json/init.lua'
        no file '/usr/share/lua/5.1/json.lua'
        no file '/usr/share/lua/5.1/json/init.lua'
        no file './json.so'
        no file '/usr/local/lib/lua/5.1/json.so'
        no file '/usr/lib/arm-linux-gnueabihf/lua/5.1/json.so'
        no file '/usr/lib/lua/5.1/json.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'

IOS files....

Code: [Select]
-rw-rw-r-- 1 cuda cuda  6575 Oct 14 20:20 D_IosPush.json
-rw-rw-r-- 1 cuda cuda  4830 Oct 14 20:20 D_IosPush_UI7.json
-rw-rw-r-- 1 cuda cuda  1176 Oct 14 20:20 D_IosPush.xml
-rw-rw-r-- 1 cuda cuda 27876 Oct 17 22:15 I_IosPush.xml
-rw-rw-r-- 1 cuda cuda 45162 Oct 17 22:15 J_IosPush.js
-rw-rw-r-- 1 cuda cuda 47827 Oct 17 22:15 J_IosPush_UI7.js
-rw-rw-r-- 1 cuda cuda  5800 Oct 17 22:15 S_IosPush.xml
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 05:12:42 pm
I'm curious, were you getting this type of error when you created the Sonos locally ?

modprobe: ERROR: could not insert 'ip_tables': Operation not permitted
iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.


I'm thinking probably not, looks more like a permissions level issue... Device is created and any attempt to configure IP throws the above error..

Code: [Select]
cuda@Ubuntu:/usr/bin$ iptables -t nat -nvxL
iptables v1.4.21: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
cuda@Ubuntu:/usr/bin$ sudo iptables -t nat -nvxL
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               destination

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               destination
cuda@Ubuntu:/usr/bin$


So how is your TTS setup, from my logs I'm using OSX (Wolf Paulus).

I just took all the default settings - so Google is the TTS engine...

...and I have it working now!! (installed directly on openLuup.)  The problem was a very old one which has come back to bite me.  Some plugins (eg. Sonos) use a shell command /etc/bin/GetNetworkState.sh to determine the machine's IP address.  I used to provide this (actually for ALTUI, but it doesn't need it now.)  So you need to create that file with the following contents:

Code: [Select]
#! /usr/bin/env lua
------------------------------------------------------------------------
-- discover main IP address of machine and write to standard output, see:
-- http://forums.coronalabs.com/topic/21105-found-undocumented-way-to-get-your-devices-ip-address-from-lua-socket/
------------------------------------------------------------------------
local socket = require "socket"
function myIP ()
  local mySocket = socket.udp ()
  mySocket:setpeername ("42.42.42.42", "424242")  -- arbitrary IP/PORT
  local ip = mySocket:getsockname ()
  mySocket: close()
  return ip or "127.0.0.1"
end
io.write (myIP())
--------

Also you'll need to set it executable with:
Code: [Select]
chmod a+x /usr/bin/GetNetworkState.sh

Notwithstanding all this, what you're doing remotely should work, so I have some more digging to do.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 05:34:40 pm
I'm curious, were you getting this type of error when you created the Sonos locally ?

No, never seen it before.  Not one of mine!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 05:37:34 pm
Attempted to install the IOS push plugin locally. In doing so it complained about expat.. No problem, (apt-get install lua-expat) then the implementation file was attempting to load 'json'. I modified it to use the json module I had loaded (yes, I know - different) but it's still not happy, 'device 133 'IosPush' requesting reload'. This won't keep you from running openLuup though, it just won't load the device. Going to remove it until I can play with it further..

You're talking about the Push Notification app number 2508 ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 05:50:28 pm
@somebody (I can't remember who it was)

...asked if openLuup should be installed in /etc/cmh-ludl/.

It's a good question, the correct response being:

So if your don't have it installed there, the easy fix is a symbolic link in /etc/ making cmh-ludl point to wherever you DO run openLuup.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 20, 2015, 06:00:26 pm
@CudaNet

It turns out that this trick might work for IOS Push too...


It turns out that you should be able to sidestep the startup checks by using this sequence in your startup file:
Code: [Select]
do -- GCal3
  local gcal = luup.create_device ('', "GCal3", "GCal3", "GCal3.xml")       
  local GCAL_SID = "urn:srs-com:serviceId:GCalIII"
  luup.variable_set(GCAL_SID, "UI7Check", "true", gcal)
  luup.attr_set("device_json", "D_GCal3_UI7.json", gcal)
end


It just needs a little tweak:
Code: [Select]
do -- IOS Push
  local ios = luup.create_device ('', "IOS Push", "IOS Push", "D_IosPush.xml")       
  local ITEM_SID = "urn:upnp-org:serviceId:IOSPush1"
  luup.variable_set(ITEM_SID, "UI7Check", "true", ios)
  luup.attr_set("device_json", "D_IosPush_UI7.json", ios)
end

I haven't tried it, but the startup UI7 check code looks identical.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 06:03:27 pm
Had my fingers crossed someone had come across this before. Not sure what the plugin is attempting to do, I'll keep searching to see if I can locate a solution.

I'm curious, were you getting this type of error when you created the Sonos locally ?

No, never seen it before.  Not one of mine!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 06:06:03 pm
Yes, that's the one.

Attempted to install the IOS push plugin locally. In doing so it complained about expat.. No problem, (apt-get install lua-expat) then the implementation file was attempting to load 'json'. I modified it to use the json module I had loaded (yes, I know - different) but it's still not happy, 'device 133 'IosPush' requesting reload'. This won't keep you from running openLuup though, it just won't load the device. Going to remove it until I can play with it further..

You're talking about the Push Notification app number 2508 ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 20, 2015, 06:15:04 pm
I just wanted to apologize to everyone for flooding this thread, just passing along what I can when it happens. I totally realize that it does make it difficult to keep track of others posting questions/issues etc.

@akbooer
I added the entry for IOS to the startup... Didn't work unfortunately. Just kept requesting a reload for that device over and over.

@amg0
Verified that triggers are all working.

Code: [Select]
2015-10-20 20:44:48.766   luup.watch_callback:: 113.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped function: 0x1dc9760
2015-10-20 20:44:48.768   luup.call_action:3: 0.urn:micasaverde-com:serviceId:HomeAutomationGateway1.RunScene
2015-10-20 20:44:48.768   luup_log:0: The doorbell says, ding - dong.
2015-10-20 20:44:48.769   luup.scenes:0: running 3, Testing, initiated by command
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 08:25:22 am
I added the entry for IOS to the startup... Didn't work unfortunately. Just kept requesting a reload for that device over and over.

Strange, because it works for me  However, to get IosPush properly going I've had to change some of its files (use the ones attached here).  I won't go into the reasons for this - suffice to say I wouldn't have written it like that.

I've also have to add a file (and directory) it references: /etc/cmh/ui with the one-line content "7".

I've tested it with Prowl, and all seem to be OK.  Clearly there might be something wrong with other notification paths.  The only things that doesn't seem right now is that the icon does not display.

Code: [Select]
do -- IOS Push
  local ios = luup.create_device ('', "IOS Push", "IOS Push", "D_IosPush.xml")       
  local ITEM_SID = "urn:upnp-org:serviceId:IOSPush1"
  luup.variable_set(ITEM_SID, "UI7Check", "true", ios)
  luup.attr_set("device_json", "D_IosPush_UI7.json", ios)
end

Hope this works for you now.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 10:37:12 am
[re. GCal3] Yes, quite involved.... However it's just one of those things once setup - you really don't have to touch it again. I was about to just send you my creds if the docs and PM didn't help.

I have now got to this stage with GCal3 (see attached).
What next?
I have NO idea how to test this.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 11:45:56 am
Within Calendar ID, enter the email address that allows you to view it via a browser (name@gmail.com). Hit 'Set' and it should validate that it has access to the calendar. If all goes well, Arm the device and configure the following variables:

1. gc_retrip = false
2. gc_triggerNoKeyword = true

'gc_triggerNoKeyword' will evaluate any event it encounters on the calendar throughout the day. In this example, I created an event called

Code: [Select]
Say{Lounge; This is an openLuup test.}

When the scene fires (I bypassed the usual check of 180/minutes) you'll see the following variables populated.




[re. GCal3] Yes, quite involved.... However it's just one of those things once setup - you really don't have to touch it again. I was about to just send you my creds if the docs and PM didn't help.

I have now got to this stage with GCal3 (see attached).
What next?
I have NO idea how to test this.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 12:00:48 pm
Within Calendar ID, enter the email address that allows you to view it via a browser (name@gmail.com). Hit 'Set' and it should validate that it has access to the calendar. If all goes well, Arm the device and configure the following variables:

I don't think I have a Google calendar - or did setting up the API generate one?  Anyway, with my google address it generates a "Access or Calendar Error" after switching to Arm from Bypass mode.

I did notice the the address I typed was saved in the device variable gc_CalendarID with URL escapes, so something like xxx%40gmail.com, which I take it is standard?

Sorry.  haven't a clue.  Just don't use this stuff - I even had to generate a Goggle account because I've never had one.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 12:14:39 pm
I actually had a Calendar before I enrolled in their API but I'm pretty sure if you have a gmail account, you have Google everything (Calendar, Drive etc..).

Quote
I don't think I have a Google calendar - or did setting up the API generate one?  Anyway, with my google address it generates a "Access or Calendar Error" after switching to Arm from Bypass mode.

Yes, that's correct.

Quote
I did notice the the address I typed was saved in the device variable gc_CalendarID with URL escapes, so something like xxx%40gmail.com, which I take it is standard?

No need to be sorry - I totally understand and I really appreciate you trying to make this work. If you want I can PM you my credentials or I can simply use the cloned device.

Quote
Sorry.  haven't a clue.  Just don't use this stuff - I even had to generate a Goggle account because I've never had one.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 12:27:41 pm
I really appreciate you trying to make this work. If you want I can PM you my credentials or I can simply use the cloned device.

Well the easiest thing for now would be for you to try this again under openLuup.  The recipe I gave for startup earlier should work.  I'm keen to see what breaks openLuup.  At the same time I'll try on a real Vera.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 12:47:43 pm
I'll give it a try...

I really appreciate you trying to make this work. If you want I can PM you my credentials or I can simply use the cloned device.

Well the easiest thing for now would be for you to try this again under openLuup.  The recipe I gave for startup earlier should work.  I'm keen to see what breaks openLuup.  At the same time I'll try on a real Vera.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 01:31:36 pm
In both cases the devices were created, however there appears to be no way to configure anything. For instance, within Variables - the only field is UI7 Check.
After reading back a few pages, I found your post [#299] where you commented on the whereabouts of json.lua, totally overlooked that part...

Code: [Select]
/usr/lib/lua/json.lua
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 02:05:25 pm
In both cases the devices were created, however there appears to be no way to configure anything. For instance, within Variables - the only field is UI7 Check.

Let's fix one thing at a time (don't forget to save your user_data.json.)  We'll work on GCal3.

With THIS startup file (so a completely clean system):
Code: [Select]
do -- ALTUI
  local upnp_impl, ip, mac, hidden, invisible, parent, room
  local pluginnum = 8246
  luup.create_device ('', "ALTUI", "ALTUI", "D_ALTUI.xml",
    upnp_impl, ip, mac, hidden, invisible, parent, room, pluginnum) 
end

do -- GCal3
  local gcal = luup.create_device ('', "GCal3", "GCal3", "D_GCal3.xml")       
  local GCAL_SID = "urn:srs-com:serviceId:GCalIII"
  luup.variable_set(GCAL_SID, "UI7Check", "true", gcal)
  luup.attr_set("device_json", "D_GCal3_UI7.json", gcal)
end

I get this console log:
Code: [Select]
root@beaglebone:/etc/cmh-ludl# ./openLuup_reload startup_gcal.lua
device 3 'ALTUI' requesting reload
GCal3.email  GCal3.json  GCal3.pem  GCal3.sem
sh: 1: bin/rm: not found
/bin/ls: cannot access /etc/cmh-ludl/GCal3/GCal3.sem: No such file or directory
/etc/cmh-ludl/GCal3/GCal3.sem
/usr/lib/lua/json.lua
/bin/ls: cannot access /etc/cmh-ludl/GCal3.json.lzo: No such file or directory
/etc/cmh-ludl/GCal3/GCal3.json
/etc/cmh-ludl/GCal3/GCal3.json
root@beaglebone:/etc/cmh-ludl#

and this log file:
Code: [Select]
2015-10-21 18:58:33.248   :: openLuup STARTUP ::
2015-10-21 18:58:33.251   openLuup.init::      version 2015.09.30  @akbooer
2015-10-21 18:58:33.435   openLuup.scheduler:: version 2015.08.23  @akbooer
2015-10-21 18:58:33.438   openLuup.server::    version 2015.10.03  @akbooer
2015-10-21 18:58:33.482   openLuup.plugins::   version 2015.09.04  @akbooer
2015-10-21 18:58:33.564   openLuup.scenes::    version 2015.10.14  @akbooer
2015-10-21 18:58:33.624   openLuup.plugins::   version 2015.09.04  @akbooer
2015-10-21 18:58:33.650   openLuup.chdev::     version 2015.10.01  @akbooer
2015-10-21 18:58:33.681   openLuup.io::        version 2015.08.15  @akbooer
2015-10-21 18:58:33.683   openLuup.luup::      version 2015.10.14  @akbooer
2015-10-21 18:58:33.746   openLuup.rooms::     version 2015.09.30  @akbooer
2015-10-21 18:58:33.748   openLuup.requests::  version 2015.10.19  @akbooer
2015-10-21 18:58:33.815   luup.create_device:: [1] urn:schemas-micasaverde-com:device:ZWaveNetwork:1 / no-implementation-file
2015-10-21 18:58:33.902   luup.create_device:: [2] urn:schemas-micasaverde-com:device:SceneController:1 / no-implementation-file
2015-10-21 18:58:33.906   openLuup.init:: loading configuration user_data.json
2015-10-21 18:58:33.919   openLuup.init:: loading user_data json...
2015-10-21 18:58:33.956   openLuup.init:: loading rooms...
2015-10-21 18:58:33.958   openLuup.init:: ...room loading completed
2015-10-21 18:58:33.961   openLuup.init:: loading devices...
2015-10-21 18:58:33.963   openLuup.init:: [1] 'ZWave', urn:schemas-micasaverde-com:device:ZWaveNetwork:1
2015-10-21 18:58:33.969   openLuup.init:: [2] '_SceneController', urn:schemas-micasaverde-com:device:SceneController:1
2015-10-21 18:58:33.974   openLuup.init:: [3] 'ALTUI', urn:schemas-upnp-org:device:altui:1
2015-10-21 18:58:34.300   openLuup.init:: [4] 'GCal3', urn:schemas-srs-com:device:GCal:3
2015-10-21 18:58:34.548   openLuup.init:: loading scenes...
2015-10-21 18:58:34.550   openLuup.init:: number of scenes = 0
2015-10-21 18:58:34.552   openLuup.init:: ...scene loading completed
2015-10-21 18:58:34.554   openLuup.init:: loading installed plugin info...
2015-10-21 18:58:34.556   openLuup.init:: ...user_data loading completed
2015-10-21 18:58:34.558   openLuup.init:: running Startup Lua
2015-10-21 18:58:34.560   openLuup.init:: startup completed
2015-10-21 18:58:34.562   openLuup.server:: starting HTTP server on 172.16.42.129:3480 tcp{server}: 0x14c168
2015-10-21 18:58:34.564   openLuup.scheduler:: starting
2015-10-21 18:58:34.566   openLuup.scheduler:3: device startup
2015-10-21 18:58:34.568   luup_log:3: ALTUI: initstatus(3) starting version: v0.93
2015-10-21 18:58:34.570   openLuup.scheduler:3: device startup completed: status=nil, msg=nil, name=nil
2015-10-21 18:58:34.572   openLuup.scheduler:4: device startup
2015-10-21 18:58:34.574   luup_log:4: GCal3 V 1.3:Delay = 4
2015-10-21 18:58:34.576   luup_log:4: GCal3 V 1.3:Device # 4 initializing
2015-10-21 18:58:34.624   luup_log:4: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/ returned 0
2015-10-21 18:58:34.759   luup_log:4: GCal3 V 1.3:Command /bin/rm -f /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-21 18:58:34.793   luup_log:4: GCal3 V 1.3:Command bin/rm -f /etc/cmh-ludl/GCal3/*.token returned 32512
2015-10-21 18:58:34.821   luup_log:4: GCal3 V 1.3:Command /bin/rm -f  /usr/lib/lua/googlejwt.sh returned 0
2015-10-21 18:58:34.824   luup.call_timer:4: interval: time=2, days={}
2015-10-21 18:58:34.826   openLuup.scheduler:4: device startup completed: status=nil, msg=nil, name=nil
2015-10-21 18:58:35.831   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2015-10-21 18:58:35.923   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Debug was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:35.926   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: EMPTY now: v0.93 #hooks:0
2015-10-21 18:58:35.928   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Present was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:35.931   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.RemoteAccess was: EMPTY now: https://vera-ui.strongcubedfitness.com/Veralogin.php #hooks:0
2015-10-21 18:58:35.934   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalHome was: EMPTY now: /port_3480/data_request?id=lr_ALTUI_Handler&command=home #hooks:0
2015-10-21 18:58:35.936   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.ThemeCSS was: EMPTY now:  #hooks:0
2015-10-21 18:58:35.939   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.ExtraController was: EMPTY now:  #hooks:0
2015-10-21 18:58:35.941   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.ServerOptions was: EMPTY now:  #hooks:0
2015-10-21 18:58:35.944   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalCDN was: EMPTY now:  #hooks:0
2015-10-21 18:58:35.946   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalBootstrap was: EMPTY now:  #hooks:0
2015-10-21 18:58:35.963   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.PluginConfig was: EMPTY now: {"urn:schemas-micasaverde-com:device:PowerMeter:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:CombinationSwitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCombinationSwitch","ScriptFile":"J_ALTUI_plugins.js"},"urn:richardgreen:device:VeraAlert:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawVeraAlerts","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:UPnPProxy:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPnPProxy","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:Heater:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHeater","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawZoneThermostat","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:DoorLock:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorLock","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:DoorSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDoorSensor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-rts-services-com:device:ProgramLogicTS:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawProgLogicTimerSwitch","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:RGBController:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:PowerMeter:2":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:IPX800:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPX","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-arduino-cc:device:arduino:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMySensors","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:Sonos:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawSonos","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-dcineco-com:device:MSwitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMultiswitch","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:2":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:MotionSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMotion","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:TempLeakSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawTempLeak","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-rts-services-com:device:ProgramLogicEG:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPLEG","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-cd-jackson-com:device:SystemMonitor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawSysMonitor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-rts-services-com:device:DayTime:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDayTime","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:VSwitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawVswitch","ScriptFile":"J_ALTUI_plugins.js"},"urn:demo-micasaverde-com:device:weather:1":{"DeviceIconFunc":"ALTUI_PluginDisplays.drawWeatherIcon","DeviceDrawFunc":"ALTUI_PluginDisplays.drawWeather","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:IPhoneLocator:1":{"StyleFunc":"ALTUI_IPhoneLocator.getStyle","DeviceDrawFunc":"ALTUI_IPhoneLocator.drawIPhone","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-utz-com:device:GCal:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawGCal","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:VContainer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawMultiString","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:altui:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawAltUI","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-micasaverde-com:device:HumiditySensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawHumidity","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:SmokeSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawSmoke","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-a-lurker-com:device:InfoViewer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawInfoViewer","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-cd-jackson-com:device:DataMine:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDataMine","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:CountdownTimer:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCountDown","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-futzle-com:device:holidayvirtualswitch:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawVacation","ScriptFile":"J_ALTUI_plugins.js"},"urn:antor-fr:device:SamsungTVRemote:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DimmableLight:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawDimmable","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:cplus:1":{"DeviceDrawFunc":"ALTUI_IPhoneLocator.drawCanalplus","ControlPanelFunc":"ALTUI_IPhoneLocator.drawCanaplusControlPanel","ScriptFile":"J_ALTUI_iphone.js"},"urn:schemas-micasaverde-com:device:TemperatureSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawTempSensor","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:DigitalSecurityCamera:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawCamera","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-upnp-org:device:BinaryLight:1":{"StyleFunc":"ALTUI_PluginDisplays.getStyle","DeviceDrawFunc":"ALTUI_PluginDisplays.drawBinaryLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:LightSensor:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawLight","ScriptFile":"J_ALTUI_plugins.js"},"urn:schemas-micasaverde-com:device:WindowCovering:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawWindowCover","ScriptFile":"J_ALTUI_plugins.js"}} #hooks:0
2015-10-21 18:58:35.967   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: v0.93 now: v0.93 #hooks:0
2015-10-21 18:58:35.969   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.VariablesToWatch was: EMPTY now:  #hooks:0
2015-10-21 18:58:35.972   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.VariablesToSend was: EMPTY now:  #hooks:0
2015-10-21 18:58:35.974   luup.set_failure:3: status = 0
2015-10-21 18:58:35.976   luup.register_handler:3: global_function_name=myALTUI_Handler, request=lr_ALTUI_Handler
2015-10-21 18:58:36.031   luup.call_action:3: 0.urn:micasaverde-com:serviceId:HomeAutomationGateway1.RunLua
2015-10-21 18:58:36.038   luup.register_handler:0: global_function_name=ALTUI_LuaRunHandler, request=lr_ALTUI_LuaRunHandler
2015-10-21 18:58:36.041   luup_log:3: ALTUI: startup completed
2015-10-21 18:58:36.544   luup_log:4: GCal3 V 1.3:Delay = delayedstart
2015-10-21 18:58:36.614   luup_log:4: GCal3 V 1.3:Checking semaphore
2015-10-21 18:58:36.669   luup_log:4: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/GCal3.sem returned 512
2015-10-21 18:58:36.672   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: EMPTY now: GCal3.sem #hooks:0
2015-10-21 18:58:36.674   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: EMPTY now: Could not Open #hooks:0
2015-10-21 18:58:36.677   luup_log:4: GCal3 V 1.3:Semaphore file returned nil
2015-10-21 18:58:36.794   luup_log:4: GCal3 V 1.3:Device 4 requested semaphore
2015-10-21 18:58:36.832   luup_log:4: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-21 18:58:36.930   luup_log:4: GCal3 V 1.3:Device 4 claimed semaphore
2015-10-21 18:58:36.933   luup.variable_set:4: 4.urn:micasaverde-com:serviceId:SecuritySensor1.Armed was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:36.936   luup.variable_set:4: 4.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:36.939   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_TrippedEvent was: EMPTY now:  #hooks:0
2015-10-21 18:58:36.941   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_TrippedID was: EMPTY now:  #hooks:0
2015-10-21 18:58:36.944   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_Value was: EMPTY now:  #hooks:0
2015-10-21 18:58:36.946   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: GCal3.sem now:  #hooks:0
2015-10-21 18:58:36.948   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: Could not Open now: . #hooks:0
2015-10-21 18:58:36.951   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_Interval was: EMPTY now: 180 #hooks:0
2015-10-21 18:58:36.953   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_StartDelta was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:36.955   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_EndDelta was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:36.957   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_Keyword was: EMPTY now:  #hooks:0
2015-10-21 18:58:36.960   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_exactKeyword was: EMPTY now: true #hooks:0
2015-10-21 18:58:36.962   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_ignoreKeyword was: EMPTY now: false #hooks:0
2015-10-21 18:58:36.965   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_triggerNoKeyword was: EMPTY now: false #hooks:0
2015-10-21 18:58:36.967   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_ignoreAllDayEvent was: EMPTY now: false #hooks:0
2015-10-21 18:58:36.969   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_retrip was: EMPTY now: true #hooks:0
2015-10-21 18:58:36.971   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_CalendarID was: EMPTY now:  #hooks:0
2015-10-21 18:58:36.973   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_jsonEvents was: EMPTY now: [] #hooks:0
2015-10-21 18:58:36.975   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_jsonActiveEvents was: EMPTY now: [] #hooks:0
2015-10-21 18:58:36.978   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_ActiveEvents was: EMPTY now:  #hooks:0
2015-10-21 18:58:36.980   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_EventsToday was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:36.982   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_EventsLeftToday was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:36.984   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_lastCheck was: EMPTY now: 2015-10-21T18:58:36 #hooks:0
2015-10-21 18:58:36.987   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_nextCheck was: EMPTY now: 2015-10-21T18:58:36 #hooks:0
2015-10-21 18:58:36.989   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_debug was: EMPTY now: 1 #hooks:0
2015-10-21 18:58:36.991   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_displaystatus was: EMPTY now: 0 #hooks:0
2015-10-21 18:58:36.993   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_notify was: EMPTY now:  #hooks:0
2015-10-21 18:58:36.996   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_notifyName was: EMPTY now:  #hooks:0
2015-10-21 18:58:36.998   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_notifyValue was: EMPTY now:  #hooks:0
2015-10-21 18:58:37.000   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_notifyType was: EMPTY now:  #hooks:0
2015-10-21 18:58:37.002   luup_log:4: GCal3 V 1.3:GCal3 V 1.3:Variables initialized ...
2015-10-21 18:58:37.440   luup_log:4: GCal3 V 1.3:GCal3 V 1.3:Running Plugin ...
2015-10-21 18:58:37.443   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_NextEvent was:  now: Successfully Initialized #hooks:0
2015-10-21 18:58:37.445   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: . now: . #hooks:0
2015-10-21 18:58:37.447   luup.call_timer:4: interval: time=1, days={}
2015-10-21 18:58:37.473   luup_log:4: GCal3 V 1.3:Device 4 released the semaphore - reason: initialization complete
2015-10-21 18:58:38.477   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: Successfully Initialized now: The CalendarID is not set #hooks:0
2015-10-21 18:58:38.480   luup.variable_set:4: 4.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: . now: . #hooks:0
2015-10-21 18:58:38.482   luup_log:4: GCal3 V 1.3:GCal3 V 1.3:The Calendar ID is not set
2015-10-21 18:59:20.793   openLuup.server:: new client connection: tcp{client}: 0x18af48
2015-10-21 18:59:20.797   openLuup.server:: /data_request?id=exit tcp{client}: 0x18af48
2015-10-21 18:59:20.803   openLuup.server:: request completed (51 bytes, 1 chunks, 6 ms) tcp{client}: 0x18af48
2015-10-21 18:59:21.306   openLuup.scheduler:: exiting with code 0
2015-10-21 18:59:21.309   openLuup.init:: saving user_data
2015-10-21 18:59:21.404   openLuup.init:: exiting with code 0 - after 0.0 hours

What do you get that's different?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 02:17:28 pm
Here's what I have so far...

Console:
Code: [Select]
cuda@Ubuntu:/etc/cmh-ludl$ ./openLuup_reload startup.lua
GCal3.email  GCal3.json  GCal3.json.save  GCal3.pem
sh: 1: bin/rm: not found
device 5 'GCal3' requesting reload
GCal3.email  GCal3.json  GCal3.json.save  GCal3.pem
sh: 1: bin/rm: not found
device 5 'GCal3' requesting reload
GCal3.email  GCal3.json  GCal3.json.save  GCal3.pem
sh: 1: bin/rm: not found
device 5 'GCal3' requesting reload
GCal3.email  GCal3.json  GCal3.json.save  GCal3.pem
sh: 1: bin/rm: not found
device 5 'GCal3' requesting reload

Log
Code: [Select]
2015-10-21 13:11:36.276   :: openLuup STARTUP ::
2015-10-21 13:11:36.277   openLuup.init::      version 2015.10.15  @akbooer
2015-10-21 13:11:36.304   openLuup.scheduler:: version 2015.10.15  @akbooer
2015-10-21 13:11:36.305   openLuup.server::    version 2015.10.15  @akbooer
2015-10-21 13:11:36.308   openLuup.plugins::   version 2015.10.16  @akbooer
2015-10-21 13:11:36.314   openLuup.scenes::    version 2015.10.15  @akbooer
2015-10-21 13:11:36.319   openLuup.plugins::   version 2015.10.16  @akbooer
2015-10-21 13:11:36.320   openLuup.chdev::     version 2015.10.15  @akbooer
2015-10-21 13:11:36.322   openLuup.io::        version 2015.10.15  @akbooer
2015-10-21 13:11:36.322   openLuup.luup::      version 2015.10.15  @akbooer
2015-10-21 13:11:36.328   openLuup.rooms::     version 2015.10.15  @akbooer
2015-10-21 13:11:36.328   openLuup.requests::  version 2015.10.15  @akbooer
2015-10-21 13:11:36.340   luup.create_device:: [1] urn:schemas-micasaverde-com:device:ZWaveNetwork:1 / no-implementation-file
2015-10-21 13:11:36.351   luup.create_device:: [2] urn:schemas-micasaverde-com:device:SceneController:1 / no-implementation-file
2015-10-21 13:11:36.351   openLuup.init:: loading configuration user_data.json
2015-10-21 13:11:36.352   openLuup.init:: loading user_data json...
2015-10-21 13:11:36.364   openLuup.init:: loading rooms...
2015-10-21 13:11:36.364   openLuup.init:: ...room loading completed
2015-10-21 13:11:36.364   openLuup.init:: loading devices...
2015-10-21 13:11:36.365   openLuup.init:: [1] 'ZWave', urn:schemas-micasaverde-com:device:ZWaveNetwork:1
2015-10-21 13:11:36.366   openLuup.init:: [2] '_SceneController', urn:schemas-micasaverde-com:device:SceneController:1
2015-10-21 13:11:36.367   openLuup.init:: [3] 'ALTUI', urn:schemas-upnp-org:device:altui:1
2015-10-21 13:11:36.415   openLuup.init:: [4] 'Remote Vera', urn:schemas-micasaverde-com:device:HomeAutomationGateway:1
2015-10-21 13:11:36.424   openLuup.init:: [5] 'GCal3', urn:schemas-srs-com:device:GCal:3
2015-10-21 13:11:36.467   openLuup.init:: loading scenes...
2015-10-21 13:11:36.467   openLuup.init:: number of scenes = 0
2015-10-21 13:11:36.467   openLuup.init:: ...scene loading completed
2015-10-21 13:11:36.467   openLuup.init:: loading installed plugin info...
2015-10-21 13:11:36.468   openLuup.init:: ...user_data loading completed
2015-10-21 13:11:36.468   openLuup.init:: running Startup Lua
2015-10-21 13:11:36.468   openLuup.init:: startup completed
2015-10-21 13:11:36.468   openLuup.server:: starting HTTP server on 172.16.5.144:3480 tcp{server}: 0x10924e8
2015-10-21 13:11:36.468   openLuup.scheduler:: starting
2015-10-21 13:11:36.468   openLuup.scheduler:4: device startup
2015-10-21 13:11:36.468   luup_log:4: VeraBridge
2015-10-21 13:11:36.468   luup_log:4: 2015.10.16   @akbooer
2015-10-21 13:11:36.469   luup_log:4: device_4
2015-10-21 13:11:36.469   luup_log:4: 192.168.2.189
2015-10-21 13:11:36.470   luup.variable_set:4: 4.urn:akbooer-com:serviceId:VeraBridge1.Devices was: 0 now: 0 #hooks:0
2015-10-21 13:11:36.470   luup.variable_set:4: 4.urn:akbooer-com:serviceId:VeraBridge1.Version was: 2015.10.16   @akbooer now: 2015.10.16   @akbooer #hooks:0
2015-10-21 13:11:36.471   luup.variable_set:4: 4.urn:upnp-org:serviceId:altui1.DisplayLine1 was: 0 devices now: 0 devices #hooks:0
2015-10-21 13:11:36.471   luup.variable_set:4: 4.urn:upnp-org:serviceId:altui1.DisplayLine2 was: 192.168.2.189 now: 192.168.2.189 #hooks:0
2015-10-21 13:11:36.472   openLuup.scheduler:4: device startup completed: status=true, msg=OK, name=device_4
2015-10-21 13:11:36.472   openLuup.scheduler:5: device startup
2015-10-21 13:11:36.472   luup_log:5: GCal3 V 1.3:Delay = 5
2015-10-21 13:11:36.473   luup_log:5: GCal3 V 1.3:Device # 5 initializing
2015-10-21 13:11:36.484   luup_log:5: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/ returned 0
2015-10-21 13:11:36.492   luup_log:5: GCal3 V 1.3:Command /bin/rm -f /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-21 13:11:36.498   luup_log:5: GCal3 V 1.3:Command bin/rm -f /etc/cmh-ludl/GCal3/*.token returned 32512
2015-10-21 13:11:36.506   luup_log:5: GCal3 V 1.3:Command /bin/rm -f  /usr/lib/lua/googlejwt.sh returned 0
2015-10-21 13:11:36.507   luup.variable_get:5: NO SUCH DEVICE: nil
2015-10-21 13:11:36.507   luup.variable_set:5: No such device ?.urn:srs-com:serviceId:GCalIII.UI7Check
2015-10-21 13:11:36.507   luup.variable_set:5: No such device ?.urn:srs-com:serviceId:GCalIII.UI7Check
2015-10-21 13:11:36.515   luup_log:5: GCal3 V 1.3:Command /bin/rm -f /etc/cmh-ludl/D_GCal37.json.lzo returned 0
2015-10-21 13:11:36.515   openLuup.luup:5: device 5 'GCal3' requesting reload
2015-10-21 13:11:36.515   luup.reload:5: saving user_data
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 03:08:46 pm
This will fix it... complete replacement for your openLuup/ directory. (but backup what you have first.)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 03:26:38 pm
OK, things are looking a lot better... Couple of things you mentioned earlier on ....

sh: 1: opkg: not found
sh: 1: /bin/opkg: not found
2015-10-21 14:16:42.265   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was:  now: Fatal error: openssl #hooks:0

Looking into Ubuntu to see what I can load to possibly resolve this... OpenSSL is already installed:

cuda@Ubuntu:/etc/cmh-ludl$ openssl
OpenSSL>



console:
Code: [Select]
root@Ubuntu:/etc/cmh-ludl# ./openLuup_reload startup.lua
GCal3.email  GCal3.json  GCal3.json.save  GCal3.pem
sh: 1: bin/rm: not found
/bin/ls: cannot access /etc/cmh-ludl/GCal3/GCal3.sem: No such file or directory
/etc/cmh-ludl/GCal3/GCal3.sem
/usr/lib/lua/json.lua
sh: 1: opkg: not found
sh: 1: /bin/opkg: not found

log:
Code: [Select]
2015-10-21 14:16:40.302   :: openLuup STARTUP ::
2015-10-21 14:16:40.302   openLuup.init::      version 2015.10.19  @akbooer
2015-10-21 14:16:40.343   openLuup.scheduler:: version 2015.10.15  @akbooer
2015-10-21 14:16:40.344   openLuup.server::    version 2015.10.15  @akbooer
2015-10-21 14:16:40.349   openLuup.plugins::   version 2015.10.16  @akbooer
2015-10-21 14:16:40.358   openLuup.scenes::    version 2015.10.15  @akbooer
2015-10-21 14:16:40.364   openLuup.plugins::   version 2015.10.16  @akbooer
2015-10-21 14:16:40.366   openLuup.chdev::     version 2015.10.15  @akbooer
2015-10-21 14:16:40.369   openLuup.io::        version 2015.10.15  @akbooer
2015-10-21 14:16:40.369   openLuup.luup::      version 2015.10.15  @akbooer
2015-10-21 14:16:40.378   openLuup.rooms::     version 2015.10.15  @akbooer
2015-10-21 14:16:40.379   openLuup.requests::  version 2015.10.19  @akbooer
2015-10-21 14:16:40.398   luup.create_device:: [1] urn:schemas-micasaverde-com:device:ZWaveNetwork:1 / no-implementation-file
2015-10-21 14:16:40.414   luup.create_device:: [2] urn:schemas-micasaverde-com:device:SceneController:1 / no-implementation-file
2015-10-21 14:16:40.415   openLuup.init:: loading configuration startup.lua
2015-10-21 14:16:40.416   openLuup.init:: running Startup Lua
2015-10-21 14:16:40.418   openLuup.rooms:: creating [1] Wiring Closet
2015-10-21 14:16:40.418   openLuup.rooms:: creating [2] Lounge
2015-10-21 14:16:40.418   openLuup.rooms:: creating [3] Office
2015-10-21 14:16:40.419   openLuup.rooms:: creating [4] Media
2015-10-21 14:16:40.419   openLuup.rooms:: creating [5] Guest
2015-10-21 14:16:40.510   luup.create_device:: [3] urn:schemas-upnp-org:device:altui:1 / no-implementation-file
2015-10-21 14:16:40.510   luup.attr_set:: 3.device_json = D_ALTUI_UI7.json
2015-10-21 14:16:40.523   luup.create_device:: [4] urn:schemas-micasaverde-com:device:HomeAutomationGateway:1 / no-implementation-file
2015-10-21 14:16:40.524   luup.attr_set:: 4.ip = 192.168.2.189
2015-10-21 14:16:40.590   luup.create_device:: [5] urn:schemas-srs-com:device:GCal:3 / no-implementation-file
2015-10-21 14:16:40.590   luup.variable_set:: 5.urn:srs-com:serviceId:GCalIII.UI7Check was: EMPTY now: true #hooks:0
2015-10-21 14:16:40.590   luup.attr_set:: 5.device_json = D_GCal3_UI7.json
2015-10-21 14:16:40.591   openLuup.init:: startup completed
2015-10-21 14:16:40.591   openLuup.server:: starting HTTP server on 172.16.5.144:3480 tcp{server}: 0xe29120
2015-10-21 14:16:40.591   openLuup.scheduler:: starting
2015-10-21 14:16:40.592   openLuup.scheduler:3: device startup
2015-10-21 14:16:40.592   luup_log:3: ALTUI: initstatus(3) starting version: v0.93
2015-10-21 14:16:40.592   openLuup.scheduler:3: device startup completed: status=nil, msg=nil, name=nil
2015-10-21 14:16:40.592   openLuup.scheduler:4: device startup
2015-10-21 14:16:40.592   luup_log:4: VeraBridge
2015-10-21 14:16:40.592   luup_log:4: 2015.10.16   @akbooer
2015-10-21 14:16:40.593   luup_log:4: device_4
2015-10-21 14:16:40.593   luup_log:4: 192.168.2.189
2015-10-21 14:16:40.595   luup.variable_set:4: 4.urn:akbooer-com:serviceId:VeraBridge1.Devices was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:40.595   luup.variable_set:4: 4.urn:akbooer-com:serviceId:VeraBridge1.Version was: EMPTY now: 2015.10.16   @akbooer #hooks:0
2015-10-21 14:16:40.596   luup.variable_set:4: 4.urn:upnp-org:serviceId:altui1.DisplayLine1 was: EMPTY now: 0 devices #hooks:0
2015-10-21 14:16:40.596   luup.variable_set:4: 4.urn:upnp-org:serviceId:altui1.DisplayLine2 was: EMPTY now: 192.168.2.189 #hooks:0
2015-10-21 14:16:40.598   openLuup.scheduler:4: device startup completed: status=true, msg=OK, name=device_4
2015-10-21 14:16:40.598   openLuup.scheduler:5: device startup
2015-10-21 14:16:40.598   luup_log:5: GCal3 V 1.3:Delay = 5
2015-10-21 14:16:40.598   luup_log:5: GCal3 V 1.3:Device # 5 initializing
2015-10-21 14:16:40.614   luup_log:5: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/ returned 0
2015-10-21 14:16:40.625   luup_log:5: GCal3 V 1.3:Command /bin/rm -f /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-21 14:16:40.634   luup_log:5: GCal3 V 1.3:Command bin/rm -f /etc/cmh-ludl/GCal3/*.token returned 32512
2015-10-21 14:16:40.646   luup_log:5: GCal3 V 1.3:Command /bin/rm -f  /usr/lib/lua/googlejwt.sh returned 0
2015-10-21 14:16:40.646   luup.call_timer:5: interval: time=2, days={}
2015-10-21 14:16:40.647   openLuup.scheduler:5: device startup completed: status=nil, msg=nil, name=nil
2015-10-21 14:16:41.649   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2015-10-21 14:16:41.649   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Debug was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:41.649   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: EMPTY now: v0.93 #hooks:0
2015-10-21 14:16:41.650   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Present was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:41.650   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.RemoteAccess was: EMPTY now: https://vera-ui.strongcubedfitness.com/Veralogin.php #hooks:0
2015-10-21 14:16:41.651   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalHome was: EMPTY now: /port_3480/data_request?id=lr_ALTUI_Handler&command=home #hooks:0
2015-10-21 14:16:41.651   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.ThemeCSS was: EMPTY now:  #hooks:0
2015-10-21 14:16:41.651   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.ExtraController was: EMPTY now:  #hooks:0
2015-10-21 14:16:41.652   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.ServerOptions was: EMPTY now:  #hooks:0
2015-10-21 14:16:41.652   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalCDN was: EMPTY now:  #hooks:0
2015-10-21 14:16:41.652   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.LocalBootstrap was: EMPTY now:  #hooks:0
--removed due to message limit size
2015-10-21 14:16:41.660   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: v0.93 now: v0.93 #hooks:0
2015-10-21 14:16:41.660   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.VariablesToWatch was: EMPTY now:  #hooks:0
2015-10-21 14:16:41.661   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.VariablesToSend was: EMPTY now:  #hooks:0
2015-10-21 14:16:41.661   luup.set_failure:3: status = 0
2015-10-21 14:16:41.661   luup.register_handler:3: global_function_name=myALTUI_Handler, request=lr_ALTUI_Handler
2015-10-21 14:16:41.680   luup.call_action:3: 0.urn:micasaverde-com:serviceId:HomeAutomationGateway1.RunLua
2015-10-21 14:16:41.682   luup.register_handler:0: global_function_name=ALTUI_LuaRunHandler, request=lr_ALTUI_LuaRunHandler
2015-10-21 14:16:41.683   luup_log:3: ALTUI: startup completed
2015-10-21 14:16:42.184   luup_log:5: GCal3 V 1.3:Delay = delayedstart
2015-10-21 14:16:42.184   luup_log:5: GCal3 V 1.3:Checking semaphore
2015-10-21 14:16:42.201   luup_log:5: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/GCal3.sem returned 512
2015-10-21 14:16:42.201   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: EMPTY now: GCal3.sem #hooks:0
2015-10-21 14:16:42.202   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: EMPTY now: Could not Open #hooks:0
2015-10-21 14:16:42.202   luup_log:5: GCal3 V 1.3:Semaphore file returned nil
2015-10-21 14:16:42.202   luup_log:5: GCal3 V 1.3:Device 5 requested semaphore
2015-10-21 14:16:42.217   luup_log:5: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-21 14:16:42.218   luup_log:5: GCal3 V 1.3:Device 5 claimed semaphore
2015-10-21 14:16:42.218   luup.variable_set:5: 5.urn:micasaverde-com:serviceId:SecuritySensor1.Armed was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:42.218   luup.variable_set:5: 5.urn:micasaverde-com:serviceId:SecuritySensor1.Tripped was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:42.219   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_TrippedEvent was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.219   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_TrippedID was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.220   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_Value was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.220   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: GCal3.sem now:  #hooks:0
2015-10-21 14:16:42.220   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: Could not Open now: . #hooks:0
2015-10-21 14:16:42.221   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_Interval was: EMPTY now: 180 #hooks:0
2015-10-21 14:16:42.221   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_StartDelta was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:42.221   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_EndDelta was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:42.222   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_Keyword was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.222   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_exactKeyword was: EMPTY now: true #hooks:0
2015-10-21 14:16:42.222   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_ignoreKeyword was: EMPTY now: false #hooks:0
2015-10-21 14:16:42.223   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_triggerNoKeyword was: EMPTY now: false #hooks:0
2015-10-21 14:16:42.223   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_ignoreAllDayEvent was: EMPTY now: false #hooks:0
2015-10-21 14:16:42.223   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_retrip was: EMPTY now: true #hooks:0
2015-10-21 14:16:42.224   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_CalendarID was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.224   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_jsonEvents was: EMPTY now: [] #hooks:0
2015-10-21 14:16:42.224   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_jsonActiveEvents was: EMPTY now: [] #hooks:0
2015-10-21 14:16:42.225   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_ActiveEvents was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.225   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_EventsToday was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:42.225   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_EventsLeftToday was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:42.226   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_lastCheck was: EMPTY now: 2015-10-21T14:16:42 #hooks:0
2015-10-21 14:16:42.226   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_nextCheck was: EMPTY now: 2015-10-21T14:16:42 #hooks:0
2015-10-21 14:16:42.227   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_debug was: EMPTY now: 1 #hooks:0
2015-10-21 14:16:42.227   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_displaystatus was: EMPTY now: 0 #hooks:0
2015-10-21 14:16:42.227   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_notify was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.228   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_notifyName was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.228   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_notifyValue was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.228   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_notifyType was: EMPTY now:  #hooks:0
2015-10-21 14:16:42.229   luup_log:5: GCal3 V 1.3:GCal3 V 1.3:Variables initialized ...
2015-10-21 14:16:42.265   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was:  now: Fatal error: openssl #hooks:0
2015-10-21 14:16:42.265   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: . now: . #hooks:0
2015-10-21 14:16:42.266   luup_log:5: GCal3 V 1.3:Device 5 released the semaphore - reason: Fatal error getting openssl
2015-10-21 14:17:12.365   openLuup.server:: new client connection: tcp{client}: 0xdb9a60
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 04:01:57 pm
Looking into Ubuntu to see what I can load to possibly resolve this... OpenSSL is already installed:

I fixed this by creating a file /usr/bin/opkg with the contents
Code: [Select]
echo openssl-util - 1.0.1g-1

...and making it executable: chmod a+x /usr/bin/opkg
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 04:37:51 pm
Awesome work... We now match.. However I am getting an  'Access or Calendar Error' as well so it's very close.

Code: [Select]
root@Ubuntu:/etc/cmh-ludl# ./openLuup_reload startup.lua
GCal3.email  GCal3.json  GCal3.json.save  GCal3.pem  GCal3.sem
sh: 1: bin/rm: not found
/bin/ls: cannot access /etc/cmh-ludl/GCal3/GCal3.sem: No such file or directory
/etc/cmh-ludl/GCal3/GCal3.sem
/usr/lib/lua/json.lua
/bin/ls: cannot access /etc/cmh-ludl/GCal3.json.lzo: No such file or directory
/etc/cmh-ludl/GCal3/GCal3.json
/etc/cmh-ludl/GCal3/GCal3.json


IOS Push (success !!!!)...
Code: [Select]
2015-10-21 15:04:22.366   openLuup.server:: /data_request?id=action&output_format=json&DeviceNum=6&serviceId=urn:upnp-org:serviceId:IOSPush1&action=SendPushOverNotification&Title=Test&Message=openLuup%20says%20hi%20!&Priority=1&URL=&URLTitle=&Sound=Incoming&DeviceName= tcp{client}: 0x17233a8
2015-10-21 15:04:22.367   luup.call_action:: 6.urn:upnp-org:serviceId:IOSPush1.SendPushOverNotification
2015-10-21 15:04:22.814   luup.variable_set:6: 6.urn:upnp-org:serviceId:IOSPush1.TimeSend was: 0 now: 1445457862 #hooks:0
2015-10-21 15:04:22.814   luup.variable_set:6: 6.urn:upnp-org:serviceId:IOSPush1.PushOverCount was: 0 now: 1 #hooks:0
2015-10-21 15:04:22.815   luup.variable_set:6: 6.urn:upnp-org:serviceId:IOSPush1.LastError was: RST - 14:59 now: Ok - 15:04 - (PushOver) #hooks:0

Looking into Ubuntu to see what I can load to possibly resolve this... OpenSSL is already installed:

I fixed this by creating a file /usr/bin/opkg with the contents
Code: [Select]
echo openssl-util - 1.0.1g-1

...and making it executable: chmod a+x /usr/bin/opkg


Looking into Ubuntu to see what I can load to possibly resolve this... OpenSSL is already installed:

I fixed this by creating a file /usr/bin/opkg with the contents
Code: [Select]
echo openssl-util - 1.0.1g-1

...and making it executable: chmod a+x /usr/bin/opkg
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 21, 2015, 04:40:31 pm
@akbooer @cudanet - as soon as you have Gcal3 working hopefully you can post the final steps and I will try it on my mac and report back. Thanks !
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 04:45:33 pm
I've documented all the necessary steps (up to this point) since Akbooer is doing all the heavy lifting here...

@akbooer @cudanet - as soon as you have Gcal3 working hopefully you can post the final steps and I will try it on my mac and report back. Thanks !
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 05:27:57 pm
I've documented all the necessary steps (up to this point) since Akbooer is doing all the heavy lifting here...

@akbooer @cudanet - as soon as you have Gcal3 working hopefully you can post the final steps and I will try it on my mac and report back. Thanks !

That's very helpful.  Thanks.

I'm kind of stuck, though, because I am getting the same error on Vera Edge.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 05:37:50 pm
It's the least I can do...

It's ever so possible that our beloved MIS department is blocking Google (select services) again. However, I do have access to my Calendar but calling for a token may be a whole other thing. Setting the debug level to 3 within the device does tell me this much... I'm assuming from glancing at Stuart's code, he's peeking at the sem file where he stores the access token until expiry. No token, no problem - just get one.. Well that it's if you have access....

2015-10-21 16:31:10.592   luup_log:5: GCal3 V 1.3:Token Info request status: HTTP/1.1 400 Bad Request
Code: [Select]
2015-10-21 16:31:10.438   luup_log:5: GCal3 V 1.3:local function:  checkGCal
2015-10-21 16:31:10.438   luup_log:5: GCal3 V 1.3:Checking semaphore
2015-10-21 16:31:10.454   luup_log:5: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-21 16:31:10.455   luup_log:5: GCal3 V 1.3:Semaphore file returned 0
2015-10-21 16:31:10.456   luup_log:5: GCal3 V 1.3:Device 5 requested semaphore
2015-10-21 16:31:10.471   luup_log:5: GCal3 V 1.3:Command /bin/ls /etc/cmh-ludl/GCal3/GCal3.sem returned 0
2015-10-21 16:31:10.472   luup_log:5: GCal3 V 1.3:Device 5 claimed semaphore
2015-10-21 16:31:10.473   luup_log:5: GCal3 V 1.3:StartMin is 2015-10-21T05:00:00Z StartMax is 2015-10-22T21:31:00Z
2015-10-21 16:31:10.474   luup_log:5: GCal3 V 1.3:End of day is 2015-10-21T23:59:59
2015-10-21 16:31:10.474   luup_log:5: GCal3 V 1.3:local function: requestCalendar
2015-10-21 16:31:10.474   luup_log:5: GCal3 V 1.3:local function: get_access_token
2015-10-21 16:31:10.592   luup_log:5: GCal3 V 1.3:Token Info request status: HTTP/1.1 400 Bad Request
2015-10-21 16:31:10.593   luup_log:5: GCal3 V 1.3:Getting a new token
2015-10-21 16:31:10.737   luup_log:5: GCal3 V 1.3:The token request did not provide an access token

I've documented all the necessary steps (up to this point) since Akbooer is doing all the heavy lifting here...

@akbooer @cudanet - as soon as you have Gcal3 working hopefully you can post the final steps and I will try it on my mac and report back. Thanks !

That's very helpful.  Thanks.

I'm kind of stuck, though, because I am getting the same error on Vera Edge.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 05:50:55 pm
Got it... So it appears it needed curl installed.. Console said, "sh: 1: curl: not found"
Installed curl, reloaded openLuup, set my calendar id and reloaded luup...

Code: [Select]
cuda@Ubuntu://$ sudo apt-get install curl
[sudo] password for cuda:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:  curl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 125 kB of archives.
After this operation, 294 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ vivid-updates/main curl armhf 7.38.0-3ubuntu2.2 [125 kB]
Fetched 125 kB in 0s (173 kB/s)
Selecting previously unselected package curl.
(Reading database ... 144584 files and directories currently installed.)
Preparing to unpack .../curl_7.38.0-3ubuntu2.2_armhf.deb ...
Unpacking curl (7.38.0-3ubuntu2.2) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up curl (7.38.0-3ubuntu2.2) ...
cuda@Ubuntu://$

Code: [Select]
2015-10-21 16:44:23.483   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: Successfully Initialized now: The CalendarID is set #hooks:0
2015-10-21 16:44:23.484   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: . now: . #hooks:0
2015-10-21 16:44:23.537   luup_log:5: GCal3 V 1.3:Device 5 claimed semaphore
2015-10-21 16:44:24.004   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: The CalendarID is set now: Accessing Calendar #hooks:0
2015-10-21 16:44:24.005   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: . now: . #hooks:0
2015-10-21 16:44:24.263   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: Accessing Calendar now: Calendar Access Success #hooks:0
2015-10-21 16:44:24.264   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: . now: . #hooks:0
2015-10-21 16:44:24.265   luup_log:5: GCal3 V 1.3:Device 5 released the semaphore - reason: calendar check complete
2015-10-21 16:44:24.265   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: Calendar Access Success now: Checking Events #hooks:0
2015-10-21 16:44:24.265   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: . now: . #hooks:0
2015-10-21 16:44:24.268   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_EventsToday was: 0 now: 1 #hooks:0
2015-10-21 16:44:24.268   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_EventsLeftToday was: 0 now: 0 #hooks:0
2015-10-21 16:44:24.269   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_ActiveEvents was:  now:  #hooks:0
2015-10-21 16:44:24.269   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_jsonEvents was: [] now: [{"eventEnd":1445428860,"eventStart":1445428800,"eventParameter":"Master","eventName":"ALERT"},{"eventEnd":1445515260,"eventStart":1445515200,"eventParameter":"Master","eventName":"ALERT"}] #hooks:0
2015-10-21 16:44:24.270   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_jsonActiveEvents was: [] now: [] #hooks:0
2015-10-21 16:44:24.270   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEvent was: Checking Events now: ALERT #hooks:0
2015-10-21 16:44:24.270   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_NextEventTime was: . now: 07:00 Oct 22 to 07:01 Oct 22 #hooks:0
2015-10-21 16:44:24.271   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_Value was:  now:  #hooks:0
2015-10-21 16:44:24.271   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_TrippedEvent was:  now:  #hooks:0
2015-10-21 16:44:24.271   luup_log:5: GCal3 V 1.3:Event-End  Inactive
2015-10-21 16:44:24.271   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_TrippedID was:  now:  #hooks:0
2015-10-21 16:44:24.272   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_displaystatus was: 0 now: 0 #hooks:0
2015-10-21 16:44:24.272   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_lastCheck was: 2015-10-21T16:43:21 now: 2015-10-21 at 16:44:24 #hooks:0
2015-10-21 16:44:24.273   luup.variable_set:5: 5.urn:srs-com:serviceId:GCalIII.gc_nextCheck was: 2015-10-21T16:43:21 now: 2015-10-21 at 19:44:24 #hooks:0
2015-10-21 16:44:24.273   luup_log:5: GCal3 V 1.3:Next check will be in 10800 sec on 2015-10-21 at 19:44:24
2015-10-21 16:44:24.273   luup.call_timer:5: interval: time=10800, days={}

@Akbooer, I can't thank you enough ...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 21, 2015, 06:01:45 pm
Ooohhh, fancy!  Well spotted!

So it actually works ?
I think that's what the log shows.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 21, 2015, 06:05:57 pm
So far so good, just did a quick scene and it fired on the event.

Ooohhh, fancy!  Well spotted!

So it actually works ?
I think that's was the log shows.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 22, 2015, 08:25:56 am
To get the correct icon for both IosPush and GCal3 you do, for the time being, need to edit their respective D_xxx.xml files to change the static .json file name:

Code: [Select]
      <staticJson>D_IosPush_UI7.json</staticJson>

and

Code: [Select]
    <staticJson>D_GCal3_UI7.json</staticJson>

I fully understand the reasons for this, but I'm unwilling to fix it at the moment.  I does look nicer with the right icon(s) though!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 22, 2015, 08:57:22 am
I was looking at this last night and didn't know exactly what controlled the icon. I went ahead and added this to the plugin documentation and I can honestly say this helps me learn how everything is tied together (I still have a lot to learn though).

To get the correct icon for both IosPush and GCal3 you do, for the time being, need to edit their respective D_xxx.xml files to change the static .json file name:

Code: [Select]
      <staticJson>D_IosPush_UI7.json</staticJson>

and

Code: [Select]
    <staticJson>D_GCal3_UI7.json</staticJson>

I fully understand the reasons for this, but I'm unwilling to fix it at the moment.  I does look nicer with the right icon(s) though!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 22, 2015, 12:56:32 pm
Things are too quiet in this thread.

I have a whole house of these Philips hue bulbs (lux/hue and bloom) and I suspect there are others too who are watching this thread. So this was one of those plugins (albeit a beta from MCV) that I wanted to run locally thus freeing up Vera. I realize that I can't do much other than attempt to get the process started as I'm in the office so here goes. We should also keep in mind that I don't know what to expect when MCV pushes out the general release which they indicate requires a firmware upgrade (if you're running it on a MCV device).

Important:
This plugin requires that dkjon be installed. So within Ubuntu, perform the following:

Code: [Select]
cuda@Ubuntu:/etc/cmh-ludl/files$ sudo luarocks install dkjson
[sudo] password for cuda:
Installing https://luarocks.org/dkjson-2.5-2.src.rock...
Using https://luarocks.org/dkjson-2.5-2.src.rock... switching to 'build' mode
Updating manifest for /usr/local/lib/luarocks/rocks
dkjson 2.5-2 is now built and installed in /usr/local (license: MIT/X11)

Within the AltUI:

[1] [misc] Lua test code.
luup.create_device ('', "PhilipsHue2", "PhilipsHue2", "D_PhilipsHue2.xml")

[2] [misc] Reload Luup engine.

[3] Log data

Code: [Select]
2015-10-22 11:34:31.163   luup_log:0: ALTUI: runLua(luup.create_device ('', "PhilipsHue2", "PhilipsHue2", "D_PhilipsHue2.xml"))
2015-10-22 11:34:31.172   luup.create_device:0: [136] urn:schemas-micasaverde-com:device:PhilipsHue:1 / no-implementation-file
2015-10-22 11:34:31.172   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-22 11:34:31.174   openLuup.server:: request completed (8 bytes, 1 chunks, 12 ms) tcp{client}: 0xb860d8
2015-10-22 11:34:31.174   openLuup.scheduler:136: device startup
2015-10-22 11:34:31.174   luup_log:136: (Hue2 Plugin)::(Startup) : Initiating
2015-10-22 11:34:31.203   luup.task:136: status=2 Hue2 Plugin : Starting up...
2015-10-22 11:34:31.203   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: EMPTY now:  #hooks:0
2015-10-22 11:34:31.204   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.DebugMode was: EMPTY now: 0 #hooks:0
2015-10-22 11:34:31.204   luup_log:136: (Hue2 Plugin)::(getInfos) : Debug mode disabled.
2015-10-22 11:34:31.204   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.POLLING_RATE was: EMPTY now: 10 #hooks:0
2015-10-22 11:34:31.205   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: EMPTY now: 0 #hooks:0
2015-10-22 11:34:36.209   luup_log:136: (Hue2 Plugin)::(findBridge) : Trying to get IP via NUPNP...
2015-10-22 11:34:36.209   luup_log:136: (Hue2 Plugin)::(findBridge) : Trying to get IP via NUPNP...
2015-10-22 11:34:37.052   luup_log:136: (Hue2 Plugin)::(findBridge) : (NUPNP) : Philips Hue Bridge could not be found!
2015-10-22 11:34:37.052   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.Status was:  now: Philips Hue Bridge could not be found! #hooks:0
2015-10-22 11:34:37.052   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: 0 now: 0 #hooks:0
2015-10-22 11:34:37.053   luup.task:136: status=1 Philips Hue by MiOS : IP address could not be automatically set! Please add it in IP field, save and reload the engine!
2015-10-22 11:34:37.053   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: Philips Hue Bridge could not be found! now: IP address could not be automatically set! Please add it in IP fie$
2015-10-22 11:34:37.053   luup.task:136: status=1 Hue2 Plugin : Startup ERROR : Connection with the Bridge could not be established!!!
2015-10-22 11:34:37.053   luup_log:136: (Hue2 Plugin)::(Startup) : Startup ERROR : Connection with the Bridge could not be established!!!

I'll continue to update this post when I pair it with the bridge tonight...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 22, 2015, 03:23:17 pm
Vera WWN (Works with Nest) has been interesting to say the least. I'll do my best to explain what's happening.

[1] Executed luup.create_device ('', "VeraConnectWWN1", "VeraConnectWWN1", "D_VeraConnectWWN1.xml") within Lua Test.
[2] Re-loaded Lua.

This is where all the issues began. AltUI was stuck on waiting data, no matter what I did it would not load. Looked back a few pages as I remember mda having the same issue. Ran a quick test from the browser to fetch user_data and that worked. I reverted to a clean user_data.json file. Re-loaded openLuup with startup.lua and it created the Google Calendars, IOS etc. I then (testing the waters) created the Philips hue plugin - no issues. Then I created the WWN plugin. With each step I re-loaded Lua. This time it created the device and I was able to access the UI.

Code: [Select]
2015-10-22 12:06:08.858   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.create_device%20(%27%27%2C%20%22VeraConnectWWN1%22%2C%20%22VeraConnectWWN1%22%2C%20%22D_VeraConnectWWN1.xml%22)&_=1445531769766 tcp{client}: 0x192e868
2015-10-22 12:06:08.859   luup_log:0: ALTUI: runLua(luup.create_device ('', "VeraConnectWWN1", "VeraConnectWWN1", "D_VeraConnectWWN1.xml"))
2015-10-22 12:06:08.869   luup.create_device:0: [137] urn:schemas-micasaverde-com:device:VeraConnectWWN:1 / no-implementation-file
2015-10-22 12:06:08.870   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-22 12:06:08.871   openLuup.server:: request completed (8 bytes, 1 chunks, 13 ms) tcp{client}: 0x192e868
2015-10-22 12:06:08.872   openLuup.scheduler:137: device startup
2015-10-22 12:06:08.872   luup_log:137: (Vera Connect WWN)::(Startup) : Initiating...
2015-10-22 12:06:08.886   luup.task:137: status=1 Vera Connect WWN : Starting up...
2015-10-22 12:06:08.887   luup.variable_set:137: 137.urn:micasaverde-com:serviceId:VeraConnectWWN1.DebugMode was: EMPTY now: 0 #hooks:0
2015-10-22 12:06:08.887   luup_log:137: (Vera Connect WWN)::(getInfos) : Debug mode disabled.
2015-10-22 12:06:08.887   luup.variable_set:137: 137.urn:micasaverde-com:serviceId:VeraConnectWWN1.POLLING_RATE was: EMPTY now: 1 #hooks:0
2015-10-22 12:06:08.888   luup_log:137: (Vera Connect WWN)::(getInfos) : POLLING_RATE = 1
2015-10-22 12:06:09.010   luup_log:137: (Vera Connect WWN)::(getInfos) : Temperature Scale is = f
2015-10-22 12:06:09.010   luup.variable_set:137: 137.urn:micasaverde-com:serviceId:VeraConnectWWN1.AUTHORIZED was: EMPTY now: false #hooks:0
2015-10-22 12:06:09.010   luup.variable_set:137: 137.urn:micasaverde-com:serviceId:VeraConnectWWN1.AUTHORIZATION_CODE was: EMPTY now: default #hooks:0
2015-10-22 12:06:09.011   luup.variable_set:137: 137.urn:micasaverde-com:serviceId:VeraConnectWWN1.TOKEN was: EMPTY now: default #hooks:0
2015-10-22 12:06:09.011   luup_log:137: (Vera Connect WWN)::(Init) : Please go to 'Authorize' tab and authorize VeraConnect!

At this point, the control panel has an Authorize tab. I click 'Authorize' (link) and it opens up a new browser window where I eventually get an authorization code. I go back to the AltUI tab and paste the code in but the enter button does nothing. I do a cntrl-shift-J and eventually see a link:

Code: [Select]
http://172.16.5.158:3480/data_request?id=variableset&DeviceNum=10&serviceId=urn:micasaverde-com:serviceId:VeraConnectWWN1&Variable=AUTHORIZATION_CODE&Value={removed by Cuda}

I take the link and paste it into a new window. That seems to have taken care of the authorization code. After changing the Authorized variable to 'true' and performing another re-load of Lua. It seems I now have the remainder of the access variables completed (e.g. expires in; token). However that's where the saga ends. About the only other signs of life from this plugin were these log entries.

Code: [Select]
2015-10-22 13:44:55.228   openLuup.server:: /luvd/S_VeraConnectWWN1.xml tcp{client}: 0x710d30
2015-10-22 13:44:55.229   openLuup.server:: /luvd/S_HVAC_FanOperatingMode1.xml tcp{client}: 0x74c3e8
2015-10-22 13:44:55.230   openLuup.server:: /luvd/S_HVAC_OperatingState1.xml tcp{client}: 0x685dd0
2015-10-22 13:44:55.230   openLuup.server:: /luvd/S_HVAC_UserOperatingMode1.xml tcp{client}: 0x6b5548
2015-10-22 13:44:55.231   openLuup.server:: /luvd/S_FanSpeed1.xml tcp{client}: 0x640040
2015-10-22 13:44:55.233   openLuup.server:: request completed (1200 bytes, 1 chunks, 4 ms) tcp{client}: 0x710d30
2015-10-22 13:44:55.235   openLuup.server:: request completed (3340 bytes, 1 chunks, 4 ms) tcp{client}: 0x640040
2015-10-22 13:44:55.237   openLuup.server:: request completed (2626 bytes, 1 chunks, 8 ms) tcp{client}: 0x74c3e8
2015-10-22 13:44:55.239   openLuup.server:: request completed (694 bytes, 1 chunks, 9 ms) tcp{client}: 0x685dd0
2015-10-22 13:44:55.241   openLuup.server:: request completed (4670 bytes, 1 chunks, 10 ms) tcp{client}: 0x6b5548
2015-10-22 13:44:55.242   openLuup.server:: /luvd/S_TemperatureSetpoint1.xml tcp{client}: 0x74c3e8
2015-10-22 13:44:55.243   openLuup.server:: /luvd/S_TemperatureSensor1.xml tcp{client}: 0x640040
2015-10-22 13:44:55.245   openLuup.server:: request completed (3344 bytes, 1 chunks, 3 ms) tcp{client}: 0x74c3e8
2015-10-22 13:44:55.247   openLuup.server:: request completed (2739 bytes, 1 chunks, 4 ms) tcp{client}: 0x640040
2015-10-22 13:44:55.248   openLuup.server:: /luvd/S_SwitchPower1.xml tcp{client}: 0x6b5548
2015-10-22 13:44:55.250   openLuup.server:: request completed (1445 bytes, 1 chunks, 2 ms) tcp{client}: 0x6b5548
2015-10-22 13:44:55.251   openLuup.server:: /luvd/S_EnergyMetering1.xml tcp{client}: 0x74c3e8
2015-10-22 13:44:55.252   openLuup.server:: /luvd/S_HaDevice1.xml tcp{client}: 0x640040
2015-10-22 13:44:55.254   openLuup.server:: request completed (1733 bytes, 1 chunks, 3 ms) tcp{client}: 0x74c3e8
2015-10-22 13:44:55.256   openLuup.server:: request completed (3172 bytes, 1 chunks, 4 ms) tcp{client}: 0x640040

Interestingly enough, if you're patient the plugin attempts to make a call out...

Code: [Select]

sh: 1: bin/rm: not found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to firebase-apiserver07-tah01-iad01.dapi.production.nest.com port 9553: Connection refused

Not sure if my company is blocking, I've said it before - it's entirely possible... Will report back tonight..

FIN
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 22, 2015, 04:37:49 pm
Because it is SO easy to switch between startup configurations in openLuup, my recommendation for comissionimg any new device would always be to create a brand new startup.lua file with only ALTUI and your device under test.

Device reloads in those circumstances take only a second or so... sometimes so quickly that the browser part of ALTUI doesn't even know that it's happened.  This makes debugging and examining logs really easy, and it's just a one-liner to restart your old user_data.json file when you want to resume your full system.

Even better, get another target machine to play with!  My 'production' openLuup system is an Arduino Yun but I'm developing mostly on a spare BeagleBone Black and within ZeroBrane Studio on my Mac.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 22, 2015, 04:54:04 pm
Ah, good to know... Thank you

Quote
Because it is SO easy to switch between startup configurations in openLuup, my recommendation for comissionimg any new device would always be to create a brand new startup.lua file with only ALTUI and your device under test.

Device reloads in those circumstances take only a second or so... sometimes so quickly that the browser part of ALTUI doesn't even know that it's happened.  This makes debugging and examining logs really easy, and it's just a one-liner to restart your old user_data.json file when you want to resume your full system.

Ordered a system on Tuesday, should be here today. Last week I installed pfSense (firewall/ids) on a Jetway http://www.jetwaycomputer.com/JBC311U93.html (http://www.jetwaycomputer.com/JBC311U93.html) since I'm upgrading our network at the house. It's really small and powerful. Anyways, I thought it was so well built I ordered it's younger brother (single NIC; Ubuntu Server 15.04) http://www.jetwaycomputer.com/JBC310U91.html (http://www.jetwaycomputer.com/JBC310U91.html). Both are outfitted with 60GB SSD's and 8GB memory. Will work nicely in my wiring closet and take up almost no space (wall mount) and their fan less..

So I'll reserve the rPi2 (Ubuntu Mate 15.04) or testing purposes and mobility.

Quote
Even better, get another target machine to play with!  My 'production' openLuup system is an Arduino Yun but I'm developing mostly on a spare BeagleBone Black and within ZeroBrane Studio on my Mac.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 22, 2015, 05:46:04 pm
Just taking a look at Vera WWN (bare system start, as I suggested) gives this log:
Code: [Select]
2015-10-22 22:30:54.906   openLuup.scheduler:4: device startup
2015-10-22 22:30:54.907   luup_log:4: (Vera Connect WWN)::(Startup) : Initiating...
2015-10-22 22:30:55.008   luup.task:4: status=1 Vera Connect WWN : Starting up...
2015-10-22 22:30:55.011   luup.variable_set:4: 4.urn:micasaverde-com:serviceId:VeraConnectWWN1.DebugMode was: EMPTY now: 0 #hooks:0
2015-10-22 22:30:55.013   luup_log:4: (Vera Connect WWN)::(getInfos) : Debug mode disabled.
2015-10-22 22:30:55.015   luup.variable_set:4: 4.urn:micasaverde-com:serviceId:VeraConnectWWN1.POLLING_RATE was: EMPTY now: 10 #hooks:0
2015-10-22 22:30:55.018   luup_log:4: (Vera Connect WWN)::(getInfos) : POLLING_RATE = 10
2015-10-22 22:30:55.029   luup_log:4: (Vera Connect WWN)::(getInfos) : Temperature Scale is = c
2015-10-22 22:30:55.073   luup_log:4: (Vera Connect WWN)::(checkPackageVersion) : Verifying...
2015-10-22 22:30:55.116   openLuup.context_switch::  ERROR: ./L_VeraConnectWWN1.lua:149: attempt to index local 'version' (a nil value)
2015-10-22 22:30:55.119   openLuup.scheduler:: job aborted : ./L_VeraConnectWWN1.lua:149: attempt to index local 'version' (a nil value)

Line 149 is somewhere here:
Code: [Select]
local function checkPackageVersion()
        log("checkPackageVersion","Verifying... ")
        local update = {}
        local REQUIRED_VERSION = { '7', '3', '8', '0', '2'}
        local stdout = io.popen("opkg list-installed | awk '/libcurl/ {print $3}'")
        local version = stdout:read("*a")
        version = version:match("([^%s]+)")
        stdout:close()

and, in fact, this function attempts to call opkg several times.

So I'm a bit surprised you have got as far as you have.  As usual, there should be a way to navigate through these initialization checks.  You may have to add some more smarts to the opkg file stub that you made earlier for some other plugin (I'm glad you're documenting this, because already I forget which it was.)

Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 22, 2015, 05:53:44 pm
This is what I have for opkg in regards to Google Calendar 3. This, the files you provided and the device entry within the startup.lua file. I think I somehow tricked the system into loading the WWN plugin, I was kind of determined to see how much ground I could cover...

Create opkg (file) within /usr/bin:
[1] Using an editor (vi/nano etc), enter the following contents within the file: echo openssl-util - 1.0.1g-1
[2] Save the file as 'opkg', exit the editor.
[3] Grant the proper permissions to the file (opkg).
     
Code: [Select]
root@Ubuntu:/usr/bin# chmod a+x /usr/bin/opkg
root@Ubuntu:/usr/bin# ls -ld opkg
-rwxr-xr-x 1 root root 29 Oct 21 15:08 opkg


Just taking a look at Vera WWN (bare system start, as I suggested) gives this log:
Code: [Select]
2015-10-22 22:30:54.906   openLuup.scheduler:4: device startup
2015-10-22 22:30:54.907   luup_log:4: (Vera Connect WWN)::(Startup) : Initiating...
2015-10-22 22:30:55.008   luup.task:4: status=1 Vera Connect WWN : Starting up...
2015-10-22 22:30:55.011   luup.variable_set:4: 4.urn:micasaverde-com:serviceId:VeraConnectWWN1.DebugMode was: EMPTY now: 0 #hooks:0
2015-10-22 22:30:55.013   luup_log:4: (Vera Connect WWN)::(getInfos) : Debug mode disabled.
2015-10-22 22:30:55.015   luup.variable_set:4: 4.urn:micasaverde-com:serviceId:VeraConnectWWN1.POLLING_RATE was: EMPTY now: 10 #hooks:0
2015-10-22 22:30:55.018   luup_log:4: (Vera Connect WWN)::(getInfos) : POLLING_RATE = 10
2015-10-22 22:30:55.029   luup_log:4: (Vera Connect WWN)::(getInfos) : Temperature Scale is = c
2015-10-22 22:30:55.073   luup_log:4: (Vera Connect WWN)::(checkPackageVersion) : Verifying...
2015-10-22 22:30:55.116   openLuup.context_switch::  ERROR: ./L_VeraConnectWWN1.lua:149: attempt to index local 'version' (a nil value)
2015-10-22 22:30:55.119   openLuup.scheduler:: job aborted : ./L_VeraConnectWWN1.lua:149: attempt to index local 'version' (a nil value)

Line 149 is somewhere here:
Code: [Select]
local function checkPackageVersion()
        log("checkPackageVersion","Verifying... ")
        local update = {}
        local REQUIRED_VERSION = { '7', '3', '8', '0', '2'}
        local stdout = io.popen("opkg list-installed | awk '/libcurl/ {print $3}'")
        local version = stdout:read("*a")
        version = version:match("([^%s]+)")
        stdout:close()

and, in fact, this function attempts to call opkg several times.

So I'm a bit surprised you have got as far as you have.  As usual, there should be a way to navigate through these initialization checks.  You may have to add some more smarts to the opkg file stub that you made earlier for some other plugin (I'm glad you're documenting this, because already I forget which it was.)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 22, 2015, 05:54:36 pm
@akbooer I'm trying to load a new device from the startup.lua by entering:
Code: [Select]
do -- Squeezebox
  local dev = luup.create_device ('', "Squeezebox", "Squeezebox", "D_SqueezeboxControl1.xml")
  luup.ip_set ("ip_address", dev)         -- set remote Vera IP address
end


But the engine throws the following error:

Code: [Select]
Compile Lua error: [string "device_4"]:26: module 'L_SqueezeboxTTS' not found:
no field package.preload['L_SqueezeboxTTS']
no file './L_SqueezeboxTTS.lua'
no file '/usr/local/share/lua/5.1/L_SqueezeboxTTS.lua'
no file '/usr/local/share/lua/5.1/L_SqueezeboxTTS/init.lua'
no file '/usr/local/lib/lua/5.1/L_SqueezeboxTTS.lua'
no file '/usr/local/lib/lua/5.1/L_SqueezeboxTTS/init.lua'
no file '/usr/share/lua/5.1/L_SqueezeboxTTS.lua'
no file '/usr/share/lua/5.1/L_SqueezeboxTTS/init.lua'
no file './L_SqueezeboxTTS.so'
no file '/usr/local/lib/lua/5.1/L_SqueezeboxTTS.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/L_SqueezeboxTTS.so'
no file '/usr/lib/lua/5.1/L_SqueezeboxTTS.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
device 3 'ALTUI' requesting reload
Compile Lua error: [string "device_4"]:26: module 'L_SqueezeboxTTS' not found:
no field package.preload['L_SqueezeboxTTS']
no file './L_SqueezeboxTTS.lua'
no file '/usr/local/share/lua/5.1/L_SqueezeboxTTS.lua'
no file '/usr/local/share/lua/5.1/L_SqueezeboxTTS/init.lua'
no file '/usr/local/lib/lua/5.1/L_SqueezeboxTTS.lua'
no file '/usr/local/lib/lua/5.1/L_SqueezeboxTTS/init.lua'
no file '/usr/share/lua/5.1/L_SqueezeboxTTS.lua'
no file '/usr/share/lua/5.1/L_SqueezeboxTTS/init.lua'
no file './L_SqueezeboxTTS.so'
no file '/usr/local/lib/lua/5.1/L_SqueezeboxTTS.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/L_SqueezeboxTTS.so'
no file '/usr/lib/lua/5.1/L_SqueezeboxTTS.so'
no file '/usr/local/lib/lua/5.1/loadall.so'


I've tried installing lua-filesystem on my system but did not solve the error. Any ideas?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 22, 2015, 06:26:45 pm
Looks like the file L_SqueezeboxTTS.lua is missing from /etc/cmh-ludl/

------

Edit: correct directory path
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 22, 2015, 06:58:06 pm
I'm confused, cmh-lua or cmh-ludl? although all the files are in there "/etc/cmh-ludl" which where all the openluup files are.

The message states clearly that the file is missing but the file is actually in there...  ???
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 22, 2015, 09:34:07 pm
Update:

And it seems to have worked for the most part (which is great), however the icons aren't really representative of their state (on & color). Yes, details - details. It looks like the device (bridge) grabbed all the bulbs and bulb groups (again, great). In looking at the json file, it has many icon links, however it just isn't using them. In test, when I increase/dim a bulb, it changes the icon from the bulb (which appears to be an off state) to a default z-wave icon.

I've attached 2 pictures. The 1st picture shows the Vera3 icon state, on and correct color of bulb. The second photo, left hand icon, represents the same bulb as picture 1, off and no color. If I adjust the bulb using the local device, it's icon changes from the bulb (off) to the z-wave icon.

http://apps.mios.com/pluginicons/8162/DS-HUE-A19-Light-ON-B-Webx1.png (http://apps.mios.com/pluginicons/8162/DS-HUE-A19-Light-ON-B-Webx1.png)

Things are too quiet in this thread.

I have a whole house of these Philips hue bulbs (lux/hue and bloom) and I suspect there are others too who are watching this thread. So this was one of those plugins (albeit a beta from MCV) that I wanted to run locally thus freeing up Vera. I realize that I can't do much other than attempt to get the process started as I'm in the office so here goes. We should also keep in mind that I don't know what to expect when MCV pushes out the general release which they indicate requires a firmware upgrade (if you're running it on a MCV device).

Important:
This plugin requires that dkjon be installed. So within Ubuntu, perform the following:

Code: [Select]
cuda@Ubuntu:/etc/cmh-ludl/files$ sudo luarocks install dkjson
[sudo] password for cuda:
Installing https://luarocks.org/dkjson-2.5-2.src.rock...
Using https://luarocks.org/dkjson-2.5-2.src.rock... switching to 'build' mode
Updating manifest for /usr/local/lib/luarocks/rocks
dkjson 2.5-2 is now built and installed in /usr/local (license: MIT/X11)

Within the AltUI:

[1] [misc] Lua test code.
luup.create_device ('', "PhilipsHue2", "PhilipsHue2", "D_PhilipsHue2.xml")

[2] [misc] Reload Luup engine.

[3] Log data

Code: [Select]
2015-10-22 11:34:31.163   luup_log:0: ALTUI: runLua(luup.create_device ('', "PhilipsHue2", "PhilipsHue2", "D_PhilipsHue2.xml"))
2015-10-22 11:34:31.172   luup.create_device:0: [136] urn:schemas-micasaverde-com:device:PhilipsHue:1 / no-implementation-file
2015-10-22 11:34:31.172   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-22 11:34:31.174   openLuup.server:: request completed (8 bytes, 1 chunks, 12 ms) tcp{client}: 0xb860d8
2015-10-22 11:34:31.174   openLuup.scheduler:136: device startup
2015-10-22 11:34:31.174   luup_log:136: (Hue2 Plugin)::(Startup) : Initiating
2015-10-22 11:34:31.203   luup.task:136: status=2 Hue2 Plugin : Starting up...
2015-10-22 11:34:31.203   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: EMPTY now:  #hooks:0
2015-10-22 11:34:31.204   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.DebugMode was: EMPTY now: 0 #hooks:0
2015-10-22 11:34:31.204   luup_log:136: (Hue2 Plugin)::(getInfos) : Debug mode disabled.
2015-10-22 11:34:31.204   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.POLLING_RATE was: EMPTY now: 10 #hooks:0
2015-10-22 11:34:31.205   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: EMPTY now: 0 #hooks:0
2015-10-22 11:34:36.209   luup_log:136: (Hue2 Plugin)::(findBridge) : Trying to get IP via NUPNP...
2015-10-22 11:34:36.209   luup_log:136: (Hue2 Plugin)::(findBridge) : Trying to get IP via NUPNP...
2015-10-22 11:34:37.052   luup_log:136: (Hue2 Plugin)::(findBridge) : (NUPNP) : Philips Hue Bridge could not be found!
2015-10-22 11:34:37.052   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.Status was:  now: Philips Hue Bridge could not be found! #hooks:0
2015-10-22 11:34:37.052   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: 0 now: 0 #hooks:0
2015-10-22 11:34:37.053   luup.task:136: status=1 Philips Hue by MiOS : IP address could not be automatically set! Please add it in IP field, save and reload the engine!
2015-10-22 11:34:37.053   luup.variable_set:136: 136.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: Philips Hue Bridge could not be found! now: IP address could not be automatically set! Please add it in IP fie$
2015-10-22 11:34:37.053   luup.task:136: status=1 Hue2 Plugin : Startup ERROR : Connection with the Bridge could not be established!!!
2015-10-22 11:34:37.053   luup_log:136: (Hue2 Plugin)::(Startup) : Startup ERROR : Connection with the Bridge could not be established!!!

I'll continue to update this post when I pair it with the bridge tonight...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcf6288 on October 23, 2015, 12:17:16 am
This definitely peaked my interest but am having problems.  I am installing on a Raspberry Pi and am following the steps carefully but am stuck.  I am up to this point in the guide:
Restart the openLuup engine, doing a factory reset:
> ./openLuup_reload reset

I get permission denied, and am logged in as root.

I pushed forward and do the next step which seems to work because all the files populate
http://<YourIP>:3480/data_request?id=altui

When I go to
http://<YourIP>:3480/data_request?id=lr_ALTUI_Handler&command=home#

I get "no handler" 

All the other steps so far work just fine and I get all the indications in the guide.  I am sure I am missing something simple.  Thanks for the assist.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 23, 2015, 03:10:44 am
I'm confused, cmh-lua or cmh-ludl? although all the files are in there "/etc/cmh-ludl" which where all the openluup files are.
You're quite right. I'm afraid the iOS spell checker changed it for me!

Quote
The message states clearly that the file is missing but the file is actually in there...  ???

Are you able to type the request line into Lua in command line mode and get it to load?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 23, 2015, 03:14:55 am
@CudaNet

Are the extra icons loaded into the appropriate directory?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 23, 2015, 03:23:03 am
> ./openLuup_reload reset

I get permission denied, and am logged in as root.
The file needs execute permission set with chmod a+x openLuup_reload

Quote
When I go to
http://<YourIP>:3480/data_request?id=lr_ALTUI_Handler&command=home#

I get "no handler" 

Your startup.lua file needs to create the ALTUI device as in the example file.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 23, 2015, 06:14:28 am
Looks like the file L_SqueezeboxTTS.lua is missing from /etc/cmh-ludl/

I presume you can find it in the .zip file attached to this post: http://forum.micasaverde.com/index.php/topic,30701.msg219599.html#msg219599
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 23, 2015, 08:31:24 am
All the files were in the right directory "cmh-ludl"  but I was starting the openluup engine from my home directory instead of starting it at "/etc/cmh-ludl" (The documentation mentions the engine can be started from any directory so I thought it won't be a problem). After starting from "/etc/cmh-ludl" the message stating there were missing files "L_SqueezeboxTTS.lua" was gone but a new problems arose.

1- Some of the plugin's files request the use of a file called "GetNetworkState.sh" so I decided to copy from the controller into my server and place it the same excutable directory "/usr/bin/GetNetworkState.sh"

2- The scripts tried to find the Unit model which fails for obvious reason so I had to hard redefined the variable as "UnitModel=Sercomm NA301" on line 11 of /usr/bin/GetNetworkState.sh to get it working.

The plugin started to work but partially. now the engine is on a reload luup and the logs don't show much, wondering if We could verbose the log a little more?

Here is what the LuaUPnP.log shows then it clears after the reload and show the same thing over and over:

06   10/23/15 08:23:31.594   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: Version was: v0.93 now: v0.93 #hooks: 0
06   10/23/15 08:23:32.099   Device_Variable::m_szValue_set device: 4 service: urn:micasaverde-com:serviceId:SqueezeBox1 variable: connectStatus was: Running now: Running #hooks: 0 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 23, 2015, 08:47:25 am
All the files were in the right directory "cmh-ludl"  but I was starting the openluup engine from my home directory instead of starting it at "/etc/cmh-ludl" (The documentation mentions the engine can be started from any directory so I thought it won't be a problem).
It can be run in any named directory, but the files have to be in there too!

Quote
1- Some of the plugin's files request the use of a file called "GetNetworkState.sh" so I decided to copy from the controller into my server and place it the same excutable directory "/usr/bin/GetNetworkState.sh"
Yes, this is discussed earlier in the thread.  It returns the IP address of your machine.  Depending on your system it may or may not work.  Either hard code or use the Lua version discussed previously.

Quote
2- The scripts tried to find the Unit model which fails for obvious reason so I had to hard redefined the variable as "UnitModel=Sercomm NA301" on line 11 of /usr/bin/GetNetworkState.sh to get it working.
Not sure about that fix.

Quote
Here is what the LuaUPnP.log shows then it clears after the reload and show the same thing over and over:

06   10/23/15 08:23:31.594   Device_Variable::m_szValue_set device: 3 service: urn:upnp-org:serviceId:altui1 variable: Version was: v0.93 now: v0.93 #hooks: 0
06   10/23/15 08:23:32.099   Device_Variable::m_szValue_set device: 4 service: urn:micasaverde-com:serviceId:SqueezeBox1 variable: connectStatus was: Running now: Running #hooks: 0
There's another log file in /etc/cmh-ludl/ which is much more extensive.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 23, 2015, 08:48:05 am
Actually no, I assumed (I know, I know...) the icons would be loaded from the json file since their all URL based. If you can confirm that won't work then I can certainly download all of them and place them within the icons directory.

Code: [Select]
http://apps.mios.com/pluginicons/8162/{icon name here}.png
D_PhilipsHueLamp2.json
Code: [Select]

        "default_icon" : "binary_light_default.png",
        "state_icons" : [
                {
                        "img" : "http://apps.mios.com/pluginicons/8162/DS-HUE-A19-Light-OFF-Webx1.png",
                        "conditions" : [{
                                        "service" : "urn:upnp-org:serviceId:Dimming1",
                                        "variable" : "LoadLevelStatus",
                                        "operator" : "==",
                                        "value" : 0
                                }, {
                                        "service" : "urn:micasaverde-com:serviceId:PhilipsHue1",
                                        "variable" : "BulbModelID",
                                        "operator" : "==",
                                        "value" : "LCT001"
                                }

@CudaNet

Are the extra icons loaded into the appropriate directory?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 23, 2015, 11:09:41 am
Actually no, I assumed (I know, I know...) the icons would be loaded from the json file since their all URL based. If you can confirm that won't work then I can certainly download all of them and place them within the icons directory.

I would have thought that should work too.  Does the Hue plugin work as expected when using ALTUI on Vera?  If not, then this is an ALTUI issue; if yes, then I don't rightly know what to do, since openLuup does nothing with .json files or icons except copy the information into the appropriate place (static_data) in the user_data structure.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 23, 2015, 11:40:12 am
Yes, the good news is it works when I interact directly with the UI. Now AltUI is displaying them correctly as clones (state and color) so I'm at a loss as to why it doesn't operate correctly localized. I'll compress the plugin files and see if amg0 can shed some light on what's happening or direct me to how to identify the issue.

Actually no, I assumed (I know, I know...) the icons would be loaded from the json file since their all URL based. If you can confirm that won't work then I can certainly download all of them and place them within the icons directory.

I would have thought that should work too.  Does the Hue plugin work as expected when using ALTUI on Vera?  If not, then this is an ALTUI issue; if yes, then I don't rightly know what to do, since openLuup does nothing with .json files or icons except copy the information into the appropriate place (static_data) in the user_data structure.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 23, 2015, 11:41:06 am
@cudanet

What OS are you using to run openLuup? The reason why I ask is because under Ubuntu 14.04 I'm dealing with issues I have not been able to resolved:

1- openLuup only works when being access from localhost. If access from anything other than localhost "data_request?id=user_data" does not download completely.

2- clean exits does not persistently save any of the work done (scenes, changes made to devices, etc)

So I really would like to test on something that We know here on the forums that works since I don't have a BeagleBone maybe I can try on something similar to yours?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 23, 2015, 11:51:59 am
Yes, the good news is it works when I interact directly with the UI. Now AltUI is displaying them correctly as clones (state and color) so I'm at a loss as to why it doesn't operate correctly localized. I'll compress the plugin files and see if amg0 can shed some light on what's happening or direct me to how to identify the issue.

A log file of state changes would help.  Curiously, I downloaded the plugin on UI7 and it doesn't have that version of the file... where did you get it from?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 23, 2015, 11:53:19 am
@ronluna

My test system (rPi2 - Mate) and now production system (Jetway running Ubuntu Server) were both running Ubuntu 15.04. This morning both systems got bumped to 15.10. For my web server I'm running Lighttpd. My Linux is pretty rusty (so bare with me) but I've got a fully working system and I can definitely access both systems from my Lan. I'll help in any way I can so ask away.

@cudanet

What OS are you using to run openLuup? The reason why I ask is because under Ubuntu 14.04 I'm dealing with issues I have not been able to resolved:

1- openLuup only works when being access from localhost. If access from anything other than localhost "data_request?id=user_data" does not download completely.

2- clean exits does not persistently save any of the work done (scenes, changes made to devices, etc)

So I really would like to test on something that We know here on the forums that works since I don't have a BeagleBone maybe I can try on something similar to yours?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 23, 2015, 11:56:32 am
It's a beta (another WWN) soon to go production with the next firmware release. It's been solid so far with very minor issues. As for log data, I left my rPi2 at home today while I work on the server (office work will have to wait) so I came unprepared.

http://forum.micasaverde.com/index.php/topic,33088.0.html (http://forum.micasaverde.com/index.php/topic,33088.0.html)

Yes, the good news is it works when I interact directly with the UI. Now AltUI is displaying them correctly as clones (state and color) so I'm at a loss as to why it doesn't operate correctly localized. I'll compress the plugin files and see if amg0 can shed some light on what's happening or direct me to how to identify the issue.

A log file of state changes would help.  Curiously, I downloaded the plugin on UI7 and it doesn't have that version of the file... where did you get it from?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: ronluna on October 23, 2015, 12:16:55 pm
Got it! I will give 15.10 a try...

Thanks!!!  :D

@ronluna

My test system (rPi2 - Mate) and now production system (Jetway running Ubuntu Server) were both running Ubuntu 15.04. This morning both systems got bumped to 15.10. For my web server I'm running Lighttpd. My Linux is pretty rusty (so bare with me) but I've got a fully working system and I can definitely access both systems from my Lan. I'll help in any way I can so ask away.

@cudanet

What OS are you using to run openLuup? The reason why I ask is because under Ubuntu 14.04 I'm dealing with issues I have not been able to resolved:

1- openLuup only works when being access from localhost. If access from anything other than localhost "data_request?id=user_data" does not download completely.

2- clean exits does not persistently save any of the work done (scenes, changes made to devices, etc)

So I really would like to test on something that We know here on the forums that works since I don't have a BeagleBone maybe I can try on something similar to yours?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 23, 2015, 03:03:39 pm
ps: i have been able to get the direct openluup cameras to work in ALTUI but not in HomeWave (hopefully Homewave will soon support direct cameras so we do not need to debug this any further.)

Just noticed this PS!  Yes, I would expect that - I have not yet implemented the request_image call that HomeWave uses... mostly because I don't know what format to use for the image.  Fortunately, regular camera operations don't use this.

@akbooer were you able to get the request_image call that HomeWave uses implemented perchance so i can setup native camera devices in openluup that Homewave can use instead of Homewave getting the cameras from Vera (which causes vera to reload luup in my system for some strange reason MCV tech support has not been able to figure out in over a year ;) ?

If so, then i will start with the cameras then move on to GCal3, DLNA Media Controller, iPhone Locator, Weather, etc. plug ins (hopefully this weekend).

Thanks!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 23, 2015, 04:51:25 pm
...were you able to get the request_image call that HomeWave uses implemented perchance so i can setup native camera devices in openluup that Homewave can use instead of Homewave getting the cameras from Vera (which causes vera to reload luup in my system for some strange reason MCV tech support has not been able to figure out in over a year ;) ?

If so, then i will start with the cameras then move on to GCal3, DLNA Media Controller, iPhone Locator, Weather, etc. plug ins (hopefully this weekend).

I haven't done any work on that, because I haven't got a camera., but I expect I could do it faster than MCV  ;)

GCal3, DLNA, seem to work OK.  iPhone locator we will have a problem with, since it seems to have an encrypted component, but I think we know someone who can help us with that?

----

Edit: this seems to be inadequate documentation to make an implementation: http://wiki.micasaverde.com/index.php/Luup_Requests#request_image

Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcf6288 on October 23, 2015, 10:39:31 pm
Thanks for that help, I now have it up and running on a RPI.

Question 1: How do I get it to auto start /etc/cmh-ludl/./openLuup_reload startup.lua on reboot.  I added it to rc.local and nothing happens.

Question 2: Now to start having fun, how do I install plugins.  I attempted to do the same thing as the verabridge but nothing loads.  I copied all the files over from the vera and put it into my startup.lua

do -- HARMONY
  local dev = luup.create_device ('', "HARMONY", "HARMONY", "D_HARMONY.xml")
end

Obviously I am not doing something right.  Again thanks for all the great work.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 23, 2015, 10:47:33 pm
@akbooer

Was attempting to see if Ubuntu Server (15.10) was kinder in regards to Sonos (iptables). Here is a log excerpt when attempting to add the device.

Code: [Select]
2015-10-23 21:41:09.843   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.create_device%20(%27%27%2C%20%22Sonos1%22%2C%20%22Sonos1%22%2C%20%22D_Sonos1.xml%22)&_=1445654441117 tcp{client}: 0x188a9b8
2015-10-23 21:41:09.844   luup_log:0: ALTUI: runLua(luup.create_device ('', "Sonos1", "Sonos1", "D_Sonos1.xml"))
2015-10-23 21:41:09.882   luup_log:0: ALTUI: Evaluation of lua code returned: ./openLuup/loader.lua:142: invalid value (table) at index 1 in table for 'concat'
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 23, 2015, 10:59:09 pm
@jcf6288

Place these lines within your rc.local.
Now when you reboot the system, you'll have logs to evaluate the engine initializing (what you'd see in the console if executing ./openLuup_reload). It's /etc/cmh-ludl/openLuup rc.local.log.

Code: [Select]
# execute openLuup

exec 2> /etc/cmh-ludl/openLuup/rc.local.log     # send stderr from rc.local to a log file
exec 1>&2                                       # send stdout to the same log file
set -x                                          # tell sh to display commands before execution

cd /etc/cmh-ludl
./openLuup_reload

exit 0

Quote
Question 1: How do I get it to auto start /etc/cmh-ludl/./openLuup_reload startup.lua on reboot.  I added it to rc.local and nothing happens.

In AltUI > Misc > Lua Test Code
Paste this in and hit submit, let it execute then reload luup (AltUI > Misc > Reload Luup Engine). Then hit F5 to refresh the page.

Code: [Select]
luup.create_device ('', "Harmony", "Harmony", "D_Harmony.xml")

Quote
Question 2: Now to start having fun, how do I install plugins.  I attempted to do the same thing as the verabridge but nothing loads.  I copied all the files over from the vera and put it into my startup.lua

do -- HARMONY
  local dev = luup.create_device ('', "HARMONY", "HARMONY", "D_HARMONY.xml")
end

Obviously I am not doing something right.  Again thanks for all the great work.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcf6288 on October 23, 2015, 11:18:08 pm
Thanks you so much.  I read earlier about PLEG, obviously it is licensed and won't work currently.  Any thoughts on if it ever will.  That is really the only plugin keeping me tied to Vera.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcf6288 on October 23, 2015, 11:44:33 pm
Final questions for the day. 

I set up the icons as described in the WWW folder and they aren't showing up for the plugins or the devices on my vera. 

On the harmony app I get

Plug in not yet initialized. Wait a moment and then Reload device and Browser.

I reloaded and rebooted and it stays.  Thank you, this is exciting.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 23, 2015, 11:58:44 pm
...were you able to get the request_image call that HomeWave uses implemented perchance so i can setup native camera devices in openluup that Homewave can use instead of Homewave getting the cameras from Vera (which causes vera to reload luup in my system for some strange reason MCV tech support has not been able to figure out in over a year ;) ?

If so, then i will start with the cameras then move on to GCal3, DLNA Media Controller, iPhone Locator, Weather, etc. plug ins (hopefully this weekend).

I haven't done any work on that, because I haven't got a camera., but I expect I could do it faster than MCV  ;)


@akbooer I have PMd you a camera. Thanks.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 24, 2015, 12:20:58 am
And back to Philips Hue... I think a different issue is at play here.. Lots of log data, plus I attached the actual files etc. Looks like the clones, when their state changes, appear in the logs. However I never see the localized bulb change at all which explains why the icon state never changes. When I peek at the variables (clone vs localized), they are different (see pics).

Code: [Select]

--[ Installing the plugin ]

2015-10-23 22:05:51.128   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.create_device%20(%27%27%2C%20%22PhilipsHue2%22%2C%20%22PhilipsHue2%22%2C%20%22D_PhilipsHue2.xml%22)&_=1445655930193 tcp{client}: 0x29651f8
2015-10-23 22:05:51.129   luup_log:0: ALTUI: runLua(luup.create_device ('', "PhilipsHue2", "PhilipsHue2", "D_PhilipsHue2.xml"))
2015-10-23 22:05:51.142   luup.create_device:0: [138] urn:schemas-micasaverde-com:device:PhilipsHue:1 / no-implementation-file
2015-10-23 22:05:51.143   luup_log:0: ALTUI: Evaluation of lua code returned: nil
2015-10-23 22:05:51.144   openLuup.server:: request completed (8 bytes, 1 chunks, 16 ms) tcp{client}: 0x29651f8
2015-10-23 22:05:51.144   openLuup.scheduler:138: device startup
2015-10-23 22:05:51.144   luup_log:138: (Hue2 Plugin)::(Startup) : Initiating
2015-10-23 22:05:51.158   luup.task:138: status=2 Hue2 Plugin : Starting up...
2015-10-23 22:05:51.158   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: EMPTY now:  #hooks:0
2015-10-23 22:05:51.159   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.DebugMode was: EMPTY now: 0 #hooks:0
2015-10-23 22:05:51.159   luup_log:138: (Hue2 Plugin)::(getInfos) : Debug mode disabled.
2015-10-23 22:05:51.159   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.POLLING_RATE was: EMPTY now: 10 #hooks:0
2015-10-23 22:05:51.159   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: EMPTY now: 0 #hooks:0
2015-10-23 22:05:56.164   luup_log:138: (Hue2 Plugin)::(findBridge) : Trying to get IP via NUPNP...
2015-10-23 22:05:57.708   luup_log:138: (Hue2 Plugin)::(findBridge) : (NUPNP) : Philips Hue Bridge could not be found!
2015-10-23 22:05:57.708   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was:  now: Philips Hue Bridge could not be found! #hooks:0
2015-10-23 22:05:57.708   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: 0 now: 0 #hooks:0
2015-10-23 22:05:57.709   luup.task:138: status=1 Philips Hue by MiOS : IP address could not be automatically set! Please add it in IP field, save and reload the engine!
2015-10-23 22:05:57.709   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: Philips Hue Bridge could not be found! now: IP address could not be automatically set! Please add it in IP field, save and reload the engine! #hooks:0
2015-10-23 22:05:57.709   luup.task:138: status=1 Hue2 Plugin : Startup ERROR : Connection with the Bridge could not be established!!!
2015-10-23 22:05:57.710   luup_log:138: (Hue2 Plugin)::(Startup) : Startup ERROR : Connection with the Bridge could not be established!!!
2015-10-23 22:05:57.710   luup.set_failure:138: status = 0

-- [ reload of Lua ]

2015-10-23 22:06:09.025   luup.call_timer:8: interval: time=2, days={}
2015-10-23 22:06:09.025   openLuup.scheduler:8: device startup completed: status=nil, msg=nil, name=nil
2015-10-23 22:06:09.025   openLuup.scheduler:133: device startup
2015-10-23 22:06:09.028   luup.set_failure:133: status = 0
2015-10-23 22:06:09.028   openLuup.scheduler:133: device startup completed: status=nil, msg=nil, name=nil
2015-10-23 22:06:09.028   openLuup.scheduler:138: device startup
2015-10-23 22:06:09.028   luup_log:138: (Hue2 Plugin)::(Startup) : Initiating
2015-10-23 22:06:09.056   luup.task:138: status=2 Hue2 Plugin : Starting up...
2015-10-23 22:06:09.056   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: Philips Hue Connected! now:  #hooks:0
2015-10-23 22:06:09.056   luup_log:138: (Hue2 Plugin)::(getInfos) : Debug mode disabled.
2015-10-23 22:06:09.386   luup_log:138: (Hue2 Plugin)::(findBridge) : Philips Hue Bridge found with IP address: 192.168.2.21
2015-10-23 22:06:09.386   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.UUID was: uuid:2f402f80-da50-11e1-9b23-0017881080c7 now: uuid:2f402f80-da50-11e1-9b23-0017881080c7 #hooks:0
2015-10-23 22:06:09.387   luup.attr_set:138: 138.ip = 192.168.2.21
2015-10-23 22:06:09.387   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was:  now: Philips Hue Bridge has been discovered! #hooks:0
2015-10-23 22:06:09.387   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: 1 now: 0 #hooks:0
2015-10-23 22:06:09.388   luup.task:138: status=1 Philips Hue by MiOS : Philips Hue bridge was detected. Please hit 'Pair with the Bridge' button!
2015-10-23 22:06:09.388   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: Philips Hue Bridge has been discovered! now: Philips Hue bridge was detected. Please hit 'Pair with the Bridge' button! #hooks:0
2015-10-23 22:06:09.899   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was: Philips Hue bridge was detected. Please hit 'Pair with the Bridge' button! now: Philips Hue Connected! #hooks:0
2015-10-23 22:06:09.899   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: 0 now: 1 #hooks:0
2015-10-23 22:06:09.899   luup.task:138: status=1 Philips Hue by MiOS : Philips Hue Connected!
2015-10-23 22:06:09.899   luup_log:138: (Hue2 Plugin)::(checkInitialStatus) : Philips Hue Connected!
2015-10-23 22:06:09.899   luup.task:138: status=1 Hue2 Plugin : Startup successful.
2015-10-23 22:06:09.903   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeScenes was: {"167ea05db3-on-0":{"lights":["1","2","3","22","25"],"name":"Doorbell","active":true},"39e49fd5f-on-0":{"lights":["1","2","3","4","5","6","13","14","15","16","17","18","19","20","21"],"name":"Warming on 1386577448000","active":true},"484ea48c6-on-0":{"lights":["1","2","3","4","5","6","13","14","15","16","17","18","19","20","21"],"name":"Full Moon on 0","active":true},"5f42844e2-on-0":{"lights":["1","2","3","4","5","6"],"name":"WhiteStrip on 0","active":true},"247ee8ad8-on-3":{"lights":["1","2","3","4","5","6"],"name":"Full Moon on 3","active":true},"b6d767d2f-off-30":{"lights":["22"],"name":"1 lights off","active":true},"d2293b4cc-off-0":{"lights":["1","2","3","4","5","6","13","14","15","16","17","18","19","20","21"],"name":"WhiteStrip off 0","active":true},"1cb4124b0c-on-0":{"lights":["1","2","3","4","5","6"],"name":"Night sky on 0","active":true},"dbf4bfc6b-on-0":{"lights":["1","2","3","4","5","6"],"name":"Warm on 13982480","active":true},"d168425e9-on-0":{"lights":["1","2","3","4","5","6"],"name":"Full Moon on 139","active":true},"782eb04211-on-0":{"lights":["1","2","3","4","5","6"],"name":"Warm on 0","active":true},"01c180699-on-0":{"lights":["1","2","3"],"name":"candle scheme on","active":true},"511dcfd05-off-5":{"lights":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"],"name":"24 lights off","active":true},"dbf4bfc6b8-on-0":{"lights":["1","2","3","4","5","6"],"name":"Warm on 0","active":true},"82dfc9fa8-on-0":{"lights":["1","2","3","4","5","6","13","14","15","16","17","18","19","20","21"],"name":"Candles on 0","active":true},"89365e34c-on-0":{"lights":["1","2","3","4","5","6","13","14","15","16","17","18","19","20","21"],"name":"Warming on 1386577448000","active":true},"6e251090ba-on-0":{"lights":["1","2","3","4","5","6"],"name":"Blueberries on 0","active":true},"167ea05db-on-0":{"lights":["1","2","3","4","5","6"],"name":"Moon Light on 0","active":true},"26c051bc9-on-0":{"lights":["1","2","3","4","5","6"],"name":"Candles on 0","active":true},"676e13dbb6-on-0":{"lights":["1","2","3","4","5","6"],"name":"Krell blue on 0","active":true},"e86634681-on-0":{"lights":["1","2","3","4","5","6","13","14","15","16","17","18","19","20","21"],"name":"WhiteStrip on 0","active":true},"4955a5a38-on-0":{"lights":["1","2","3","4","5","6","13","14","15","16","17","18","19","20","21"],"name":"Warming on 1386577448000","active":true},"ab404c10a-on-0":{"lights":["1","2","3","4","5","6","13","14","15","16","17","18","19","20","21"],"name":"WhiteStrip on 0","active":true},"1d379631f2-on-0":{"lights":["1","2","3"],"name":"Rainforest on 0","active":true},"b6d767d2f-off-45":{"lights":["22"],"name":"1 lights off","active":true},"238a95a09d-on-0":{"lights":["1","2","3","4","5","6"], TONS OF STUFF HERE/MAKES POST BIGGIE SIZED} #hooks:0
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_1] HueLamp 1: Office Lamp
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_2] HueLamp 2: Floor Lamp
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_3] HueLamp 3: Foyer Globe Light
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_4] HueLamp 4: Hallway
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_5] HueLamp 5: Hallway 1
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_6] HueLamp 6: Hallway 2
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_7] HueLux 7: Pendant 1
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_8] HueLux 8: Pendant 2
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_9] HueLux 9: Bar
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_10] HueLux 10: Linen
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_11] HueLux 11: Guest 1
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_12] HueLux 12: Guest 2
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_13] HueLamp 13: Den 4
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_14] HueLamp 14: Den 3
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_15] HueLamp 15: Den 1
2015-10-23 22:06:09.904   luup.chdev.append:138: [hueLamp_16] HueLamp 16: Den 2
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_17] HueLamp 17: Den 6
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_18] HueLamp 18: Den 7
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_19] HueLamp 19: Den 8
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_20] HueLamp 20: Den 9
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_21] HueLamp 21: Den 5
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_22] HueLamp 22: Abby Nightlight
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_23] HueLamp 23: Porch
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_24] HueLux 24: Arbor
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueLamp_25] HueLamp 25: Nightstand
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueGroup_1] HueGroup 1: Default
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueGroup_2] HueGroup 2: Hallway
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueGroup_3] HueGroup 3: BarnLights
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueGroup_4] HueGroup 4: GuestLamps
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueGroup_5] HueGroup 5: Den
2015-10-23 22:06:09.905   luup.chdev.append:138: [hueGroup_6] HueGroup 6: KitchenPendants
2015-10-23 22:06:09.905   luup.chdev.sync:138: syncing 31 children
2015-10-23 22:06:09.906   luup.variable_get:138: NO SUCH DEVICE: nil
2015-10-23 22:06:09.906   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLights was: EMPTY now: 1,Office Lamp;2,Floor Lamp;3,Foyer Globe Light;4,Hallway;5,Hallway 1;6,Hallway 2;7,Pendant 1;8,Pendant 2;9,Bar;10,Linen;11,Guest 1;12,Guest 2;13,Den 4;14,Den 3;15,Den 1;16,Den 2;17,Den 6;18,Den 7;19,Den 8;20,Den 9;21,Den 5;22,Abby Nightlight;23,Porch;24,Arbor;25,Nightstand #hooks:0
2015-10-23 22:06:09.906   luup_log:138: (Hue2 Plugin)::(Startup) : Startup Successful
2015-10-23 22:06:09.906   luup.task:138: status=1 Philips Hue by MiOS : Startup successful..
2015-10-23 22:06:09.906   luup.set_failure:138: status = 0
2015-10-23 22:06:09.906   openLuup.scheduler:138: device startup completed: status=nil, msg=nil, name=nil
2015-10-23 22:06:09.906   luup_log:3: ALTUI: startupDeferred, called on behalf of device:3
2015-10-23 22:06:09.908   luup.variable_set:3: 3.urn:upnp-org:serviceId:altui1.Version was: v0.93 now: v0.93 #hooks:0
2015-10-23 22:06:09.908   luup.set_failure:3: status = 0

-- [ when setting the cloned light to a value to 3.1 ]
2015-10-23 22:57:16.738   openLuup.server:: /data_request?id=action&output_format=json&DeviceNum=80&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=3.1 tcp{client}: 0x304eb98
2015-10-23 22:57:16.739   luup.call_action:: 80.urn:upnp-org:serviceId:Dimming1.SetLoadLevelTarget
2015-10-23 22:57:16.739   luup.call_action:: action will be handled by parent: 4
2015-10-23 22:57:16.742   openLuup.server:: request completed (68 bytes, 1 chunks, 4 ms) tcp{client}: 0x304eb98
2015-10-23 22:57:16.742   luup_log:4: http://192.168.2.189:3480/data_request?id=action&action=SetLoadLevelTarget&serviceId=urn:upnp-org:serviceId:Dimming1&DeviceNum=316&newLoadlevelTarget=3.1
2015-10-23 22:57:17.291   openLuup.server:: request completed (6769 bytes, 1 chunks, 5209 ms) tcp{client}: 0x32b58c8
2015-10-23 22:57:17.399   openLuup.server:: /data_request?id=lu_status2&output_format=json&DataVersion=655970829&Timeout=60&MinimumDelay=1500&_=1445657323772 tcp{client}: 0x32b58c8
2015-10-23 22:57:21.972   luup.variable_set:4: 80.urn:upnp-org:serviceId:SwitchPower1.Status was: 0 now: 1 #hooks:0
2015-10-23 22:57:21.973   luup.variable_set:4: 80.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 0 now: 3 #hooks:0
2015-10-23 22:57:21.973   luup.variable_set:4: 80.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 0 now: 3 #hooks:0
[code]
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 05:58:21 am
@akbooer

Was attempting to see if Ubuntu Server (15.10) was kinder in regards to Sonos (iptables). Here is a log excerpt when attempting to add the device.

Code: [Select]
2015-10-23 21:41:09.843   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.create_device%20(%27%27%2C%20%22Sonos1%22%2C%20%22Sonos1%22%2C%20%22D_Sonos1.xml%22)&_=1445654441117 tcp{client}: 0x188a9b8
2015-10-23 21:41:09.844   luup_log:0: ALTUI: runLua(luup.create_device ('', "Sonos1", "Sonos1", "D_Sonos1.xml"))
2015-10-23 21:41:09.882   luup_log:0: ALTUI: Evaluation of lua code returned: ./openLuup/loader.lua:142: invalid value (table) at index 1 in table for 'concat'

Are you sure you have the latest files... we did change a few individually in posts here since Release 5.

The code is now on GitHub https://github.com/akbooer/openLuup

This is version 5.3 which simply consolidates the latest.  I haven't had a problem creating Sonos devices, but will test again.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 06:05:13 am
Thanks you so much.  I read earlier about PLEG, obviously it is licensed and won't work currently.  Any thoughts on if it ever will.  That is really the only plugin keeping me tied to Vera.

We need to talk to Richard on this.  It's best to wait until there's enough people using openLuup to make it worthwhile.  I believe he's keeping something of an eye on this. But I'm not a PLEG user, and ALTUI makes it simpler to code more complex scenes.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 06:12:41 am
And back to Philips Hue... I think a different issue is at play here.. Lots of log data, plus I attached the actual files etc. Looks like the clones, when their state changes, appear in the logs. However I never see the localized bulb change at all which explains why the icon state never changes. When I peek at the variables (clone vs localized), they are different (see pics).

Code: [Select]
2015-10-23 22:05:56.164   luup_log:138: (Hue2 Plugin)::(findBridge) : Trying to get IP via NUPNP...
2015-10-23 22:05:57.708   luup_log:138: (Hue2 Plugin)::(findBridge) : (NUPNP) : Philips Hue Bridge could not be found!
2015-10-23 22:05:57.708   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was:  now: Philips Hue Bridge could not be found! #hooks:0
2015-10-23 22:05:57.708   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: 0 now: 0 #hooks:0
2015-10-23 22:05:57.709   luup.task:138: status=1 Philips Hue by MiOS : IP address could not be automatically set! Please add it in IP field, save and reload the engine!

Have you tried doing what the log message suggests and set the IP manually?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 06:45:12 am
Re. the PLEG issue, it's certainly something to pursue, but I was interested to read this post (just an excerpt here)

I've recently moved on from Vera to Domoticz (http://domoticz.com/). It's a free Open Source HA system.

[...]

In Vera I was using PLEGS. PLEG is a fantastic plugin that I was hevily depending on. Richard has made a fantastic work. However in Domoticz I dont have to separate my "triggering if statements" in one place and and the rest of the logics in another place. Furthermore I dont have to wait for the tedious and time consuming Luup reloads after making changes. I can even use a programmers editor Notepad++ to alterthe scripts. It will connect to my Domoticz via secure FTP and saving is as easy as Ctrl+S.

After some time I've realized that my new environment allows me to scripting on a much higher level than what I could do on Vera. I can write robust lua scripts that are easy to maintain.

Now, I'm not trying to persuade you all to move to Domoticz, or knock PLEG in any way, but the situation with ALTUI and openLuup seems similar on the face of it.  Once you've divorced yourself from UPnP-style Vera triggers and moved to ALTUI device variable watch triggers (which is what PLEG does effectively), then you're in the same place as the OP above.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 07:01:49 am
I haven't had a problem creating Sonos devices, but will test again.

I lied (again.)  I can replicate the error.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 24, 2015, 09:37:52 am
I'm one step closer to sanity now, glad you could replicate...

I haven't had a problem creating Sonos devices, but will test again.

I lied (again.)  I can replicate the error.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 24, 2015, 09:40:13 am
The last time I updated my openLuup directory was for the Google Calendar issue. I'll back this up and load your v5.3 from Git.

Code: [Select]
-rw-rw-r-- 1 cuda cuda  4612 Oct 15 14:27 chdev.lua
-rw-rw-r-- 1 cuda cuda 20164 Oct 19 15:56 devices.lua
-rw-rw-r-- 1 cuda cuda  5251 Oct 15 14:27 gateway.lua
-rw-rw-r-- 1 cuda cuda  8123 Oct 19 18:22 init.lua
-rw-rw-r-- 1 cuda cuda  7806 Oct 15 14:27 io.lua
-rw-rw-r-- 1 cuda cuda 11000 Apr 11  2015 json.lua
-rw-rw-r-- 1 cuda cuda  9523 Oct 19 15:54 loader.lua
-rw-rw-r-- 1 cuda cuda  8988 Oct 15 14:27 logs.lua
-rw-rw-r-- 1 cuda cuda 20775 Oct 15 14:27 luup.lua
-rw-rw-r-- 1 cuda cuda  6796 Oct 16 10:34 plugins.lua
-rw-r--r-- 1 root root   693 Oct 24 08:25 rc.local.log
-rw-rw-r-- 1 cuda cuda 21475 Oct 19 18:10 requests.lua
-rw-rw-r-- 1 cuda cuda  2964 Oct 15 14:27 rooms.lua
-rw-rw-r-- 1 cuda cuda  9244 Oct 15 14:27 scenes.lua
-rw-rw-r-- 1 cuda cuda 14657 Oct 15 14:27 scheduler.lua
-rw-rw-r-- 1 cuda cuda 14412 Oct 15 14:27 server.lua
-rw-rw-r-- 1 cuda cuda 13665 Oct 19 16:21 timers.lua
-rw-rw-r-- 1 cuda cuda  5557 Oct 15 14:27 userdata.lua
-rw-rw-r-- 1 cuda cuda  3962 Oct 21 18:29 xml.lua
cuda@cobalt:/etc/cmh-ludl/openLuup$

@akbooer

Was attempting to see if Ubuntu Server (15.10) was kinder in regards to Sonos (iptables). Here is a log excerpt when attempting to add the device.

Code: [Select]
2015-10-23 21:41:09.843   openLuup.server:: /data_request?id=lr_ALTUI_LuaRunHandler&command=run_lua&lua=luup.create_device%20(%27%27%2C%20%22Sonos1%22%2C%20%22Sonos1%22%2C%20%22D_Sonos1.xml%22)&_=1445654441117 tcp{client}: 0x188a9b8
2015-10-23 21:41:09.844   luup_log:0: ALTUI: runLua(luup.create_device ('', "Sonos1", "Sonos1", "D_Sonos1.xml"))
2015-10-23 21:41:09.882   luup_log:0: ALTUI: Evaluation of lua code returned: ./openLuup/loader.lua:142: invalid value (table) at index 1 in table for 'concat'

Are you sure you have the latest files... we did change a few individually in posts here since Release 5.

The code is now on GitHub https://github.com/akbooer/openLuup

This is version 5.3 which simply consolidates the latest.  I haven't had a problem creating Sonos devices, but will test again.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 24, 2015, 09:44:04 am
Yes, with fatal results - well kind of... Looks like it reloads the system after encounter. No log data to speak of other than it stopping and starting...

And back to Philips Hue... I think a different issue is at play here.. Lots of log data, plus I attached the actual files etc. Looks like the clones, when their state changes, appear in the logs. However I never see the localized bulb change at all which explains why the icon state never changes. When I peek at the variables (clone vs localized), they are different (see pics).

Code: [Select]
2015-10-23 22:05:56.164   luup_log:138: (Hue2 Plugin)::(findBridge) : Trying to get IP via NUPNP...
2015-10-23 22:05:57.708   luup_log:138: (Hue2 Plugin)::(findBridge) : (NUPNP) : Philips Hue Bridge could not be found!
2015-10-23 22:05:57.708   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.Status was:  now: Philips Hue Bridge could not be found! #hooks:0
2015-10-23 22:05:57.708   luup.variable_set:138: 138.urn:micasaverde-com:serviceId:PhilipsHue1.BridgeLink was: 0 now: 0 #hooks:0
2015-10-23 22:05:57.709   luup.task:138: status=1 Philips Hue by MiOS : IP address could not be automatically set! Please add it in IP field, save and reload the engine!

Have you tried doing what the log message suggests and set the IP manually?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 09:56:57 am
I'm one step closer to sanity now, glad you could replicate...

Yes, but I am one step further away.  Did I mention that Lua code as part of an I_xxx.xml file is the work of the devil?  Especially when it parses XML strings and replaces escapes...

So I do know exactly what the problem is, but not the solution.  I may need to move to a proper XML DOM parser  :(

PS. the DLNA plugin will suffer from the same problem.  Probably also Squeezebox, since they all borrowed the same code  :'(
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 24, 2015, 10:05:12 am
No need to mention that, we all know the true devil here is MCV...

I'm one step closer to sanity now, glad you could replicate...

Yes, but I am one step further away.  Did I mention that Lua code as part of an I_xxx.xml file is the work of the devil?  Especially when it parses XML strings and replaces escapes...

So I do know exactly what the problem is, but not the solution.  I may need to move to a proper XML DOM parser  :(

PS. the DLNA plugin will suffer from the same problem.  Probably also Squeezebox, since they all borrowed the same code  :'(
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcf6288 on October 24, 2015, 11:51:00 am
For the Harmony app I get

Plug in not yet initialized. Wait a moment and then Reload device and Browser.

Reload everything and it remains.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 01:26:33 pm
For the Harmony app I get

Plug in not yet initialized. Wait a moment and then Reload device and Browser.

Reload everything and it remains.

It won't solve the problem entirely, but do you have the differently-named harmony_json.lua copied into /etc/cmh-ludl/ ?

The Harmony app is extremely devious in its initialization, re-writing JSON files, placing symbolic links for icons, ...  This one probably needs some tweaking of the Lua file, alas.

I'm also struggling with understanding how it uses its additional device files.

----

Edit: it also appears to reference the dkjson.lua file
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 24, 2015, 08:49:39 pm
Version 5.3 loaded (taken from Git)...

Code: [Select]
cuda@Ubuntu:/etc/cmh-ludl$ ./openLuup_reload
lua: openLuup/init.lua:4: unexpected symbol near '<'
cuda@Ubuntu:/etc/cmh-ludl$

Code: [Select]

cuda@Ubuntu:/etc/cmh-ludl$ ls -ld *VeraBridge*
-rw-r--r-- 1 cuda cuda  41828 Oct 24 19:31 D_VeraBridge.json
-rw-r--r-- 1 cuda cuda  34197 Oct 24 19:31 D_VeraBridge.xml
-rw-r--r-- 1 cuda cuda  47129 Oct 24 19:31 I_VeraBridge.xml
-rw-rw-r-- 1 cuda cuda 126498 Oct 24 19:31 L_VeraBridge.lua
cuda@Ubuntu:/etc/cmh-ludl$

cuda@Ubuntu:/etc/cmh-ludl/openLuup$ ls -ld *.lua*
-rw-rw-r-- 1 cuda cuda  61489 Oct 24 19:34 chdev.lua
-rw-rw-r-- 1 cuda cuda 166807 Oct 24 19:34 devices.lua
-rw-rw-r-- 1 cuda cuda  68102 Oct 24 19:35 gateway.lua
-rw-rw-r-- 1 cuda cuda  96213 Oct 24 19:35 init.lua
-rw-rw-r-- 1 cuda cuda  80440 Oct 24 19:35 io.lua
-rw-rw-r-- 1 cuda cuda 118894 Oct 24 19:35 json.lua
-rw-rw-r-- 1 cuda cuda 112761 Oct 24 19:35 loader.lua
-rw-rw-r-- 1 cuda cuda 110424 Oct 24 19:35 logs.lua
-rw-rw-r-- 1 cuda cuda 192063 Oct 24 19:35 luup.lua
-rw-rw-r-- 1 cuda cuda 101110 Oct 24 19:35 plugins.lua
-rw-rw-r-- 1 cuda cuda 211249 Oct 24 19:35 requests.lua
-rw-rw-r-- 1 cuda cuda  57543 Oct 24 19:35 rooms.lua
-rw-rw-r-- 1 cuda cuda 102320 Oct 24 19:36 scenes.lua
-rw-rw-r-- 1 cuda cuda 147347 Oct 24 19:36 scheduler.lua
-rw-rw-r-- 1 cuda cuda 145335 Oct 24 19:36 server.lua
-rw-rw-r-- 1 cuda cuda 129259 Oct 24 19:36 timers.lua
-rw-rw-r-- 1 cuda cuda  80311 Oct 24 19:36 userdata.lua
-rw-rw-r-- 1 cuda cuda  64264 Oct 24 19:36 xml.lua
cuda@Ubuntu:/etc/cmh-ludl/openLuup$

Sorry, the devil made me do it...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: mda on October 24, 2015, 09:44:15 pm
@akbooer I have PMd you a camera. Thanks.

@akbooer i just wanted to check if you got my PM, and if it was helpful? (i don't see it in my outbox so i am not certain it sent.) Thanks !
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 24, 2015, 10:22:54 pm
Quick thing, everything apears to work fine exept of 2 things:

- sometime (if the vera is busy with itself doing nithing) status changed are not updated, sometimes for hours, i have to trigger the item again or poll it to update, is there a way to enforce the verabridge to poll everything at some time intervals ?

Second and more important,
With some reason, none of the triggers or watched variables do fire.
Is there anything need to taken care of first ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 10:25:00 pm
@akbooer i just wanted to check if you got my PM, and if it was helpful? (i don't see it in my outbox so i am not certain it sent.) Thanks !

Yes, great thanks.  It will be useful, but I just want to fix the more general XML problem I've introduced recently!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 10:27:18 pm
Version 5.3 loaded (taken from Git)...

Code: [Select]
cuda@Ubuntu:/etc/cmh-ludl$ ./openLuup_reload
lua: openLuup/init.lua:4: unexpected symbol near '<'
cuda@Ubuntu:/etc/cmh-ludl$

Yes, horrible.  Obviously an inadequately tested fix.    It's the XML problem.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 10:33:56 pm
Quick thing, everything apears to work fine exept of 2 things:
Good news - don't change anything!

Quote
- sometime (if the vera is busy with itself doing nithing) status changed are not updated, sometimes for hours, i have to trigger the item again or poll it to update, is there a way to enforce the verabridge to poll everything at some time intervals ?
That's exactly what it does do.  Quite often.  Actually about once a minute.  What version of the bridge are you running - it's been that way for a while.  See second half of this post http://forum.micasaverde.com/index.php/topic,32315.msg252489/topicseen.html#msg252489

Quote
Second and more important,
With some reason, none of the triggers or watched variables do fire.
Is there anything need to taken care of first ?

See this post: http://forum.micasaverde.com/index.php/topic,32315.msg252844/topicseen.html#msg252844

...Vera-style UPnP inspired triggers are not implemented, and will not be.  ALTUI ones certainly should work.  What exactly are you trying to do?  Can you build a simple system that demonstrates the problem?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 24, 2015, 10:39:25 pm
I just want to execute scenes or code on events, such as a swich flipped
I dont care how thats to be accomplished really, looks like i do somethings wrong in setting them up.

How can i access this AltUI ones ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 11:16:17 pm
How can i access this AltUI ones ?

Under Scenes > Create > Triggers > Device Variable Watches
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 11:21:38 pm
@all

Can you try this fix (which is also on GitHub) - changes to the openLuup modules in that subdirectory.

It addresses a recent XML problem (I hope) and it works really well for my Sonos.  I would hope that DLNA and Squeeze box would be similarly affected.  Let me know (I'm sure you will.)

Is everyone OK with pulling stuff off GitHub and then I can stop posting the code here?

Title: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 24, 2015, 11:32:07 pm
How can i access this AltUI ones ?

Under Scenes > Create > Triggers > Device Variable Watches

You mean watch instead of triggers ?
I try that before
Like this:

(http://images.tapatalk-cdn.com/15/10/24/3c6c2c2b7ee042407ae28e5ebecfc6bc.jpg)
(http://images.tapatalk-cdn.com/15/10/24/b5ccd09ba31131b86af49be13f2f9b72.jpg)

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 24, 2015, 11:41:24 pm
You mean watch instead of triggers ?

Yes, exactly that.  It should work.

If it doesn't we need to investigate.  A log of the relevant trigger event would be helpful.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 25, 2015, 03:27:13 am
You mean watch instead of triggers ?

Yes, exactly that.  It should work.

If it doesn't we need to investigate.  A log of the relevant trigger event would be helpful.


i'm pretty sure iam just doing it wrong.
here is a photo of what i ahve done.

the result should be the light to go back off once turned on ...

right ?
at least that what i want to accomplish ;P

P.S. the screenshoot shows watch on "Target" .. i had it on Status before without luck

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 25, 2015, 03:38:07 am
You appear to be watching the same device as you are actioning!

Your watch is for the target value to be set to 0.  Your action sets the target back to one.

Without looking at the code of the watch, I can't tell what you've actually written in the trigger logic.  Bear in mind that all device variables are strings so, in fact, you should look for "0" and not 0.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 25, 2015, 04:01:18 am
All i did show on the screenshoot,

Watch for switchpower status change to 1
New=1
And action on the same device switchpower1 setTarget NewTarget alue=0

That should turn the light right back off
But nothing happens (stays on, also the log stays clear)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 25, 2015, 04:07:39 am
When the variable is changed, does the log file show on the same line "#hooks: 1" ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 25, 2015, 04:12:12 am
Code: [Select]
New = 1

should be

Code: [Select]
new == "1"
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 25, 2015, 04:20:42 am
oh yes it was new=1
i changed it to new="1" now .. same thing

log shows this if i flip the switch
Code: [Select]

06 10/25/15 15:18:45.190 Device_Variable::m_szValue_set device: 15 service: urn:upnp-org:serviceId:SwitchPower1 variable: Status was: 0 now: 1 #hooks: 1
06 10/25/15 15:18:45.192 Device_Variable::m_szValue_set device: 15 service: urn:upnp-org:serviceId:SwitchPower1 variable: Target was: 0 now: 1 #hooks: 0
06 10/25/15 15:18:45.194 Device_Variable::m_szValue_set device: 15 service: urn:micasaverde-com:serviceId:EnergyMetering1 variable: Watts was: 0 now: 15 #hooks: 0
06 10/25/15 15:18:45.196 Device_Variable::m_szValue_set device: 15 service: urn:micasaverde-com:serviceId:EnergyMetering1 variable: Log was: 0,0,15,1445761113,2914 now: 15,0,15,1445761122,2923 #hooks: 0

hooks:1
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 25, 2015, 04:30:14 am
oh yes it was new=1
i changed it to new="1" now .. same thing

Look closer...
Code: [Select]
new == "1"

...TWO equals signs.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 25, 2015, 04:54:34 am

...TWO equals signs.

Meet Stupid!! Haha
It works

I had with == before, didnt work, but that was probably for other reasons ..

Thanks again,
Cant wait to move the triggers now to openluup
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 25, 2015, 07:15:59 am
@akbooer

btw, what is the actual Target aproach for you to write this ?

running ALL Plugins on openluup and just have the vera do its own things ?
or just offload "some" things and keep the vera as the center of the universe ?


for me the roadmap is to have openLuup do all the heavy scripts .. (specially the ones taking much time to get done)
but everything keeps spinning arround the vera ..

not sure this is the right way to do it .. as all the device plugins still will be on the vera .. (just without the logic)
and some time critical triggers i can't move too

my "usless machine test" with turning off a light after its turned on resulted in some time delays up to 6 Secounds (time from the light actually ON till openLuup turned it back off) .. so time sensetive stuff like movement lights and button interpretation from the harmony remote have to stay on the vera ..

or is there another aproach seen as the ultimate goal ?
like have openLuup be the center and the vera just executing z-wave commands ?

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 25, 2015, 08:26:21 am
running ALL Plugins on openluup and just have the vera do its own things ?
or just offload "some" things and keep the vera as the center of the universe ?

Well it's very individual.  The goal for openLuup is to "run unmodified plugins on any machine".  It turns out that although openLuup itself is extremely portable, some of the more sophisticated plugins (unsurprisingly) make large assumptions about the system and require additional installed modules.  Slowly working through the issues but I'm hoping that Sonos, DLNA, Squeezbox are OK now.  Harmony is much harder because it re-writes its own JSON file and assumes a number of extra facilities within the Unix system.

Some might need a little adjustment, some would have to be rewritten more extensively (but hopefully so they would still run on  Vera.)  PLEG needs a discussion with Richard about encryption and licensing.

Now that ALTUI provides a great triggering mechanism, scenes can move there quite easily...

Quote
for me the roadmap is to have openLuup do all the heavy scripts .. (specially the ones taking much time to get done)
but everything keeps spinning arround the vera ..
I'm really interested to learn what you might have in the heavy scripting line.  HA shouldn't really be that CPU intensive.  I'm doing fine with stuff running on an Arduino Yun.

Quote
not sure this is the right way to do it .. as all the device plugins still will be on the vera .. (just without the logic)
My personal goal was to have Vera act as simply a Zwave / HTTP bridge.

Quote
and some time critical triggers i can't move too

my "usless machine test" with turning off a light after its turned on resulted in some time delays up to 6 Secounds (time from the light actually ON till openLuup turned it back off) .. so time sensetive stuff like movement lights and button interpretation from the harmony remote have to stay on the vera ..
A scene activating a remote device on Vera should be nearly instantaneous, unless there is something heavy going on (like a complete dump of user_data or the like).  For me it's typically under half a second.  Zwave response times are unchanged (variable.)  Where your delay comes from is a polling loop in the VeraBridge plugin.  This can be changed - I just set it to that initially because I was unsure of the system impact.  It seems to be minuscule.  On a 400 Mhz system-on-a-chip bridged to a remote Vera, the whole processor still sits at around 4% load.  To be fair, once openLuup itself is running smoothly for everyone, I'll revisit the bridge: it can be improved (need to add lazy polling, but this needs asynchronous I/O, which openLuup does support but the bridge code does not currently use.)

Quote
or is there another aproach seen as the ultimate goal ?
like have openLuup be the center and the vera just executing z-wave commands ?
as described above, that's another way to do it.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 25, 2015, 09:47:51 am
Quote
not sure this is the right way to do it .. as all the device plugins still will be on the vera .. (just without the logic)
My personal goal was to have Vera act as simply a Zwave / HTTP bridge.

guess thats the best way to go ...
well while the transition i gonna stick with the Scenes only and move "some" of the scripts/plugins ..

as the new machine also uses new ID's (i just hope they wont change on a random basis)
so i have a lot of id-numbers to replace while copy the scenes over ...
but thats also a good thing to ger familiar with altui .. (i used it only briefly on my vera once and fast got back to UI5)

my heavy parts are tons of CURL's to other systems connected in my house ...
like tell transmission to pull the parking break so i got some bandwith to work ;)
turn on Airconditioner in the office if its after 13:00 and my wife has late-shift
push notifications and so on and so on ..

my away scene (plain lua) id making serval changes based on other status ( i have a multiswitch where i change my wife working shifts .. and my daugter has school or not ... based on this settings and the daynight status .. and the presentce of my car .. I will not swear does happen ... so its a lot of -if-else-then-
nothing really complex ... just alot to do for the vera to go trough ;)

basically every 4-5 times i come home .. i stand with my car in front of a closed driveway gate ..
i check with homewave on my phone .. (which usally takes forever because i have shitty signal at this spot, and the vera may be still busy with herself) and see the virtual switch for "car is present" is set to "on" but the vera crashed half way executing the script ..
and missed to open the gate for me, or turn on the lights or whatever ... didnt unlock the doors .. or (the worst) my coffee maker did not pre-heat (which is a reason to bite the vera off the rack and .... !!!

usally only 10% of the things do happen .. rest falles trough the reload loop

logs are the usual useless junk, MVC support blaming something else ...
basically its the z-wave stack flooded .. cause the vera to freeze for a secound or two and this causes the watchdog to reload luup .. pretty simple actually ;)

thats the main reason for me to use openluup for processing ..


oh while on useless use-cases ..
how do i start a scene within a scene ?
Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "32"}, 1)
does not really work
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 25, 2015, 09:58:04 am
guess thats the best way to go ...
well while the transition i gonna stick with the Scenes only and move "some" of the scripts/plugins ..
That's a reasonable starting point.

Quote
as the new machine also uses new ID's (i just hope they wont change on a random basis)
so i have a lot of id-numbers to replace while copy the scenes over ...
They won't change if you don't change anything.  The key would be to have ALTUI as device 3, and the VeraBridge as device 4.  I would always build a startup.lua file which recreates the system you want.  Always backup your user_data.json file.

To get around the device ID problem, I've posted elsewhere a simple function which you can put into the startup Lua script which maps between device names and IDs.  For me, the names are much more stable.

Quote
my heavy parts are tons of CURL's to other systems connected in my house ...
like tell transmission to pull the parking break so i got some bandwith to work ;)
turn on Airconditioner in the office if its after 13:00 and my wife has late-shift
push notifications and so on and so on ..
Why would you use curl and not luup.inet.wget ?

Quote
usally only 10% of the things do happen .. rest falles trough the reload loop
I hope we're on the way to fixing that.

Quote
oh while on useless use-cases ..
how do i start a scene within a scene ?
Code: [Select]
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "32"}, 1)
does not really work

Can you elaborate?  So far as I know, this does work.  A log would help (openLuup logs are much better than Vera ones!)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 25, 2015, 10:11:43 am
The good news is openLuup initializes without an error (version 5.3a). Unfortunately I seem to be having issues, for example (simple test):
Using AltUI, I set the dimmer to 100% on the cloned device [13]. I don't see it making the call to Vera at all to make the change to device [44].

Code: [Select]
2015-10-25 09:01:34.354   openLuup.server:: /data_request?id=action&output_format=json&DeviceNum=13&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=100 tcp{client}: 0x1be5000
2015-10-25 09:01:34.355   luup.call_action:: 13.urn:upnp-org:serviceId:Dimming1.SetLoadLevelTarget
2015-10-25 09:01:34.357   openLuup.server:: request completed (2 bytes, 1 chunks, 2 ms) tcp{client}: 0x1be5000

Scenes seem to be running but it looks like most of my devices simply aren't updating from Vera. Should I start clean ?

@all

Can you try this fix (which is also on GitHub) - changes to the openLuup modules in that subdirectory.

It addresses a recent XML problem (I hope) and it works really well for my Sonos.  I would hope that DLNA and Squeeze box would be similarly affected.  Let me know (I'm sure you will.)

Is everyone OK with pulling stuff off GitHub and then I can stop posting the code here?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 25, 2015, 11:52:50 am
Scenes seem to be running but it looks like most of my devices simply aren't updating from Vera. Should I start clean ?

Well, it's no consolation, but for a scene running on openLuup, triggered by a 1 minute timer, toggling a remote RGBW dimmer I see this:
Code: [Select]
2015-10-25 15:49:27.269   luup.scenes:0: running 1, Toggle Green, initiated by 1 min timer
2015-10-25 15:49:27.272   luup.call_action:0: 33.urn:micasaverde-com:serviceId:HaDevice1.ToggleState
2015-10-25 15:49:27.274   luup.call_action:0: action will be handled by parent: 4
2015-10-25 15:49:27.777   luup_log:4: http://172.16.42.14:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HaDevice1&action=ToggleState&DeviceNum=44
2015-10-25 15:49:31.339   luup.variable_set:4: 33.urn:upnp-org:serviceId:SwitchPower1.Status was: 0 now: 1 #hooks:0
2015-10-25 15:49:31.342   luup.variable_set:4: 33.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 0 now: 100 #hooks:0
2015-10-25 15:49:31.344   luup.variable_set:4: 33.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 0 now: 100 #hooks:0

and, of course, it's actually making the device turn on/off too.

I wonder what's different?

Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 25, 2015, 12:14:13 pm
I'm going to restore (v5.0), test to see if all is well then upgrade again. I'll post back my results later. This will at least tell me if I made a mistake on my end.

Scenes seem to be running but it looks like most of my devices simply aren't updating from Vera. Should I start clean ?

Well, it's no consolation, but for a scene running on openLuup, triggered by a 1 minute timer, toggling a remote RGBW dimmer I see this:
Code: [Select]
2015-10-25 15:49:27.269   luup.scenes:0: running 1, Toggle Green, initiated by 1 min timer
2015-10-25 15:49:27.272   luup.call_action:0: 33.urn:micasaverde-com:serviceId:HaDevice1.ToggleState
2015-10-25 15:49:27.274   luup.call_action:0: action will be handled by parent: 4
2015-10-25 15:49:27.777   luup_log:4: http://172.16.42.14:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HaDevice1&action=ToggleState&DeviceNum=44
2015-10-25 15:49:31.339   luup.variable_set:4: 33.urn:upnp-org:serviceId:SwitchPower1.Status was: 0 now: 1 #hooks:0
2015-10-25 15:49:31.342   luup.variable_set:4: 33.urn:upnp-org:serviceId:Dimming1.LoadLevelTarget was: 0 now: 100 #hooks:0
2015-10-25 15:49:31.344   luup.variable_set:4: 33.urn:upnp-org:serviceId:Dimming1.LoadLevelStatus was: 0 now: 100 #hooks:0

and, of course, it's actually making the device turn on/off too.

I wonder what's different?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 25, 2015, 10:53:19 pm
To get around the device ID problem, I've posted elsewhere a simple function which you can put into the startup Lua script which maps between device names and IDs.  For me, the names are much more stable.

could you hint me to that again i could not find it (google and forum search is pretty much useless for finding tiny bits :( )
i think its time for sub-forum for openLuup ...

ID mapping for core devices is defently somethings should be considered ..
i use svn to backup (cronjob simply commit to my repro)

variable Id's do change basically every time i hit reload. (i have not yet seen a device ID change .. but better not to risc it)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 26, 2015, 12:05:25 am
OK, so I did a couple of tests.


v5.0 initialized and had no issues whatsoever loading the Vera devices.
v5.3 would initialize but wouldn't call Vera to load devices, so - no devices at all.
v5.3 and v5.0 (combination of files from both versions) initialized and loaded all my devices from Vera.

I have all the log data available for all tests but it came down to the VeraBridge files (from Git; v5.3). The last test (v53 and v5) was a combination of all the v5 VeraBridge files (/etc/cmh-ludl) and openLuup files (latest posted by you).

Unrelated topic, I vote for fetching the files off GitHub moving forward...
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 26, 2015, 12:37:14 am
And then there was sound !

I need to do some research on this error...
Code: [Select]
device 0 '_system_' requesting reload
modprobe: ERROR: could not insert 'ip_tables': Operation not permitted
iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: nullx8 on October 26, 2015, 02:20:59 am
Nat is disabled or connection tracking is off

Make sure nf_conntrack is set to 1 if use iptables with nat-rules
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 26, 2015, 04:06:42 am
could you hint me to that again i could not find it (google and forum search is pretty much useless for finding tiny bits :( )
The basic idea was here: http://forum.micasaverde.com/index.php/topic,14743.msg111814.html#msg111814 but these days I wrap it into a function which simply returns the ID given a name.  You can do the same for scenes.  I had thought of using the UUID option for devices (ie. strings as an alternative to numeric IDs, possibly also allowing device names.  But that diverges too much from Vera, I think.)

Quote
i think its time for sub-forum for openLuup ...
I think we are just about at critical mass for that.

Quote
ID mapping for core devices is defently somethings should be considered ..
i use svn to backup (cronjob simply commit to my repro)
If you use the same user_data.json (ie. don't run a startup.lua file) then device IDs will not change.

Quote
variable Id's do change basically every time i hit reload. (i have not yet seen a device ID change .. but better not to risc it)
I don't know what variable IDs are for.  They're not used by the system (openLuup) or any plugin AFAIK.  They're there simply for cosmetic value in the user_data, since they not documented and I didn't know if they would make a difference.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 26, 2015, 07:45:56 am
@nullx8, This is the code I use for translating between device and scene names and IDs.

Code: [Select]
local deviceLookupTable    -- table of [device.description] = deviceNo for name lookup
local sceneLookupTable    -- table of [scene.description]  = sceneNo for name lookup

-- generic reverse lookup table constructor for element table.field
function lookupTable (table, field)
  field = field or "description" -- default field name
  local lookup = {} 
  for i,d in pairs (table) do  -- create the lookup table
    lookup [d[field] ] = i
  end
  return lookup
end

-- deviceNo (deviceName) returns matching device number
function deviceNo (name)
  deviceLookupTable = deviceLookupTable or lookupTable (luup.devices)
  return deviceLookupTable[name]
end

-- sceneNo (sceneName) returns matching scene number
function sceneNo (name)
  sceneLookupTable = sceneLookupTable or lookupTable (luup.scenes)
  return sceneLookupTable[name]
end

Put it in your startup code (not the startup.lua.)
 
Use it like this:
Code: [Select]
local devNo = deviceNo "My Device Name"
local scnNo = sceneNo  "A useful scene"

I find this very useful in scene and startup code.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 26, 2015, 07:58:45 am
OK, so I did a couple of tests.

...and some!  I apologise.  By way of excuse, I have just discovered that somehow the GitHub repository that I was using was in the trash can on my Mac  :(

How this happened, I have no idea, but this has led me into some sort of version control hell.  I believe that the VeraBridge in the 5.3 release was, in fact, an experimental one I had offered to @mda to try and solve a problem there.

Can you confirm that the attached is, in fact, the version that works for you?

Quote
Unrelated topic, I vote for fetching the files off GitHub moving forward...

That's one vote.  If you confirm that the attached is the right file, I'll update GitHub and move onwards [Edit: you can find it at https://github.com/akbooer/openLuup]

I think we need to regroup and assess what's working.  Might be a good idea to share those configuration docs you have? (pull request on GihHub??)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 26, 2015, 08:14:45 am
And then there was sound !

I need to do some research on this error...
Code: [Select]
device 0 '_system_' requesting reload
modprobe: ERROR: could not insert 'ip_tables': Operation not permitted
iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

This is, I think, the Sonos plugin checking for, or trying to install, the UPnP Discovery patch.  I haven't tested that, and without installing it, the system seems to be able to find my various bits of Sonos hardware without difficulty (both on OpenWRT and Debian.)

I wouldn't bother with the UPnP Event Proxy either, unless someone can tell me that it's necessary.


Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 26, 2015, 11:38:26 am
Good news, the file works perfectly... You're making excellent progress !

OK, so I did a couple of tests.

...and some!  I apologise.  By way of excuse, I have just discovered that somehow the GitHub repository that I was using was in the trash can on my Mac  :(

How this happened, I have no idea, but this has led me into some sort of version control hell.  I believe that the VeraBridge in the 5.3 release was, in fact, an experimental one I had offered to @mda to try and solve a problem there.

Can you confirm that the attached is, in fact, the version that works for you?

Quote
Unrelated topic, I vote for fetching the files off GitHub moving forward...

That's one vote.  If you confirm that the attached is the right file, I'll update GitHub and move onwards [Edit: you can find it at https://github.com/akbooer/openLuup]

I think we need to regroup and assess what's working.  Might be a good idea to share those configuration docs you have? (pull request on GihHub??)
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 26, 2015, 12:05:42 pm
Quite possibly, I just used the [discover] button which quickly located the devices - never touched the patch. The err is a 1:1 for each device on init..

And then there was sound !

I need to do some research on this error...
Code: [Select]
device 0 '_system_' requesting reload
modprobe: ERROR: could not insert 'ip_tables': Operation not permitted
iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

This is, I think, the Sonos plugin checking for, or trying to install, the UPnP Discovery patch.  I haven't tested that, and without installing it, the system seems to be able to find my various bits of Sonos hardware without difficulty (both on OpenWRT and Debian.)

I wouldn't bother with the UPnP Event Proxy either, unless someone can tell me that it's necessary.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on October 26, 2015, 12:25:37 pm
This is a fairly clean system configured for sole purpose of testing openLuup. Nothing that wasn't added by a default Ubuntu install is on this system unless it was needed for openLuup. However, It appears from /proc/net that I do have entries within nf_conntrack.

Code: [Select]
unknown  2 503 src=172.16.5.25 dst=224.0.0.251 [UNREPLIED] src=224.0.0.251 dst=172.16.5.25 mark=0 use=2
udp      17 123 src=172.16.5.25 dst=91.189.89.199 sport=123 dport=123 src=91.189.89.199 dst=172.16.5.25 sport=123 dport=123 [ASSURED] mark=0 use=2
udp      17 9 src=172.16.0.71 dst=224.0.0.252 sport=61914 dport=5355 [UNREPLIED] src=224.0.0.252 dst=172.16.0.71 sport=5355 dport=61914 mark=0 use=2
udp      17 4 src=172.16.0.31 dst=172.16.255.255 sport=138 dport=138 [UNREPLIED] src=172.16.255.255 dst=172.16.0.31 sport=138 dport=138 mark=0 use=2
udp      17 20 src=172.16.5.104 dst=172.16.255.255 sport=138 dport=138 [UNREPLIED] src=172.16.255.255 dst=172.16.5.104 sport=138 dport=138 mark=0 use=2
unknown  2 502 src=0.0.0.0 dst=224.0.0.1 [UNREPLIED] src=224.0.0.1 dst=0.0.0.0 mark=0 use=2

Nat is disabled or connection tracking is off

Make sure nf_conntrack is set to 1 if use iptables with nat-rules
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 26, 2015, 01:59:50 pm
@akbooer

System was running fine until this morning.  It seems I had an interruption for a few minutes in the network connection.  Raspberry recovered when the network connection came up but lua crashed without leaving a trace in the logs.  Is this something which can avoided? 

Thanks for your help
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 26, 2015, 02:15:09 pm
System was running fine until this morning.  It seems I had an interruption for a few minutes in the network connection.  Raspberry recovered when the network connection came up but lua crashed without leaving a trace in the logs.  Is this something which can avoided? 

I can't see why that would be.  Maybe it's too late to ask, but what was the last log file, and the penultimate one (in /etc/cmh-ludl/ there is the latest LuaUPnP.log and the five previous ones LuaUPnP.log.1 etc.)

I can imagine that some plugin connections using luup.open or the IP address in the device attributes could be compromised, but that shouldn't shut down Lua.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcf6288 on October 26, 2015, 03:04:51 pm
For scenes I cannot get triggers from my veraEdge to show up.  All the devices are listed but cannot select a trigger.  Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: delle on October 26, 2015, 04:40:26 pm
@akbooer

Last log file just ended without an error message
2015-10-26 08:24:25.688   luup.variable_set:4: 42.urn:akbooer-com:serviceId:EventWatcher1.AppMemoryUsed was: 768 now: 772 #hooks:0
2015-10-26 08:24:25.692   luup.variable_set:4: 42.urn:akbooer-com:serviceId:EventWatcher1.MemAvail was: 84344 now: 84300 #hooks:0
2015-10-26 08:24:25.693   luup.variable_set:4: 42.urn:akbooer-com:serviceId:EventWatcher1.MemFree was: 60328 now: 60276 #hooks:0
2015-10-26 08:24:25.694   luup.variable_set:4: 42.urn:akbooer-com:serviceId:EventWatcher1.CpuLoad05 was: 0.27 now: 0.24 #hooks:0

and that's when lua crashed
system log shows nothing more
Oct 26 08:17:43 raspberrypi kernel: [   52.156211] cfg80211: Calling CRDA to update world regulatory domain
Oct 26 08:17:46 raspberrypi kernel: [   55.316301] cfg80211: Calling CRDA to update world regulatory domain
Oct 26 08:17:49 raspberrypi kernel: [   58.476490] cfg80211: Calling CRDA to update world regulatory domain
Oct 26 08:17:52 raspberrypi kernel: [   61.636619] cfg80211: Calling CRDA to update world regulatory domain
Oct 26 08:17:55 raspberrypi kernel: [   64.796759] cfg80211: Exceeded CRDA call max attempts. Not calling CRDA
Oct 26 09:17:01 raspberrypi /USR/SBIN/CRON[2438]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Oct 26 10:17:01 raspberrypi /USR/SBIN/CRON[2448]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Oct 26 11:17:01 raspberrypi /USR/SBIN/CRON[2458]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly

Where else can I have see more info?

Thanks
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 26, 2015, 05:30:23 pm
Couldn't really say... not a Unix expert at all.

I tried unplugging a Debian system for a minute or two and reconnecting.  Took a while but all OK, no crashes.  Sonos controls still work, as does remote connection to Vera via the bridge.  Not a conclusive test, but it gives some encouragement.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 26, 2015, 05:40:58 pm
For scenes I cannot get triggers from my veraEdge to show up.  All the devices are listed but cannot select a trigger.  Thanks

Does this post shed any light on the situation? http://forum.micasaverde.com/index.php/topic,32315.msg252844/topicseen.html#msg252844

Also

Quote from: User Guide, p. 3
  • supports scenes with timers and ALTUI-style triggers

--

Edit:  Also, are you running the latest version of the VeraBridge ?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcf6288 on October 27, 2015, 02:20:19 am
Yes I am running the latest bridge.  I figured out the triggers stuff, and am having trouble with the actions.  I read through the guide as well as the altui doc and am not sure what the scene editor is looking for, for something like turning on a light connected to the vera.  Do I have to use LUA for anything connected to the vera?  Also any idea why my icons aren't showing up. I have them set in the exact directories described in the setup guide?  Thanks for all the help.  I continue to believe this is the best option to move away from Vera and still have all the benefits of Vera if that makes any sense.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 27, 2015, 04:05:21 am
Actions work exactly the same way as on Vera.  No need for any Lua.  You select the device you want to action, then the actual action from the pop up menu, and finally the value of any parameter.

Re. Icons: I assume, then, that you've tested as described in the guide that you can access these two locations through a browser.  Have you also run the configuration test Lua script and does it give any diagnostic message?  My guess would be that the /www/ directory used by your port 80 server is not, in fact, accessible by that exact path from the root directory, and that you perhaps need a symbolic link to make that actual connection.
Title: Create Device
Post by: nullx8 on October 27, 2015, 05:39:13 am
somehow i keep failing in creating local devices on openLuup

the AltUI dialog does not work at all

if u use luup.create_device its beeing added but the ALTID is the device name .. and change the name itself does not really work either ..

somethings odd here ...

everything from the verabridge works fine ... but i cant even get a virtual switch to work ..

if i use luup.create_device the device is created .. but watched variables do not fire ..
Title: Re: Create Device
Post by: akbooer on October 27, 2015, 06:44:46 am
somehow i keep failing in creating local devices on openLuup

the AltUI dialog does not work at all
No, it doesn't.  This is something we need to ask @amg0.  The problem is well defined: it makes a request to port 80, which shows in the syslog file like this...

Code: [Select]
[Tue, 27 Oct 2015 10:26:01 GMT] "OPTIONS /port_49451/upnp/control/hag HTTP/1.1" 404 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0"
...expecting it to be redirected to port 49451.  Your system doesn't do that redirection, nor does mine, nor does it matter, since I've not implemented a server on port 49451 anyway.

The solution is to use a much more normal port 3480 call documented here: http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions#HomeAutomationGateway1 and also in file S_HomeAutomationGateway1.xml.

Code: [Select]
http://ip_address:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreateDevice&...

Quote
if u use luup.create_device its beeing added but the ALTID is the device name .. and change the name itself does not really work either ..

somethings odd here ...
Are you sure you have the right parameters?  This works:

Code: [Select]
local arduino = luup.create_device ('', "Arduino", "Arduino", "D_Arduino1.xml")       
...giving the device name AND the altid as "Arduino", but you could use anything you like for either/both.

Quote
everything from the verabridge works fine ... but i cant even get a virtual switch to work ..

if i use luup.create_device the device is created .. but watched variables do not fire ..
How exactly are you creating the device and what are you expecting it to do?
Title: Re: openLuup - running unmodified plugins on any machine
Post by: jcf6288 on October 27, 2015, 09:35:55 am
Actions work exactly the same way as on Vera.  No need for any Lua.  You select the device you want to action, then the actual action from the pop up menu, and finally the value of any parameter.

Re. Icons: I assume, then, that you've tested as described in the guide that you can access these two locations through a browser.  Have you also run the configuration test Lua script and does it give any diagnostic message?  My guess would be that the /www/ directory used by your port 80 server is not, in fact, accessible by that exact path from the root directory, and that you perhaps need a symbolic link to make that actual connection.
Thanks, I will keep playing with it.  Weird, when installing I was able to see the VeraBridge.PNG now I can't.

When I select the drop down under action with a vera device nothing happens.  It just shows a blank box. 
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on October 27, 2015, 11:20:23 am
i think its time for sub-forum for openLuup ...

So do I, and here we are.

I'm locking this thread (it has got a bit unwieldy) so feel free to make new ones under the new child board here http://forum.micasaverde.com/index.php/board,79.0.html

I've initially made a few threads on likely topics to get us started.  Tell me what's missing.
Title: Re: openLuup - running unmodified plugins on any machine
Post by: akbooer on December 18, 2015, 03:42:49 pm
This is my 3000th post, and I just wanted to place it as a sort of end-stop in an old thread which started more than 6 months ago with my 2000th post (http://forum.micasaverde.com/index.php/topic,32315.msg235161.html#msg235161).

In that post I laid out a roadmap for openLuup, and, whilst we're not quite there with everything, most of the objectives have been accomplished.  openLuup runs a wide variety of plugins on a wide variety of platforms.  This is not to say I'm at the end of developing this - far from it - but I think it's reaching stability.

Quite coincidentally, today one of my openLuup systems has also reached a milestone that can never be accomplished by Vera: over 31 days of continuous operation without a reload.  Of course, most Veras reload much more often than that, but with care you can get them to run for a month.  But that's the very longest because at the start of every calendar month, Vera will reload.

So here's a couple of screen shots showing openLuup, running on a 400 Mhz Arduino Yun board, after 32 days of continuous use.  It supports a MySensors network, two Netatmo stations with additional modules, a DataYours installation, and is my main machine for plotting DataYours graphs (such as these two plots.)  It averages around 10 Mbytes of memory use and 4.6% of the CPU load (the vertical axis for the plot is Mbytes and CPU %)

In fact, even with a machine linked to 4 remote Veras, I've struggled to make openLuup use much more resource than this.  This was the whole point of the exercise in the first place, so (if you allow some smugness) I'm well pleased.

I hope it works as well for you.

---------

I should definitely add that this would certainly not have been possible without the extended efforts of others - especially @amg0 and all the epic work on AltUI.  Also a small but select band of intrepid beta-testers (you know who you are) who have been brave enough to step into the deep water and try things out.  Without you all, and access to some of your devices, I would have not got far.  Thank you for your patience and support.

Title: Re: openLuup - running unmodified plugins on any machine
Post by: amg0 on December 19, 2015, 03:58:14 am
Very well done AK
Title: Re: openLuup - running unmodified plugins on any machine
Post by: d55m14 on December 19, 2015, 04:22:35 am
Great fantastic job akbooer !!
Title: Re: openLuup - running unmodified plugins on any machine
Post by: CudaNet on December 19, 2015, 08:25:19 pm
Just wanted to drop in real quick and thank you and amg0 for everything - the time/patience and of course openLuup and AltUI ! I honestly cannot imagine using anything else at this point ....