0

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 !

Gingerboy
  • 3
  • 4

1 Answers1

0

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.

Garr Godfrey
  • 8,257
  • 2
  • 25
  • 23
  • Thanks a lot ! I just tested some line of code in C to be sure that I could disable the USB port and it seems to work fine. Ajax/Javascript with C seems to be the answer I was looking. Thanks again ! – Gingerboy Apr 03 '17 at 13:21