Vera - Smarter Home Control Forum

Advanced => Plugins & Plugin Development => Programming => openLuup => Topic started by: bruring on May 07, 2018, 06:08:30 pm

Title: Trouble installing openLUUP
Post by: bruring on May 07, 2018, 06:08:30 pm
Hello,

Finally I took the plunge and installed openLUUP.

I've run into a problem, though.
I'm running Debian 4.9.88-1 and installed the required prerequisites (lua5.1, lua-socket, lua-filesystem and lua-sec).
I've added an user and installed into ~/cmh-ludl.

Code: [Select]
vera@debian:~/cmh-ludl$ lua5.1 openLuup_install.lua
openLuup_install   2017.03.28   @akbooer
getting latest openLuup version tar file from GitHub...
un-zipping download files...
getting dkjson.lua...
creating required files and folders
initialising...
downloading and installing AltUI...
Tue May  8 00:06:11 2018 device 3 'Alternate UI' requesting reload
openLuup downloaded, installed, and running...
visit http://172.20.1.70:3480 to start using the system
vera@debian:~/cmh-ludl$ Tue May  8 00:06:11 2018 device 2 '    openLuup' requesting reload

Now, when I access http://172.20.1.70:3480, it redirects to http://172.20.1.70:3480/data_request?id=lr_ALTUI_Handler&command=home# and I get the following error:

Code: [Select]
error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)

Anyone knows what to do?

Thanks in advance!
Title: Re: Trouble installing openLUUP
Post by: a-lurker on May 07, 2018, 07:57:46 pm
Looking at the code (or some version of it), suggests you are missing a json decoder.

https://github.com/amg0/ALTUI/blob/master/L_ALTUI.lua

The code at the start does this:

Code: [Select]
local json = require("dkjson")
if (type(json) == "string") then
luup.log("ALTUI warning dkjson missing, falling back to L_ALTUIjson", 2)
json = require("L_ALTUIjson")
end

Note I'm just guessing here but see if the json files exist.
Title: Re: Trouble installing openLUUP
Post by: bruring on May 09, 2018, 04:40:45 pm
Hi a-lurker,

I've checked and the L_ALTUIjson.lua file is there.
Might there be some other dependencies I'm missing? Or is there another way to debug this?
Title: Re: Trouble installing openLUUP
Post by: rafale77 on May 09, 2018, 05:39:12 pm
you need a file called dkjson.lua.. your log says it got it. You may want to check that.
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 09, 2018, 06:01:08 pm
Do you see any errors or warnings in your LuaUPnP.log and the startup logs for openLuup?

Also, can you go to http://172.20.1.70:3480/console ?  You should be able to view the logs there.
Title: Re: Trouble installing openLUUP
Post by: bruring on May 10, 2018, 05:04:06 am
Thanks for all the help.

I've done the following:
- installed the lua-dkjson and lua-json Debian packages

Accessing /console works.
Accessing / still gives me the same error.

The log files say this:

