Author Topic: Reboot vera +  (Read 898 times)

Offline Cor

  • Hero Member
  • *****
  • Posts: 1064
  • Karma: +4/-4
Reboot vera +
« on: November 29, 2016, 06:49:02 pm »
Hello ,

On my vera 3 with UI5 I run a LUA code to reboot my vera every night.

I thought it might be a good idea to do this on the vera plus as well, But I get an error message "ERROR : Error in lua for scenes and events".

Anyone knows why?

Code: [Select]
local ping = os.execute("ping -c 1 8.8.8.8")
if ping ~= 0 then
  luup.log("Auto Reboot: Network down. Aborted.")
else
  luup.log("Auto Reboot: Network OK. Rebooting in 2 seconds.")
  luup.sleep(2000)
  os.execute("reboot")
end

Thanks,
Cor

Offline Cor

  • Hero Member
  • *****
  • Posts: 1064
  • Karma: +4/-4
Re: Reboot vera +
« Reply #1 on: February 06, 2017, 05:45:40 pm »
Very wierd ,

I am running the code on both my vera's , on the vera plus , I don't notice anything wrong , but on my vera 3 ( since today  ??? ) I get a "ERROR : Error in lua for scenes and events"

When I look in the LuaUPnP log I see this:

Code: [Select]
01 02/06/17 23:33:52.065 LuaInterface::LoadCode: [string "function event_1()..."]:3: '=' expected near 'end' <0x2ab54310>
01 02/06/17 23:33:52.068 JobHandler_LuaUPnP::Run cannot start lua with code:
function event_1()
LS1bW1N0YXJ0VmVyYUFsZXJ0c11dbHV1cC5jYWxsX2FjdGlvbigndXJuOnJpY2hhcmRncmVlbjpzZXJ2aWNlSWQ6VmVyYUFsZXJ0MScsJ0RldmljZU5vdGlmaWNhdGlvbicsIHtNc2c9J01vdGlvbiUyMERldGVjdGVkJTIwbmVhciUyMHRoZSUyMGdhdGUnLCBOYW1lPSdnYXRlJTIwbW90aW9uJTIwZGV0ZWN0ZWQnLCBEZXNjcmlwdGlvbj0nV2hlbmV2ZXIlMjBHYXRlJTIwbW90aW9uJTIwZGV0ZWN0b3IlMjBpcyUyMGFybWVkJTIwYW5kJTIwZGV0ZWN0cyUyMG1vdGlvbicsIERldmljZUlEPTI0LCBIb3VzZU1vZGVNYXNrPXVuZGVmaW5lZCwgU2VydmljZT0ndXJuOm1pY2FzYXZlcmRlLWNvbTpzZXJ2aWNlSWQ6U2VjdXJpdHlTZW5zb3IxJywgVmFyaWFibGVzPScnLCBSZWNpcGllbnRzID0nQ29ydmwnfSwgNiktLVtbRW5kVmVyYUFsZXJ0c11d
end
function scene_5()
local ping = os.execute("ping -c 1 8.8.8.8")
if ping ~= 0 then
  luup.log("Auto Reboot: Network down. Aborted.")
else
  luup.log("Auto Reboot: Network OK. Rebooting in 2 seconds.")
  luup.sleep(2000)
  os.execute("reboot")
end
end
function event_2()
LS1bW1N0YXJ0VmVyYUFsZXJ0c11dbHV1cC5jYWxsX2FjdGlvbigndXJuOnJpY2hhcmRncmVlbjpzZXJ2aWNlSWQ6VmVyYUFsZXJ0MScsJ0RldmljZU5vdGlmaWNhdGlvbicsIHtNc2c9J0RpbmclMjBkb25nJywgTmFtZT0nRGluZyUyMGRvbmcnLCBEZXNjcmlwdGlvbj0nV2hlbmV2ZXIlMjBHYXRlJTIwQmVsbCUyMGlzJTIwYXJtZWQlMjBhbmQlMjBkZXRlY3RzJTIwbW90aW9uJywgRGV2aWNlSUQ9MzYsIEhvdXNlTW9kZU1hc2s9dW5kZWZpbmVkLCBTZXJ2aWNlPSd1cm46bWljYXNhdmVyZGUtY29tOnNlcnZpY2VJZDpTZWN1cml0eVNlbnNvcjEnLCBWYXJpYWJsZXM9JycsIFJlY2lwaWVudHMgPSdDb3J2bCd9LCA2KS0tW1tFbmRWZXJhQWxlcnRzXV0=
end


Anyone knows what is wrong with this?

Thanks,
Cor

Offline XA44Owq26HxCq88

  • Full Member
  • ***
  • Posts: 120
  • Karma: +0/-1
Re: Reboot vera +
« Reply #2 on: February 06, 2017, 06:14:45 pm »
Looks very similar to what occasionally happens with my veraplus (uI17). For some reason garbage gets added to the code, then you get the error message. What I've done is make sure I've got all my LUUA code scenes in text files. Then when the error message appears, I go through each scene that contains LUUA code and find the one that has gotten corrupted, copy and paste the good code back in, save the LUUA code, save the scene. Wait for the progress message in the blue bar up top and see if the error is displayed. If it does, I keep looking.

