turn on/off usb lamp

G

Guest

hi,

i want to turn on/turn off a usb lamp via a vb.net button...
i think i would have to turn on/turn off the power for this usb port....

how could i do this?

kind regards
 
H

Herfried K. Wagner [MVP]

Zabby said:
i want to turn on/turn off a usb lamp via a vb.net button...
i think i would have to turn on/turn off the power for this usb port....

Check out if the manufacturer of the USB lamp provides an SDK which allows
turning off the lamp.
 
G

Guest

Looks like you have to do somekind of device driver level programming for this.

Anyway there seem to be a product that traps raw USB data at
http://www.hhdsoftware.com/usbmon.html.My guess is that you will have to do
something similar.

Another idea is you can try and disable/enable the device, if Windows
recognizes it. I am not sure what API to use, but my guess is that there is a
set of Windows API/DD API which will allow you to do it.
 
G

Guest

the usbmonitor is a good idea...
but i think, the usb lamp turns on when you connect it...
but i am not sure, because i don´t have bought one yet...

so i would have to disable or enable the device...

any sample code, how to disable/enable a device in vb.net?
 
G

Guest

i testet it with a usb lamp...
the lamp starts lightening, when i connect it to usb...

but even if i deactivate the whole usb-port, it´s always lightening....
:(
 
N

Nick

Hi Zabby,

No disrespect meant toward you at all, but if you want to program for a
specific piece of hardware, acquire it first. Even if a piece of hardware
can be controlled it wont necessarily be to your liking or be reliable! And
that applies to expensive hardware too that boast a control protocol which
doesnt actually work! You might not even like the lamp and have wasted
hours/days of work getting the code for something inadequate.

Anyway, just my opinion.

Nick Pateman.
 
G

Guest

wasn´t a good day for you - uh?

in my post i wrote:
"i testet it with a usb lamp...
the lamp starts lightening, when i connect it to usb...
but even if i deactivate the whole usb-port, it´s always lightening...."

so, i didn´t solved my problem yet....
 
G

Guest

The USB ports supply 5V power to whatever is plugged into them. A device can
use the data lines and/or the power lines when plugged into them. Since most
lights don't use the data at all, they'll just get power from the 5V lines.

5V power is always supplied to the ports, even if you disable to USB ports.
There's no method, that I've found anyway, of turning the power off to a USB
port.

Unless you can program the light and send data to it (I don't know of ANY
that you can do this with), you can't do what you want.
 
N

Nick

Hi Zabby,

actually, a quote from you,

"but i am not sure, because i don´t have bought one yet..."

No need to bad mannored, I was offering my professional advice as I've spent
many an hour controlling hardware via many different protocols, I've even
had to write code to support some via documents before even recieving the
hardware, just to come across problems which needn't have happened.

And I also said "Anyway, just my opinion.", take it or leave it, no skin off
my nose!

Nick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top