CarNetix Support Forum  

Go Back   CarNetix Support Forum > Main Forum > CNX-P2140-PC

Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2008, 10:11 PM
ShellDude ShellDude is offline
Junior Member
Site Admin
 
Join Date: Sep 2008
Posts: 17
Default Simple Service & Tray App for Managing USB Hibernation - X64 Supported

Now includes x64 support! Read last post for important driver information.

A couple weeks ago I picked up my Carnetix P2140, went through the firmware update process, and quickly grew tired of always having the Carnetix PSU mon app open on my taskbar.

I saw that Carnetix had released an SDK some time back, grabbed it, and soon had a custom hibernation service and trayicon app running that met my specific needs.

I'm a developer by trade so this stuff is very common for me. I recognize this isn't necessarily the case for others so I'm releasing my app suite, free of charge, without warranty, for unlimited personal use to those interested.

You can download the Windows installer here:
http://www.shellware.com/projects/p2...40MonSetup.zip

Download the zip file, extract the files and run setup.exe. After a few moments a new service will be installed on your computer named "P2140 Monitor", a trayicon application will be added to your Startup folder, and a handful of shortcuts will be created in a new Programs folder that enable you to start/stop the P2140 Monitor service and launch the P2140 Monitor system tray application.


The behavior of the service is pretty simple -- wait for the USBShutdown event and put the system into Hibernation.

Feel free to chime in with any questions, etc. This project will be probably be "developmentally" active for the next couple months.

Shell

Last edited by ShellDude; 01-30-2010 at 04:45 PM.
Reply With Quote
  #2  
Old 09-16-2008, 07:02 AM
mikeh's Avatar
mikeh mikeh is offline
Administrator
Site Admin
 
Join Date: Jun 2006
Posts: 836
Default

Shell,

Awesome job! I'll give it a test and let you know what I find.

MikeH
__________________
Mike H
CarNetix
www.carnetix.com
mikeh@carnetix.com
Reply With Quote
  #3  
Old 09-16-2008, 11:57 AM
ShellDude ShellDude is offline
Junior Member
Site Admin
 
Join Date: Sep 2008
Posts: 17
Default

Looking forward to any feedback, from anyone willing to provide it.

I have a short list of enhancements I'm currently considering ranging from a settings toolbox window from the trayicon app, to being able to select from Standby, Hibernate, and Shutdown as USBShutdown actions.

I'm also considering an option for launching a 3rd party app on shutdown/resume, but currently do not have any personal need for it.

Also on the table is services/device shutdown on USBShutdown and restart on resume from standby/hibernation. XP is riddled with Hibernate issues -- picking and choosing what devices are active at hibernate time may help to reduce issues... All very pie in the sky at the moment, but a possibility, especially if I start encountering device issues myself.

Shell
Reply With Quote
  #4  
Old 09-20-2008, 02:17 PM
mikeh's Avatar
mikeh mikeh is offline
Administrator
Site Admin
 
Join Date: Jun 2006
Posts: 836
Default

Shell,

Works as advertised! Nice job.

There were times while testing that I did not want my PC to go into hibernation when the P2140 was shutting down. Perhaps your previous suggestion of a selectable "shutdown state" could include "no shutdown".

The selective services/devices active at hibernate time sounds like a good idea. I would be interested in seeing if this does help with the quirky hibernate problems in XP.

Keep up the good work!
__________________
Mike H
CarNetix
www.carnetix.com
mikeh@carnetix.com
Reply With Quote
  #5  
Old 09-21-2008, 02:17 AM
ShellDude ShellDude is offline
Junior Member
Site Admin
 
Join Date: Sep 2008
Posts: 17
Default

Thanks for the info.

Here are how things are working out for the next release:

  • "Options. . ." added to the context menu

  • Cute icon and copyright notice added
  • Option to select Standby, Hibernate, Shutdown, or Ignore


  • tab is currently disabled - but functions are implemented
  • Use WakeUp.bat & Shutdown.bat for custom shutdown / wake up events
  • Checkout DEVCON and RUNAS for advanced operations

  • Ability to stop/start the P2140 Monitor service
  • Ability to reset to the P2140 PSU itself
  • Reset P2140 factory defaults
  • Disable/Enable the Primary Power Rail (be careful)
  • Disable/Enable the Secondary Power Rail
  • Disable/Enable the P5V Rail (if installed)