LuaUPnP_startup.log:
Code: [Select]
vera@debian:~/cmh-ludl/logs$ cat LuaUPnP_startup.log
2018-05-10 10:59:15.624   :: openLuup STARTUP :: /home/vera/cmh-ludl
2018-05-10 10:59:15.624   openLuup.init::        version 2018.03.21  @akbooer
2018-05-10 10:59:15.630   openLuup.scheduler::   version 2018.03.21  @akbooer
2018-05-10 10:59:15.632   openLuup.wsapi::       version 2017.01.12  @akbooer
2018-05-10 10:59:15.632   openLuup.servlet::     version 2018.02.22  @akbooer
2018-05-10 10:59:15.632   openLuup.server::      version 2018.03.22  @akbooer
2018-05-10 10:59:15.633   openLuup.rooms::       version 2016.06.23  @akbooer
2018-05-10 10:59:15.634   openLuup.scenes::      version 2018.02.19  @akbooer
2018-05-10 10:59:15.635   openLuup.chdev::       version 2018.03.18  @akbooer
2018-05-10 10:59:15.635   openLuup.userdata::    version 2018.03.02  @akbooer
2018-05-10 10:59:15.635   openLuup.requests::    version 2018.02.18  @akbooer
2018-05-10 10:59:15.635   openLuup.gateway::     version 2018.03.05  @akbooer
2018-05-10 10:59:15.636   openLuup.smtp::        version 2018.03.20  @akbooer
2018-05-10 10:59:15.636   openLuup.io::          version 2018.03.22  @akbooer
2018-05-10 10:59:15.637   openLuup.luup::        version 2018.03.22  @akbooer
2018-05-10 10:59:15.637   luup.create_device:: [1] D_ZWaveNetwork.xml /  /
2018-05-10 10:59:15.639   luup.create_device:: [2] D_openLuup.xml / I_openLuup.xml / D_openLuup.json
2018-05-10 10:59:15.639   openLuup.init:: loading configuration user_data.json
2018-05-10 10:59:15.639   openLuup.userdata:: loading user_data json...
2018-05-10 10:59:15.642   openLuup.userdata:: loading rooms...
2018-05-10 10:59:15.642   openLuup.userdata:: ...room loading completed
2018-05-10 10:59:15.642   openLuup.userdata:: loading devices...
2018-05-10 10:59:15.642   luup.create_device:: [1] D_ZWaveNetwork.xml /  /
2018-05-10 10:59:15.653   luup.create_device:: [3] D_ALTUI.xml / I_ALTUI.xml / D_ALTUI_UI7.json
2018-05-10 10:59:15.654   luup.create_device:: [4] D_AltAppStore.xml / I_AltAppStore.xml / D_AltAppStore.json
2018-05-10 10:59:15.654   openLuup.userdata:: loading scenes...
2018-05-10 10:59:15.654   openLuup.userdata:: number of scenes = 0
2018-05-10 10:59:15.654   openLuup.userdata:: ...scene loading completed
2018-05-10 10:59:15.654   openLuup.userdata:: loading installed plugin info...
2018-05-10 10:59:15.654   openLuup.userdata:: [openLuup] openLuup (18.3.23)
2018-05-10 10:59:15.654   openLuup.userdata:: [8246] Alternate UI (GitHub.master)
2018-05-10 10:59:15.654   openLuup.userdata:: [AltAppStore] Alternate App Store (18.2.27)
2018-05-10 10:59:15.654   openLuup.userdata:: [VeraBridge] VeraBridge (not.installed)
2018-05-10 10:59:15.654   openLuup.userdata:: [Z-Way] Z-Way (not.installed)
2018-05-10 10:59:15.654   openLuup.userdata:: [Arduino] MySensors (not.installed)
2018-05-10 10:59:15.654   openLuup.userdata:: [8211] DataYours (not.installed)
2018-05-10 10:59:15.654   openLuup.userdata:: ...user_data loading completed
2018-05-10 10:59:15.654   openLuup.init:: running _openLuup_STARTUP_
2018-05-10 10:59:15.655   luup_log:0: startup code completed
2018-05-10 10:59:15.655   openLuup.init:: init phase completed
2018-05-10 10:59:15.655   :: openLuup LOG ROTATION :: (runtime 0.0 days)

So that seems alright.

LuaUPnP.log still gives me the same error:
Code: [Select]
2018-05-10 10:59:36.694   openLuup.server:: new client connection from 172.20.1.100: tcp{client}: 0x557b036c14a8
2018-05-10 10:59:36.694   openLuup.server:: GET / HTTP/1.1 tcp{client}: 0x557b036c14a8
2018-05-10 10:59:36.695   openLuup.server:: request completed (194 bytes, 1 chunks, 0 ms) tcp{client}: 0x557b036c14a8
2018-05-10 10:59:36.905   openLuup.server:: GET /data_request?id=lr_ALTUI_Handler&command=home HTTP/1.1 tcp{client}: 0x557b036c14a8
2018-05-10 10:59:36.905   openLuup.context_switch::  ERROR: [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)
2018-05-10 10:59:36.905   openLuup.servlet:: error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)
2018-05-10 10:59:36.905   openLuup.server:: request completed (222 bytes, 0 chunks, 0 ms) tcp{client}: 0x557b036c14a8

So it seems there is trouble loading AltUI?
I'm going to dig deeper into the source files of AltUI to find out what reference it is missing.
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 10, 2018, 06:40:51 am
check your ALTUI_SERVICE / "PluginConfig" variable
it must be perfect JSON, otherwise you can get this error
Code: [Select]
2018-05-10 10:59:36.905   openLuup.servlet:: error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)
Title: Re: Trouble installing openLUUP
Post by: bruring on May 11, 2018, 04:46:50 am
Hi amg0,

Thank you.
How do I check the variable?

I think it's weird because this is a complete clean install (new Debian install and new openLUUP install). No one else has this problem?
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 11, 2018, 05:19:35 am
Hi amg0,

Thank you.
How do I check the variable?

I think it's weird because this is a complete clean install (new Debian install and new openLUUP install). No one else has this problem?

I think on openluup there are visible in the user_data file are not they ? you may need to check with openluup experts.
the failure in your log file indicates we get a nil value for tbl which can only come from a corrupted PluginConfig variable or a json decode which is not working fine

Code: [Select]
local result = luup.variable_get(ALTUI_SERVICE, "PluginConfig", deviceID)
local tbl = json.decode(result)
Title: Re: Trouble installing openLUUP
Post by: bruring on May 16, 2018, 10:14:38 am
I still can't figure it out :-(

Could it have to do with this: http://forum.micasaverde.com/index.php/topic,50352.0.html ?

Maybe I should try manually installing through git?
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 16, 2018, 11:34:37 am
You should check your openSSL version: http://forum.micasaverde.com/index.php/topic,38102.msg352456.html#msg352456

Also try reinstalling AltUI:
Code: [Select]
http://openLuupIP:3480/data_request?id=altui - check the logs during this time to make sure it is fully installed (replace 'openLuupIP' appropriately).

