Search code examples
browserusbusbserial

Activate/Desactivate usb device from distant computer


I would like to turn on/off an USB device (light) from a distant computer, is it possible ?

More details

This is for a digital display at work, we would like to power a light everytime the display is changing. We are using web browser to make our display but I don't think there is a way to activate/desactivate USB through browser. I'm thinking about using PHP and event-trigger on C to make this work, what do you think ?

Thank you !


Solution

  • Since most browsers removed plugin support (at least native plug-ins), the common way to solve this problem now is to have a separate driver that provides an http service to javascript.

    This sounds like a situation where you have control over the client machine. So, yes, you need a native app of some sort to control the USB device. You can write this in a language that works to control the device and can listen for http connections on a local port. Java may be a good choice. or C#. With the right libraries it can be done in just about any language.

    You then can use Ajax to communicate with the native program from javascript.