Author Topic: luup.inet.wget not working  (Read 2043 times)

Offline sjf2626

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
luup.inet.wget not working
« on: May 12, 2017, 02:06:31 am »
I have a Vera3 running firmware 1.7.919.  I have several scenes that use luup.inet.wget to send HTTP commands to my Foscam cameras.  For example:  luup.inet.wget('http://192.168.86.33:30/set_alarm.cgi?motion_armed=0&user=<use>&pwd=<pwd>')

These commands have worked great in my scenes until I upgraded to the latest firmware.  Now they are not working anymore.  If I run the HTTP command from my browser they work great. 

Any ideas?

Offline shallowearth

  • Hero Member
  • *****
  • Posts: 985
  • Karma: +47/-9
Re: luup.inet.wget not working
« Reply #1 on: May 12, 2017, 05:17:39 am »
Delete the command and retype them in (don't copy anything from the Vera UI then try to re paste it back). Encoding was changed in one of the firmware updates that corrupts something in the LUA code.  I can't tell what it was, but fresh typing it in, fixed it.  Using copy paste to try to fix it seems to maintain the corruption even If you go through notepad (maybe it is the wrong return character or something not visible), but fresh typing it in or copying it from  something that wasn't in Vera works fine to fix it.

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +36/-35
Re: luup.inet.wget not working
« Reply #2 on: May 12, 2017, 06:32:46 pm »
What I did was create a text file and placed it on my NAS with any LUA code I need to reenter into Vera. This way I can coy from the text file and paste it to Vera.
Vera 3, 1.7.1030, CT101, Everspring motion sensor, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb, Hue, Alexa

Offline jd67b

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: luup.inet.wget not working
« Reply #3 on: May 13, 2017, 10:35:24 am »
I had the same problem triggering Blue Iris actions. Retyping did not solve the problem, but taking the user and pw out of the url and passing it as a parameter for basic authentication worked for me. If retyping doesn't work for you, try the following: luup.inet.wget('http://192.168.86.33:30/set_alarm.cgi?motion_armed=0', 5, '<use>','<pwd>')

Offline sjf2626

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: luup.inet.wget not working
« Reply #4 on: May 13, 2017, 10:52:31 pm »
Thanks for the suggestions.  I tried them both.  And neither of them worked. 

The weird thing is if I run the LUUP code in the "Apps->Develop Apps->Test Luup code (Lua)" area it works great.  So I know the code is written correctly and my Vera runs it correctly.  It just seems that when I run it as part of a Scene that it doesn't get run.

Is there a way to see any error codes that are output from running a Scene?  How do I see the log for my Vera?

Also, there's a constant error message at the top of my Vera page that says "ERROR : Error in lua for scenes and events".  Would that error message be stopping all Scene Lua code from running?

Thanks.

Offline michelhamelin

  • Full Member
  • ***
  • Posts: 161
  • Karma: +3/-1
Re: luup.inet.wget not working
« Reply #5 on: May 14, 2017, 02:07:25 pm »
I have many scenes, sometime i got that error in lua for scene in events,
If i disable all the scenes is that error is going to show up again?
Then try to re-enable one scene every couples of day... till i found the defective script

i m looking for a way to find if it s a corrupt scene script or a defective device.

Offline jswim788

  • Hero Member
  • *****
  • Posts: 801
  • Karma: +58/-2
Re: luup.inet.wget not working
« Reply #6 on: May 14, 2017, 07:02:59 pm »
@akbooer has worked on some scripts to scan the scenes: http://forum.micasaverde.com/index.php/topic,48749.msg320046.html#msg320046  Maybe it could be used to scan your code.  There are some other good replies in that chain as well.

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +36/-35
Re: luup.inet.wget not working
« Reply #7 on: May 26, 2018, 10:25:47 am »
I have a Vera3 running firmware 1.7.919.  I have several scenes that use luup.inet.wget to send HTTP commands to my Foscam cameras.  For example:  luup.inet.wget('http://192.168.86.33:30/set_alarm.cgi?motion_armed=0&user=<use>&pwd=<pwd>')

These commands have worked great in my scenes until I upgraded to the latest firmware.  Now they are not working anymore.  If I run the HTTP command from my browser they work great. 

Any ideas?


My LUUP code was working for years and with the last firmware update, it stopped working.  The URL works within a browser, it is the wget that no longer works:


luup.inet.wget("http://BLUE_IRIS_SERVER:PORT/admin?profile=1&lock=2&user=USER&pw=PASSWORD")


Does the wget format need to change or do I need to enable something somewhere?
Vera 3, 1.7.1030, CT101, Everspring motion sensor, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb, Hue, Alexa

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +36/-35
Re: luup.inet.wget not working
« Reply #8 on: May 26, 2018, 10:34:15 am »
Figured it out.  With the latest firmware, you have to manually enable unsafe lua code, which I did, but had to reboot Vera to actually enable it.
Vera 3, 1.7.1030, CT101, Everspring motion sensor, GE/Jasco switch, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, Weatherunderground, LB60Z-1 bulb, Hue, Alexa

Offline cw-kid

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1589
  • Karma: +17/-2
Re: luup.inet.wget not working
« Reply #9 on: June 13, 2018, 07:33:49 am »
Figured it out.  With the latest firmware, you have to manually enable unsafe lua code, which I did, but had to reboot Vera to actually enable it.

Strange, I have a scene that's using wget to bring up my camera image on the HTPC. Its still working fine and I have not enabled that security setting. I did see that setting previously and wondered if to enable it or not, but as my scene was still working I left it turned off.