Make sure the /tmp/AltAppStore has correct permissions:
Code: [Select]
sudo chmod a+w /tmp
sudo chmod a+w /tmp/AltAppStore

Not sure if any of this will help, but maybe it gives you a lead.

Title: Re: Trouble installing openLUUP
Post by: flaquito on May 16, 2018, 02:51:08 pm
I'm having the same problem -- fresh openLuup install on a fresh RedHat/Centos 7.5 system. Currently running it as root, so permissions shouldn't be an issue. Here's the end of the log output after reinstalling AltUI:

Code: [Select]
2018-05-16 14:42:57.205   luup.variable_set:: 4.urn:upnp-org:serviceId:altui1.DisplayLine2 was: Alternate UI 100% now: Alternate UI 100% #hooks:0
2018-05-16 14:42:57.205   luup_log:4: AltAppStore : updating icons in icons/ ...
2018-05-16 14:42:57.205   luup_log:4: AltAppStore : updating device files in ./ ...
2018-05-16 14:42:57.236   luup_log:4: AltAppStore : ... 2 icon files
2018-05-16 14:42:57.236   luup_log:4: AltAppStore : ... 30 device files
2018-05-16 14:42:57.236   luup_log:4: AltAppStore : Alternate UI update completed
2018-05-16 14:42:57.236   openLuup.luup:: device 4 'Alternate App Store' requesting reload
2018-05-16 14:42:57.236   luup.reload:: saving user_data
2018-05-16 14:42:57.244   openLuup.luup:: exiting with code 42 - after 0.0 hours
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 16, 2018, 04:28:25 pm
And do you also see this in the log after it restarts when you try to access AltUI?

Code: [Select]
2018-05-10 10:59:36.905   openLuup.context_switch::  ERROR: [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)
2018-05-10 10:59:36.905   openLuup.servlet:: error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)
Title: Re: Trouble installing openLUUP
Post by: flaquito on May 16, 2018, 04:34:04 pm
Almost, but a different line number:

Code: [Select]
2018-05-16 16:32:36.798   openLuup.server:: GET /data_request?id=lr_ALTUI_Handler&command=home HTTP/1.1 tcp{client}: 0x272c6f8
2018-05-16 16:32:36.799   openLuup.context_switch::  ERROR: [string "L_ALTUI.lua"]:2306: attempt to index local 'tbl' (a nil value)
2018-05-16 16:32:36.799   openLuup.servlet:: error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2306: attempt to index local 'tbl' (a nil value)
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 16, 2018, 05:02:53 pm
Can you try this:
Code: [Select]
http://openLuupIP:3480/data_request?id=status&output_format=xml&DeviceNum=3replace the 3 with your AltUI device ID.  If you are not sure, try them consecutively from 2.  One of them should give you the full variable set for AltUI.  Then look for the PluginConfig that amg0 mentions above.  Or take a look directly at the user_data.json to find that variable.  The theory is that it isn't set correctly for some reason.
Title: Re: Trouble installing openLUUP
Post by: flaquito on May 16, 2018, 06:06:47 pm
It's there, but empty:

Code: [Select]
      "id":7,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"PluginConfig"

What should it be?

Edit: and how do I change it, if need be?
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 16, 2018, 06:27:07 pm
It has to be valid JSON, but perhaps it can be minimal: "{}".

You can edit it by stopping openLuup, edit the file (save a copy first!), then start up openLuup.

The bigger question that I'm worried about is why didn't this get set properly initially and what problems will you hit after this?  I'm worried that there are other issues because something went wrong earlier.  But I don't know what that it is, so maybe try this and see what you hit next...

I'm not familiar with the initial installation flow in openLuup with AltUI.
Title: Re: Trouble installing openLUUP
Post by: flaquito on May 16, 2018, 07:03:30 pm
That seems to have done it! System is up and running, and I haven't gotten any more errors (although I can't get the bridge plugin to clone my vera, but that's an issue for another thread). Thanks for your help!
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 16, 2018, 07:19:44 pm
amg0, any idea why this isn't set?  Looks like getDefaultConfig didn't get called?  Something went wrong in initialization of AltUI.
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 17, 2018, 12:47:05 am
amg0, any idea why this isn't set?  Looks like getDefaultConfig didn't get called?  Something went wrong in initialization of AltUI.
No . I ll have a look but it should be fine now.
To be sure flaquito can you share the whole device variable list and values ( same http call as you used earlier )
Title: Re: Trouble installing openLUUP
Post by: flaquito on May 17, 2018, 10:04:35 am
Here you go. Pretty much the only thing I've done so far is add my Vera.