It doesn't have to be the particular scene you are working on. When the error message pops up, go through each scene and I'll bet you'll find one that has gotten messed up.

Why this happens is beyond my skill set. I've found that once I've gotten the bad scene corrected and stop playing, my veraplus works fine.

Good luck. Maybe they'll fix the issue in an upcoming update.

Offline rafale77

  • Hero Member
  • *****
  • Posts: 643
  • Karma: +35/-20
Re: Reboot vera +
« Reply #3 on: February 06, 2017, 06:31:29 pm »
That's why I save a backup before any lua scene edits. I have become paranoid...
Hey where's the fun if we didn't have these random scene corruption problems heh? The vera would be so boring...  :-X ???
127 zwave nodes, 8 zigbee nodes, 256 devices, 17 apps, 122 scenes on a Vera Plus linked with Echo and HomeKit through bridges

Offline Cor

  • Hero Member
  • *****
  • Posts: 1064
  • Karma: +4/-4
Re: Reboot vera +
« Reply #4 on: February 07, 2017, 04:37:23 am »
Oh really?!?!?! , the code in that LUA-code was different when I first inserted it ??  :o :o  ::)

But which part?

Cor

Offline XA44Owq26HxCq88

  • Full Member
  • ***
  • Posts: 120
  • Karma: +0/-1
Re: Reboot vera +
« Reply #5 on: February 07, 2017, 08:30:27 am »
Cor, take a look at the actual code in the various scenes you have LUUA code in, rather than the log. See if there's a bunch of gibberish there. I'd bet dollars to donuts that something has gotten garbled.
« Last Edit: February 07, 2017, 11:54:33 am by XA44Owq26HxCq88 »

Offline Cor

  • Hero Member
  • *****
  • Posts: 1064
  • Karma: +4/-4
Re: Reboot vera +
« Reply #6 on: February 07, 2017, 11:32:47 am »
@ XA44Owq26HxCq88:

 There are only 2 scenes on that vera and one has this luup code:
Code: [Select]
local ping = os.execute("ping -c 1 8.8.8.8")
if ping ~= 0 then
  luup.log("Auto Reboot: Network down. Aborted.")
else
  luup.log("Auto Reboot: Network OK. Rebooting in 2 seconds.")
  luup.sleep(2000)
  os.execute("reboot")
end

The other one just switches on and of a fibaro switch.

BUT , yesterday I upgraded the firmware , I noticed there was a newer version , and the error notification is gone  ??? ??? ..... very wierd.

Cor

Offline XA44Owq26HxCq88

  • Full Member
  • ***
  • Posts: 120
  • Karma: +0/-1
Re: Reboot vera +
« Reply #7 on: February 07, 2017, 11:54:07 am »
Cora, While working with the tech help from Vera they said that they could clear out the bad stuff and a "ghost" scene for me, so they were aware of the issue. Maybe the new firmware has dealt with it. Did you upload the Beta version?

Offline Cor

  • Hero Member
  • *****
  • Posts: 1064
  • Karma: +4/-4
Re: Reboot vera +
« Reply #8 on: February 07, 2017, 12:20:39 pm »
No I am not on the beta version , I upgraded last month . and last night I updated to 1.7.902

So far so good  :-X

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 636
  • Karma: +13/-11
    • Worthington Engineering, Inc.
Re: Reboot vera +
« Reply #9 on: February 07, 2017, 08:11:10 pm »
I had the same error for a couple of days but could not get to it until tonight. I had changed a scene using the Vera Mobile app (iOS) while I was out of town, by removing a particular mode so it would not execute on Vacation mode. That was it.

When I looked at the scene in the UI, gibberish was showing up in the LUA.  The scene had no LUA code when I created it. Deleted it, saved the scene, working fine again.

Perhaps it was the Vera Mobile app. 
Vera 3, UI7 1.7.947, CT101 t-stat, Everspring motion detector, GE/Jasco switch, Leviton outlet, AeonLabs door sensor, Insteon garage control, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual & Multi Switch, Weather, Sys. Mon.

Offline XA44Owq26HxCq88

  • Full Member
  • ***
  • Posts: 120
  • Karma: +0/-1
Re: Reboot vera +
« Reply #10 on: February 08, 2017, 04:23:33 pm »
Don, I've never used the mobile app to modify anything, so not sure the problem is linked specifically to the app.

Offline jambalto

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-1
Re: Reboot vera +
« Reply #11 on: February 10, 2017, 06:05:23 pm »
All,

I too have experienced this exact error message stating an error in lua scene.  I have two scenes with the exact same lua code and both were gibberish/garbage.  I'm using UI7 with firmware 1.7.2414 and this just started today.  I cleared the lua code gibberish/garbage and re-entered the lua code and all is better again.  I do use both the mobile iOS app and PC browser.  Not sure what may have caused this.  Hopefully Vera will address this in a new update.

Regards,