Author Topic: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices  (Read 28178 times)

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Hi twostep, jasperhb, RexBeckett, and others,

Thank you for your interest in ZeroBrane Studio integration with Vera. I'm pleased to announce that the product is available for purchase and download at http://studio.zerobrane.com/vera.html. I know, it's been coming soon for several weeks, but I wanted to make sure I incorporate all the feedback from the early users and provide documentation that will make it easier to start using the product.

I'd like to thank all the beta testers, who not only took time to test the product and provide their feedback, but also reviewed and updated the documentation.

I'll briefly go over its features to provide a summary for those who may be new to the product. The main aspect that should be of interest to most of you is the debugging on the device. You can run Lua code from the IDE and make it execute on the device; not only that, but you can also step through the code, look at the stack and variables, run any Lua and luup commands in the remote console, modify variables there and more.

You can also initiate debugging from the device, which allows to debug Lua code running as part of scenes or plugins. It is setup a bit differently from the "regular" debugging you initiate from the IDE, but otherwise provides access to the same functions (stepping, breakpoints, remote console, and everything else).

The IDE also provides auto-complete and tooltips for Luup functions, support for editing XML files, and ability to upload files to the device, download LuaUPnP.log, and restart the Luup engine on the device.

There are two more things that may help with debugging and troubleshooting Lua scripts. You can use print() expressions when debugging and their result will be redirected to the Output window in the IDE. This is a lightweight alternative to luup.log calls. Not only that, but the output is going to be pretty-printed, which means that print(mytable) will print the table content. You can also use pretty printing in several other places in the IDE, for example, in the Console and in the Watch window.

The last thing I'll mention is the code analyzer that checks your code for typos and subtle errors.

Onto the pricing. The current introductory price includes 40% discount that is likely to be available through the holidays till the end of the year. You can choose between non-commercial (hobby and learning) and commercial options. I also have subscription plans for those who need work with more than one device. If you need any special arrangements, you can email me at support@zerobrane.com.

Please let me know if you have any questions/suggestions or come across any issues; I'll keep an eye on this thread and other forum posts. You can also find me on freenode IRC in #zerobrane or email me. Thank you.

Paul.

Offline persimmonx

  • Full Member
  • ***
  • Posts: 116
  • Karma: +4/-5
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #1 on: November 27, 2013, 10:18:01 pm »
Hopefully it speeds up software development for vera. The licence agreement doesn't seem to be appealing though.

"ZeroBrane LLC reserves the right to publish a selected list of users of the Software." why?

"ZeroBrane LLC reserves the right to make changes to this License at any time without notice to you. It is your responsibility as a user of this Software to periodically return to this page to review...."  Need to put a periodical reminder on my calendar ...

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #2 on: November 27, 2013, 11:46:32 pm »
> Hopefully it speeds up software development for vera. The licence agreement doesn't seem to be appealing though.

Thank you for the feedback!

> "ZeroBrane LLC reserves the right to publish a selected list of users of the Software." why?

So that I could use it as a reference, but I agree; it does look better without it.

> "ZeroBrane LLC reserves the right to make changes to this License at any time without notice to you. It is your responsibility as a user of this Software to periodically return to this page to review...."  Need to put a periodical reminder on my calendar ...

This was something that was suggested by my attorney, although it applies more to services, than to products.

I updated the license to remove both of these; should look shorter and simpler now.

Offline persimmonx

  • Full Member
  • ***
  • Posts: 116
  • Karma: +4/-5
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #3 on: November 28, 2013, 12:31:08 am »
I totally understand the pain of developing this and I hope you make heck lots of money :-)
Maybe what you need is a personal license and a business license. In business license, it seems to be fine to publish the user name.

You can update the license, but what you have sold is probably going to remain under the older license.

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #4 on: November 28, 2013, 12:38:53 am »
You can update the license, but what you have sold is probably going to remain under the older license.

Correct (it's all version controlled anyway). I don't think it's worth splitting to personal/commercial over this as I can always ask for a permission in either case.

Offline Weeves

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #5 on: November 28, 2013, 12:47:33 am »
@Paul,

  am I right in thinking that it won't upload .xml files (greyed out in the I_XXXX.xml I'm looking at)

 also, it would be nice to download files from the vera as well.

certainly a lot easier than blind editing!

