A Device To Send A Magic Packet?

Talk about speakers, TVs, receivers, STBs, etc.
Post Reply
User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

A Device To Send A Magic Packet?

#1

Post by CyberSimian » Sat Jun 02, 2012 10:41 am

This is going to seem like a really weird request, but I was wondering if anyone knows of a device that will send an ethernet magic packet to wake up a sleeping/hibernating PC.

At its simplest, all I want is a "black box" about the size of a packet of cancer sticks (cigarettes) costing around £20, that when powered on immediately sends a magic packet down the LAN cable. That is all it does. At some later time the power is removed from the black box, but it does nothing at that time.

It seems unlikely to me that a manufacturer would find a big enough market for such a weird device, but there might be more complex devices that send magic packets when powered up.

For example, perhaps there is a TV that can be configured to send a magic packet when powered up. Or maybe an AV amplifier that can be configured to do this. Or a LAN router, or...?

Yes, I know that the obvious answer is: "another PC", but I was trying to avoid having a second PC whose sole function was to start the first PC (although a Raspberry Pi might be a possibility when they become available).

Any suggestions?

-- from CyberSimian in the UK

User avatar
holidayboy

Posts: 2836
Joined: Sun Jun 05, 2011 1:44 pm
Location: Northants, UK

HTPC Specs: Show details

#2

Post by holidayboy » Sat Jun 02, 2012 11:53 am

I think you might be able to do it using the Arduino bits and pieces, a google search brought up some interesting stuff - assuming you're happy tinkering with soldering irons and weird command line type stuff!!

http://www.arduino.cc/cgi-bin/yabb2/YaB ... 1257171745
Rob.

TGB.tv - the one stop shop for the more discerning Media Center user.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#3

Post by barnabas1969 » Sat Jun 02, 2012 2:10 pm

I have an old Linksys WRT-54GL router that sends a magic packet to my HTPC when one of my HP or Linksys extenders turns on. I'm using DD-WRT to accomplish this. It would not be difficult to make it send one when the router is initially powered-on.

I see two possible problems with this:

1) I don't know if you can get a used router that is compatible with DD-WRT for £20 GBP.
2) The router takes about a minute to boot. I don't know if you can wait this long for the WOL to be sent.

I'm not sure what you're planning to use this for, but if you're looking to do something similar to what I'm doing (sending a WOL when my extenders get powered on), then I can help you with that. Here's a link to my DD-WRT forum post on the subject:
http://www.dd-wrt.com/phpBB2/viewtopic. ... 120#602120

Venom51

Posts: 568
Joined: Sun Jun 12, 2011 7:12 pm
Location: Cumming,GA

HTPC Specs: Show details

#4

Post by Venom51 » Sun Jun 03, 2012 4:02 am

I have an app on my droid3 that does just that. It's set up to send a WOL packet to my work station when it connects to my wireless SSID in the house.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#5

Post by barnabas1969 » Sun Jun 03, 2012 2:34 pm

Venom51 wrote:I have an app on my droid3 that does just that. It's set up to send a WOL packet to my work station when it connects to my wireless SSID in the house.
I have the same thing on my Android phone. The app is called Tasker. It wakes my HTPC and triggers an event in EventGhost. The event fires a macro that checks to see if it's after sundown, and if so, it turns on my porch light for me.

EDIT: but mine is based on my location, not my SSID. I can't connect to my WiFi until I'm already in the driveway. I have the task in Tasker setup to turn on the porch light when I'm about a block away from the house.

User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

#6

Post by CyberSimian » Mon Jun 04, 2012 3:37 pm

holidayboy wrote:I think you might be able to do it using the Arduino bits and pieces
I had not seen this before. Looking on their web site I see that there are several retailers in the UK, so acquiring one should be easy. This is a possible solution, but would need further investigation.
barnabas1969 wrote:The router takes about a minute to boot.
That is definitely too long for my purpose; ideally I would like a 1-second response. So your Linksys router solution is probably not a viable solution for me.
Venom51 wrote:I have an app on my droid3 that does just that. It's set up to send a WOL packet
Unfortunately, the PC to be woken is connected wirelessly to the router, and I think that it needs to be a wired connection for WOL to work? It is not practical to connect the PC to the router using cable. Also, I do not have a smart phone!


