wake on lan problems

I take it the Vera WOL add-in only works from the local LAN ? Can you wake PC’s on the LAN when you are else where from the WAN / Internet ? I logged in to my VeraLite from the mIOS webpage but can’t seem to wake up the PC’s.

thanks

As long as the vera is on the same network as the computer, wol should wake up the computer remotely with out issue.

  • Garrett

[quote=“garrettwp, post:22, topic:170287”]As long as the vera is on the same network as the computer, wol should wake up the computer remotely with out issue.

  • Garrett[/quote]

The WOL add-in for Vera worked fine when I tested it locally. Will have to test again remotely next time I am out of the house.

Thanks

EDIT: Its not working locally now either the computer will not wake up anymore, this was working the other day. Just tried deleting the add-in and setup again but still not working.

Rebooted the PC and now its working again and waking up via Vera must have been a glitch.

OK so I buckled and installed the Kindel MCE Controller and I now have a solution with MCE Controller for directly launching Windows Media Center into 3rd party MCE add-ins from Vera scenes.

If anyone wants to know how to do this I will have to write a little setup guide. But basically using AutoHotKey on the HTPC to intercept keyboard commands like: Ctrl+Alt+1 to then launch Windows Media Center in to the desired 3rd party MCE add-in (entry point).

AutoHotKey Script:

^!1::
IfWinExist Untitled - My Movies
WinActivate
else
Run %windir%\ehome\ehshell.exe /entrypoint:{8984aed5-7c9d-42f0-b2ad-c39bbcf04a25}{810d7b87-1300-4aed-a700-1c6179f8f14b}
return

Then adding a new custom command in to MCE Controller command file, for “mymovies” for example and working out the VK Codes and using the same keyboard command Ctrl+Alt+1.

Then in Vera add luup code like the below to call my new custom command in MCE Controller.

local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“mymovies”)
c:close()

Works perfectly! If Windows Media Center is closed it will open and launch in to the desired MCE add-in or if Windows Media Center is already open, it will just jump you in to desired MCE add-in.

Here is an example: you could have your Foscam at your front door, trigger a scene in Vera that then controls MCE to bring up the IP camera on the TV. This is an older video showing a macro (scene) in mControl, however I can now recreate this scene and do it in VeraLite!

I can also confirm the standby command works in MCE Controller to put the HTPC in to S3 sleep mode from a scene in Vera.

What’s the correct way to send more than one command to MCE Controller from a Vera scene?

I tried something like:

local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“mControl”)
c:send(“right”)
c:send(“right”)
c:send(“right”)
c:send(“right”)
c:send(“down”)
c:send(“ok”)
c:close()

But it doesn’t work, should each command be sent individually e.g.

local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“mControl”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“right”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“right”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“right”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“right”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“down”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“ok”)
c:close()

This doesn’t seem to work well either.

Also is there a way with MCE Controller to slow down the commands and maybe add pauses in between ? As I think that’s the problem.

EDIT: OK this works better adding luup.sleep(1000) in between some of the commands being send to MCE Controller. The below opens the mControl MCE add-in moves right four times down once and then selects OK - Which brings up my IP cam on the TV.

local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“mControl”)
c:close()
luup.sleep(1000)
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“right”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“right”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“right”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“right”)
c:close()
luup.sleep(1000)
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“down”)
c:close()
local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“ok”)
c:close()

I’ve had great success with wake on LAN and MCE controller. Search the forum for: “wake sleep”. It explains it. Was really easy.

I’m using the code below to send the standby command to MCE Controller from a Vera Scene, this puts the HTPC in to S3 Sleep mode.

local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“standby”)
c:close()

Does anyone know how to send to Windows Media Center a Msgbox popup using MCE Controller ?

I can send msgbox popups to Windows Media Center via VMCController using this code in a Vera scene:

luup.inet.wget(“http://192.168.0.6:40510/msgbox%20"Motion"%20"Detected%20Back%20Garden"%205”)

But as I’ve started using MCE Controller with Vera would be good to send a MCE Controller command to do this instead.

[quote=“cw-kid, post:25, topic:170287”]What’s the correct way to send more than one command to MCE Controller from a Vera scene?

I tried something like:

local socket = require(“socket”)
host = “192.168.0.6”
c = assert(socket.connect(host, 5150))
c:send(“mControl”)
c:send(“right”)
c:send(“right”)
c:send(“right”)
c:send(“right”)
c:send(“down”)
c:send(“ok”)
c:close()

But it doesn’t work, should each command be sent individually[/quote]

I don’t think you should have to specify the socket everytime. I think you probably need the commands to have a carriage return or newline? Something like:

c:send(“right\r”)
c:send(“right\r”)

Or:

c:send(“right\n”)
c:send(“right\n”)

That is guest a guess though… Maybe you should try this from a non Vera telnet client and see if you can get it to work?

I’ve got it working on the one socket connection!

First I tried this:

luup.inet.wget("http://192.168.0.6:40510/msgbox%20%22Motion%22%20%22Detected%20Back%20Garden%22%205") luup.sleep(3500) local socket = require("socket") host = "192.168.0.6" c = assert(socket.connect(host, 5150)) c:send("mControl\n") luup.sleep(2000) c:send("right\n") c:send("right\n") c:send("right\n") c:send("right\n") c:send("down\n") luup.sleep(1000) c:send("ok") c:close()

Which displays the msgbox, opens mControl in MCE and moves right only once. Tried the above with \r as well same thing happened.

The only way I could make it move right a second time and continue with the other navigation commands, was to insert a small sleep command in between the other navigational commands like the below, which makes it work and I don’t have to open and close the socket connection to send each command!

luup.inet.wget("http://192.168.0.6:40510/msgbox%20%22Motion%22%20%22Detected%20Back%20Garden%22%205") luup.sleep(3500) local socket = require("socket") host = "192.168.0.6" c = assert(socket.connect(host, 5150)) c:send("mControl\n") luup.sleep(2000) c:send("right\n") luup.sleep(500) c:send("right\n") luup.sleep(500) c:send("right\n") luup.sleep(500) c:send("right\n") luup.sleep(500) c:send("down\n") luup.sleep(500) c:send("ok") c:close()

I tried the above code with \r on the end of each command and that works as well.

So I then tried it with neither \n or \r like this:

luup.inet.wget("http://192.168.0.6:40510/msgbox%20%22Motion%22%20%22Detected%20Back%20Garden%22%205") luup.sleep(3500) local socket = require("socket") host = "192.168.0.6" c = assert(socket.connect(host, 5150)) c:send("mControl") luup.sleep(2000) c:send("right") luup.sleep(500) c:send("right") luup.sleep(500) c:send("right") luup.sleep(500) c:send("right") luup.sleep(500) c:send("down") luup.sleep(500) c:send("ok") c:close()

Which works so I guess you don’t need \n or \r on the end of the commands but inserting a small sleep in between each, seems to make it work

Now I have a new problem:

http://forum.micasaverde.com/index.php/topic,11608.0.html

If the HTPC is sleeping when this scene runs, it hangs VeraLite.

The scene is for my Foscam sensor on an outdoor cam, if it detects motion it turns on the kitchen light for a period of time, send a msgbox to the Win7 PC and opens up the camera live video in Media Center. This all works but if the scene is triggered when the PC is asleep it craps out…

I am trying to get vera to shutdown a networked PC. I have installed MCE Controller ver. 1.8.6.27986 into the PC that I want to shutdown, and I created a scene with the following saved into the LUUP section:

local socket = require(“socket”)
host = “IP_address”
c = assert(socket.connect(host, 5150))
c:send(“shutdown\r”)
c:close()

Note: I put in the ip address of my pc in IP_address

however, everytime I activate the scene, nothing happens. Do I have to configure MCE Controller?

MCE Controller has a GUI - bring it up on the PC in question and see what I shows when you run the scene. It should show a connection from Vera at the time you run the scene…

I know nothing about the MCE controller …
But should you be using a:
c:send(“shutdown\n”)