0
\$\begingroup\$

I want to build a simple USB lamp (maybe colored LED lamp) which will be controlled by PC. So, actually, i want to get practice in linux kernel modules development, but i need to get appropriate schematic. It is clear for me that basically i want to switch on and switch off this lamp from userspace utility, which will manipulate with device through the driver. Further, maybe, i will add lamp color changing using principles from this article http://www.diylife.com/2008/01/25/make-a-usb-color-changing-light/

But now i want to understand one thing, as i said before, i want to build a scheme with lamp and without microcontroller, which will connects to PC through the USB interface. And i want to manipulate (switch on switch off and further maybe color changing) this lamp directly using usb data channel. Is it possible? Can anybody helps me to find appropriate schematic? Thanks.

\$\endgroup\$
  • 4
    \$\begingroup\$ You can always buy an off the shelf USB-based lamp driver device, which will internally incorporate a microcontroller. USB is not a simple protocol like parallel ports, where individual lines can get pulled high or low by software. There is an USB enumeration step which requires intelligence (code) on the part of a microcontroller. \$\endgroup\$ – Anindo Ghosh May 2 '13 at 9:39
2
\$\begingroup\$

"with lamp and without microcontroller" - this is basically impossible, as you need a microcontroller or similar to run the other end of the USB protocol. You can get devices which roll up the complexity for you: FTDI chips can be used to drive a line high or low, for example.

\$\endgroup\$
0
\$\begingroup\$

This used to be possible by enabling/disabling a USB port, but is no longer supported since kernel version 2.6.38 (give or take a couple minor releases). The code was entirely removed from the kernel in 2010. Only option is some sort of 'USB relay', you might want to google on that.

If you are still curious, Google for /sys/bus/usb/devices/.../power/control and /sys/bus/usb/devices/.../power/level

\$\endgroup\$
  • 1
    \$\begingroup\$ github.com/mvp/uhubctl allows per-port control with usb hubs that support it, though few do. \$\endgroup\$ – Lucas W Jan 4 '18 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.