Code: [Select]
{
  "DataVersion":515043756,
  "Device_Num_3":{
    "Jobs":[],
    "PendingJobs":0,
    "id":3,
    "states":[{
      "id":48,
      "service":"urn:micasaverde-com:serviceId:HaDevice1",
      "value":"0",
      "variable":"CommFailureTime"
    },{
      "id":47,
      "service":"urn:micasaverde-com:serviceId:HaDevice1",
      "value":"0",
      "variable":"CommFailure"
    },{
      "id":24,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"ThemeCSS"
    },{
      "id":0,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"0",
      "variable":"Present"
    },{
      "id":34,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"WorkflowsVariableBag"
    },{
      "id":8,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"DeviceType"
    },{
      "id":12,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"DeviceIconFunc"
    },{
      "id":3,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"0",
      "variable":"WorkflowMode"
    },{
      "id":14,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"FavoriteFunc"
    },{
      "id":6,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"Result"
    },{
      "id":30,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"ALTUIPath"
    },{
      "id":28,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"{\"ShowMyHomeImages\":\"MQ==\",\"UseMasonryInMyHome\":\"MA==\",\"ShowVideoThumbnail\":\"MQ==\",\"ShowWeather\":\"MQ==\",\"ShowHouseMode\":\"MQ==\",\"ServerSideOptions\":\"MA==\",\"UseVeraFavorites\":\"MA==\",\"SyncLastRoom\":\"MQ==\",\"StickyFooter\":\"MA==\",\"UseUI7Heater\":\"MA==\",\"ShowAllRows\":\"MA==\",\"LockFavoritePosition\":\"MA==\",\"TopStats\":\"MA==\",\"Menu2ColumnLimit\":\"MTU=\",\"TempUnitOverride\":\"Zg==\",\"EditorFontSize\":\"MTI=\",\"Theme\":\"\",\"MainUser\":\"OTU0Yzk3M2YtYTM0OS00Y2NjLTlkYjAtZGY2OTRmNzNmY2Q0\",\"FavoritesOrder\":\"bWV0ZW8saG91c2Vtb2Rl\"}",
      "variable":"ServerOptions"
    },{
      "id":16,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"JsonParameters"
    },{
      "id":29,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"LocalCDN"
    },{
      "id":13,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"ControlPanelFunc"
    },{
      "id":50,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"/favicon.ico",
      "variable":"FavIcon"
    },{
      "id":10,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"DeviceDrawFunc"
    },{
      "id":18,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"Volume"
    },{
      "id":42,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"[]",
      "variable":"Timers"
    },{
      "id":45,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"VariablesToSend"
    },{
      "id":44,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"VariablesToWatch"
    },{
      "id":2,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"\"0-0\"",
      "variable":"WorkflowAltuiid"
    },{
      "id":46,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"RemoteVariablesToWatch"
    },{
      "id":41,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"GoogleLastError"
    },{
      "id":23,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"https://hirwatech.com/veralogin/Veralogin.php",
      "variable":"RemoteAccess"
    },{
      "id":40,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"0",
      "variable":"EnableMachineLearning"
    },{
      "id":39,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"0",
      "variable":"PendingReset"
    },{
      "id":22,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"/data_request?id=lr_ALTUI_Handler&command=home",
      "variable":"LocalHome"
    },{
      "id":4,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"\"\"",
      "variable":"TransitionId"
    },{
      "id":25,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"ImagePath"
    },{
      "id":19,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"groupDevices"
    },{
      "id":26,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"BackgroundImg"
    },{
      "id":5,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"Url"
    },{
      "id":37,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"[]",
      "variable":"Data_CustomPages_0"
    },{
      "id":21,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"v2.26",
      "variable":"Version"
    },{
      "id":35,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"1500,60",
      "variable":"CtrlOptions"
    },{
      "id":33,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"[]",
      "variable":"WorkflowsActiveState"
    },{
      "id":1,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"0",
      "variable":"Debug"
    },{
      "id":32,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"0",
      "variable":"EnableWorkflows"
    },{
      "id":49,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"3.3.1",
      "variable":"SWVersion"
    },{
      "id":31,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"LocalBootstrap"
    },{
      "id":43,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"{\"Vera@192.168.20.112\":{\"url\":\"http://127.0.0.1:3480/data_request?id=lr_HTTP_VeraBridgeMirror_192.168.20.112\",\"callback\":\"\",\"parameters\":[{\"key\":\"mirror\",\"type\":\"text\",\"default\":\"device.serviceId.name\",\"label\":\"Mirror\"}]},\"IFTTT\":{\"url\":\"\",\"callback\":\"sendValueToStorage_ifttt\",\"parameters\":[{\"type\":\"text\",\"key\":\"webhookkey\",\"label\":\"Web Hook Key\"},{\"default\":\"vera_data_published\",\"type\":\"text\",\"key\":\"eventname\",\"label\":\"Hook Event Name\"}]},\"emoncms\":{\"url\":\"\",\"callback\":\"sendValueToStorage_emoncms\",\"parameters\":[{\"default\":1,\"type\":\"number\",\"key\":\"nodeid\",\"label\":\"Node ID\"},{\"type\":\"number\",\"key\":\"feedid\",\"label\":\"Feed ID\"},{\"type\":\"text\",\"key\":\"inputkey\",\"label\":\"Input Key name\"},{\"type\":\"text\",\"key\":\"readwritekey\",\"label\":\"Read/Write API Key\"},{\"type\":\"url\",\"key\":\"graphicurl\",\"label\":\"Graphic Url\",\"ifheight\":460,\"default\":\"http://emoncms.org/vis/realtime?feedid={1}&embed=1&apikey={3}\"}]},\"thingspeak\":{\"url\":\"\",\"callback\":\"sendValueToStorage_thingspeak\",\"parameters\":[{\"type\":\"number\",\"key\":\"channelid\",\"label\":\"Channel ID\"},{\"type\":\"text\",\"key\":\"readkey\",\"label\":\"Read API Key\"},{\"type\":\"text\",\"key\":\"writekey\",\"label\":\"Write API Key\"},{\"default\":1,\"type\":\"number\",\"key\":\"fieldnum\",\"label\":\"Field Number\"},{\"default\":\"//api.thingspeak.com/channels/{0}/charts/{3}?key={1}&width=450&height=260&results=60&dynamic=true\",\"type\":\"url\",\"key\":\"graphicurl\",\"label\":\"Graphic Url\"}]}}",
      "variable":"DataStorageProviders"
    },{
      "id":9,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"ScriptFile"
    },{
      "id":17,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"Message"
    },{
      "id":27,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"ExtraController"
    },{
      "id":15,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"Name"
    },{
      "id":38,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"emoncms.org",
      "variable":"EmonCmsUrl"
    },{
      "id":36,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"VoiceRSS_KEY"
    },{
      "id":7,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"{}",
      "variable":"PluginConfig"
    },{
      "id":20,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"true",
      "variable":"UI7Check"
    },{
      "id":11,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"StyleFunc"
    }],
    "status":-1,
    "tooltip":{"display":"0"}
  },
  "LoadTime":1526515010,
  "LocalTime":"2018-05-17 09:57:46 D",
  "Mode":1,
  "TimeStamp":1526565466,
  "UserData_DataVersion":515017916,
  "alerts":[]
}
Title: Re: Trouble installing openLUUP
Post by: bruring on May 17, 2018, 11:42:15 am
Great!

