pi@raspberrypi ~ $ ls Desktop blink1-tool ocr_pi.png pyusb-1.0.0a3.zip twilight.png RPi.GPIO-0.1.0 blink1-tool-raspi.zip python_games shell.txt blink1-ctypes.py blink1hid-demo.py pyusb-1.0.0a3 test.py pi@raspberrypi ~ $ ls -l 合計 1556 drwxr-xr-x 2 pi pi 4096 6月 18 23:18 Desktop drwxr-xr-x 7 pi pi 4096 6月 18 04:31 RPi.GPIO-0.1.0 -rw-r--r-- 1 pi pi 4317 6月 18 23:19 blink1-ctypes.py -rwsr-xr-x 1 root pi 1020394 11月 28 2012 blink1-tool -rw-r--r-- 1 pi pi 439917 6月 18 04:50 blink1-tool-raspi.zip -rw-r--r-- 1 pi pi 2426 6月 18 23:19 blink1hid-demo.py -rw-r--r-- 1 pi pi 5781 2月 3 05:07 ocr_pi.png drwxrwxr-x 2 pi pi 4096 7月 20 2012 python_games drwxr-xr-x 5 pi pi 4096 6月 18 23:09 pyusb-1.0.0a3 -rw-r--r-- 1 pi pi 58508 6月 18 23:06 pyusb-1.0.0a3.zip -rwxr-xr-x 1 pi pi 1700 6月 19 01:27 shell.txt -rw-r--r-- 1 pi pi 964 6月 18 23:19 test.py -rw-r--r-- 1 pi pi 20123 5月 31 11:45 twilight.png pi@raspberrypi ~ $ cd pyusb-1.0.0a3 pi@raspberrypi ~/pyusb-1.0.0a3 $ ls ACKNOWLEDGEMENTS LICENSE README.rst TODO docs usb ChangeLog PKG-INFO ReleaseNotes.rst build setup.py pi@raspberrypi ~/pyusb-1.0.0a3 $ sudo python setup.py install running install running build running build_py running install_lib running install_egg_info Removing /usr/local/lib/python2.7/dist-packages/pyusb-1.0.0a3.egg-info Writing /usr/local/lib/python2.7/dist-packages/pyusb-1.0.0a3.egg-info pi@raspberrypi ~/pyusb-1.0.0a3 $ sudo python blink1-demo.py python: can't open file 'blink1-demo.py': [Errno 2] No such file or directory pi@raspberrypi ~/pyusb-1.0.0a3 $ cd .. pi@raspberrypi ~ $ ls Desktop blink1-tool ocr_pi.png pyusb-1.0.0a3.zip twilight.png RPi.GPIO-0.1.0 blink1-tool-raspi.zip python_games shell.txt blink1-ctypes.py blink1hid-demo.py pyusb-1.0.0a3 test.py pi@raspberrypi ~ $ sudo python blink1hid-demo.py Traceback (most recent call last): File "blink1hid-demo.py", line 42, in dev.ctrl_transfer(bmRequestTypeOut, 0x09, (3 << 8) | 0x01, 0, [0x00, action, red, green, blue, 0x00, 0x00, 0x00, 0x00]) File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 702, in ctrl_transfer self.__get_timeout(timeout) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 596, in ctrl_transfer timeout)) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 403, in _check raise USBError(_str_error[ret], ret, _libusb_errno[ret]) usb.core.USBError: [Errno 5] Input/output error pi@raspberrypi ~ $ pwd /home/pi pi@raspberrypi ~ $ rcp nagasm@172.16.65.31:Desktop/pyusb-1.0.0-a1.tar.gz . Password: pyusb-1.0.0-a1.tar.gz 100% 155KB 155.3KB/s 00:00 pi@raspberrypi ~ $ ls Desktop blink1-tool ocr_pi.png pyusb-1.0.0a3 test.py RPi.GPIO-0.1.0 blink1-tool-raspi.zip python_games pyusb-1.0.0a3.zip twilight.png blink1-ctypes.py blink1hid-demo.py pyusb-1.0.0-a1.tar.gz shell.txt pi@raspberrypi ~ $ tar xzvf pyusb-1.0.0-a1.tar.gz pyusb-1.0.0-a1/ pyusb-1.0.0-a1/TODO pyusb-1.0.0-a1/README pyusb-1.0.0-a1/setup.py pyusb-1.0.0-a1/ChangeLog pyusb-1.0.0-a1/PKG-INFO pyusb-1.0.0-a1/docs/ pyusb-1.0.0-a1/docs/tutorial.txt pyusb-1.0.0-a1/usb/ pyusb-1.0.0-a1/usb/core.py pyusb-1.0.0-a1/usb/backend/ pyusb-1.0.0-a1/usb/backend/libusb01.py pyusb-1.0.0-a1/usb/backend/openusb.py pyusb-1.0.0-a1/usb/backend/libusb10.py pyusb-1.0.0-a1/usb/backend/__init__.py pyusb-1.0.0-a1/usb/legacy.py pyusb-1.0.0-a1/usb/_interop.py pyusb-1.0.0-a1/usb/control.py pyusb-1.0.0-a1/usb/_debug.py pyusb-1.0.0-a1/usb/util.py pyusb-1.0.0-a1/usb/__init__.py pyusb-1.0.0-a1/ACKNOWLEDGEMENTS pyusb-1.0.0-a1/LICENSE pyusb-1.0.0-a1/tests/ pyusb-1.0.0-a1/tests/testall.py pyusb-1.0.0-a1/tests/test_integration.py pyusb-1.0.0-a1/tests/utils.py pyusb-1.0.0-a1/tests/test_control.py pyusb-1.0.0-a1/tests/pic18f4550/ pyusb-1.0.0-a1/tests/pic18f4550/README pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/ pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/ pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/ pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/superClean.bat pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PIC24FJ64GB004 PIM.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/rm18f4550 - HID Bootload.lkr pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PIC24 HID Bootloader Remapping.s pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/Benchmark.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/rm18f46j50_g.lkr pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/rm18f87j50.lkr pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PicFWCommands.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/usb_descriptors.c pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C32_StarterKit.mcw pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PIC24FJ64GB002 BreadBoard.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C32_StarterKit.mcp pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PIC32MX460F512L PIM.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PIC32 USB Starter Kit.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C30.mcp pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PIC24FJ256GB110 PIM.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_PICDEM_FSUSB.mcs pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/main.c pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/rm18f14k50.lkr pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_P18F46J50_PIM.mcw pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/CleanUp.bat pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/procdefs.ld.boot pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/p24FJ256GB110 - HID Bootloader.gld pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_PICDEM_FSUSB.mcw pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - Low Pin Count USB Development Kit.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PIC18F87J50 PIM.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/rm18f4550 - MCHPUSB Bootload.lkr pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/usb_config.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_LowPinCountDevKit.mcp pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_P18F87J50_PIM.mcp pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PICDEM FSUSB.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_P18F46J50_PIM.mcp pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_LowPinCountDevKit.mcw pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PIC18F46J50 PIM.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C32_P32MX460F512L_PIM.mcp pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C32_StarterKit.mcs pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile - PIC24F Starter Kit.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/ pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/ pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/PyUSB.C30.sln pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/PyUSB.C18.FSUSB.lkr pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/PyUSB.C18.FSUSB.sln pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/clean.cmd pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/PyUSB.C18.FSUSB.vcproj pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/_vcDummy.cpp pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/Utility/ pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/Utility/MplabMake.exe pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/Utility/RegexClean.exe pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/CompilerSettings.txt pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/PyUSB.C30.vcproj pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/projects/VStudio/p24FJ64GB002.gld pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_PICDEM_FSUSB.mcp pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C18_P18F87J50_PIM.mcw pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C30.mcw pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/BDT_transfer.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/HardwareProfile.h pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/PyUSB_C32_P32MX460F512L_PIM.mcw pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/TestFirmware/Firmware/Benchmark.c pyusb-1.0.0-a1/tests/pic18f4550/Microchip Solutions/IMPORTANT README.txt pyusb-1.0.0-a1/tests/test_find.py pyusb-1.0.0-a1/tests/devinfo.py pyusb-1.0.0-a1/tests/test_backend.py pyusb-1.0.0-a1/tests/test_util.py pi@raspberrypi ~ $ ls Desktop blink1-tool ocr_pi.png pyusb-1.0.0-a1.tar.gz shell.txt RPi.GPIO-0.1.0 blink1-tool-raspi.zip python_games pyusb-1.0.0a3 test.py blink1-ctypes.py blink1hid-demo.py pyusb-1.0.0-a1 pyusb-1.0.0a3.zip twilight.png pi@raspberrypi ~ $ cd pyusb-1.0.0-a1 pi@raspberrypi ~/pyusb-1.0.0-a1 $ sudo python setup.py install running install running build running build_py creating build creating build/lib.linux-armv6l-2.7 creating build/lib.linux-armv6l-2.7/usb copying usb/__init__.py -> build/lib.linux-armv6l-2.7/usb copying usb/_interop.py -> build/lib.linux-armv6l-2.7/usb copying usb/_debug.py -> build/lib.linux-armv6l-2.7/usb copying usb/legacy.py -> build/lib.linux-armv6l-2.7/usb copying usb/control.py -> build/lib.linux-armv6l-2.7/usb copying usb/core.py -> build/lib.linux-armv6l-2.7/usb copying usb/util.py -> build/lib.linux-armv6l-2.7/usb creating build/lib.linux-armv6l-2.7/usb/backend copying usb/backend/__init__.py -> build/lib.linux-armv6l-2.7/usb/backend copying usb/backend/libusb10.py -> build/lib.linux-armv6l-2.7/usb/backend copying usb/backend/libusb01.py -> build/lib.linux-armv6l-2.7/usb/backend copying usb/backend/openusb.py -> build/lib.linux-armv6l-2.7/usb/backend running install_lib copying build/lib.linux-armv6l-2.7/usb/backend/libusb10.py -> /usr/local/lib/python2.7/dist-packages/usb/backend copying build/lib.linux-armv6l-2.7/usb/backend/libusb01.py -> /usr/local/lib/python2.7/dist-packages/usb/backend byte-compiling /usr/local/lib/python2.7/dist-packages/usb/backend/libusb10.py to libusb10.pyc byte-compiling /usr/local/lib/python2.7/dist-packages/usb/backend/libusb01.py to libusb01.pyc running install_egg_info Writing /usr/local/lib/python2.7/dist-packages/pyusb-1.0.0_a1.egg-info pi@raspberrypi ~/pyusb-1.0.0-a1 $ sudo python blink1-demo.py python: can't open file 'blink1-demo.py': [Errno 2] No such file or directory pi@raspberrypi ~/pyusb-1.0.0-a1 $ ls ACKNOWLEDGEMENTS ChangeLog LICENSE PKG-INFO README TODO build docs setup.py tests usb pi@raspberrypi ~/pyusb-1.0.0-a1 $ cd .. pi@raspberrypi ~ $ ls Desktop blink1-tool ocr_pi.png pyusb-1.0.0-a1.tar.gz shell.txt RPi.GPIO-0.1.0 blink1-tool-raspi.zip python_games pyusb-1.0.0a3 test.py blink1-ctypes.py blink1hid-demo.py pyusb-1.0.0-a1 pyusb-1.0.0a3.zip twilight.png pi@raspberrypi ~ $ cd pyusb-1.0.0-a1 pi@raspberrypi ~/pyusb-1.0.0-a1 $ ls ACKNOWLEDGEMENTS ChangeLog LICENSE PKG-INFO README TODO build docs setup.py tests usb pi@raspberrypi ~/pyusb-1.0.0-a1 $ ls build lib.linux-armv6l-2.7 pi@raspberrypi ~/pyusb-1.0.0-a1 $ ls tests devinfo.py test_backend.py test_find.py test_util.py utils.py pic18f4550 test_control.py test_integration.py testall.py pi@raspberrypi ~/pyusb-1.0.0-a1 $ ls usb __init__.py _debug.py _interop.py backend control.py core.py legacy.py util.py pi@raspberrypi ~/pyusb-1.0.0-a1 $ cd .. pi@raspberrypi ~ $ ls Desktop blink1-tool ocr_pi.png pyusb-1.0.0-a1.tar.gz shell.txt RPi.GPIO-0.1.0 blink1-tool-raspi.zip python_games pyusb-1.0.0a3 test.py blink1-ctypes.py blink1hid-demo.py pyusb-1.0.0-a1 pyusb-1.0.0a3.zip twilight.png pi@raspberrypi ~ $ sudo python blink1hid-demo.py Traceback (most recent call last): File "blink1hid-demo.py", line 42, in dev.ctrl_transfer(bmRequestTypeOut, 0x09, (3 << 8) | 0x01, 0, [0x00, action, red, green, blue, 0x00, 0x00, 0x00, 0x00]) File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 702, in ctrl_transfer self.__get_timeout(timeout) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 596, in ctrl_transfer timeout)) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 403, in _check raise USBError(_str_error[ret], ret, _libusb_errno[ret]) usb.core.USBError: [Errno 5] Input/output error pi@raspberrypi ~ $ ls -l 合計 1716 drwxr-xr-x 2 pi pi 4096 6月 18 23:18 Desktop drwxr-xr-x 7 pi pi 4096 6月 18 04:31 RPi.GPIO-0.1.0 -rw-r--r-- 1 pi pi 4317 6月 18 23:19 blink1-ctypes.py -rwsr-xr-x 1 root pi 1020394 11月 28 2012 blink1-tool -rw-r--r-- 1 pi pi 439917 6月 18 04:50 blink1-tool-raspi.zip -rw-r--r-- 1 pi pi 2426 6月 18 23:19 blink1hid-demo.py -rw-r--r-- 1 pi pi 5781 2月 3 05:07 ocr_pi.png drwxrwxr-x 2 pi pi 4096 7月 20 2012 python_games drwxr-xr-x 6 pi pi 4096 6月 19 02:59 pyusb-1.0.0-a1 -rw-r--r-- 1 pi pi 158976 6月 19 02:58 pyusb-1.0.0-a1.tar.gz drwxr-xr-x 5 pi pi 4096 6月 18 23:09 pyusb-1.0.0a3 -rw-r--r-- 1 pi pi 58508 6月 18 23:06 pyusb-1.0.0a3.zip -rwxr-xr-x 1 pi pi 1700 6月 19 01:27 shell.txt -rw-r--r-- 1 pi pi 964 6月 18 23:19 test.py -rw-r--r-- 1 pi pi 20123 5月 31 11:45 twilight.png pi@raspberrypi ~ $ rm *.zip pi@raspberrypi ~ $ ls -l 合計 1224 drwxr-xr-x 2 pi pi 4096 6月 18 23:18 Desktop drwxr-xr-x 7 pi pi 4096 6月 18 04:31 RPi.GPIO-0.1.0 -rw-r--r-- 1 pi pi 4317 6月 18 23:19 blink1-ctypes.py -rwsr-xr-x 1 root pi 1020394 11月 28 2012 blink1-tool -rw-r--r-- 1 pi pi 2426 6月 18 23:19 blink1hid-demo.py -rw-r--r-- 1 pi pi 5781 2月 3 05:07 ocr_pi.png drwxrwxr-x 2 pi pi 4096 7月 20 2012 python_games drwxr-xr-x 6 pi pi 4096 6月 19 02:59 pyusb-1.0.0-a1 -rw-r--r-- 1 pi pi 158976 6月 19 02:58 pyusb-1.0.0-a1.tar.gz drwxr-xr-x 5 pi pi 4096 6月 18 23:09 pyusb-1.0.0a3 -rwxr-xr-x 1 pi pi 1700 6月 19 01:27 shell.txt -rw-r--r-- 1 pi pi 964 6月 18 23:19 test.py -rw-r--r-- 1 pi pi 20123 5月 31 11:45 twilight.png pi@raspberrypi ~ $ rm *.gz pi@raspberrypi ~ $ ls Desktop blink1-ctypes.py blink1hid-demo.py python_games pyusb-1.0.0a3 test.py RPi.GPIO-0.1.0 blink1-tool ocr_pi.png pyusb-1.0.0-a1 shell.txt twilight.png pi@raspberrypi ~ $ ls -l 合計 1068 drwxr-xr-x 2 pi pi 4096 6月 18 23:18 Desktop drwxr-xr-x 7 pi pi 4096 6月 18 04:31 RPi.GPIO-0.1.0 -rw-r--r-- 1 pi pi 4317 6月 18 23:19 blink1-ctypes.py -rwsr-xr-x 1 root pi 1020394 11月 28 2012 blink1-tool -rw-r--r-- 1 pi pi 2426 6月 18 23:19 blink1hid-demo.py -rw-r--r-- 1 pi pi 5781 2月 3 05:07 ocr_pi.png drwxrwxr-x 2 pi pi 4096 7月 20 2012 python_games drwxr-xr-x 6 pi pi 4096 6月 19 02:59 pyusb-1.0.0-a1 drwxr-xr-x 5 pi pi 4096 6月 18 23:09 pyusb-1.0.0a3 -rwxr-xr-x 1 pi pi 1700 6月 19 01:27 shell.txt -rw-r--r-- 1 pi pi 964 6月 18 23:19 test.py -rw-r--r-- 1 pi pi 20123 5月 31 11:45 twilight.png pi@raspberrypi ~ $ sudo python blink1hid-demo.py Traceback (most recent call last): File "blink1hid-demo.py", line 42, in dev.ctrl_transfer(bmRequestTypeOut, 0x09, (3 << 8) | 0x01, 0, [0x00, action, red, green, blue, 0x00, 0x00, 0x00, 0x00]) File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 702, in ctrl_transfer self.__get_timeout(timeout) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 596, in ctrl_transfer timeout)) File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 403, in _check raise USBError(_str_error[ret], ret, _libusb_errno[ret]) usb.core.USBError: [Errno 5] Input/output error pi@raspberrypi ~ $ cat blink1hid-demo.py #!/usr/bin/python """ blink1hid-demo.py -- Low-level HID access with Python Thanks to Aaron Blondeau for this As he says: "I am working on controlling a Blink1 from an Android. In order to understand how the set feature calls work without wearing out the usb port on my Android I have created a python script that uses the pyusb library. The code is as follows if you wish to share and save some time for other folks." """ import usb # https://github.com/walac/pyusb # + "brew install libusb" on osx # + libusb-win32 (inf method) on windows #Find the Blink1 dev = usb.core.find(idVendor=0x27b8, idProduct=0x01ed) assert dev is not None #The Blink1 takes 8 bytes of input # 1=report_id (0) # 2=action (c = fade to rgb, n = set rgb now) # 3=red # 4=green # 5=blue # 6=th : time/cs high (T >>8) where time 'T' is a number of 10msec ticks # 7=tl : time/cs low (T & 0xff) # 8=step (0) # once a buffer is set with these bytes, we need to do what blink1_write / hid_send_feature_report does # https://github.com/todbot/blink1/blob/master/commandline/blink1-lib.c # https://github.com/signal11/hidapi/blob/master/libusb/hid.c #set color to red bmRequestTypeOut = usb.util.build_request_type(usb.util.CTRL_OUT, usb.util.CTRL_TYPE_CLASS, usb.util.CTRL_RECIPIENT_INTERFACE) action = 0x6E # ='n' (set rgb now) red = 0xFF green = 0x00 blue = 0x00 dev.ctrl_transfer(bmRequestTypeOut, 0x09, (3 << 8) | 0x01, 0, [0x00, action, red, green, blue, 0x00, 0x00, 0x00, 0x00]) #then fade to blue action = 0x63 # ='c' (fade to rgb) red = 0x00 green = 0x00 blue = 0xFF T = 5000/10 #5 seconds worth of 10msec tics th = (T & 0xff00) >> 8 tl = T & 0x00ff dev.ctrl_transfer(bmRequestTypeOut, 0x09, (3 << 8) | 0x01, 0, [0x00, action, red, green, blue, th, tl, 0x00, 0x00]) #get version number import time import string action = 0x76 # ='v' (version) dev.ctrl_transfer(bmRequestTypeOut, 0x09, (3 << 8) | 0x01, 0, [0x00, action, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) time.sleep(.05) bmRequestTypeIn = usb.util.build_request_type(usb.util.CTRL_IN, usb.util.CTRL_TYPE_CLASS, usb.util.CTRL_RECIPIENT_INTERFACE) version_raw = dev.ctrl_transfer(bmRequestTypeIn, 0x01, (3 << 8) | 0x01, 0, 8) version = ''.join(chr(i) for i in version_raw) # items in the array should correspond to ascii codes for something like "v 100" version = filter(lambda x: x in string.printable, version) print version #the c code must tack on an extra 0? pi@raspberrypi ~ $