Main > Main Forum

One-button power on/off with IPAC2?

<< < (4/5) > >>

fkane:
One bit of progress - I came across the attached plug-in that will safely shut down Mala when Windows 7 shuts down. Hooray! I don't know who to thank for writing it, but thanks whoever you are. So, you'd think at this point I could wire my power button to the motherboard's power switch and be done with it.

Now for the sad part - even when powered down, my computer is still giving power to the USB bus, and Mala is not issuing exit commands when shutting down using this plugin. That means I can't have Mala tell LED Blinky to shut all the lights off at shutdown, and I don't see any BIOS options for cutting power to the USB bus when it's off either. So, my "powered off" cabinet still has lights illuminated on it in whatever state they were in at shutdown.

I can't believe how hard such a simple thing is! But for people who don't have such odd BIOS's, perhaps this is useful.

keilmillerjr:

--- Quote from: fkane on August 26, 2013, 02:20:10 pm ---The only appeal of going through the IPAC is that I could tell Mala to shut itself down cleanly, instead of resorting to some other process forcing it to close upon shutdown. I could envision a kid hitting the power key at just the wrong time leading to a corrupt file or something. If only Mala handled shutdown properly, this would be so simple - I would just wire the button the the motherboard's power switch and be done with it.

Thinking about it some more, I wonder if my BIOS wasn't recognizing my power button as a keyboard press because I mapped it to "power" in the IPAC instead of a "normal" key. I think I'll try mapping it to some normal keystroke that Mala recognizes as an exit and shutdown command, and see if that works. I'll follow up.

--- End quote ---

You could do what you are wanting using autohotkey or similar automation scripting engine with button attached to power pins on motherboard. Using a button connected to an ipac, I doubt there is any way you can get it to start up the system.

fkane:
You're right - I contacted Ultimarc and an IPAC cannot start up a powered down system.

I do think AHK is my only hope for shutting off the lights. I was trying to hack the "graceful exit" plugin to call ledblinky.exe 2 before closing Mala, but that didn't work.

fkane:
Just for posterity, here's what I ended up with. To recap, the problem is that my computer has a "feature" - an increasingly popular one - that power keeps going to the USB bus even when power is off, so you can charge your iDevices at all times.  And with my BIOS, there seems to be no way of disabling it. This means my Pac-Drive-powered LED lights stay on even when the system is off, which is just silly - and my family nags me about leaving the cabinet on all the time and wasting power, even though it is in fact sleeping or shut down.

Shutting off the LED's at shutdown proved to be a delicate operation; it must be timed perfectly with other things going on at shutdown it seems. Plus, Windows' + Mala's startup time is enough to annoy a user who expects to push the power button and quickly start playing. So, I just gave up on having my cabinet's power button actually power down the system and lights. Given that power would still be flowing to my IPAC and Pac-Drive anyhow, there seemed to be little to gain from shutting down vs. sleeping. I put a piece of tape over the blinking light on the case when it sleeps, and kept my power button wired to the IPAC and mapped to sleep/wake. I also set up Windows to automatically sleep after an hour of idle time.

Now, the problem was getting my Pac-Drive lights to shut off when sleeping, and to start back up on waking. Initially I set up an AutoHotKey script to run "ledblinky.exe 2" upon sleep, and "ledblinky.exe 1" upon wake, but this ended up confusing the Mala plugin since this causes the ledblinky process to get a new process ID.

So, I set up a new screensaver animation with LED Blinky's animation editor that just does nothing, and assigned that to be LED Blinky's front end screensaver. When AutoHotKey gets notified that Windows is about to sleep, I tell ledblinky to start its screensaver - which turns off the LED's. When it wakes back up, I end the screensaver, putting ledblinky back to its previous state for Mala.

It is a sick hack, but so far it seems to work. Here's my AutoHotKey script if anyone else finds it useful (obviously substitute your own path to ledblinky - and set up that do-nothing screensaver animation first.) I compiled this script to an exe and put it in my Startup folder.

OnMessage(0x218, "func_WM_POWERBROADCAST")

Return

func_WM_POWERBROADCAST(wParam, lParam)
{   
   If (lParam = 0) {
      ; PBT_APMSUSPEND or PBT_APMSTANDBY? -> System will sleep
      If (wParam = 4 OR wParam = 5) {
         RunWait, c:\arcade\mala174\mala174\plugins\ledblinky\ledblinky.exe 5
      }
      
      ; PBT_APMRESUMESUSPEND oder PBT_APMRESUMESTANDBY? -> System wakes up
      If (wParam = 7 OR wParam = 8) {
         RunWait, c:\arcade\mala174\mala174\plugins\ledblinky\ledblinky.exe 6
      }
   }
   Return
}

severdhed:
another option would be to have the PC on a smart power strip, and your pac-drive plugged into a powered usb hub, which is plugged into one of the slave ports on the smart power strip..when the pc shuts off, the power strip kills power to the other outlets and therefore shuts off the usb hub.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version