Tools for developing Plugins

Hi,

i?ve got a general question about developing plugins for vera.

1.) Which tools or IDEs do you use?
I?m developing with the Lua Development Tools on a Windows machine with LuaForWindows5.1. There you have a nice debugger and you can change value
of variables during debugging. But there is a big disadvantage, you cant call luup functions.

2.)Is there a Luup Package for windows or linux?

The described way of debugging in the documentation is not really useful. Is there a better way? How does mcv develop their software?

Thanks

I’ve used a mishmash of things to figure out how to program in Lua and make plugins for the Vera 3.

I like Notepad++ with the Lua plugin, since it is an easy program to edit in. There is a slew of other plugins for it as well, like XML, etc.

For XML, I actually have a program I had to get for a class I took a while ago. The program is called EditiX. Has a ton of features for XML.

I also have two other programs installed, but have only played with one – SciTE and LuaEdit 2010. SciTE is the more powerful of the two Lua IDEs, and LuaEdit 2010 is pretty buggy. I’ve used LuaEdit 2010 to tell me where my Lua code was messed up when getting errors on the Vera 3.

There is a LuaUPnP implementation out there, but it is listed more as a proof of concept (at least that it was it says on main page):

[url=https://github.com/Tieske/LuaUPnP]https://github.com/Tieske/LuaUPnP[/url]

There is a place on the Wiki where it says that at one time, you could run the Lua interpreter on a Windows machine and have your Vera connect to it for debugging. [url=http://wiki.micasaverde.com/index.php/Windows_LuaUPnP]http://wiki.micasaverde.com/index.php/Windows_LuaUPnP[/url]

Problem is, the file linked isn’t available anymore – clicking on it returns an error.

Most of the development is noting more than scouring the internet, pulling apart code from other plugins, and good old trial and error.

Good luck.

I find SciTE/Lua for Windows very useful for getting basic Lua code working. It will not, of course, let you debug luup calls. Actually, you can really only debug luup calls on a working Vera that will give the correct responses so it’s doubtful that any external tool will be much help.

Notepad++ is great for editing the xml files for plugins. Note that Lua embedded in I_.xml must conform to xml syntax rules. The statement If I < 10 then … will fail because the < has special meaning in xml syntax. The simple solution is to use If 10 > I then …

You can debug chunks of Lua with luup calls by adding copious luup.log("X = " … X) statements to write important values to the log. You can paste the code into APPS, Develop Apps, Test Luup code (Lua) and hit Go. Note that if your code returns false, it will be flagged as Code failed even if the syntax is perfect.

Even if you check all your Lua beforehand, getting a plugin to work will require a certain amount of trial and error. You will need to inspect the log carefully following a restart as any issues with your I_.xml will probably cause its startup process to fail. The error messages are not terrifically helpful but the indicated line number will be close to where the error really is. Once you get the startup process working, errors in your action code will also get logged and point you to the right area of your code.

If you don’t already have it, get the excellent Info Viewer plugin. [url=http://forum.micasaverde.com/index.php/topic,13477.msg119081.html#msg119081]http://forum.micasaverde.com/index.php/topic,13477.msg119081.html#msg119081[/url]. The recent 0.54 update makes viewing the log much easier. It also includes XML Validator and JSONLint which are really useful for checking plugin files before uploading.

check here [url=http://wiki.micasaverde.com/index.php/Category:Development]http://wiki.micasaverde.com/index.php/Category:Development[/url]
you could also run a linux version of the lua tools on the vera itself but it kinda lacks space on the memchip .
the windows luaupnp doesnt work anymore as it is for UI4
nice tool Archived Projects | The Eclipse Foundation

I am using Notepad++ for ?diting lua and XML files.
For debugging, I simply deploy the updated files on the Vera and reload. I use logs to help debugging. Very “old school” way to debug !

I just escape all the"special" characters in XML when I put the Lua code in the implementation file.

[code]" = "
’ = '
< = <

= >
& = &[/code]

[quote=“lolodomo, post:5, topic:176138”]I am using Notepad++ for ?diting lua and XML files.
For debugging, I simply deploy the updated files on the Vera and reload. I use logs to help debugging. Very “old school” way to debug ![/quote]

I more or less do that, unless I get stuck, then I fire up the Lua editors and run the code to see where the error lies. I know the code is syntactically correct when I get an error looking for all the external dependencies and asking me if I wish to continue to run or abort.

[quote=“SOlivas, post:6, topic:176138”][quote=“lolodomo, post:5, topic:176138”]I am using Notepad++ for ?diting lua and XML files.
For debugging, I simply deploy the updated files on the Vera and reload. I use logs to help debugging. Very “old school” way to debug ![/quote]I more or less do that, unless I get stuck, then I fire up the Lua editors and run the code to see where the error lies. I know the code is syntactically correct when I get an error looking for all the external dependencies and asking me if I wish to continue to run or abort.[/quote]+1 :wink:

There is now a new Lua IDE that runs on your PC but executes the code on Vera. In this way it is not necessary to simulate LuuP calls because they are executed on Vera. I have used it and it is so good to be able to step through your code on Vera. Have a look at MiCasaVerde/Vera debugging and integration with ZeroBrane Studio - YouTube

The video looks fantastic. However, I just installed version 0.39 and the interpreter “MCV Vera/Lua” shown on the vidio is nowhere to be found? Did I miss something?

The integration shown in the demo is not available as part of the ZeroBrane Studio. It will be available as a separate product. I’m finishing up the documentation and couple of other things and expect it to be release later this week. Please let me know if I can answer any other questions.

Paul.

This has been coming soon for quite a while. It looks great but I’m anticipating a price…

Actually, guys. I have a copy of it. I’ve been beta testing a version for the author. It is actually pretty good.

The author is looking to having it available soon.

Between work and now getting stuck messing with the bitcoin fad, I’ve been neglecting my HA hobby.

Anyways, the author is looking at starting around $60 USD for the initial price.

@RexBeckett, I just posted the announcement here: http://forum.micasaverde.com/index.php/topic,17780.0.html; hope it’s worth the wait. SOlivas, thank you for your help!