Author Topic: Error in Lua Startup, cannot find the code anywhere  (Read 571 times)

Offline Pendragon

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Error in Lua Startup, cannot find the code anywhere
« on: April 01, 2018, 08:50:08 am »
Hello!
I have problems with my Vera and found out that there is this error in the LuaUPnP.log.

01      04/01/18 14:41:10.838   LuaInterface::LoadCode: [string "function scene_1()..."]:89: 'end' expected (to close 'if' at line 84) near 'return' <0x7703a000>
01      04/01/18 14:41:10.892   JobHandler_LuaUPnP::Run cannot start lua with code:
function scene_1()
...

However, I have no idea, where is code is. I wrote it some time agao :-(
How can I find it? Is there a lua file where the startup code is?

Thanks, Stefan

Offline jswim788

  • Hero Member
  • *****
  • Posts: 788
  • Karma: +57/-2
Re: Error in Lua Startup, cannot find the code anywhere
« Reply #1 on: April 02, 2018, 11:41:44 pm »
In UI5: APPS --> Develop Apps --> Edit Startup Lua

Maybe something similar for UI7?  That's assuming that you can get to the UI to do something.

Offline reneboer

  • Hero Member
  • *****
  • Posts: 1380
  • Karma: +79/-30
Re: Error in Lua Startup, cannot find the code anywhere
« Reply #2 on: April 03, 2018, 06:44:41 am »
Hi,

On UI7 look at the list of Scenes. It includes a scene ID. The one with number 1 looks to be the culprit. I heard that large bits of code in a scene can have issues to edit in UI7. Try ALTUI to fix the scene's LUA code.

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline Pendragon

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Error in Lua Startup, cannot find the code anywhere
« Reply #3 on: April 06, 2018, 12:50:47 pm »
In UI5: APPS --> Develop Apps --> Edit Startup Lua

Maybe something similar for UI7?  That's assuming that you can get to the UI to do something.

This part is empty, I don't have any code here

Offline Pendragon

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Error in Lua Startup, cannot find the code anywhere
« Reply #4 on: April 06, 2018, 12:52:10 pm »
Hi,

On UI7 look at the list of Scenes. It includes a scene ID. The one with number 1 looks to be the culprit. I heard that large bits of code in a scene can have issues to edit in UI7. Try ALTUI to fix the scene's LUA code.

Cheers Rene

In the scene with id:1 I've got 11 lines of code. What is ALTUI, I've never heard this...

Offline jswim788

  • Hero Member
  • *****
  • Posts: 788
  • Karma: +57/-2
Re: Error in Lua Startup, cannot find the code anywhere
« Reply #5 on: April 06, 2018, 01:04:34 pm »
ALTui is an alternative user interface to the Vera.  See http://forum.micasaverde.com/index.php/board,78.0.html

It's very nice with lots of great features.  Check out the 'read me first' post.

Offline kartcon

  • Full Member
  • ***
  • Posts: 158
  • Karma: +7/-0
Re: Error in Lua Startup, cannot find the code anywhere
« Reply #6 on: April 06, 2018, 07:51:02 pm »
Please post the 11 lines of code from scene #1. if there are calls to functions or other routines, the parser will reference the entire code block. So the 11 lines of obvious code may, in fact, be much larger, thus the reason that line #84 is tagged as the culprit. There are also some other techniques to help sort things out, but without knowing what the code does, its difficult to offer suggestions.