Adding {} in the value field of PluginConfig also worked for me.

Code: [Select]
      "id":7,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"{}",
      "variable":"PluginConfig"

Thanks everyone for helping out.
Title: Re: Trouble installing openLUUP
Post by: bruring on May 20, 2018, 04:25:51 am
So everything is all up and running. I've used VeraBridge to clone everything from my main Vera to openLuup.

There is a problem though, and I'm not sure if it's originating from openLuup, AltUI or VeraBridge.
All devices and scenes show up. Devices show battery status and other information, pulled from the main Vera.

The devices don't show controls, though. There are no on/off switches or sliders for the dimmers, for example. I've checked the device configuration and dimmers correctly have the device_file D_DimmableLight1.xml.

When I run a scene that changes dimmable lights, it works. I only don't get the controls in the UI. I've tried with different browsers but no luck.
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 20, 2018, 04:32:01 am
Goto altui device setting panel and press reset button
Plugin config must then be filled with a big json structure.
After that reload LUUP

Also note I am not sure about Vera bridge side effect in case there is also a altui device on the vera.
Between openluup and Vera , make sure you configure the openluup one is openluup is your main controller ( controlleur 0 )
Title: Re: Trouble installing openLUUP
Post by: bruring on May 20, 2018, 04:56:21 am
Hi amg0,

Thanks for helping out. I resetted AltUI, and indeed plugin config got filled with a big json structure.
Then I reloaded LUUP, but this didn't fix the problem.

I've checked the log files, and it seems the device XML file's can't be found (small snippet):
Code: [Select]
2018-05-20 10:54:21.485   openLuup.chdev:: ERROR: unable to read XML file D_SceneController1.xml
2018-05-20 10:54:21.485   luup.create_device:: [10157] D_SceneController1.xml /  /
2018-05-20 10:54:21.485   openLuup.chdev:: ERROR: unable to read XML file D_DimmableLight1.xml
2018-05-20 10:54:21.485   luup.create_device:: [10165] D_DimmableLight1.xml /  /
2018-05-20 10:54:21.485   openLuup.chdev:: ERROR: unable to read XML file D_SceneController1.xml
2018-05-20 10:54:21.485   luup.create_device:: [10170] D_SceneController1.xml /  /
2018-05-20 10:54:21.485   openLuup.chdev:: ERROR: unable to read XML file D_CountdownTimer1.xml
2018-05-20 10:54:21.485   luup.create_device:: [10171] D_CountdownTimer1.xml /  /
2018-05-20 10:54:21.485   openLuup.chdev:: ERROR: unable to read XML file D_CountdownTimer1.xml
2018-05-20 10:54:21.485   luup.create_device:: [10172] D_CountdownTimer1.xml /  /
2018-05-20 10:54:21.486   openLuup.chdev:: ERROR: unable to read XML file D_Siren1.xml
2018-05-20 10:54:21.486   luup.create_device:: [10173] D_Siren1.xml /  /

