Ich habe eine USB-schaltbare Steckdosenleiste, für die es auch ein auf pyusb basierendes Python-Modul gibt:
http://sispmctl.svn.sourceforge.net/vie ... y?view=log
Das Gerät kann ich nur als superuser (sudo) ansteuern, sonst kommt etwas wie:
Code: Alles auswählen
$ python sispm.py -dev 0 -status 0
Traceback (most recent call last):
File "sispm.py", line 180, in <module>
{False: "off", True: "on"}[dev.get_outlet_enabled(outlet)])
File "sispm.py", line 116, in get_outlet_enabled
return self._usb_command(3*(outlet+1), 0x03, True)
File "sispm.py", line 99, in _usb_command
buf=self.deviceHandle.controlMsg(reqtype,req,buf,(0x03<<8)|b1,0,500)
usb.USBError: error sending control message: Operation not permitted
Code: Alles auswählen
$ sispmctl -s
Gembird #0 is USB device 039.This device is a 4-socket SiS-PM.
USB set configuration could not set config 1: Operation not permitted
Code: Alles auswählen
BUS=="usb", SYSFS{idVendor}=="04b4", SYSFS{idProduct}=="fd13", ACTION=="add", MODE="666"
Code: Alles auswählen
/etc/init.d/udev reload
Nach Abziehen und Einstecken kommt mit dmesg:
Code: Alles auswählen
[] usb 4-4.4: new low speed USB device using ehci_hcd and address 40
[] usb 4-4.4: configuration #1 chosen from 1 choice
[] /build/buildd/linux-2.6.27/drivers/hid/usbhid/hid-core.c: couldn't find an input interrupt endpoint
Werde mich jetzt tiefer in udev einlesen, aber wer eine Idee hat ..