• 08.06.2024, 17:50
  • Registrieren
  • Anmelden
  • Sie sind nicht angemeldet.

 

iBeta2

Junior Member

Workaround for Resume from Sleep USB Connection Issues

Sonntag, 5. Februar 2012, 21:56

I've been plagued by resume from sleep (S3 state) problems for ever now. Specifically in 2012 all settings (sensor names, Controllers, Alarms) are lost after a resume and the only way to get them back is to reconnect the usb or reboot.
To fix this the aquasuite process should be suspended just before sleep and resumed just after.
The quickest way is to download pstools from: http://technet.microsoft.com/en-us/sysin…s/bb897540.aspx.
Bat files can be made - these will work if pssuspend.exe is copied to c:\ : ( -r == resume )
C:\pssuspend.exe aquasuite.exe
C:\pssuspend.exe -r aquasuite.exe

Of course it is still a pain to have to double click bat files every time. Automation can be done by ie .NET:

1 - this needs to go in the constructor: (using Microsoft.Win32)

Quellcode

1
SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged);


2-then just need to add the event: (using Microsoft.VisualBasic)

Quellcode

1
2
3
4
5
6
7
8
void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) 
{ 
if (e.Mode == PowerModes.Suspend) 
int procID2 = Interaction.Shell("C:\\pssuspend.exe aquasuite.exe", AppWinStyle.NormalNoFocus, true , -1); 

if (e.Mode == PowerModes.Resume) 
int procID2 = Interaction.Shell("C:\\pssuspend.exe -r aquasuite.exe", AppWinStyle.NormalNoFocus, true , -1); 
}

On Edit - altered args from NormalFocus to NormalNoFocus and false to true, so the function waits for pssuspend to finish .

Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von »iBeta2« (6. Februar 2012, 13:59)

kkorky

unregistriert

Dienstag, 28. Februar 2012, 13:29

Hi ibeta2,
i came across your thread, and i found it very interesting. I myself have an aquastream xt ultra in my new wc loop. So far so good i hear you say, but my problem is as follows-i am absolutely USELESS when it comes to what i call programming, and so although your post seems to give a solution to the aquastream/S3 prob, i have no idea how to set up the info you have provided, and implement it into my windows 7 64 bit system. could i possibly trouble you to post a walk-through for IT challenged people such as myself?
thanking you in advance for your much appreciated help :thumbsup:

iBeta2

Junior Member

Montag, 5. März 2012, 00:46

No problem :) .

MAke a new text file containing only:

C:\pssuspend.exe aquasuite.exe

Call it anything - its function is to suspend the Aquasuite - and save anywhere. Then change the extension from .txt to .bat (if the extension is not shown in file explorer, you need to press 'Organize' at the top-left of the File Explorer and click Folder and search options in the drop down list. Then click the 'view' tab and uncheck the 'Hide extensions....' box ).

Repeat the process for:
C:\pssuspend.exe -r aquasuite.exe

to resume Aquasuite.

There are now 2 .bat files, and if you double-click on them they should work. Of course, before they do, the app they reference must be where they state - so you'd need to download PsTools from here, and copy pssuspend.exe to the c:\ drive. It can be anywhere you want, but then the path in the bat files will have to match.

Hope this helps. Have you actually had any problems?

Donnerstag, 8. März 2012, 17:50

Maybe we should run this as a service ? Or how do you run this? Is this an .exe which runs the whole time?

iBeta2

Junior Member

Dienstag, 13. März 2012, 22:48

Maybe we should run this as a service ? Or how do you run this? Is this an .exe which runs the whole time?
Yes, it runs as a hidden windows form. I could maybe upload the exe, but AC mailed that the usb connection problem that this fixes (most of the time anyway) will be fixed in Beta14. So hopefully there will be no point in going further with this.