Cheers

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #6 on: November 28, 2013, 12:55:47 am »
> am I right in thinking that it won't upload .xml files (greyed out in the I_XXXX.xml I'm looking at)

It will; it will upload any files you have, but only during a debugging session. Note that it won't compress the files.

> also, it would be nice to download files from the vera as well.

It downloads the log file (also during the debugging), but I could not come up with a good interface to get the list of files and select one to download. Also, if you use Vera upload, those files are likely to be compressed and the download through ZBS won't help as it can't decompress them.

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #7 on: November 28, 2013, 01:09:08 am »
> also, it would be nice to download files from the vera as well.

@Weeves, not quite as straightforward as downloading to a new window, but you can also run something like this in the console (while debugging is in progress):

io.open('/etc/cmh-ludl/whatever.lua'):read('*a')

This should print the (serialized) content of the file in the console. The output is limited to 400 characters, but this can be changed in the config file (this is fixed in the next version).

> certainly a lot easier than blind editing!

That's the goal; thank you!

Offline Weeves

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #8 on: November 28, 2013, 01:39:28 am »
@Paul,

I think I found why I can't upload a file - it's throwing a compilation error :
Compilation error on line 201:
[string "D:\Users\Joe\Documents\Vera Files\L_IPhone.lua"]:201: invalid escape sequence near '"'

the line in question is executed successfully in the vera, but ZBS seems to object to it

                          function escapeQuotes( str )
this line ---->      return str:gsub("\'", "\\'"):gsub("\?", '\\?'):gsub('\"','\\"') -- escape quote characters
                          end

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #9 on: November 28, 2013, 02:35:49 am »
@Weeves, yes, \? is an invalid escape. ZBS is using LuaJIT interpreter internally, which is a bit more strict about escape sequence and will complain even when Lua 5.1 allows those to go through. You can just replace "\?" with "?" in your script.

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +478/-10
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #10 on: November 28, 2013, 01:14:59 pm »
Good job, @paulclinger, this works really well. I think it should be very helpful to people starting-out with Lua/Luup programming for Vera scenes and plugins. I would say it was good value at the current offer price.

It would be good if the Documentation entry in the Help menu included links to the Vera-specific documentation. Also a link to the Lua Reference Manual would be very useful.
« Last Edit: November 28, 2013, 07:21:57 pm by RexBeckett »

Offline persimmonx

  • Full Member
  • ***
  • Posts: 116
  • Karma: +4/-5
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #11 on: November 28, 2013, 10:57:10 pm »
@paulclinger,
do u accept Paypal?

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #12 on: November 29, 2013, 12:40:30 am »
> do u accept Paypal?

@persimmonx, I do, but I don't want to enable it as one of the payment options for various reasons. I really like Stripe integration and I don't have any access to the credit card information, but if you prefer paypal, please email me at support@zerobrane.com and I'll send you payment information.

If you don't mind me asking, is paypal much better than the current payment option? I don't store this information and I don't think that Stripe stores it either; everything goes over https, so it should be fairly secure.
« Last Edit: November 29, 2013, 01:31:25 am by paulclinger »

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #13 on: November 29, 2013, 01:00:12 am »
> Good job, @paulclinger, this works really well.

@RexBeckett, thank you for the feedback!

> It would be good if the Documentation entry in the Help menu included links to the Vera-specific documentation. Also a link to the Lua Reference Manual would be very useful.

That's a great point; the links should all point to the Vera-specific resources as you suggested. I'll add it in the next version.

In terms of Lua Reference Manual, I can add a link, but I can actually do better. I have a plugin that adds a context menu item when you use it on a particular function (like "print" or "io.open") and it will open the manual page in the browser for that particular function. The plugin and instructions are in this post: http://www.freelists.org/post/zerobrane/Unsolicited-feature-wishlist,1

Offline RexBeckett

  • Master Member
  • *******
  • Posts: 3888
  • Karma: +478/-10
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #14 on: November 29, 2013, 12:02:21 pm »
Quote
In terms of Lua Reference Manual, I can add a link, but I can actually do better. I have a plugin that adds a context menu item when you use it on a particular function (like "print" or "io.open") and it will open the manual page in the browser for that particular function. The plugin and instructions are in this post: http://www.freelists.org/post/zerobrane/Unsolicited-feature-wishlist,1
Thank you, @paulclinger. The showluareference plugin works well. Actually I think it works better than the context-sensitive help in MS Visual Studio.  ;D