Since my original post I have had a look at the Raspberry Pi web site (http://www.raspberrypi.org), and this thread was asking about a Pi sending a WOL, but triggered via the internet:

http://www.raspberrypi.org/phpBB3/viewt ... 1e4043f1c0

I do not need internet triggering, but the Pi looks like it would be a very good basis for constructing a bespoke device. The Pi runs Linux, and seems to have a very active user community (so lots of help available if I decide to go that way). Ultimately I may decide to go in a completely different direction (one that does not require this WOL device).

Thank you for your suggestions.

-- from CyberSimian in the UK

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#7

Post by barnabas1969 » Mon Jun 04, 2012 4:39 pm

CyberSimian,

Just to be clear, it would take a minute to send the WOL if you wanted to do it when the router is first powered on. However, it is instant when used as I have it configured on my network. Basically, the Media Center extenders "phone home" when they are powered up. The router is running a script (Linux) that detects the outbound connection from the extenders. When it is detected, a WOL is sent to my HTPC. This happens within a second or two.

Basically, if you can do it with a Raspberry Pi, you can do it with an old router that runs Linux.

It would help if you would describe what you are hoping to do with this WOL device.

EDIT: And no, you can't wake a device that is connected wirelessly. This is because the wireless connection is lost when the device turns off or goes into standby. The device to be woken needs to be connected by wire. The device that is sending the WOL can be connected wirelessly however.

User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

#8

Post by CyberSimian » Wed Jun 06, 2012 11:23 am

barnabas1969 wrote:It would help if you would describe what you are hoping to do with this WOL device.
Warning: extremely long tale of woe

My HTPC was working perfectly, so I thought that I ought to fix it. The excuse for fixing it was the arrival of high-definition TV (DVB-T2) at my location in the UK. So I replaced my Pinnacle PCI tuners with TBS PCI-E tuners. This exposed the fact that the PCI-E slots in my Dell motherboard do not work correctly.

When freshly booted, the PCI-E slots work as expected. The problem is that two out of the three PCI-E slots do not sleep correctly. I have tried 4 different cards in the 1x PCI-E slot, and none of them sleep correctly. I have tried 3 different cards in the 16x PCI-E slot, and only one (the graphics card) sleeps correctly. It is only the 4x PCI-E slot that sleeps correctly with the cards that I have tried.

However, all of the PCI-E slots hibernate correctly, so this is why I have switched from sleep to hibernation. Now hibernation is not usable in a bog-standard Windows Media Center installation. If you define the power button on the remote control to cause hibernation instead of sleep, when the button is pressed, it causes immediate hibernation, even if Media Center is in the middle of recording a programme (i.e. the recording is terminated prematurely). I have written a small program to circumvent this problem, so that switching off is now working OK. However, switching on is problematic, since the remote control has no effect when the system is hibernating. Currently I have to switch on the HTPC using the power button on the system unit, but I would like to arrive at some sort of remote-control solution.

There is a device marketed by Simerec (http://www.simerec.com) that allows remote control of PCs that are off or hibernating, but it requires connecting a circuit board in parallel to the existing power button on the system unit. On my ancient Abit BX6 motherboard it would be easy to connect -- there are two pins on the motherboard that connect to the power button. But on the Dell motherboard in my HTPC, the power button is awkward to access, and when I did finally access it, I saw that there are 7(!) wires connecting it to the motherboard. These control the illumination and various flashing modes of the power button. But it is not clear how the Simerec device should be connected (i.e. to which pair of wires the device should be connected).

So I was looking for another solution, preferably one that is non-invasive, and I considered the WOL solution. I downloaded a WOL command-line tool, connected my laptop to the HTPC, and issued the WOL command on the laptop, and the HTPC did indeed wake from hibernation. So I know that WOL would work as a solution, provided that I can find some convenient way of causing it to be issued using the remote control.

I have my TV connected to the master socket of a TrickleSaver device (http://www.tricklestar.com), and a hi-fi amplifier connected to the slave socket of the TrickleSaver, so the amp powers on and off in synchronism with the TV. The amplifier is an Audiolab 8000A, which was highly-regarded in hi-fi circles in its day, but that day was the 1980's, and consequently it does not have a remote control (I replaced it after a couple of years with a fully remote-controlled Sony lifestyle system). Nevertheless, I am determined to "get my money's worth" out of it (as my late father would have said). So my thought was for a WOL device that could also be plugged into the slave socket of the TrickleSaver. Hence the question that started this thread.

I am wary of going too far along a cul-de-sac, so I have considered other solutions. I am already using the most recent BIOS for the motherboard, and because the HTPC is several years old (not a current model), I am sure that if I asked Dell "How do I solve my problem?", the answer would be "Buy a new Dell computer!".

I have also considered replacing the motherboard with a different brand. The problem here is that the motherboard and case were made to conform to the unloved BTX standard, and new BTX motherboards are now virtually unobtainable. I googled for BTX, and found only Fujitsu (who?) manufacturing one, and even then I think that it has been discontinued (although there might be one retailer in the UK that still has some stock). But it is a low-end board and expensive (intended for commercial applications, not home use), and the following video illustrates some of the pitfalls in trying to replace a Dell BTX motherboard with a different brand:

http://www.youtube.com/watch?v=yJHdp8lcILo

So overall I am not tempted to try replacing the motherboard.

So we arrive at the final alternative of building a completely new HTPC. The Dell works fine if sleep is not used, so I might as well retain that as a working general-purpose PC. So the new HTPC would need a case, motherboard, CPU, and memory (I have enough spare hard disks and a spare graphics card). Since I do not want entry-level components, I roughly guessed at 400 UK pounds as the cost of a new HTPC (100 pounds for each of: the case, motherboard, CPU, memory). This is why I stipulated that the WOL device should cost around 20 pounds; if it is going to cost 100-200 pounds, I might as well opt for a new HTPC.

Decisions, decisions...

-- from CyberSimian in the UK

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#9

Post by barnabas1969 » Wed Jun 06, 2012 3:39 pm

That's a complicated situation indeed. The last time you mentioned BTX, I had to google it. I had never heard of it. I actually LIKE the idea.... heat sinks on the TOP side of the expansion boards (when the case is vertical), so that heat can RISE off of them. What a novel concept!

Well... hmmm... do you have any sort of IR device (maybe home automation type stuff) that will send some kind of ethernet request when you press a button on the remote? If so, you could use my approach of using your router to detect that ethernet packet, and in turn send a WOL to the HTPC.

User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

#10

Post by CyberSimian » Thu Jun 07, 2012 9:04 am

barnabas1969 wrote:do you have any sort of IR device (maybe home automation type stuff) that will send some kind of ethernet request when you press a button on the remote?
Unfortunately not. The only equipment I have that could loosely be described as "home automation" are several radio-controlled mains sockets, and even those are unreliable. One brand often does not work unless I hold the remote control within one foot of the receiver. Another brand turns on and off by itself (I suspect that a neighbour has the same unit, and my unit is responding to his remote control). Sigh.

-- from CyberSimian in the UK

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#11

Post by barnabas1969 » Thu Jun 07, 2012 1:28 pm

It sounds like you're really stuck between a rock and a hard place. You can either build your own device using Arduino and/or Phidgets (http://www.phidgets.com/index.php)... OR you can build a new PC!

Both will require spending some money and time.

milli260876

Posts: 726
Joined: Wed Jun 08, 2011 2:56 pm
Location: Barnsley Sth Yorks

HTPC Specs: Show details

#12

Post by milli260876 » Sat Jun 16, 2012 10:00 pm

Why don't U contact TBS about swapping out the tuners for one quad tuner? Then use the one slot that will sleep.
I had a failed satellite tuner and paid an upgrade fee from dual to quad...
If U explain that the cards won't sleep together they may be accomodating.
Lee

User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

#13

Post by CyberSimian » Sun Jun 17, 2012 6:19 pm

milli260876 wrote:Why don't U contact TBS about swapping out the tuners for one quad tuner? Then use the one slot that will sleep.
That would be a viable solution, if I did not have so many tuners: I have two TBS quad-tuner PCI-E cards, so I need three PCI-E slots that sleep correctly (two for the tuner cards, and one for the graphics card).

I have been looking some more at the Raspberry Pi, and it looks to be a pretty complete hardware solution -- I would just need to buy a network Pi and one of the cheap plastic cases for it (http://www.modmypi.com). So that just leaves the software. I would probably leave the Pi powered up 24/7, as the recommended power supply is 700mA at 5V, so the maximum power consumption cannot exceed 3.5W. To trigger the sending of the WOL I would use an IR receiver and an unused IR code on my remote. TBS have got a Linnux IR package (including source code) that users can download, and there may be others available. Combined with something like EventGhost I should be able to get it to send the WOL. I have got OpenSuse installed in another partition on this laptop, so I can experiment to see if I can get it to work before actually buying anything (at least, that is the theory; the practice might turn out to be somewhat different!).

-- from CyberSimian in the UK

bobbob

Posts: 676
Joined: Wed Oct 26, 2011 11:21 am
Location:

HTPC Specs: Show details

#14

Post by bobbob » Mon Jun 18, 2012 9:46 am

hope you have your order in otherwise you may be waiting 6 months for your slice of pi

User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

#15

Post by CyberSimian » Wed Jun 20, 2012 8:14 am

bobbob wrote:hope you have your order in otherwise you may be waiting 6 months for your slice of pi
No, I have not ordered one yet.

Although I am reasonably competent at writing programs that run on Windows, I have no Linnux experience, and have no confidence that I could actually write the (simple) program (possibly a shell script) to detect the trigger condition and invoke the WOL program. So I am not buying anything until after I have successfully prototyped it on my laptop's OpenSuse installation!

-- from CyberSimian in the UK

User avatar
CyberSimian

Posts: 516
Joined: Mon Jun 20, 2011 5:52 pm
Location: Southampton, UK

HTPC Specs: Show details

#16

Post by CyberSimian » Thu Mar 06, 2014 5:58 pm

Earlier this week I chanced upon a solution to my problem. I thought that I would record it here, just in case anyone else is faced with a similar problem (in fact there is someone in a MediaPortal forum at the moment who has a problem for which this would be a solution). The solution is hardware based, but I was lucky enough already to have all of the parts needed, so it has ended up costing nothing.

(1) The first thing to do is to go to Windows "Device Manager" and look at the properties of the network adapter in your HTPC. Click the "Power Management" tab and look at the "Wake on LAN" options. My network adapter is an Intel 82566DC-2 integrated on the motherboard, and has these options:

(a) Wake on Directed Packet
(b) Wake on Magic Packet
(c) Wake on Magic Packet from power off state
(d) Wake on Link

The one that you want is the last one: "Wake on Link", so select that option.

(2) Next, you need to obtain a mains power controller with master and slave sockets. When the device plugged into the master socket powers up, the devices plugged into the slave socket are powered up too. Various brands are available, but I would recommend one that has adjustable sensitivity. I originally purchased mine to use with sleep, but sleep on my Dell XPS420 consumes 9 watts, so I needed a power controller that would regard a consumption of 9 watts as being "off"(!) This is the one that I have:

http://www.amazon.co.uk/TrickleStar-E27 ... B003EYULT4

but this particular model is no longer shown on the TrickleStar website (http://www.tricklestar.com/intl/).

(3) Finally, you need a trigger device to connect to the network adapter in the HTPC. The first device that I tried was my Belkin Network USB Hub (F5L009). Connecting that via a cross-over cable to the HTPC and powering up the Belkin caused the HTPC to wake from hibernation (success!). I then tried a Netgear Fast Ethernet hub (FE104); connecting that to the HTPC via a standard cable and powering up the Netgear caused the HTPC to wake. Lastly, I tried a device that is probably the most common, is readily available, and is cheap, namely a powerline network adapter. Since this is merely acting as a trigger device, a cheap (i.e. slow) one is suitable. Connecting the powerline network adapter to the HTPC via a standard cable and powering up the adapter caused the HTPC to wake from hibernation.

(4) So this is how you put it all together. You plug your TV into the master socket of the power controller, and plug the trigger device (e.g. powerline network adapter) into the slave socket, and connect the trigger device to the network adapter in the HTPC. Using a programmable remote control, you define all buttons to send MCE commands, except for the power button, which you define to send the power-toggle command for your TV.

With the HTPC hibernating, to start using your HTPC you press the power button on the remote control. That powers on the TV, which then powers on the trigger device, which then establishes a link with the HTPC, which then wakes from hibernation.

To finishing using the HTPC, you press the power button on the remote control to switch off the TV. That then switches off the trigger device, which breaks the connection to the network adapter in the HTPC. On my HTPC, I use a program that monitors the state of the TV, and sets the hibernation timeout accordingly: when the TV switches on, the hibernation timeout is set to 2 hours; when the TV switches off, the hibernation timeout is set to 10 seconds. So after switching off the TV, the HTPC hibernates within about 30 seconds, provided that the HTPC is not recording and a recording is not about to start within the next 5 minutes.

(5) The configuration that I have described above is suitable for an HTPC which does not use its wired network adapter; it would presumably download the EPG and connect to other devices on your home network using wireless networking.

If your HTPC connects to your home network using wired networking, but does not act as a server to other devices on your network, you need to use an ethernet hub as the trigger device, and connect one port to the HTPC and another port to the wired network socket (which could be a powerline network adapter).

If your HTPC connects to your home network using wired networking, and acts as a server to other devices on your home network, you need to have two network adapters in your HTPC. This is because you need to set one adapter to "wake on link", and the other adapter to "wake on magic packet" and/or "wake on directed packet" (whichever the software running on the client computers uses to wake the server HTPC).

(6) Final thoughts: a far simpler solution is to use sleep on your HTPC. But for me there is a certain satisfaction in arriving at a usable solution without discarding existing equipment or buying new equipment.

-- from CyberSimian in the UK

Post Reply