title: Turning off a single usb device... again
body: <p>I know that this topic has been discussed many times, but none of the answers helped me. For the record, i'm running Debian.</p>
  
  <p>The deal is: I bought an usb powered led lamp, which is very simple and doesn't even have an on/off switch (it works and is always on). I want to be able to turn it on/off via command line. Here's what i tried:</p>
  
  <pre><code>    echo on &gt; /sys/bus/usb/devices/usb1/power/level       # turn on
      echo suspend &gt; /sys/bus/usb/devices/usb1/power/level  # turn off
  </code></pre>
  
  <p>which is what i've found on many forums. Turning "on" works, but "suspending" yields</p>
  
  <pre><code>    -su: echo: write error: Invalid argument
  </code></pre>
  
  <p>for every usbN. I also tried </p>
  
  <pre><code>    echo "0" &gt; "/sys/bus/usb/devices/usbX/power/autosuspend_delay_ms"
  </code></pre>
  
  <p>which doesn't give an error, but also doesn't do anything (again, for every usbN)</p>
  
  <p>trying </p>
  
  <pre><code>    echo "usb1" &gt; /sys/bus/usb/drivers/usb/unbind
  </code></pre>
  
  <p>works only for more "inteligent" devices, like the keyboard, the mouse, or the usb wifi card. What i mean is that only tyhose devices are turned off, other usbN don't give an error, but the lamp never goes off.</p>
  
  <p>the contents of /sys/bus/usb/devices/ are </p>
  
  <pre><code>    1-0:1.0 1-1:1.0 1-2:1.0 1-2:1.2 2-0:1.0 4-0:1.0 4-1:1.0 6-0:1.0 8-0:1.0 8-2:1.0 usb2 usb4 usb6 usb8
      1-1 1-2 1-2:1.1 1-2:1.3 3-0:1.0 4-1 5-0:1.0 7-0:1.0 8-2 usb1 usb3 usb5 usb7
  </code></pre>
  
  <p>i tried to do </p>
  
  <pre><code>    echo device_name &gt; /sys/bus/usb/drivers/usb/unbind
  </code></pre>
  
  <p>with every single one of them, but only the devices usbN and N-M react, the ones of the form n-m:x.y yield</p>
  
  <pre><code>    tee: /sys/bus/usb/drivers/usb/bind: No such device
  </code></pre>
  
  <p>(i tried putting in, for instance, "1-0:1.0", "1-0\:1.0" and "1-0\:1.0", all gave the same result). </p>
  
  <p>One last thing, what is shown after executing </p>
  
  <pre><code>    lsusb -t
  </code></pre>
  
  <p>does not change when i plug or unplug the lamp.</p>
  
  <p>Any ideas?</p>