Python: Blinkstick Strip set_info_block not working


#1

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


#2

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.


#3

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


#4

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


#5

What OS are you running Python code on?


#6

MacOS mojave with pycharm professional


#7

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.


#8

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