I should have this version packaged up and ready for distribution some time tomorrow evening. I want to do a little bit more testing before I release it. It's working fine so far.
Reply With Quote
  #6  
Old 09-21-2008, 02:32 AM
ShellDude ShellDude is offline
Junior Member
Site Admin
 
Join Date: Sep 2008
Posts: 17
Default Using DEVCON to start and stop devices...

DEVCON is cool little app Microsoft put together to show developers how to use the WIN32 SetupApi to manipulate device statuses like what you do in Device Manager.

You can find it here: http://support.microsoft.com/kb/311272

Download it, and put the i386/DEVCON.exe file in your C:\Windows directory -- that way it is in your system path.

Here's an example of how you could use DEVCON to disable all USB devices prior to a shutdown and then re-enable them on Wake Up with P2140 Monitor.

Add the following line to C:\Program Files\P2140 Monitor\Shutdown.bat

Code:
devcon disable usb*
Then in C:\Program Files\P2140 Monitor\WakeUp.bat, add the following:

Code:
devcon enable usb*
The text following enable/disable is the DEVICE ID for the device(s) you want to manipulate. You can find the DEVICE ID for specific devices in the Details tab for them in Device Manager.

You can also add as many devcon statements to each batch file as you like, so long as they can complete executing, and the subsequent shutdown event finish before the SD_LOC timer on the P2140 is reached.
Reply With Quote
  #7  
Old 09-21-2008, 02:47 AM
ShellDude ShellDude is offline
Junior Member
Site Admin
 
Join Date: Sep 2008
Posts: 17
Thumbs up Another one - Killing Apps on Shutdown and Re-Launching them on Wake Up

If you don't already have PSKILL, you need it. Grab PSTools here: http://technet.microsoft.com/en-us/s.../bb896683.aspx and put PSKILL.EXE in your C:\Windows directory.

If you wish to kill a flakey process on shutdown (lets say something like iNav iGuidance because it and your GPS don't play well together) add the following lines to your C:\Program Files\P2140 Monitor\Shutdown.bat file:

Code:
pskill iguidance
pskill iguidanceumpc
And there there's a third party freeware app that replaces Microsoft's RUNAS command and allows you a bit more freedom in launching applications, especially from services.

You can find it here: http://www.softtreetech.com/24x7/archive/53.htm

I chose to put RUNAS.EXE in my P2140 Monitor directory so that I am not messing with system files (Windows already has a RUNAS command).

Hypothetically, since we can't go into Hibernate with iGuidance running, we kill it with PSKILL on shutdown, but we want it reloaded when we power cycle. Add the following to your C:\Program Files\P2140 Monitor\WakeUp.bat file:

Code:
"C:\Program Files\P2140 Monitor\RunAs.exe" domain\username password /V "C:\Program Files\iNav\iGuidance\iGuidanceUMPC.exe"
Be sure to replace domain\username and password with a valid username/password combination. If you want to use a local account then prefix username with ".\" instead of "domain\".
Reply With Quote
  #8  
Old 09-21-2008, 09:05 PM
ShellDude ShellDude is offline
Junior Member
Site Admin
 
Join Date: Sep 2008
Posts: 17
Default

The link in the first post has been updated. For the sake of versioning, this release is considered v1.0.0.1

I don't see myself making any more enhancements in the near future unless there's a pressing request or I encounter something requiring a fix / enhancement.

With that said, if there's something you'd like to see that hasn't already been covered, or you need help setting up the shutdown/wakeup batch files to meet your specific needs, jump on in.

Shell
Reply With Quote
  #9  
Old 08-30-2009, 08:24 PM
ShellDude ShellDude is offline
Junior Member
Site Admin
 
Join Date: Sep 2008
Posts: 17
Default

First post updated.

Now includes x64 support. You'll need to update the PIC18F device drivers yourself though. You can find them here:

http://www.microchip.com/Microchip.W...Name=en537044#

They're in the MCHPFSUSB folder of the referenced .zip file. You'll want the Application Support Libary download.
Reply With Quote
  #10  
Old 10-03-2009, 11:15 PM
mentor mentor is offline
Junior Member
Site Admin
 
Join Date: Oct 2009
Posts: 2
Default Service cannot be started!

Hi all, I'm running this tool on a new intel mac mini (XP SP3). The PSUMoni application seems to be able to connect using the USB fine but I cannot get this service to start. It fails stating an error communicating with the usb device.

Any ideas?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
The contents of this forum are copyright 2010 CarNetix