Author Topic: Scene LUA line or character limit?  (Read 493 times)

Offline tbrock47

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +1/-1
Scene LUA line or character limit?
« on: January 02, 2018, 03:48:25 pm »
I've successfuly created multiple scenes that essentially run only LUA code to operate.
I recently expanded one of my scripts which is now 85 lines long, however, the scene no longer functions.
When i test the script in chunks it works fine, but when it is all put together, it fails.

This leads me to belive that my script is too long for the VeraPlus to handle. Is there some unwritten limit that I have exceeded?
Apologies if this has been addressed, as I couldn't find any results searching around.

Online akbooer

  • Master Member
  • *******
  • Posts: 5972
  • Karma: +258/-69
  • "Less is more"
Re: Scene LUA line or character limit?
« Reply #1 on: January 02, 2018, 04:38:39 pm »
Yes, I believe this is true.

There's no need to have all this code in one piece.  By far the easiest thing is to split it into library modules and use require to include them at startup.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline tbrock47

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +1/-1
Re: Scene LUA line or character limit?
« Reply #2 on: January 02, 2018, 04:42:55 pm »
I assume you are talking about putting the code into actual module files?
How do I save these files with my code?
Can you link me to a tutorial or wiki?

Online akbooer

  • Master Member
  • *******
  • Posts: 5972
  • Karma: +258/-69
  • "Less is more"
Re: Scene LUA line or character limit?
« Reply #3 on: January 02, 2018, 05:50:23 pm »
Do you know how to use ssh or putty?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline tbrock47

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +1/-1
Re: Scene LUA line or character limit?
« Reply #4 on: January 02, 2018, 06:13:05 pm »
I do.

Offline tbrock47

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +1/-1
Re: Scene LUA line or character limit?
« Reply #5 on: January 02, 2018, 06:40:56 pm »
And as an update, it looks like its a character limit, not a line limit. And this character limit also includes comments.
Unsure what the exact limit it however.

Online akbooer

  • Master Member
  • *******
  • Posts: 5972
  • Karma: +258/-69
  • "Less is more"
Re: Scene LUA line or character limit?
« Reply #6 on: January 03, 2018, 11:01:36 am »
Lua files, written as modules, can be transferred to /etc/cmh-ludl/ and then accessed through the require statement.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10070
  • Karma: +761/-141
Re: Scene LUA line or character limit?
« Reply #7 on: January 03, 2018, 06:53:56 pm »
This is a BUG in Vera.
Early in UI7 I pushed Vera to accept POST commands for most of their requests.
It took a few releases for them to get that right ... its working now.
The nice thing about a POST request is there is NO size limit.
A GET request, what they mostly use, has a LINE LENGTH limit.

See:
http://forum.micasaverde.com/index.php/topic,33226.0.html

Offline tbrock47

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +1/-1
Re: Scene LUA line or character limit?
« Reply #8 on: January 07, 2018, 03:20:48 pm »
Awesome info. Thanks for the help!