Author Topic: Scheduled reboot of vera  (Read 6746 times)

Offline Gommasch

  • Sr. Newbie
  • *
  • Posts: 48
  • Karma: +0/-0
Scheduled reboot of vera
« on: June 09, 2011, 07:19:29 am »
Is there a way to make a scheduled reboot of the Vera ? I want to avoid "strange" things to happen once in a while which usually happens to wireless routers. Will the Vera be more stable if it is rebooted every night ?

Offline MCV.Eugen

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #1 on: June 09, 2011, 07:34:52 am »
One way would be, if you're familiar with ssh, vi and crontab to ssh to the box, 'crontab -e' and add something like

min hour * * * reboot

to the file, so it will reboot every day at hour:min.

Offline Gommasch

  • Sr. Newbie
  • *
  • Posts: 48
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #2 on: June 09, 2011, 07:38:56 am »
Sorry, no idea how to do that. Actually I was just hoping for a scene with a "simple" LUA script and a timer.

Offline MCV.Eugen

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #3 on: June 09, 2011, 07:58:07 am »
1. Get putty from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html and copy it somewhere on your machine.
2. launch putty.exe and enter Vera IP in 'Host Name' then click 'Open'. Click 'Yes' on the security alert.
3. login as: 'root' and use the WiFi password as the password (you should have that password somewhere)
4. at the command prompt you'll get, type 'crontab -e' and press enter. It will start vi for the /etc/crontab file. Basically you would only have one line in that file, something about rotating the logs
5. press 'o'
6. type '30 18 * * * reboot' (that would reboot Vera every day at 18:30 - modify that to suit your needs)
7. hit escape twice (now you should have two lines in the file)
8. type ':wq!' and press enter
9. you're done, close the putty window (or press ctrl-d and it will auto-close)

Don't type the ' chars, they are just there to limit the strings.
« Last Edit: June 09, 2011, 08:00:18 am by MCV.Eugen »

Offline Gommasch

  • Sr. Newbie
  • *
  • Posts: 48
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #4 on: June 09, 2011, 08:10:51 am »
OK thank You, it looks like it can be done that way but when I login the system tells me that any changes to the system without guidance from MiOS support will void my future support requests so I don't think I will go on. I have already used their support quite a lot and they have been a really good help up until now so I want to keep it that way.

Offline Henk

  • Hero Member
  • *****
  • Posts: 820
  • Karma: +3/-0
Re: Scheduled reboot of vera
« Reply #5 on: June 09, 2011, 10:26:54 am »
OK thank You, it looks like it can be done that way but when I login the system tells me that any changes to the system without guidance from MiOS support will void my future support requests so I don't think I will go on. I have already used their support quite a lot and they have been a really good help up until now so I want to keep it that way.

since @MCV.Eugen gave the howto i would think this should not void warranty?
After all MCV gave the info themselves?!?
| Vera2 @ UI4 1.1.1350 / 3.20 | Vera Lite @ UI5 | Vera 3 @ UI5 | 2x Merten  504519 | 1x Duewi  064374 | 1x Everspring SM103 doorbell mod |1 Y-cam IP cam | various LUUP plugins |

Offline Gommasch

  • Sr. Newbie
  • *
  • Posts: 48
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #6 on: June 09, 2011, 10:31:43 am »
Oh  - I wasn't aware that @MCV.Eugen was from MCV.

Offline robinnes

  • Full Member
  • ***
  • Posts: 171
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #7 on: June 09, 2011, 10:50:30 am »
I one of the threads in the "setup and usage" forum someone suggested plugging Vera into a simple $5 mechanical lamp/appliance timer from the hardware store set to off/on at 2am.

Won't void warranty either.

Offline BillC

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #8 on: June 16, 2011, 05:42:53 pm »
I can't connect to my Vera except thru SSH and it doesn't seem to like the wifi password I give it.  It takes the root user name and keeps kicking out the password.  Any guess on what I am doing wrong?

thanks
Bill

Offline mikkelj

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #9 on: June 21, 2011, 10:20:46 am »
I have a different approach to this. You can execute a Lua command and make the box restart by doing something like this:

https://FWD.mios.com/USERNAME/PASSWORD/SERIALNUMBER/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunLua&Code=LUA_CODE_GOES_HERE

e.g.

https://fwd2.mios.com/john/tokyo/12345/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunLua&Code=os.execute("reboot")


Then every time you access this URL, your Vera box reboots. The server replies back with "OK" when succesful.
You can execute any commands through the Lua engine, so your only limit is your imagination :)


I've got a thread running, on exploiting the Lua-engine to do stuff remotely:
http://forum.micasaverde.com/index.php?topic=6465.0

Offline veradude

  • Newbie
  • *
  • Posts: 1
  • Karma: +2/-0
Re: Scheduled reboot of vera
« Reply #10 on: November 15, 2017, 08:34:49 pm »
This question is older than my kids, but in case anyone like me wants this problem solved...

SOLUTION:
- create a scene, tell it to run daily at some early-morning hour
- no device actions
- you'll see at the bottom "Also, execute the following Luup code:"
- enter these lines and hit 'save'
           local command = "reboot"
           os.execute(command)

Thats it! I just manually executed the scene and it rebooted perfectly.

Offline resq93

  • Sr. Member
  • ****
  • Posts: 272
  • Karma: +0/-2
Re: Scheduled reboot of vera
« Reply #11 on: February 05, 2018, 04:52:01 pm »
This won't work when Lua is in an error state already

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1382
  • Karma: +36/-35
Re: Scheduled reboot of vera
« Reply #12 on: February 05, 2018, 08:17:42 pm »
I think the idea is to keep Vera freshly booted everyday to avoid LUA being in an error state.
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 Bobone

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Re: Scheduled reboot of vera
« Reply #13 on: February 24, 2018, 10:42:10 am »
Argh!!
So, I went off for vacation and checked some lighting remotely. Then erased a few (many) old alerts and bam, got stuck with ?Controller is busy updating data? in the app and ?offline? through the web site.
So, I had someone open my door and unplug/replug Vera Plus. No change.

What can I do? My network is working fine.
Bob