1

I would like to control a usb lamp with linux by switching its current on and off.

Basically any solution comes with inserting values in

/sys/bus/usb/devices/..../power/level

This would be a great idea but there is no way to find which device my device is. I tried lsusb, exploring /proc.bus/input/devices, even a bit a C code [4] but nothing seems related to my device.

To give more information it is a rotating lamp with a on/off switch but it does not seem to have any interaction with the computer except for the current.

Note : I have already looked for solution in SO on [1], [2] and even for windows ([3])

[1] : Controlling a USB power supply (on/off) with linux

[2] : Linux USB: turning the power on and off?

[3] : USB Device Connected

[4] : http://www.kernel.org/doc/pending/hotplug.txt

Community
  • 1
  • 1
kamaradclimber
  • 2,479
  • 1
  • 26
  • 45
  • Is your device identified when you plug it into the USB port? In a terminal you can do `dmesg | tail` and watch while you plug in the device. Check to see if a driver is associated with it. – Kurt Stutsman Oct 14 '11 at 20:54

1 Answers1

2

The problem is probably that most USB lamps are not USB devices at all. They use the USB port just to get the power.

No data connection means that the operating system does not know anything about it, and there is little you can do about that, other than using a hub, for example, and detect the hub, instead of the lamp...

rodrigo
  • 94,151
  • 12
  • 143
  • 190