We have moved at community.getvera.com

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

Offline persimmonx

  • Full Member
  • ***
  • Posts: 116
  • Karma: +4/-5
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #15 on: November 29, 2013, 04:07:07 pm »
> do u accept Paypal?

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.

Yes, Paypal is much more appealing if one are buying over internet. I know you said you don't store credit card info, but in theory, the buyer cannot be sure. Besides, processing credit card info requires PCI compliance, and again, users aren't sure if the seller actually has it.

Personally, I don't provide credit card info online, unless I am buying from a major company or paying by Paypal, Google wallet or Amazon checkout .

Regards.



Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #16 on: November 29, 2013, 04:55:47 pm »
> Besides, processing credit card info requires PCI compliance, and again, users aren't sure if the seller actually has it.

@persimmonx, I agree; it's a valid concern. The advantage of using Stripe is that it allows me to satisfy PCI compliance without capturing and protecting CC info on my side. You (as a user) indeed can't be sure, but you can inspect the JavaScript code to verify that I follow Stripe guidelines and don't get CC information (not that you need to, but you could).

As to the other payment methods, I may provide Amazon payments as an alternative, but a bit later.

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #17 on: November 30, 2013, 03:59:50 pm »
also, it would be nice to download files from the vera as well.

@Weeves, agree. I added loading/editing/saving files from the device; see this post for details: http://forum.micasaverde.com/index.php/topic,17807.0.html. Give it a try and let me know how it works for you.

Offline Weeves

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #18 on: November 30, 2013, 10:37:11 pm »
didn't work for me:

Debugging session started in 'D:\Users\Joe\Documents\Vera Files\'.
Failed to load file 'L_SmartSwitch_core.lua': L_SmartSwitch_core.lua: No such file or directory.

that lua file is one of the few that isn't compressed.

Do I need to add a path?

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #19 on: November 30, 2013, 10:39:46 pm »
> Failed to load file 'L_SmartSwitch_core.lua': L_SmartSwitch_core.lua: No such file or directory.
> Do I need to add a path?

@Weeves, yes, put in a full path as it can get a file from any folder. I may add /etc/cmh-ludl by default if a relative path is detected.

Offline Weeves

  • Jr. Member
  • **
  • Posts: 61
  • Karma: +1/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #20 on: November 30, 2013, 11:46:28 pm »
Yep - that works!
a default would be good.

Cheers

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #21 on: December 01, 2013, 12:23:51 am »
@Weeves, it just opens the file in the current directory. Since the current directory is set to "/" by default, it doesn't find the file if it's in a subdirectory.

You can change the directory by running lfs.chdir('/etc/cmh-ludl') (or whatever value you need) from the Console when debugging is in progress. This should set it until luup is restarted. You can then open a file using just the file name. I just tested it and it works. In fact, you can probably add it to the startup script if you want.

Also, I've been thinking about adding "remote:" indicator to the tab name. Do you think it would be useful?

Offline SOlivas

  • Sr. Member
  • ****
  • Posts: 282
  • Karma: +1/-1
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #22 on: December 03, 2013, 09:54:51 am »
Glad to see that this is taking off.

Thanks for letting me be a beta tester.  It is a pretty cool program.  While lately I've been occupied with work and a few other things, when I get a chance to put more time back into HA, I will be using this to push forward with my mods to the plugins I've done.