Edit: also, I don't have altUI running on my main Vera.

Edit 2: After choosing "download files" in the VeraBridge plugin, the /files directory got propagated with all the device xml files. Everything is working now!
Title: Re: Trouble installing openLUUP
Post by: parkerc on May 24, 2018, 03:58:14 pm
Hi

Just installed openLuup on Debian 9, and I get the same error mentioned earlier when I access it via 192.168.1.122:3480/data_request?id=lr_ALTUI_Handler&command=home%23

Code: [Select]
error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2306: attempt to index local 'tbl' (a nil value
Please can someone confirm exactly what file in /cmd_ludl/ I need to edit (to add {} etc.) as I can see that is not present via 192.168.1.122:3480/data_request?id=status&output_format=xml&DeviceNum=3

Code: [Select]
    },{
      "id":7,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"",
      "variable":"PluginConfig"
    },{
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 24, 2018, 04:37:15 pm
1) stop openLuup
2) edit user_data.json and update the value below (save a copy before editing):
Code: [Select]
      "id":7,
      "service":"urn:upnp-org:serviceId:altui1",
      "value":"{}",
      "variable":"PluginConfig"
3) start up openLuup
Title: Re: Trouble installing openLUUP
Post by: rafale77 on May 24, 2018, 04:49:16 pm
I found the trouble spot. in the userdata.lua file, in the device_table function:

edit the line:

Code: [Select]
        value = item.value or {},
I will submit to akbooer on github
Title: Re: Trouble installing openLUUP
Post by: parkerc on May 24, 2018, 05:15:50 pm
Thanks all

Some quick questions

How do I stop/start openLuup, when I can?t access the UI?
@rafale77 My userdata.lua file only has 617 lines?
I found the trouble spot. in the userdata.lua file, in the device_table function:

edit the line:

Code: [Select]
        value = item.value or {},
I will submit to akbooer on github
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 24, 2018, 05:27:02 pm
This will stop it:
Code: [Select]
http://127.0.0.1:3480/data_request?id=exit(Change IP if not local.)  Start it just as you did initially.
Title: Re: Trouble installing openLUUP
Post by: parkerc on May 24, 2018, 05:31:16 pm
thanks @jswim788

To start (restart) openLuup, I?ve just rebooted the machine.

Is that the only way ?

UPDATE - I?ve updated the value and rebooted, but unfortunately now I?m unable to access anything, all previous urls are now showing they?re unable to connect?
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 24, 2018, 05:40:47 pm
There's a script that's included called openLuup_reload.  That will start it up.

But if a reboot starts it, then you must have added it to systemd or init.d or rc.local already?

See page 19 of akbooer's documentation (https://github.com/akbooer/openLuup/blob/master/Documentation/openLuup%20User%20Guide.pdf)
Title: Re: Trouble installing openLUUP
Post by: rafale77 on May 24, 2018, 06:30:51 pm
Thanks all

Some quick questions

How do I stop/start openLuup, when I can?t access the UI?
@rafale77 My userdata.lua file only has 617 lines?
I found the trouble spot. in the userdata.lua file, in the device_table function:

edit the line:

Code: [Select]
        value = item.value or {},
I will submit to akbooer on github

Yeah sorry I edited my post to remove the line number, I am working off of the development branch so the line number is not accurate. When AK comes back hopefully he will merge into the main branch and release a new version.

Also I just looked and the released master you should be getting should be on line 688 and there should be 786 lines in that file...
Title: Re: Trouble installing openLUUP
Post by: parkerc on May 25, 2018, 03:40:08 am
Thanks all again

