# libusb1.py timeout error using BlinkStickNano

**URL:** <https://forums.blinkstick.com/t/libusb1-py-timeout-error-using-blinksticknano/809>\
**Category:** Support\
**Created:** [September 25, 2017, 8:43am UTC](https://forums.blinkstick.com/t/libusb1-py-timeout-error-using-blinksticknano/809 "2017-09-25T08:43:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marsdbr](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@marsdbr](https://forums.blinkstick.com/u/marsdbr)\
**Post date:** [September 25, 2017, 8:43am UTC](https://forums.blinkstick.com/t/libusb1-py-timeout-error-using-blinksticknano/809/1 "2017-09-25T08:43:32Z")

</div>

Hello,

i received two BlinkStick Nano and would like to use them for messenger notification.  
It works very well, but but after some time (sometimes some seconds, sometimes two minutes) of blinking i got an error message. Libusb1.py report an timeout error. I could reduce the error generation python code to the following lines.

```
from blinkstick import blinkstick

for bstick in blinkstick.find_all():
    bstick.blink(index=0, hex='#101010', repeats=20000, delay=500)

```

The error message is:

```
    Traceback (most recent call last):
  File "/home/marco/Desktop/blink2.py", line 16, in <module>
    bstick.blink(index=0, hex='#101010', repeats=20000, delay=500)
  File "/usr/lib/python2.7/site-packages/blinkstick/blinkstick.py", line 689, in blink
    self.set_color(channel=channel, index=index)
  File "/usr/lib/python2.7/site-packages/blinkstick/blinkstick.py", line 341, in set_color
    self._usb_ctrl_transfer(0x20, 0x9, report_id, 0, control_string)
  File "/usr/lib/python2.7/site-packages/blinkstick/blinkstick.py", line 244, in _usb_ctrl_transfer
    return self.device.ctrl_transfer(bmRequestType, bRequest, wValue, wIndex, data_or_wLength)
  File "/usr/lib/python2.7/site-packages/usb/core.py", line 711, in ctrl_transfer
    self.__get_timeout(timeout)
  File "/usr/lib/python2.7/site-packages/usb/backend/libusb1.py", line 836, in ctrl_transfer
    timeout))
  File "/usr/lib/python2.7/site-packages/usb/backend/libusb1.py", line 571, in _check
    raise USBError(_str_error[ret], ret, _libusb_errno[ret])
USBError: [Errno 5] Input/output error

```

My system:  
Manjaro linux 17.0.5, kernel 4.13.2 x64  
python 2.7.12  
pyusb (1.0.0b1)  
BlinkStick (1.1.8)

Blinkstick was installed via python pip.  
Running the following command in a terminal, does not produces an error.

```
blinkstick --set-color=red --blink --repeats=10000 --delay=500

```

Can somebody help?

Regards!

---

<div class="post-metadata">

**Author:** ![arvydas](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/arvydas/32/242_2.png) [@arvydas](https://forums.blinkstick.com/u/arvydas)\
**Post date:** [September 25, 2017, 8:57am UTC](https://forums.blinkstick.com/t/libusb1-py-timeout-error-using-blinksticknano/809/2 "2017-09-25T08:57:33Z")

</div>

Is BlinkStick still functioning after you get the error?

---

<div class="post-metadata">

**Author:** ![marsdbr](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@marsdbr](https://forums.blinkstick.com/u/marsdbr)\
**Post date:** [September 25, 2017, 9:06am UTC](https://forums.blinkstick.com/t/libusb1-py-timeout-error-using-blinksticknano/809/3 "2017-09-25T09:06:46Z")

</div>

The BlinkStick stops blinking with static light on or off, but is still working after a restart of the script.

---

<div class="post-metadata">

**Author:** ![p0ke](https://forums.blinkstick.com/user_avatar/forums.blinkstick.com/p0ke/32/14_2.png) [@p0ke](https://forums.blinkstick.com/u/p0ke)\
**Post date:** [September 25, 2017, 11:36am UTC](https://forums.blinkstick.com/t/libusb1-py-timeout-error-using-blinksticknano/809/4 "2017-09-25T11:36:51Z")

</div>

Add a time.sleep(0.2). In fact you have 2 nanos you need this to avoid sending the data too fast to the devices.

```
for bstick in blinkstick.find_all():
    bstick.blink(index=0, hex='#101010', repeats=20000, delay=500)
    time.sleep(0.2)
```

---

<div class="post-metadata">

**Author:** ![marsdbr](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/m/5fc32e/32.png) [@marsdbr](https://forums.blinkstick.com/u/marsdbr)\
**Post date:** [September 25, 2017, 12:48pm UTC](https://forums.blinkstick.com/t/libusb1-py-timeout-error-using-blinksticknano/809/5 "2017-09-25T12:48:56Z")

</div>

> [@p0ke](#):
>
> time.sleep(0.2)

I use only 1 Stick, so adding time.sleep(0.2) has no effect. I recognized, on on-board USB 2.0 the error show only sometimes and with a USB3.0-Hub it works fine. If i use the on-board USB3.0 port it generates the error. I use the USB-Hub now and blinking works for one hour without an error.

In the meantime i even cleaned the connecting pins of the BlinkStick. It was new, maybe some production residues are removed now and the electric connection is increased.

Thank you for your help, maybe it’s a problem with USB3.0 and pyusb. During the Blinkstick setup via pip there was a message that pyusb will be removed or replaced in future.

Regards.