Vera 3 (1.5.622) / 9x GE/Jasco 45609 / 2x GE/Jasco 45612 / 2x GE/Jasco 45614 / 1x MIMO Lite
1x Twine (http://forum.micasaverde.com/index.php/topic,15617.0.html), DSC Security System, Honeywell  YTH8320ZW1007 Thermostat, 1x Fortrezz WWA-01, 1x CA9000 Wireless PIR Sensor

Offline hifs

  • Jr. Member
  • **
  • Posts: 88
  • Karma: +0/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #23 on: December 04, 2013, 09:50:40 pm »
I just thought I'd throw some positive feedback out there. I'm not affiliated with the author of this software, but went ahead and purchased a copy of the Vera edition after playing around with the non-Vera integrated version for a few weeks. I had recently posed a question about intercepting http requests initiated outside of the Vera in the MiCasaVerde forum and was pointed toward using lug_WapRequest. I tried some code in ZeroBrane Studio for Vera and at first did not have success, but then posed a question to the ZeroBrane support team. They quickly responded and pointed out the minor change I needed to make. I was able to debug my code fairly quickly. I also used it to debug some luup.variable_watch commands and the IDE allowed me to intercept the events. I'm quite impressed that these work and look forward to spending more time in this IDE!

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #24 on: December 06, 2013, 02:00:36 am »
@hifs, @SOlivas, thank you for the feedback!

> I had recently posed a question about intercepting http requests initiated outside of the Vera in the MiCasaVerde forum and was pointed toward using lug_WapRequest.

I updated the documentation with some examples of how debugging works for plugin "startup" code and request (register_handler) callbacks: http://studio.zerobrane.com/vera-documentation.html. I'm also adding other sections and will update when they are posted.

Offline twostep

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +0/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #25 on: December 07, 2013, 05:40:58 pm »
Using the Zerobrane Output window when remote debugging.

I have a long running Vera process which, when testing, I write messages to the Vera log for later review. This is not ideal because there are a lot of other messages going to the Vera log so it is necessary to copy this file and filter it to see all my messages contiguously, and the size of the log in Vera can be a problem and cause instability. I would prefer to use Zerobrane for this debugging to make use of the pretty print facility in conjunction with the Output window. Is it possible to configure Zerobrane to also write text written to the Output window to a file on the system where Zerobrane is running. This would avoid the issues around using the Vera log. I can then start a Zerobrane remote debug session, leave it running and later, review the captured file.

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #26 on: December 07, 2013, 08:15:48 pm »
> I would prefer to use Zerobrane for this debugging to make use of the pretty print facility in conjunction with the Output window. Is it possible to configure Zerobrane to also write text written to the Output window to a file on the system where Zerobrane is running. This would avoid the issues around using the Vera log. I can then start a Zerobrane remote debug session, leave it running and later, review the captured file.

@twostep, this is a very interesting idea! I put together a simple plugin to test this functionality: http://notebook.kulchenko.com/zerobrane/saving-debugging-output-to-file. It will write to output.log file in the current project directory, but you can change that in the config file. It will also "trim" the output to the last 100 lines in the Output window, so you can run long sessions without using much memory.

All the writes to the log file are flushed immediately, so you can check the file while the process is still running. Please let me know if you run into any issues with it.

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #27 on: December 07, 2013, 08:40:04 pm »
Not wishing to minimize the advantages of ZeroBrane Studio, you could also just write your logs to a text file in Vera with something like:

Code: [Select]
local value = 123
local time = os.date()
local file = io.open("/www/log.txt", "a")
file:write("Log " .. time .. " Value: " .. value .. "\n")
file:close()

You can review the results in your browser through <veraipaddress>/log.txt

Offline paulclinger

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +5/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #28 on: December 08, 2013, 12:31:24 am »
RexBeckett, I'm sure there are good alternatives ;); thank you for providing one.

I think two main advantages of using remote printing in ZBS are that the output is pretty-printed (with tables expanded in the output) and it doesn't require code changes in your scripts (assuming you do "printing" anyway). Also, since the log is already stored locally, you can simply delete the file between sessions if you want to truncate it.

The advantage of your method is that you don't need any additional tools to collect this in a log file.

Offline twostep

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +0/-0
Re: ZeroBrane Studio for Vera -- Lua IDE for debugging on Vera devices
« Reply #29 on: December 11, 2013, 10:38:06 am »
One of the problems I have found with logging on Vera is that if significant amounts of logging occurs, Vera can become unstable. Using a separate local log for minimal runtime logging is much better to isolate it from the Vera log but in actual debugging sessions, getting the data back on the client is a good option for me. Horses for courses I guess. It's good to have the choice.