Python: Blinkstick Strip set_info_block not working

When i try to call set_info_block either 1 or 2 on a Blinkstick Strip i get the following error

Traceback (most recent call last):
File "/Users/user/Desktop/test/test.py", line 4, in <module>
bstick.set_info_block1("test")
File "/usr/local/lib/python2.7/site-packages/blinkstick/blinkstick.py", line 610, in set_info_block1
self._usb_ctrl_transfer(0x20, 0x9, 0x0002, 0, self._data_to_message(data))
File "/usr/local/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/local/lib/python2.7/site-packages/usb/core.py", line 711, in ctrl_transfer
self.__get_timeout(timeout)
File "/usr/local/lib/python2.7/site-packages/usb/backend/libusb1.py", line 836, in ctrl_transfer
timeout))
File "/usr/local/lib/python2.7/site-packages/usb/backend/libusb1.py", line 571, in _check
raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 5] Input/output error

The string is set anyway (albeit most of the time it’s corrupted and not actually what i wrote) but the program crashes and i can’t understand why or how to solve it, on a Blinkstick Square it works only for set_info_block1 but not for set_info_block2. Can anyone help me fix this or understand what is the problem?

EDIT: ok i have no idea what’s happening, i tried to set the info_block2 on the Square with the command line instead of using python. The first 2 times it threw the error and after those 2 it’s now working both on the command line and on the python IDE. There clearly is something wrong in the implementation

Just wanted to mention, it also doesn’t work with the example provided in the python section so I can’t see if i’m doing something wrong or pyusb is just not cooperating.

Is there any news on this problem? It’s more a quality of life thing to be able to connect to devices with a name instead of the serial but that would be really helpful and save a lot of time

this still doesn’t work for 3 out of the 4 blincksticks i own

What OS are you running Python code on?

MacOS mojave with pycharm professional

I had random issues with usb like that on 1/3 of my computers, it was running an older version of python (3.5 maybe?). The other two are on 3.6.7 and work great. Once the other was upgraded it worked normally.

i tried with python version 3.5, 3.6 and 3.7 but i always have the same problem

EDIT: Seems that the issue is related to the voltage, once I’ve put it through external adapter with extra juice the issue disappeared.

Hi, same issue here. Linux x64. usb.core.USBError: [Errno 5] Input/Output Error when running this while loop for a while (usually happens within seconds/minutes):

‘>>> while 1:
… bstick.blink(red=255,repeats=5,delay=500)
…’

Tried to do some changes based on what is written on: python - PyUSB usb.core.USBError: [Errno 5] Input/Output Error in Windows - Stack Overflow (added line data_or_wLength = data_or_wLength + (8-len(data_or_wLength))*b’\x00’ before “return” at line 249 of blinkstick.py) - seemed to reduce the occurence, but it was still happening now and then. Seems that there are more people having the same issue: Bought a BlinkStick - suck-o.com . Can I provide any useful debug info to resolve this issue (for instance wireshark dump on the specific USB port)? If yes, what I should provide?

Here is a full fail report:

Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/blinkstick/blinkstick.py”, line 249, in _usb_ctrl_transfer
return self.device.ctrl_transfer(bmRequestType, bRequest, wValue, wIndex, data_or_wLength)
File “/usr/lib/python3.10/site-packages/usb/core.py”, line 1082, in ctrl_transfer
ret = self._ctx.backend.ctrl_transfer(
File “/usr/lib/python3.10/site-packages/usb/backend/libusb1.py”, line 893, in ctrl_transfer
ret = _check(self.lib.libusb_control_transfer(
File “/usr/lib/python3.10/site-packages/usb/backend/libusb1.py”, line 604, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 5] Input/Output Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/yan/share/ms_service/water_checkers/./sticktest.py”, line 9, in
bstick.blink(red=255,repeats=4,delay=500)
File “/usr/lib/python3.10/site-packages/blinkstick/blinkstick.py”, line 756, in blink
self.set_color(channel=channel, index=index, red=r, green=g, blue=b)
File “/usr/lib/python3.10/site-packages/blinkstick/blinkstick.py”, line 410, in set_color
self._usb_ctrl_transfer(0x20, 0x9, report_id, 0, control_string)
File “/usr/lib/python3.10/site-packages/blinkstick/blinkstick.py”, line 255, in _usb_ctrl_transfer
return self.device.ctrl_transfer(bmRequestType, bRequest, wValue, wIndex, data_or_wLength)
File “/usr/lib/python3.10/site-packages/usb/core.py”, line 1082, in ctrl_transfer
ret = self._ctx.backend.ctrl_transfer(
File “/usr/lib/python3.10/site-packages/usb/backend/libusb1.py”, line 893, in ctrl_transfer
ret = _check(self.lib.libusb_control_transfer(
File “/usr/lib/python3.10/site-packages/usb/backend/libusb1.py”, line 604, in _check
raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 5] Input/Output Error