Im still missing something here, how do I run openLuup_reload  from the command Line to restart it - see below (im afraid. i dont have much Linux experience  :( )?

Quote
root@debian:/home/qwerty/cmh-ludl# ls
backup            I_ALTUI.xml                      J_ALTUI_b_en.js                       J_ALTUI.js           J_ALTUI_uimgr.js      L_ALTUI_LuaRunHandler.lua  trash.          D_ALTUI.json      icons                            J_ALTUI_b_fr.js                       J_ALTUI_loc_es.js    J_ALTUI_upnp.js       latest.tar.gz              user_data (copy).json.            D_ALTUI_UI7.json  images                           J_ALTUI_b_it.js                       J_ALTUI_loc_fr.js    J_ALTUI_utils.js      logs                       user_data.json
D_ALTUI.xml       index.html                       J_ALTUI_b_javascript_compressed.js    J_ALTUI_loc_it.js    J_ALTUI_verabox.js    openLuup                   www
dkjson.lua        J_ALTUI_api.js                   J_ALTUI_b_lua_compressed.js           J_ALTUI_loc_nl.js    L_ALTUI_compress.lua  openLuup_install.lua
files             J_ALTUI_b_blockly_compressed.js  J_ALTUI_iphone.js                     J_ALTUI_multibox.js  L_ALTUIjson.lua       openLuup_reload
I_ALTUI-old.xml   J_ALTUI_b_blocks_compressed.js   J_ALTUI_jquery.ui.touch-punch.min.js  J_ALTUI_plugins.js   L_ALTUI.lua           S_ALTUI.xml

root@debian:/home/qwerty/cmh-ludl# openLuup_reload
bash: openLuup_reload: command not found
root@debian:/home/qwerty/cmh-ludl# su openLuup_reload
No passwd entry for user 'openLuup_reload'
root@debian:/home/qwerty/cmh-ludl# su
root@debian:/home/qwerty/cmh-ludl# openLuup_reload
bash: openLuup_reload: command not found
root@debian:/home/qwerty/cmh-ludl#
Title: Re: Trouble installing openLUUP
Post by: rafale77 on May 25, 2018, 03:50:25 am
try entering this command:

Code: [Select]
./openLuup_reload
This is because it is a shell script
Title: Re: Trouble installing openLUUP
Post by: jswim788 on May 25, 2018, 11:22:49 am
The reason you need the ./ form is that the current directory is not in your PATH.  And that is for good reason - it keeps you from inadvertently executing a program in an unexpected and possibly insecure location.  You can add '.' to your PATH so it is there if you wish.  And you can see what your PATH by this: echo $PATH
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on May 25, 2018, 12:06:48 pm
I'm also installing on debian 9, and i can access the altUI console locally, but when i try using another computer, it stalls on "Waiting Initial Data".

I tailed the LuaUPnP.log, and see a "openluup.servlet:: file not found:J_ALTUI_loc_nb.js"

any suggestions?
Title: Re: Trouble installing openLUUP
Post by: rafale77 on May 25, 2018, 12:13:19 pm
This looks like an ALTUI installation problem. Do you actually have this file in your openLuup folder?

Edit: It maybe a typo... I don't know of a country acronym with nb... What country are you in?
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 25, 2018, 02:52:48 pm
I'm also installing on debian 9, and i can access the altUI console locally, but when i try using another computer, it stalls on "Waiting Initial Data".

I tailed the LuaUPnP.log, and see a "openluup.servlet:: file not found:J_ALTUI_loc_nb.js"

any suggestions?

note sur what country nb is but that is not offered (yet).  it should fall back automatically to english
if you want you can copy one of the J_ALTUI_loc_xx.js and make a 'nb' translation then have that file on your vera and it should then work
if you cant you can contribute that file into the normal release.  in that case I would include it in the github repo
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on May 25, 2018, 05:31:48 pm
Aha, if its a language file its looking for its "Norwegian Bokmal(which is one of two written languages)". I set the regional settings in debian to this to get the time right. I'll revert to english and manual time adjustment.

Not sure why Altui looks for this? I prefer english language in any case for the system..
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on May 25, 2018, 06:13:22 pm
that didnt work, it seems like it looks for it on the basis of the connecting computers regional settings? I Installed AltUI now on the VeraPlus, and I encounter the same problem if i type <IP>:3480 there too.  Maybe te "revert to english" doesnt work with the latest release?
Title: Re: Trouble installing openLUUP
Post by: a-lurker on May 25, 2018, 08:27:38 pm
On a Vera with more recent firmware you need to use:

http://<IP_ADDRESS>/port_3480/data_request?id=lr_ALTUI_Handler&command=home#
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 26, 2018, 02:40:09 am
that didnt work, it seems like it looks for it on the basis of the connecting computers regional settings? I Installed AltUI now on the VeraPlus, and I encounter the same problem if i type <IP>:3480 there too.  Maybe te "revert to english" doesnt work with the latest release?

It is based on client side language preference (browser)
Adding &lang=XX in the url forces a language. You can Use the setting tab to prepare your home url.
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 26, 2018, 02:41:58 am
On a Vera with more recent firmware you need to use:

http://<IP_ADDRESS>/port_3480/data_request?id=lr_ALTUI_Handler&command=home#
Yes !!! Vera and openluup need different url.
port_3480 For Vera
:3480 for openluup
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on May 26, 2018, 03:43:37 am
Yes, i tried them both. anyway, the "&lang=en" did the trick. :) Thanks for all the help guys! Now to other new issues. ;)
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on May 26, 2018, 10:09:51 am
Well, i have to correct my previous statement. "&lang=en" didnt work, i thought it did because i logged on with a win10 pc with english settings in OS.

I think the problem might be the "revert to english" function, as a walkaround i could mabye make a norwegian version, but that is a lot of work, and i don't really want it in norwegian either..
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 26, 2018, 02:18:37 pm
Well, i have to correct my previous statement. "&lang=en" didnt work, i thought it did because i logged on with a win10 pc with english settings in OS.

I think the problem might be the "revert to english" function, as a walkaround i could mabye make a norwegian version, but that is a lot of work, and i don't really want it in norwegian either..

What is exactly your setup ?
Client and server side ?

What is also the exact url that you use to open altui ?
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on May 27, 2018, 09:46:33 am
Beaglebone xM running Debian 9.3.

My laptop is Win10 english language, connects fine with the standard link to altui.

