We have moved at community.getvera.com

Author Topic: Trouble installing openLUUP  (Read 3155 times)

Offline bruring

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +2/-0
  • Why not automate everything?
Trouble installing openLUUP
« 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!
Trying to make my house smarter than myself since 2012.
Vera Lite & Vera Edge UI7, 15x Fibaro, 10x Aeotec, 6x Zwave.Me, 3x GreenWave, 3x TKBHome, 1x Y-CAM, 1x Netatmo, Logitech Harmony, Google Home. ESXi with pfSense, openLuup, AltUI, Grafana and Vera Concierge amongst others.

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 872
  • Karma: +66/-8
Re: Trouble installing openLUUP
« Reply #1 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.
« Last Edit: May 07, 2018, 08:51:12 pm by a-lurker »

Offline bruring

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +2/-0
  • Why not automate everything?
Re: Trouble installing openLUUP
« Reply #2 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?
Trying to make my house smarter than myself since 2012.
Vera Lite & Vera Edge UI7, 15x Fibaro, 10x Aeotec, 6x Zwave.Me, 3x GreenWave, 3x TKBHome, 1x Y-CAM, 1x Netatmo, Logitech Harmony, Google Home. ESXi with pfSense, openLuup, AltUI, Grafana and Vera Concierge amongst others.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Trouble installing openLUUP
« Reply #3 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.
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Trouble installing openLUUP
« Reply #4 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.

Offline bruring

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +2/-0
  • Why not automate everything?
Re: Trouble installing openLUUP
« Reply #5 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.
« Last Edit: May 10, 2018, 05:07:56 am by bruring »
Trying to make my house smarter than myself since 2012.
Vera Lite & Vera Edge UI7, 15x Fibaro, 10x Aeotec, 6x Zwave.Me, 3x GreenWave, 3x TKBHome, 1x Y-CAM, 1x Netatmo, Logitech Harmony, Google Home. ESXi with pfSense, openLuup, AltUI, Grafana and Vera Concierge amongst others.

Offline amg0

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Trouble installing openLUUP
« Reply #6 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)

Offline bruring

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +2/-0
  • Why not automate everything?
Re: Trouble installing openLUUP
« Reply #7 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?
Trying to make my house smarter than myself since 2012.
Vera Lite & Vera Edge UI7, 15x Fibaro, 10x Aeotec, 6x Zwave.Me, 3x GreenWave, 3x TKBHome, 1x Y-CAM, 1x Netatmo, Logitech Harmony, Google Home. ESXi with pfSense, openLuup, AltUI, Grafana and Vera Concierge amongst others.

Offline amg0

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3174
  • Karma: +209/-8
Re: Trouble installing openLUUP
« Reply #8 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)

Offline bruring

  • Jr. Member
  • **
  • Posts: 63
  • Karma: +2/-0
  • Why not automate everything?
Re: Trouble installing openLUUP
« Reply #9 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?
Trying to make my house smarter than myself since 2012.
Vera Lite & Vera Edge UI7, 15x Fibaro, 10x Aeotec, 6x Zwave.Me, 3x GreenWave, 3x TKBHome, 1x Y-CAM, 1x Netatmo, Logitech Harmony, Google Home. ESXi with pfSense, openLuup, AltUI, Grafana and Vera Concierge amongst others.

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Trouble installing openLUUP
« Reply #10 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.


Offline flaquito

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +5/-0
Re: Trouble installing openLUUP
« Reply #11 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

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Trouble installing openLUUP
« Reply #12 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)

Offline flaquito

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +5/-0
Re: Trouble installing openLUUP
« Reply #13 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)

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Trouble installing openLUUP
« Reply #14 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.