Teddy Posted March 1, 2013 Report Share Posted March 1, 2013 First off I just want to say that I really enjoy using my flirc, thanks for making such a great product! That said, I really think this should be the default behavior of the wake command (to also put the computer to sleep when pressed) but that may not be possible so here is my solution. Sorry this is so long but that's only because it goes step by step by step. :) Obtain the beta firmware and utility. Current ones as of this writing available After you extract the zip you might need to move the firmware file to the same folder the flirc_util.exe file is in. Open a command prompt and navigate to the folder flirc_util.exe is in. If you have already set up your remote buttons then you should back up your flirc's config, Type flirc_util saveconfig myConfig Then to upgrade the firmware type flirc_util upgrade fw_255.9.bin You can then reload your config flirc_util loadconfig myConfig.fcfg You can now record a button to wake up your computer when it is sleeping. If the button you want to use is already mapped to something you will have to clear it first with flirc_util delete and press the button on your remote that needs to be cleared. Then record the wake command flirc_util record wake and press the button on your remote you want. To make the flirc able to wake the computer type flirc_util suspend_detect enable (there are still bugs and error messages when this is enabled but you can mostly ignore them.) Save your flirc config again now flirc_util saveconfig myConfigWake At this point you should have a remote that will wake your computer from sleep. Its always good to test things so go ahead and try it out! So now that that works we need a way to put your computer to sleep. Eskro has made a great guide on how to do that with a system call shortcut. But we need to put these two together somehow. So instead of a shortcut to a system call we will make a shortcut to a .bat file that will make the system call and other various things. Before you go any further you should move the flirc_util.exe and your myConfigWake.fcfg somewhere more organized. Mine are at C:\HTPC\Flirc. In this folder create a new txt file and name it Sleep.bat Right click on the Sleep.bat and click edit then paste this into it and save it. cd c:\HTPC\Flirc flirc_util loadconfig myConfigWake.fcfg flirc_util suspend_detect enable rundll32 powrprof.dll,SetSuspendState So there is a little bit more in there then just the sleep command but it will soon be clear why. Next we need a way to run this bat file. In Eskro's thread some people suggested creating a shortcut in your startmenu or on the desktop that has a shortcut key. That worked fine for me until I started XBMC and then it wouldn't work any more so I made an AutoHotKey script for it instead and haven't had any more problems. So go download AutoHotKey and install it. Make another txt file and name it Sleep.ahk. Right click on Sleep.ahk and click edit then paste this into it, save it, close it, and double click it to run it. ^!s::Run C:\HTPC\Flirc\Sleep.bat Also we need to make a shortcut of Sleep.ahk and put that in the startup folder in the startmenu. The ^!s in the AHK script means ctrl-alt-s. You can make this anything you want, just make it something you are not using already. We need to setup flirc now to make one of the buttons on your remote press ctrl-alt-s or whatever you made it to be. Actually we're not going to make just any button do that, we need to make the same button that wakes up your computer to press those keys. So back to the command prompt! Type: cd c:\HTPC\Flirc flirc_util delete flirc_util record_api 5 22 flirc_util saveconfig myConfigSleep If you are not using ctrl-alt-s then you will need to give the record_api command different arguments to reflect your hotkey. You can type flirc_util record_api help for the syntax and you can look up the list of HID codes starting on page 53 of this pdf file. We need to make one more .bat file that will be run by windows Task Scheduler when windows is coming out of sleep mode. Create a new .txt file and name it setFlircSleep.bat. Right click setFlircSleep.bat and click edit and paste this code into it and save it. cd c:\HTPC\Flirc flirc_util suspend_detect disable flirc_util loadconfig myConfigSleep.fcfg Now hit start and in the search bar type Event Viewer (yes Event Viewer, not Task Scheduler.) On the left side expand Windows Logs and click on System. You should have some recent events from when you were testing your wake button with a source listed as "Power-Troubleshooter" and an Event ID of "1". Right click on one of them and click Attatch Task To This Event. Click Next, Next, Next, then click browse and find your setFlircSleep.bat file. One last thing to do is to make a shortcut to setFlircSleep.bat and put that in the startup folder in the startmenu. This is to ensure that in the off chance that your computer loses power while it's sleeping, the remote will still be able to put the computer back to sleep when it turns back on. The final contents of my c:\HTPC\Flirc folder are: flirc_util.exe Sleep.ahk myConfigSleep.fcfg myConfigWake.fcfg setFlircSleep.bat Sleep.bat and both Sleep.ahk and setFlircSleep.bat have shortcuts in the startup folder. And thats it! Congratulations on setting up sleep/wake on the same button with your flirc! note: The use of the flirc_util suspend_detect enable and disable commands may be unnecessary with future firmware. They definitely help at the moment but it still might not work every time. I only tested this on Windows 7 64bit but it should work fine on other versions. Also I consider this solution a super messy hack (reprogramming the whole flirc config twice every cycle lol) and I hope this functionality will eventually be supported in the main application but its working fine for me and I'm happy with it. 7 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.