My desktop is Win19 Norwegian "bokmal" language, connection problems with standard altui link, and when adding "&lang=en" to the end of the link.

Is there any logs i can provide to figure this out?
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 27, 2018, 10:41:43 am
Beaglebone xM running Debian 9.3.

My laptop is Win10 english language, connects fine with the standard link to altui.

My desktop is Win19 Norwegian "bokmal" language, connection problems with standard altui link, and when adding "&lang=en" to the end of the link.

Is there any logs i can provide to figure this out?

Yes first what is the exact url you use to open altui ?
Second, open console JavaScript log ( CTRL J ) on chrome and force a browser refresh ( CTRL F5 ) then share the log seen in the console.
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on May 27, 2018, 01:08:03 pm
URL:
Code: [Select]
http://2.70.50.7:3480/data_request?id=lr_ALTUI_Handler&command=home#
Log screenshot attached.
Title: Re: Trouble installing openLUUP
Post by: amg0 on May 27, 2018, 03:12:22 pm
URL:
Code: [Select]
http://2.70.50.7:3480/data_request?id=lr_ALTUI_Handler&command=home#
Log screenshot attached.
Sorry the log is not readable can you repost ?

could you also try the url
http://2.70.50.7:3480/data_request?id=lr_ALTUI_Handler&command=home&lang=en
Title: Re: Trouble installing openLUUP
Post by: Buxton on May 27, 2018, 07:51:48 pm
Is 2.70.50.7 the correct IP address?  The address seems to be assigned to the public network in Sweden.  I would think that the URL should be a private address.
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on May 27, 2018, 11:36:56 pm
The picture looks fine here if you click on it to expand?
Im going abroad for a week, ill try the New link when i get back.

The IP is a local IP, not exposed to the outside.  :)
Title: Re: Trouble installing openLUUP
Post by: Forzaalfa on June 04, 2018, 01:54:06 am
I tested the link Amg0 posted, and that works fine. If i press Home, it tries its default login link, which still doesnt work.

I'll try to repost the log from chrome later.
Title: Re: Trouble installing openLUUP
Post by: akbooer on July 22, 2018, 12:13:59 pm
Now, when I access http://172.20.1.70:3480, it redirects to http://172.20.1.70:3480/data_request?id=lr_ALTUI_Handler&command=home# and I get the following error:

Code: [Select]
error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)


This issue (eventually) properly solved in the latest development commit (v18.7.22)

Actually, quite an obscure root cause (caused by me in the v18.3.18 release), so apologies for the inordinately long time to fix.
Title: Re: Trouble installing openLUUP
Post by: d55m14 on August 06, 2018, 06:30:55 am
Now, when I access http://172.20.1.70:3480, it redirects to http://172.20.1.70:3480/data_request?id=lr_ALTUI_Handler&command=home# and I get the following error:

Code: [Select]
error in callback [lr_ALTUI_Handler] : [string "L_ALTUI.lua"]:2310: attempt to index local 'tbl' (a nil value)


This issue (eventually) properly solved in the latest development commit (v18.7.22)

Actually, quite an obscure root cause (caused by me in the v18.3.18 release), so apologies for the inordinately long time to fix.

Hi akbooer,

I'm installing a new server with openluup and I get the same error. Can I install the version in Development ?

tnks

donato
Title: Re: Trouble installing openLUUP
Post by: akbooer on August 06, 2018, 12:20:26 pm
Yes, the development version fixed this error a while ago.  However, you'd have to update your files manually, or change the install script, since by default it takes its files from the master directory.

If that's too difficult I could try patching the master release.

I plan a new master release shortly, but I'm not quite ready for that.  Sorry for the inconvenience.

Title: Re: Trouble installing openLUUP
Post by: d55m14 on August 06, 2018, 05:02:23 pm
Hi akbooer,

tnks for your reply, I modified the link from master branch to development one in the install lua .

now the installation is ok.


donato
Title: Re: Trouble installing openLUUP
Post by: akbooer on August 06, 2018, 05:37:03 pm
Excellent news, thanks!
Title: Re: Trouble installing openLUUP
Post by: d55m14 on December 04, 2018, 09:54:06 am
Hi akbooer,

I received an error trying to install openLuup on Rpi

Attached a screen-copy.

Have you any idea ?

tnks

Title: Re: Trouble installing openLUUP
Post by: reneboer on December 05, 2018, 06:46:19 am
Hi,

Have you first updated all software on your PI? (sudo apt-get update , sudo apt-get upgrade, and the LUA libs in the manual).

I just installed it on a PI3B+ without a hitch using the LUA script. I did not specify the specific lua version. I.e. I typed lua openluup_install.lua.

Cheers Rene
Title: Re: Trouble installing openLUUP
Post by: akbooer on December 05, 2018, 11:00:33 am
Have you first updated all software on your PI? (sudo apt-get update , sudo apt-get upgrade, and the LUA libs in the manual).

Yes, that would be my advice too. 

Thanks @reneboer